-
Notifications
You must be signed in to change notification settings - Fork 0
123 bes rules #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
123 bes rules #127
Conversation
…to 123_bes-rules
|
Thank you for making a Pull Request to BESMod! Our CI pipeline will help you finalize your contribution.
If HTML errors occur, I will fix the issues using a separate pull request. Tips to fix possible naming violations:
If all CI stages pass and you have addressed possible naming violations, please consider the following:
Once you have addressed these points, you can assign a reviewer. If you have any questions or issues, please tag a library developer. |
HvanderStok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making it public. I looked mostly over the aspects I use in my work and the examples. It would be nice if all examples were working. But mostly everything else looks good from my site.
| userProfiles( | ||
| fileNameIntGains=Modelica.Utilities.Files.loadResource( | ||
| "D:/00_temp/01_bes_rules/UseCase_TBivAndV/influence_user/data/InternalGainsHoliday.txt"), | ||
| gain={1,1,1}, | ||
| use_TSetFile=true, | ||
| fileNameTSet=Modelica.Utilities.Files.loadResource( | ||
| "D:/00_temp/01_bes_rules/UseCase_TBivAndV/influence_user/data/TSetHoliday.txt"), | ||
| use_absIntGai=false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add these to the Resources or remove them here? Then this example is running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the models in PVAndHPDesignAndControl Optimization are not needed anymore, or are they? Remove them or add package.mo and add the package to the BESRules package.order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if I fix the wrong path in MonoenergeticOptiHorst is not translating with the following error:
Failed to generate code for an algebraic loop
involving when equations or algorithms with when parts.
Unknowns:
hydraulic.generation.defCtrl.and1.u1
hydraulic.generation.defCtrl.andDefrost.y
hydraulic.generation.defCtrl.greater.u2
hydraulic.generation.defCtrl.greater.y
hydraulic.generation.defCtrl.orDef.y
hydraulic.generation.defCtrl.timer.entryTime
hydraulic.generation.defCtrl.timer.u
hydraulic.generation.defCtrl.timer.y
hydraulic.generation.heatPump.hys.y
hydraulic.generation.heatPump.refCyc.refCycHeaPumHea.nDTabQUse_flow.u[1]
hydraulic.generation.heatPump.refCyc.swiQEva.u2
hydraulic.generation.heatPump.safCtr.andCanOpe.u[1]
hydraulic.generation.heatPump.safCtr.swiErr.u2
Equations:
when hydraulic.generation.defCtrl.timer.u then
hydraulic.generation.defCtrl.timer.entryTime = time;
end when;
hydraulic.generation.defCtrl.timer.y = (if hydraulic.generation.defCtrl.timer.u then time-hydraulic.generation.defCtrl.timer.entryTime else 0.0);
hydraulic.generation.defCtrl.greater.y = hydraulic.generation.defCtrl.greater.u1 > hydraulic.generation.defCtrl.greater.u2;
hydraulic.generation.defCtrl.orDef.y = hydraulic.generation.defCtrl.orDef.u1 or hydraulic.generation.defCtrl.orDef.u2;
hydraulic.generation.defCtrl.and1.y = hydraulic.generation.defCtrl.and1.u1 and hydraulic.generation.defCtrl.and1.u2;
hydraulic.generation.defCtrl.andDefrost.y = hydraulic.generation.defCtrl.andDefrost.u1 and hydraulic.generation.defCtrl.andDefrost.u2;
hydraulic.generation.defCtrl.notHea.y = not hydraulic.generation.defCtrl.notHea.u;
hydraulic.generation.defCtrl.swi.y = (if hydraulic.control.priGenPIDCtrl.isOn then hydraulic.generation.defCtrl.swi.u1 else 1E+60);
hydraulic.generation.defCtrl.andIsOn.y = hydraulic.control.priGenPIDCtrl.isOn and hydraulic.generation.defCtrl.andIsOn.u2;
hydraulic.generation.heatPump.safCtr.swiErr.y = (if hydraulic.generation.heatPump.safCtr.swiErr.u2 then hydraulic.generation.heatPump.safCtr.swiErr.u1 else 0.0);
hydraulic.generation.heatPump.safCtr.andCanOpe.y = Modelica.Math.BooleanVectors.andTrue (hydraulic.generation.heatPump.safCtr.andCanOpe.u);
hydraulic.generation.heatPump.hys.y = not pre(hydraulic.generation.heatPump.hys.y) and hydraulic.generation.heatPump.hys.u > hydraulic.generation.heatPump.hys.uHigh or pre(hydraulic.generation.heatPump.hys.y) and hydraulic.generation.heatPump.hys.u >= 0.001;
hydraulic.generation.heatPump.safCtr.opeEnv.swiHeaCoo.y = (if hydraulic.generation.heatPump.safCtr.opeEnv.swiHeaCoo.u2 then hydraulic.generation.heatPump.safCtr.opeEnv.swiHeaCoo.u1 else hydraulic.generation.heatPump.safCtr.opeEnv.swiHeaCoo.u3);
You may be able to cut the loop
by putting 'pre' around some of the references to
unknown continuous time variables in when parts or when conditions.
Translation aborted.
WARNINGS have been issued.
ERRORS have been issued.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these tests work? They are not running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these tests work? They are not running.
| INPUT_CONFIG = "TRY2015_541817120824_Jahr_B1918_standard_o0w2r1g0_SingleDwelling_M_0K-Per-IntGai" | ||
| INPUT_CONFIG = "TRY2045_474856110632_Somm_B2001_standard_o2w2r2g2_SingleDwelling_M_0K-Per-IntGai" | ||
|
|
||
| BASE = RESULTS_FOLDER.joinpath("UseCase_TBivAndV", "influence_heat_transfer_januar", "DesignOptimizationResults") | ||
| for M in [ | ||
| "HeatTransferOnlyConduction", | ||
| "HeatTransferLambdaEffSmooth", | ||
| "HeatTransferBuoyancyWetter", | ||
| ]: | ||
| for N in ["_NLayer", ""]: | ||
| for STO in [0, 3]: | ||
| for SCALE in [False, True]: | ||
| map_besmod_to_plot_function( | ||
| mat_file=BASE.joinpath(f"{INPUT_CONFIG}_{M}{N}", f"iterate_{STO}.mat"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these results generated?
| buildings_per_year = boundary_conditions.building.get_all_tabula_sfh_buildings(as_dict=True) | ||
| if years_of_construction is None: | ||
| years_of_construction = buildings_per_year.keys() | ||
| buildings_to_simulate = [ | ||
| buildings_per_year[f"{year}_standard"] for year in years_of_construction | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the dict buildings_per_year is used as in compare_onoff an error occurs because the keys already include "_standard".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the following error here:
pydantic_core._pydantic_core.ValidationError: 3 validation errors for configuration of agent 'mpc' / module 'mpc':
enable_deactivate_mpc
Input should be a valid Field name. Field 'enable_deactivate_mpc' does not exist. Did you mean any of ['states', 'time_step', 'type', 'module_id', 'validate_incoming_values']? [type=literal_error, input_value=True, input_type=bool]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
control_values_when_deactivated
Input should be a valid Field name. Field 'control_values_when_deactivated' does not exist. Did you mean any of ['controls', 'states', 'type', 'time_step', 'validate_incoming_values']? [type=literal_error, input_value={'TBufSet': 303.15, 'yVal... 'actExtBufCtrl': False}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
outputs_to_send_when_activated
Input should be a valid Field name. Field 'outputs_to_send_when_activated' does not exist. Did you mean any of ['outputs', 'set_outputs', 'inputs', 'states', 'type']? [type=literal_error, input_value={'actExtVal': True, 'actE..., 'actExtBufCtrl': True}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
Closes #123