-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connector for nonlinear system #3288
Comments
Time-dependent systems have a nonlinear system associated with their steady state, so the simplest thing would be just to use that interpretation directly, i.e. define everything as time-dependent but then with no differential equations, only algebraic equations, and call NonlinearProblem on it. |
Hi Chris,
but, I got:
And I tried building the system with |
Ok, I think I might found a workaround for this, a simple example as follows:
prob = ODEProblem(r_model, [], (0, 10.0))
sol = solve(prob)
sol[[t, r_model.resistor.v]]
@named ns = NonlinearSystem([equations(r_model); observed(r_model)])
@named simplified_ns = structural_simplify(ns)
prob = NonlinearProblem(simplified_ns, [])
sol = solve(prob, NewtonRaphson())
sol[r_model.resistor.v] Even though the resistor circuit is a linear system, but it is fine. |
Question❓
Is there any tutorial or maybe feature to support connector for pure nonlinear systems?
Explaination
According to the documentation, which says MTK could also for modeling NonlinearSystem besides ODESystem, but currently not supported with the macros, and this is fine if we can programmatically generate the system.
My scenario is that I still would like to use the acausal modeling benefiting from connector, but only nonlinear system instead of ode system. From my understanding based on this, it seems that connector only supports ODESystem, so is there any way that we can achieve this?
Example
Here is basically what I would like to do:
and with the following errors:
The text was updated successfully, but these errors were encountered: