You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes structural_simplify eliminates the variable that I wanted to use to set the initial condition of a system. It would be nice to have a way to specify the initial state by providing values for these 'observed' variables rather that the ones that that end up being the 'states' of the system. Here's an example:
using ModelingToolkit
@parameters C R
@variables t V(t) Q(t) I(t)
eqs = [V ~ C * Q,
D(Q) ~ I,
V ~ I * R]
@named sys = ODESystem(eqs)
simp = structural_simplify(sys)
states(simp)
The charge Q is the remaining state variable. I typically don't know how many coulombs I put on the capacitor, it's the initial voltage that I measure. So I end up manually solving for Q in terms of V & plugging in my initial condition for V to find the initial condition for Q that goes into u0.
The text was updated successfully, but these errors were encountered:
Sometimes
structural_simplify
eliminates the variable that I wanted to use to set the initial condition of a system. It would be nice to have a way to specify the initial state by providing values for these 'observed' variables rather that the ones that that end up being the 'states' of the system. Here's an example:The charge
Q
is the remaining state variable. I typically don't know how many coulombs I put on the capacitor, it's the initial voltage that I measure. So I end up manually solving forQ
in terms ofV
& plugging in my initial condition forV
to find the initial condition forQ
that goes intou0
.The text was updated successfully, but these errors were encountered: