Skip to content

Feature/upgrade to rtc tools 2.7.3 casadi 3.7.2#176

Closed
jarsarasty wants to merge 419 commits into
Project-OMOTES:masterfrom
Multi-Energy-Systems-Optimization:feature/upgrade-to-rtc-tools-2.7.3-casadi-3.7.2
Closed

Feature/upgrade to rtc tools 2.7.3 casadi 3.7.2#176
jarsarasty wants to merge 419 commits into
Project-OMOTES:masterfrom
Multi-Energy-Systems-Optimization:feature/upgrade-to-rtc-tools-2.7.3-casadi-3.7.2

Conversation

@jarsarasty

Copy link
Copy Markdown
Contributor

Upgrades mesido from rtc-tools-gil-comp==2.6.1 / casadi-gil-comp==3.6.7 to standard rtc-tools==2.7.3 / casadi==3.7.2 / rtctools-highs==0.1.3.

Changes:

  • Replace rtc-tools-gil-comp and casadi-gil-comp with rtc-tools==2.7.3 and rtctools-highs==0.1.3 (casadi 3.7.2 pinned transitively). The GIL fix is now included in standard casadi 3.7.2.
  • Register HiGHS 1.14.0 CasADi plugin at import time via mesido/init.py
  • Widen python_requires to >=3.10,<3.13 (bounded by pandas<2.0)
  • Refactor __state_vector_scaled duplication: delegate to BaseProblemMixin from AssetSizingMixin and FinancialMixin; add BaseProblemMixin to FinancialMixin bases
  • Add presolve="off" workaround for HiGHS 1.14.0 infeasibility bug (Presolve: HiGHS v1.10.0 incorrectly declares infeasibility ERGO-Code/HiGHS#2388 (Presolve: HiGHS v1.10.0 incorrectly declares infeasibility ERGO-Code/HiGHS#2388)) in affected models
  • Raise tox.ini end-scenario-sizing timeout 120s → 300s
  • Remove CBC solver override from test_heat_pump_elec_price_profile (HiGHS 1.14.0 passes)
  • Add tests/test_highs_solver.py: verifies HiGHS 1.14.0 is loaded and GIL is released during solves
  • Update test assertions to use asset IDs instead of names, relax numerical tolerances where HiGHS 1.14.0 produces residuals ~1e-7

Known failing (WIP — to be fixed):

  • test_head_loss::test_heat_network_pipe_split_head_loss — HiGHS 1.14.0 finds a different but equally valid flow split in the parallel pipe network; the test hard-codes the assumption that Pipe4 is inactive
  • test_end_scenario_sizing_staged — IndexError on _priorities_output[1]; a priority solve is failing with HiGHS 1.14.0, needs investigation

KobusVanRooyen and others added 30 commits June 17, 2024 16:29
- can now update pipe info if return pipe is not "_ret"
- updated test case
…t case & input ESDL

- Updated kpi names for yearly costs
* creating battery test case

* fixed discharging efficiency calculation battery

* created esdl, timeseries and problem setup to test battery
…dl-when-supply-and-return-pipes-not-linked-with-_ret-in-name
…dl-when-supply-and-return-pipes-not-linked-with-_ret-in-name
Co-authored-by: Femke Janssen <137757789+FJanssen-TNO@users.noreply.github.com>
…ply-and-return-pipes-not-linked-with-_ret-in-name'
Jaimepatt and others added 28 commits March 12, 2026 17:20
The goal of the PR is to allow geothermal assets to use electricity. The regular geothermal source can now take a COP value to compute power consumption costs. The new electric geothermal source has the previous functionality plus it accepts an electricity carrier in port.
---------

Co-authored-by: Femke Janssen <femke.janssen@tno.nl>
Reduced the number of equations for LinearizedEqualityConstraints headloss. And started with the work on a cleaner method to add the big_m equality constraints.
Generalizing state_vector_scaled in the BaseProblemMixin, to be used across all scripts.
A new asset is created for an integrated heat storage that can be charged using electricity.
It is an heatbuffer with an additional electricity port.
 
A new component is added with the name heat_buffer_elec that is a sub-component of heat_buffer. 
It can only be charged by electricity and discharge to the connected heat network.
ChargeEfficiency attribute from esdl is parsed to define the efficiency of conversion of electricty to heat.
 
---------

Co-authored-by: tolga-akan <tolga.akan@tno.nl>
The discrete path variables for assets are moved to pycml object variable creation. Only discrete path variables that are linked to system variables (e.g. temperature) are now created in the Mixins. All non-path discrete variables remain in the Mixins.
ESDL asset IDs are now used instead of asset names as identifiers for the asset. Therefore variable names and parameters do now start with the asset id. Asset IDs need to be unique while asset names no longer need to be unique in ESDL. CSVs to load profiles still contain asset names in the headers.
Used DataSource to indicate that output profiles are coming from the optimizer. Hence, source of output profiles will be clearly indicated in optimized esdl.

---------

Co-authored-by: KobusVanRooyen <136796865+KobusVanRooyen@users.noreply.github.com>
Updating check on which demands are not matched in the grow_workflow
Centralised methods to add big_m equality and inequality constraints have been created. Those methods can be used by any class that inherits BaseProblemMixin.
Work done to implement the feature of allowing a variable temperature profile at the out port of a producer. This is still experimental as now the profiles are only active on the outports of producers.
Make a test for airco to check sizing and cost calculations work.
A new general function in utilts test is created to check all the cost components in the problem. Function can also verify objective function of the problem if required.
EndScenarioSizing for ensembles has been created as inheritance class from  EndScenarioSizing to allow for uncertainty modelling. It accomodates the goals being a weighted average of each ensemble and different demand profiles for different ensembles. With the explicit requirement that the first ensemble should have the largest heat demand profile. Priority 1, no longer goes to 0 for demand matching as this is partially covered by constraints. Furthermore, constraints are added that allow the selection of asset types for which the sizing has to be equal among all ensembles.
Added tests on logical links, where consumers and producers are logically connected.
Added a test for non linear head loss with option HeadLossOption.CQ2_EQUALITY.
Changed the name convention of CQ2_INEQUALITY to CQ2_WEAK_INEQUALITY.
Generic ramp constraints added for heat producers.
- The existing heating and cooling case in Example is cleaned up. 
- The input csv is modified such that hard coded modifications are removed.
- In addition to variable operation cost coefficient, the electricity cost profile contributes to variable operational cost of assets which convert electricity to heat.

---------

Co-authored-by: KobusVanRooyen <kobus.vanrooyen@tno.nl>
…om esdl (#468)

Parse maximum and minimum temperatures of heat producers from esdl.
Note that currently ESDL has min/max temps only for the following heat sources: HeatProducer, GeothermalSource, ResidualHeatSource.
Update heat physics mixin and gas_physics_mixin  to reduce discrete variables for linearized equality headloss by only creating the discrete variables for the positive quadrant. The negative quadrant is formed based on flow direction variables and the linearlized variables.
Low_temperature_ates is now a subcomponent type of ates.
Feedback on potential network limitations (producers and pipes) causing heat not to be matching in the grow workflow.
Fix that no longer a priceprofile is needed is an electricity carrier is available.
Changed the carrier_id mapping in MESIDO to use the carrier ids directly as a string instead of a integers.
Thereby the requirement for "_ret" in the carrier name is removed as now the carriers can be identified by their ids directly.
do rerun with HIGHS (presolve off) when needed
- Replace rtc-tools-gil-comp and casadi-gil-comp with rtc-tools 2.7.3
and rtctools-highs 0.1.3 (casadi 3.7.2 pinned transitively)
- Register HiGHS 1.14.0 CasADi plugin via import in mesido/__init__.py
- Widen python_requires to >=3.10,<3.15
- Update solver docstrings from cbc to HiGHS
- Fix __state_vector_scaled duplication: delegate to BaseProblemMixin
- Add BaseProblemMixin to FinancialMixin bases
- Add presolve=off workaround for HiGHS 1.14.0 (ERGO-Code/HiGHS#2388)
in HeatProblem and HeatProblemSetPoints; HeatProblemPlacingOverTime
explicitly removes it as it needs presolve on for correct solution
- Fix test_multicommodity: use asset IDs and correct .__disabled key
- Fix test_electricity_storage: use asset IDs, relax tolerance
- Fix test_gas_pipe_topology_optimization: relax atol 1e-10 -> 1e-6
- Add test_highs_solver.py: verify HiGHS 1.14.0 and GIL release
- Raise tox.ini end_scenario_sizing timeout 120s -> 300s
- Remove CBC solver override from test_multicommodity price_profile test
- Tighten python_requires to <3.13 (pandas<2.0 has no wheels for 3.13+)
- Add comment on CBC removal in test_multicommodity explaining why
  HiGHS 1.14.0 via rtctools-highs 0.1.3 now passes correctly

Known failing (WIP):
- test_head_loss::test_heat_network_pipe_split_head_loss: HiGHS 1.14.0
finds different valid flow split; test assumption too strict
- test_end_scenario_sizing_staged: IndexError on _priorities_output[1],
suggests a priority solve is failing with HiGHS 1.14.0
@jarsarasty

Copy link
Copy Markdown
Contributor Author

Wrong remote.

@jarsarasty jarsarasty closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants