How to solve a systems of ODE and Algebraic Equations
Show older comments
I have a system of 3 nonlinear ODE and 2 nonlinear algebraic equations.
Please how can I solve these systems of equation.
ODE 45 can easily solve the ODE part. However, I don't know how to combine the solution from ODE45 and the algebraic equations.
Thank you.
2 Comments
James Tursa
on 28 Jan 2021
Please show us the equations you are working with.
it sounds like what you're after is "how to solve a DAE" if the algebraic eqations constrain the solutions of the ODE part https://www.mathworks.com/help/matlab/math/solve-differential-algebraic-equations-daes.html
otherwise, if the algebraic equations aren't constraints (ie. they determine diagnostic variables), you probably want to solve the ODE and then solve the algebraic equations 'offline' using e.g. fsolve
Accepted Answer
More Answers (1)
Telema Harry
on 28 Jan 2021
Edited: Telema Harry
on 28 Jan 2021
0 votes
2 Comments
Alex Sha
on 29 Jan 2021
Hi, since: u = x(3) + A.* sin(w.*t) and y = 25 - (5 - u).^2, so y = 25 - (5 - ( x(3) + A.* sin(w.*t))).^2, substitute y into dx1dt and dx2dt, then pure ODE functions will be formed.
Nikhil Kapoor
on 16 Apr 2022
How to do this?
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!