4

I am new to Mathematica, please help me to handle the following problem:

I have the following system of equations:

\begin{cases} \dot x = 2xy \\ \dot y = 1 - x^2 - y^2 \end{cases}

What I want is to draw the phase portrait in the rectangle $[-4,4]\times[-4,4]$. This looks like the most natural thing one want to do as long as he wants to study phase portraits, since drawing them manually will take a lot of time. Unfortunately I was not able to find Mathematica code and since I am newbie I can not write it myself. I am sure this type of question is relevant for all ODE students, but I was not able to find the answer here.

Can you please help me to draw the phase portrait for this particular system?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Hedgehog
  • 293
  • 3
  • 8

1 Answers1

7

I suggest, you study the documentation about StreamPlot.

For your example:

StreamPlot[{2 x*y, 1 - x^2 - y^2}, {x, -4, 4}, {y, -4, 4}]

enter image description here

Explanation:

{2 x*y, 1 - x^2 - y^2}

Is your ode system.

{x, -4, 4}

Is the range for your x-coord. (from -4 to 4)

{y, -4, 4}

vice versa with y.

Perhaps also interesting: LineIntegralConvolutionPlot

Related

Hope this helps.

Julien Kluge
  • 5,335
  • 1
  • 17
  • 29