0
$\begingroup$
x1'[t] == x2[t]
x2'[t] == -4*y2[t]*y1[t]^2 + (2*x2[t]*y2[t])/y1[t] - (y2[t]^2*y1[t]^2)/
   x1[t]^3
y1'[t] == y2[t]
y2'[t] == 
 4*x2[t]*x1[t]^2 + (2*y2[t]*x2[t])/x1[t] - (x2[t]^2*x1[t]^2)/y1[t]^3

How can I plot of x1 versus x2, x1 versus y1, x1 versus y2, y1 versus y2?

Please help me ?

$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Apr 4 '15 at 15:04
4
$\begingroup$

You are trying to solve a set of Ordinary differential equation but you forgot to set up initial conditions.

This is just to get you started.

Your equation

 eqn = { x1'[t] == x2[t],
  x2'[t] == -4*y2[t]*y1[t]^2 + (2*x2[t]*y2[t])/
     y1[t] - (y2[t]^2*y1[t]^2)/x1[t]^3,
  y1'[t] == y2[t],
  y2'[t] ==  4*x2[t]*x1[t]^2 + (2*y2[t]*x2[t])/x1[t] - (x2[t]^2*x1[t]^2)/y1[t]^3}

Some initial condition that I randomly chose as you forgot to specify them:

ics = {x1[0] == 1, x2[0] == 2, y1[0] == 1, y2[0] == 1};

The numerical solution

sol = NDSolve[Flatten[{eqn, ics}], {x1, y1, x2, y2}, {t, 0, 1}];

One of the plots you requested

 ParametricPlot[{x1[t], x2[t]} /. sol, {t, 0, 1},AxesLabel -> {x1[t], x2[t]}]

Mathematica graphics

Map[ParametricPlot[# /. sol, {t, 0, 1}] &,
   {{x2[t], x1[t]}, {y1[t], x1[t]},
    {y2[t], x1[t]}, {y2[t], y1[t]}}] // Partition[#, 2] & // Grid

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ how can I plot x1-x2 on the same plot with different initial conditions? please help me $\endgroup$ – merve Apr 5 '15 at 17:09
  • $\begingroup$ ok I have done thank you. $\endgroup$ – merve Apr 5 '15 at 17:19

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.