Solving a system of 6 DAEs of first order - index error
1 回表示 (過去 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!