I have set up a system that I know well from before and try to reproduce simulation results with JModelica. The system is non-linear and have 4 states and can actually easily be written in state space form, which I did.
I gave start values for the states but and run a simulation.
The results looked quite similar to what expected. The transient looked the same, but at least one variable had different steady state value. Further, the initial transient looked funny since the start value I had given was not really used.
Reading the book by Tiller I find that the start value is taken as "initial guess" of what the initial condition should be. Only if fixed is set to true, the initial value for that variable will bet set and to the start value. When I sett all the four state variables with fixed=true, I got correct initial transient and the steady states became correct (there is an integrator that gave a bias).
In my case I new the answer before I simulate and was prepared to look for errors but usually you do not know, of course.
1) Reading Tillers book chapter 13 explains very briefly the difficulties with initial values.
Where should I read to learn more for "basic user needs"?
2) Is a reasonable rule of thumb to set all state variables with the attribute fixed=true?
provided the system is on state space from.
3) Is there anything in the text output after compilation or after simulation that is a warning flag?
4) In my case I actually thought I needed to scale the variables and that was the source of problems.
Is there anything in the output text that indicates that variables should be scaled?
I realize that the initialzation is far more tricky than I thought for DAE. One aspect is that Modelica encourage you to specify inital conditions locally in each component, while one need to consider the integrated system to make a complete analysis of how initializations should be done.
Would appreciate some basic guiding and a ref where I can read more.