Algebraic variable derivatives in the DAE solution process

조회 수: 4 (최근 30일)
Lazar
Lazar 2024년 10월 12일
편집: Torsten 2024년 10월 12일
I'm trying to solve a DAE system of the form:
x' = f(x,y,u)
0 = g(x,y,u)
using the ode15s method.
Is it possible to determine the derivatives of the algebraic variables y with respect to time during the integration process and use them as inputs u when evaluating f and g?

답변 (1개)

Torsten
Torsten 2024년 10월 12일
편집: Torsten 2024년 10월 12일
0 = dg/dx * x' + dg/dy * y' + dg/du * u' = dg/dx * f + dg/dy * y' + dg/du * u'
Solve for y'.
  댓글 수: 5
Lazar
Lazar 2024년 10월 12일
편집: Lazar 2024년 10월 12일
@Torsten, unfortunately, I do need y' to evaluate f. Derivative of one algebraic variable is used to evaluate one of the differential equations in f.
Update: I've implemented the evaluation of y' at each time step using the f values from the previous time step. The code seems to be working properly with expected results. However, I had to reduce the maximum step size to 1e-5 because the solver was failing for 1e-3 and 1e-4.
Torsten
Torsten 2024년 10월 12일
편집: Torsten 2024년 10월 12일
The ode solvers are adaptive in their time stepping. There is no "previous time step". Thus I wouldn't trust in what you get from the solver.
Since g depends on y', could you update the correct form of your DAE system ? Maybe f depends on y', too ?
If you say that g depends on y', can't you simply solve 0 = g(x,y,y',u) for y' and get a purely differential system without algebraic equations ? Or use ODE15I instead of ODE15S ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by