The toolkits dfield and pplane are staples in ODE courses. First in MATLAB, now in Java. Do they have a Mathematica expression?

Sample outputs follow:

pplane dfield

@Michael E2

Your suggestions were great. Here are the results.



Nice example by @David Slater in Plotting a Phase Portrait

Phase portraits

@Chris Degnen: Phase Portrait Trajectories

@chris: Plotting a Phase Portrait

@Kuba♦, @Jens: Phase portrait on a cylinder

@Alexei Boulbitch: How to make program for phase portrait?

@yarchik: Cleaner Approach to Plotting Multiple Solution Curves on Phase Portrait

@Artes, @Sektor, @Michael E2: Phase portraits and StreamPlot

@Rahul: Why isn't my Stream code plotting multiple solution curves?

@ubpdqn: Posted to this question

Direction Field

@Jens: Plotting the direction field of a differential equation

@Jens: Graphics Grid Direction Field Animations as GIF

@Dr. belisarius, @Wesley Wolfe: How can I plot the direction field for a differential equation?

@Kuba♦: How to plot a vector field on a geographic map?

  • 7
    $\begingroup$ Have you seen EquationTrekker or search this site for phase portrait or direction field? $\endgroup$
    – Michael E2
    Apr 7, 2017 at 2:41
  • $\begingroup$ @Michael E2: Had not seen EquationTrekker; will tinker with it immediately. Had not searched with those keywords. Found many promising links. Thanks, very helpful insights. My hope is to find a package and avoid writing code. Many homework problems are written around the functionality of pplane and dfield, so a close match is desirable. $\endgroup$
    – dantopa
    Apr 7, 2017 at 2:53
  • $\begingroup$ @ Michael E2: Please consider promoting your comment to an answer; it deserves a vote. $\endgroup$
    – dantopa
    Apr 7, 2017 at 4:20
  • 1
    $\begingroup$ I'm a bit involved in a family situation and don't have the time to consider answering. If a good duplicate or two can be found, it might be better to "close" it as a duplicate. The advantage is that others searching for an equivalent to dfield or pplane would likely find this question and the linked solutions. $\endgroup$
    – Michael E2
    Apr 7, 2017 at 10:17
  • 1
    $\begingroup$ @Michael E2: Thanks for the idea. Here is a hasty collection, not a curation. Your further insights are welcome. Readers: Please remember to upvote these clever solutions. $\endgroup$
    – dantopa
    Apr 20, 2017 at 23:45

1 Answer 1


There are a lot of resources on this site (as suggested in the comments and likely to make the question reasonably deemed a duplicate). You can do a lot yourself, e.g.:

sp = StreamPlot[{2 x - y + 3 (x^2 - y^2) + 2 x y, 
    x - 3 y - 3 (x^2 - y^2) + 3 x  y}, {x, -2, 4}, {y, -4, 2}];
cp = {x, y} /. 
   NSolve[{2 x - y + 3 (x^2 - y^2) + 2 x y, 
      x - 3 y - 3 (x^2 - y^2) + 3 x  y} == {0, 0}, {x, y}
sn = ParametricNDSolve[{{x'[t], 
      y'[t]} == {2 x[t] - y[t] + 3 (x[t]^2 - y[t]^2) + 2 x[t] y[t], 
      x[t] - 3 y[t] - 3 (x[t]^2 - y[t]^2) + 3 x[t]  y[t]}, {x[0], 
      y[0]} == {a, b}}, {x, y}, {t, 0, 1}, {a, b}];
 Show[sp, ParametricPlot[{x[a, b][t], y[a, b][t]} /. sn, {t, 0, 1}, 
   PlotStyle -> Red], 
  Epilog -> {PointSize[0.02], Black, Point[{a, b}], Green, Point[cp]},
   PlotLabel -> 
   Column[Thread[{x', y'} == {2 x - y + 3 (x^2 - y^2) + 2 x y, 
       x - 3 y - 3 (x^2 - y^2) + 3 x  y}]]], {a, 0, 2}, {b, 0, 2}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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