Solving System of Differential Equations using Laplace transformation
Ältere Kommentare anzeigen
Hello,
I am attempting to solve the following system of differential equations using Laplace transformation. I used the code found under the documentation heading "Solve Differential Equations Using Laplace Transform" as a reference point. However, my code does not stop running and I was hoping for some guidance as to why this was occuring.
syms x1(t) x2(t) x3(t) x4(t) m1 m2 m3 m4 k1 k2 k3 k4 keq c1 c2 c3 c4 ceq s
dx1 = diff(x1,t);
d2x1 = diff(dx1,t);
dx2 = diff(x2,t);
d2x2 = diff(dx2,t);
dx3 = diff(x3,t);
d2x3 = diff(dx3,t);
dx4 = diff(x4,t);
d2x4 = diff(dx4,t);
eqn1 = m1*d2x1 + k1*(x1-x2) + c1*(dx1-dx2) + keq*(x1-x3) + ceq*(dx1-dx3) == 0;
eqn2 = m2*d2x2 + k1*(x2-x1)+ c1*(dx2-dx1) == 0;
eqn3 = m3*d2x3 + keq*(x3-x1)+ ceq*(dx3-dx1)+ k4*(x3-x4) + c4*(dx3-dx4) == 0;
eqn4 = m4*d2x4 + k4*(x4-x3) + c4*(dx4-dx3) == 0;
cond1 = x1(0) == 0;
cond2 = dx1(0) == 2.2351;
cond3 = x2(0) == 0;
cond4 = dx2(0) == 2.2351;
cond5 = x3(0) == 0;
cond6 = dx3(0)== 22.3509;
cond7 = x4(0) == 0;
cond8 = dx4(0) == 22.3509;
eqn1LT = laplace(eqn1,t,s);
eqn2LT = laplace(eqn2,t,s);
eqn3LT = laplace(eqn3,t,s);
eqn4LT = laplace(eqn4,t,s);
syms x1_LT x2_LT x3_LT x4_LT
eqn1LT = subs(eqn1LT,[laplace(x1,t,s) laplace(x2,t,s) laplace(x3,t,s)...
laplace(x4,t,s)],[x1_LT x2_LT x3_LT x4_LT]);
eqn2LT = subs(eqn2LT,[laplace(x1,t,s) laplace(x2,t,s) laplace(x3,t,s)...
laplace(x4,t,s)],[x1_LT x2_LT x3_LT x4_LT]);
eqn3LT = subs(eqn3LT,[laplace(x1,t,s) laplace(x2,t,s) laplace(x3,t,s)...
laplace(x4,t,s)],[x1_LT x2_LT x3_LT x4_LT]);
eqn4LT = subs(eqn4LT,[laplace(x1,t,s) laplace(x2,t,s) laplace(x3,t,s)...
laplace(x4,t,s)],[x1_LT x2_LT x3_LT x4_LT]);
eqns = [eqn1LT eqn2LT eqn3LT eqn4LT];
vars = [x1_LT x2_LT x3_LT x4_LT];
[x1_LT, x2_LT, x3_LT, x4_LT] = solve(eqns,vars);
x1sol = ilaplace(x1_LT,s,t);
x2sol = ilaplace(x2_LT,s,t);
x3sol = ilaplace(x3_LT,s,t);
x4sol = ilaplace(x4_LT,s,t);
x1sol = simplify(x1sol);
x2sol = simplify(x2sol);
x3sol = simplify(x3sol);
x4sol = simplify(x4sol);
vars = [x1(0) x2(0) x3(0) x4(0) dx1(0) dx2(0) dx3(0)...
dx4(0) m1 m2 m3 m4 k1 k2 k3 k4 keq c1 c2 c3 c4 ceq];
values = [0 0 0 0 2.2351 2.2351 22.3509 22.3509 1.2698e+03 79.3651 ...
2.0408e+03 102.0408 100e+3 500e+3 560e+3 140e+3 2.6415e+05 ...
10e+3 30e+3 15e+3 35e+3 10e+3];
x1sol = subs(x1sol,vars,values)
x2sol = subs(x2sol,vars,values)
1 Kommentar
Paul
am 20 Mär. 2021
I didn't actually check the code. But it's going to be trying ilaplace on a rational function with a seventh order numerator and eighth order denminator, each with coefficients that are long symbolic expressions. That sounds like it would be difficult, if not completely intractable. Even if you sub in the symbolic values for the variables before taking ilaplace, it might still be quite difficult (impossible?) to solve symbolically for a closed form expression (i.e., not given in terms of roots of other expressions).
Antworten (0)
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!