Solving a system of 6 DAEs of first order - index error
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Torsten
am 15 Okt. 2023
Bearbeitet: Torsten
am 15 Okt. 2023
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!