Open hersle opened 1 week ago
Yeah that's an odd bug. I'll see if I can look during JuliaCon.
The problem (I'm fairly certain) is structural_simplify
uses metadata to identify variables vs parameters. Since T
is an @variable
, it doesn't have the metadata and structural_simplify
gets confused. The default indepvar works because it's an @parameter
.
This trivial example works as it should, where the independent parameter
t
is imported asModelingToolkit.t_nounits
:Now run the same example, but using our own independent parameter (
T
instead oft
) and differential (D
instead ofd
):In the second example (and not the first), the initialization system becomes underdetermined, as reported by the warning
By inspecting
structural_simplify(generate_initializesystem(sys2); fully_determined = false)
, I see that the bug is caused by the independent parameter appearing twice, as both a parameter and unknown:I expected the second example to behave like the first. This is with
ModelingToolkit v9.19.0
.