Solving a system of coupled diferential equations using ODE15s
이전 댓글 표시
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.
채택된 답변
추가 답변 (1개)
Torsten
2022년 6월 1일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!