3
$\begingroup$

when I run this, I get "Supplied equations not differential or integral equations of the given functions" although the solution for this initial conditions is x = [sin(t),0,cos(t),0]. Why can't Dsolve solve this problem? Is there any way to get the general solution for this problem?

B = 0.5;
c = 10;
eqns = {x1'[t] == x3[t],
    x2'[t] == x4[t],
    x3'[t] == -x1[t] + 
     B*(-1 + x1[t]^2 + x2[t]^2 + x3[t]^2 + x4[t]^2),
    x4'[t] == -c^2*x2[t] + 
     B*(-1 + x1[t]^2 + x2[t]^2 + x3[t]^2 + x4[t]^2), x1[0] == 0, 
   x2[0] == 0, x3[0] == 1, x4[0] == 0};
sols = DSolve[eqns, {x1, x2, x3, x4}, t]
$\endgroup$
2
  • $\begingroup$ you have typo. You wrote x[4]==0 in the initial conditions. It should be x4[0]==0 but DSolve can not solve it still. Since it is non-linear system of ode's which is much harder to solve analytically than linear set of odes'. $\endgroup$
    – Nasser
    Aug 9 at 7:33
  • $\begingroup$ @Nasser yep crap! thanks for the correction $\endgroup$
    – Rudinberry
    Aug 9 at 7:38

1 Answer 1

5
$\begingroup$

you have typo. You wrote x[4]==0 in the initial conditions. It should be x4[0]==0 but DSolve can not solve it still. Since it is non-linear system of ode's which is much harder to solve analytically than linear set of odes'

B = 1/2;
c = 10;
ClearAll[x1, x2, x3, x4, t];
eqns = {x1'[t] == x3[t],
   x2'[t] == x4[t],
   x3'[t] == -x1[t] + B*(-1 + x1[t]^2 + x2[t]^2 + x3[t]^2 + x4[t]^2),
   x4'[t] == -c^2*x2[t] + 
     B*(-1 + x1[t]^2 + x2[t]^2 + x3[t]^2 + x4[t]^2)
   };
ic = {x1[0] == 0, x2[0] == 0, x3[0] == 1, x4[0] == 0};
DSolve[{eqns, ic}, {x1, x2, x3, x4}, t]

Mathematica graphics

Here is numerical

sol = NDSolveValue[{eqns, ic}, {x1, x2, x3, x4}, {t, 0, 30}]

Mathematica graphics

Plot[Evaluate[(sol[[#]][t]) & /@ Range[4]], {t, 0, 30}, 
      GridLines -> Automatic, GridLinesStyle -> LightGray]

Mathematica graphics

Or to see them more clearly (since the domain changes)

p = Table[
   Plot[sol[[n]][t], {t, 0, 30}, GridLines -> Automatic, 
    GridLinesStyle -> LightGray, PlotLabel -> Row[{"sol ", n}]], {n, 
    1, 4}];
Grid[{p}]

Mathematica graphics

So first and third solutions are dominant and second and fourth are minimal.

$\endgroup$
1
  • 1
    $\begingroup$ FWIW the symbolic solution to the IVP is made from the sine, cosine, and zero functions: {eqns, ic} /. {x1 -> Sin, x3 -> Cos, x2 | x4 -> (0 &)} // Simplify $\endgroup$
    – Michael E2
    Aug 9 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.