Closed
Description
MTK currently makes no distinction between "initial condition" and "initial guess", something that we have to start making. A specified initial condition must be respected exactly, if not possible, an error should be thrown.
The interface to providing initial conditions and initial guesses need to support the following:
- It is possible to distinguish an initial guess from a specified initial condition. Modelica allows this for any variable using the syntax
variable_name(start = 1.0, fixed=true)
, this enforcesvariable_name = 1.0
at time$t=0$ . - It must be possible to specify this at any level in the model, for example
- a component may specify that one of it's variables has a fixed initial condition.
- a component may fix the initial condition for one of its subsystems, even if this variable was not fixed in the implementation of the subsystem. Implementing this appears harder since Julia does not have the same built-in support for adding metadata to arbitrary input arguments that modelica does.
@variables x(t)=1 [fixed=true]
is a rather cumbersome syntax, maybe @variables x(t)==1
could be used instead?
Somewhat related to this, it should be possible to specify whether a variable will be selected as state "always" or "never", simple priorities is not always enough.