In MTK libraries, should I include “hard-coded” initial values in components, or not?
I’m toying with an alpha version of a library based on MTK, and have now come to the stage of testing whether I can linearize the completed model… To find the operating point, I simulate the system to “steady state”, then grab the final values of the unknowns, and use these as operating point in the linearization attempt.
In my components, I have “hard-coded” initial values for some variables just to minimize the number of initial variables a user would have to specify. I don’t know whether this is good practice.
Questions:
- Is it ok to “hard-code” initial values for “states” in the components, to minimize the amount of initialization the user has to do? Or is it better to just use “guess” values in the components?
- When I have “hard-coded” initial values for variables that are not “unknowns”, and I then specify unknowns as initial values, I seem to get error messages (or warnings?) that the initialization is over-determined. How do I get around these warnings/error messages?
- I can set the variables that I have hard-coded in the component to
nothing, but that doesn’t work well for vector variables. And it is also adding to the burden of the user to know which ones have been hard-coded… - Is there a command to remove all “hard-coded” variables in the model, so that I can start with the known steady state unknowns?
OK, I hope my “problem” is explained such that it is understandable.