Problem: Given the following non autonomous differential equation, plot the line fields which represents the solutions of the ODE.
\[ \frac {dy\left ( x\right ) }{dx}=x^2 - y \]
Direction field plot (or slope plot) shows solutions for the ODE without actually solving the ODE.
The following are the steps to generate direction field plot for \(\frac {dy}{dx}=f(x,y)\)
Using Matlab, the points are first generated (the \((x,y)\) coordinates) then the slope \(f(x,y)\) evaluated at each of these points, then the command quiver() is used. Next contour() command is used to plot few lines of constant slope.
In Mathematica, the command VectorPlot
is used. In Maple dfieldplot
is used.