Solving a system of coupled diferential equations using ODE15s
Show older comments
I'm solving a large system of coupled differential equations using ODE15s. All variables are depending only on t. However, I've found conflicts when trying to solve the following:
x'=f(z')
y'=f(x',z')
z'=f(y')
In this case the derivatives of x(t),y(t),z(t) are in terms of the derivatives of each other. Therefore, when programming the ODE function. I reach the error of "using the variable before it's defined" or it makes one of the derivatives equal to zero. (Which is a trivial solution not relevant for my problem). I will appreciate some insights.
I want to use ODE solver if possible since is way faster than building solver from scratch. All the equations are thermodynamic variables as pressure, temperature and velocity of the gas, which are coupled.
Accepted Answer
More Answers (1)
Torsten
on 1 Jun 2022
0 votes
Use ODE15I instead of ODE15S.
Or use "fsolve" or "linsolve" to explicitly solve for x', y' and z' in the function where you return the derivatives for ODE15S.
Categories
Find more on Ordinary 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!