Dear Jesus,
I am part of the System Modeler development team, and will try to answer even though I don't consider myself one of the real "users of System Modeler".
To make sure we're on the same page, this is what I get when building the attached example:
Building "SteadyStateComputations.MartiExample" as experiment "temporary-experiment" started at 11:35:13
Notification: interactive The following variables are selected as states: L3.i, c2.v
Notification: interactive The initialization problem is underdetermined, the following variables were chosen to be initialized from their start values: c2.v, L3.i
Notification: interactive C/C++ compiler output:
…
For some reason, I'm getting L3.i
instead of L1.i
as a state, and will return to this difference below.
In Model Center, I then set fixed = true
for both L3.i
and c2.v
, and the result is a balanced initialization problem:
Building "SteadyStateComputations.MartiExample" as experiment "temporary-experiment" started at 11:39:28
Notification: interactive The following variables are selected as states: L3.i, c2.v
Notification: interactive C/C++ compiler output:
…
That we don't get the same selection of states is in the nature of automatic state selection, and means that one generally have to find the right balance between fiddling with stateSelect
in the models (not unlikely to end up getting in the way of the automatic state selection) and finding ways to cope with uncertainty about where the states are. The latter requires good tool support, and although there are situations where System Modeler could act more intelligently, an example of it working well is that I can set the fixed = true
on L1.i
instead, and the selection of states changes to make it straight-forward to respect this choice of initialization constraints instead:
Building "SteadyStateComputations.MartiExample" as experiment "temporary-experiment" started at 11:46:53
Notification: interactive The following variables are selected as states: L1.i, c2.v
Note, that the fixed
attribute is a so-called structural property of a model, meaning that it must be known at the time of translating the model, so if L3.i
and c2.v
were reported to be selected as states when the model was built, is is precisely where you find the two degrees of freedom in the initialization when looking at the Initial Values column of the Variables tab in Simulation Center.