Message Boards Message Boards

Analytical solution of a system of linear ODEs

Posted 1 month ago

How to solve a system of differential equations

x''[t] + t  x'[t] + x[t] = z[t],   y''[t] + y'[t] + y[t] = 0

and z''[t] + z'[t] +z[t] = 0 analytically using Mathematica?

6 Replies

It does not work.

Posted 1 month ago
In[1]:= $VersionNumber

Out[1]= 14.1

In[2]:= {x[t],y[t],z[t]}/.FullSimplify[DSolve[
  {x''[t]+t x'[t]+x[t]==z[t],y''[t]+y'[t]+y[t]==0,z''[t]+z'[t]+z[t]==0},
  {x[t],y[t],z[t]},t]]

Out[2]= {{(6*C[2] + Sqrt[2*Pi]*(E^(1/4 - (I/4)*Sqrt[3])*(Sqrt[3]*E^((I/2)*
  Sqrt[3])*C[4]*Erf[(I + Sqrt[3] - (2*I)*t)/(2*Sqrt[2])] - (3*I)*C[3]*Erf[(-I +
  Sqrt[3] + (2*I)*t)/(2*Sqrt[2])]) + 3*C[1]*Erfi[t/Sqrt[2]]))/(6*E^(t^2/2)),
  (C[6]*Cos[(Sqrt[3]*t)/2] + C[5]*Sin[(Sqrt[3]*t)/2])/E^(t/2), 
  ((-3 - (3*I)*Sqrt[3])*C[3] + (3 + I*Sqrt[3])*E^(I*Sqrt[3]*t)*C[4])/(6*E^(((1 +
  I*Sqrt[3])*t)/2))}}

with no warning or error messages.

But, unless I have made a mistake, substituting the solution into the original three equations does not result in {True,True,True}

POSTED BY: Bill Nelson

Try:

{x[t], y[t], z[t]} /. 
  FullSimplify[
   dsol = DSolve[
     ode = {
       x''[t] + t x'[t] + x[t] == z[t], 
       y''[t] + y'[t] + y[t] == 0,
       z''[t] + z'[t] + z[t] == 0},
     {x, y, z}, t]];
ode /. dsol // FullSimplify

(*  {{True, True, True}}  *)

If you solved for {x[t], y[t], z[t]} instead of {x, y, z}, you will have to do some extra work to substitute the solution into the derivatives x'[t], y'[t], and z'[t]. You didn't show what you substituted, so I cannot comment definitively.

POSTED BY: Michael Rogers
Posted 1 month ago
{x[t],y[t],z[t]}/.FullSimplify[DSolve[
  {x''[t]+t x'[t]+x[t]==z[t],y''[t]+y'[t]+y[t]==0,z''[t]+z'[t]+z[t]==0},
  {x[t],y[t],z[t]},t]]
POSTED BY: Bill Nelson

It does not work using Mathematica 10.0. Will it work if I use Mathematica 14.1?

I used V14.1. IIRC, early versions of DSolve[] did not handle nonautonomous linear systems. Now it does, or at least some of them. DSolve[] has been enhanced with every subversion release, I believe.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract