Laplace Transform Method:
System of Ordinary Differential Equations
M.M. Yovanovich
LPTODE7.MWS
> restart:
> with(inttrans):
> alias(X(s) = laplace(x(t),t,s), Y(s) = laplace(y(t),t,s)):
Define the two ordinary differential equations.
> eq1:= diff(x(t),t) + 2*diff(y(t),t)-2*y(t) = t;
> eq2:= x(t) + diff(y(t),t) - y(t) = 1;
Take the Laplace transform of the two equations.
> lpteq1:= laplace(eq1,t,s);
> lpteq2:= laplace(eq2,t,s);
Specify the two initial conditions.
> ics:= (x(0)=0, y(0)=0);
Substitute the initial conditions into the transformed equations.
> eqs:= subs(ics, [lpteq1,lpteq2]);
Obtain the solutions of the transformed equations, i.e., and .
> sols:= solve({eqs[1],eqs[2]}, {X(s),Y(s)});
Use the inverse Laplace transform to obtain the solutions for and .
> ysol= invlaplace(sols[1],s,t);
> xsol= invlaplace(sols[2],s,t);
Here we obtain the solutions of the system of equations directly.
> syseqs:= {eq1,eq2,ics};
> dsolve(syseqs, {x(t), y(t)}, method=laplace);