next up previous contents
Next: Using sol1.m Up: Using slopef.m Previous: Using slopef.m   Contents

Example

When you first copy init.m, it should be set to run this example.
Plot the slopefield for $x' \,=\, 2\,t\,x$ over the rectangle $1 \,\leq\, t \,\leq\, 4$, $-2 \,\leq\, x \,\leq\, 0$. Investigate whether this rectangle gives a good overall picture of the ODE behavior. If not, plot over a better rectangle.
  1. Change only the following in init.m
    ftx = '2*t*x'; (``$*$'' indicates multiplication)
    initax = [1,4,-2,0];
    Save then type init in the command window to initialize the variables (or copy-and-paste in the Emporium).

  2. Type slopef(ftx,N) to obtain

    \begin{picture}(5,5.5)
\put(1,0){\includegraphics [width=5cm,height=5cm]{inst2f01.ps}}
\end{picture}
Since $x' \,=\, 2\,t\,x$ represents the slope, we should also consider when $t < 0$ and $x > 0$. Suppose we try the symmetric rectangle $-2 \,\leq\, t \,\leq\, 2$, $-2 \,\leq\, x \,\leq\, 2$.
  1. This time change only
    initax = [-2,2,-2,2];
    Save then type init in the command window (or copy-and-paste in the Emporium).
  2. Type slopef(ftx,N) to obtain

    \begin{picture}(5,5.5)
\put(1,0){\includegraphics [width=5cm,height=5cm]{inst2f02.ps}}
\end{picture}
Build your intuition: Does this picture match the general slope behavior indicated by $x' \,=\, 2\,t\,x$? Look at the following cases

\begin{displaymath}\mbox{(a)}\;\; t < 0, \;\; x > 0, \qquad \mbox{(b)}\;\; t < 0...
...;\; t > 0, \;\; x < 0, \qquad
\mbox{(d)}\;\; t > 0, \;\; x > 0\end{displaymath}


next up previous contents
Next: Using sol1.m Up: Using slopef.m Previous: Using slopef.m   Contents
Michael Renardy
2000-05-12