- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » parameters and init.xml [solved]
parameters and init.xml [solved]
parameters and init.xml [solved]
I am doing several simulations, where parameters are changed by updating the Model_init.xml.
Some values do not arrive.
model SubModel
parameter Real C = 1;
...
end SubModel;
model MainModel
parameter Real C = 2;
SubModel submodel(C=C);
...
end MainModel;
When I reset parameter MainModel.C in init.xml to a value of 3 (or something else), then the value of submodel.C does not change - it remains 2.
The flat model says:
parameter Real C = 2;
parameter Real submodel.C = C;
The MainModel_init.xml is changed from:
(MainModel.)C -> <Real fixed="true" start="2" useNominal="false" useStart="true" />
submodel.C -> <Real fixed="true" start="2" useNominal="false" useStart="true" />
to:
(MainModel.)C -> <Real fixed="true" start="3" useNominal="false" useStart="true" />
submodel.C -> <Real fixed="true" start="2" useNominal="false" useStart="true" />
The MainModel_res.mat says:
C = 3
submodel.C = 2
---
Problem was solved by setting preOptModules without "evaluateReplaceProtectedFinalEvaluateParameters".
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » parameters and init.xml [solved]