|
| 1 | +""" |
| 2 | + $(TYPEDSIGNATURES) |
| 3 | +
|
| 4 | +Generate the initialization system for `sys`. The initialization system is a system of |
| 5 | +nonlinear equations that solve for the full set of initial conditions of `sys` given |
| 6 | +specified constraints. |
| 7 | +
|
| 8 | +The initialization system can be of two types: time-dependent and time-independent. |
| 9 | +Time-dependent initialization systems solve for the initial values of unknowns as well as |
| 10 | +the values of solvable parameters of the system. Time-independent initialization systems |
| 11 | +only solve for solvable parameters of the system. |
| 12 | +
|
| 13 | +# Keyword arguments |
| 14 | +
|
| 15 | +- `time_dependent_init`: Whether to create an initialization system for a time-dependent |
| 16 | + system. A time-dependent initialization requires a time-dependent `sys`, but a time- |
| 17 | + independent initialization can be created regardless. |
| 18 | +- `op`: The operating point of user-specified initial conditions of variables in `sys`. |
| 19 | +- `initialization_eqs`: Additional initialization equations to use apart from those in |
| 20 | + `initialization_equations(sys)`. |
| 21 | +- `guesses`: Additional guesses to use apart from those in `guesses(sys)`. |
| 22 | +- `default_dd_guess`: Default guess for dummy derivative variables in time-dependent |
| 23 | + initialization. |
| 24 | +- `algebraic_only`: If `false`, does not use initialization equations (provided via the |
| 25 | + keyword or part of the system) to construct initialization. |
| 26 | +- `check_defguess`: Whether to error when a variable does not have a default or guess |
| 27 | + despite ModelingToolkit expecting it to. |
| 28 | +- `name`: The name of the initialization system. |
| 29 | +
|
| 30 | +All other keyword arguments are forwarded to the [`System`](@ref) constructor. |
| 31 | +""" |
1 | 32 | function generate_initializesystem( |
2 | 33 | sys::AbstractSystem; time_dependent_init = is_time_dependent(sys), kwargs...) |
3 | 34 | if time_dependent_init |
|
0 commit comments