ModelingToolkit.jl icon indicating copy to clipboard operation
ModelingToolkit.jl copied to clipboard

Reduce system to DAE index 0 in the presence of unbound inputs

Open baggepinnen opened this issue 2 years ago • 1 comments

Following up on the discussion in https://github.com/SciML/ModelingToolkit.jl/issues/1303#issuecomment-960857224

It would be beneficial to have a version of dae_index_lowering/tearing that is aware of unbound_inputs in the sense of #1322
The motivation is detailed in the linked issue comment above, get a linear statespace system from a linearization function.

Most users would probably like to have this linearized system on the form

x' = Ax + Bu
y  = Cx + Du

but advanced users could use the index 1 form below as well

Ex' = Ax + Bu
 y  = Cx + Du

The problem with the current version of dae_index_lowering/tearing is that they do not distinguish between a state and a variable marked as [input = true] and thus fail to simplify the system.

baggepinnen avatar Nov 04 '21 13:11 baggepinnen

To clarify, we only need to reduce away the linear algebraic equations in the linearized model instead of trying to solve nonlinear algebraic equations.

YingboMa avatar Nov 17 '21 14:11 YingboMa

This is now handled correctly by linearize

baggepinnen avatar Mar 03 '23 05:03 baggepinnen