Solving a system of 6 DAEs of first order - index error
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I'm trying to solve follofing system
%constants
syms a b c d e f g h i
%variables
syms s(t) u(t) v(t) w(t) x(t) y(t) z(t)
ddt(1) = diff(w(t)) == c;
ddt(2) = diff(x(t)) == - y(t) + a + b;
ddt(3) = diff(s(t)) + e*diff(v(t)) == f+ g- c;
ddt(4) = 0 == s(t) - w(t)*e;
ddt(5) = 0 == u(t) - x(t)*e;
ddt(6) = 0 == v(t) + z(t) - d;
ddt(7) = diff(u) == i + a*g + b*h - y(t);
vars = [ y(t); w(t);v(t); z(t); x(t); u(t); s(t)];
[eqns,vars] = reduceDifferentialOrder(ddt,vars);
isLowIndexDAE(eqns,vars)
I get the answer that the system is of index two and cannot be solved. The problem lies in the equation 7. Specifically, i doesn't seem to like calculating y(t). Why is that and how can I get it to work?
I have tried using reduceDifferentialOrder(ddt,vars) but the equations did not make any sence physically. It would help a lot if I could also understand why it doesn't work
댓글 수: 0
채택된 답변
Torsten
2023년 10월 15일
편집: Torsten
2023년 10월 15일
The reason why it doesn't work is that you don't have an equation that directly solves for y.
Equation (1) solves for w, equation (2) solves for x, equation (4) solves for s, equation (5) solves for u, equation (3) solves for v, equation (6) solves for z. So equation (7) must solve for y, but it's too difficult for the solver to get diff(u(t)) from the other equations.
From equation (5), it follows that
diff(u(t)) = e*diff(x(t))
Inserting diff(x(t)) from equation (2) gives
i + a*g + b*h - y(t) = e*(- y(t) + a + b)
thus
y(t) = (i + a*g + b*h - e*(a+b))/(1-e)
So if you remove equation (7) and insert this constant for y(t), it should work.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!