next up previous contents
Next: Example Up: First Order ODEs Symbolically Previous: bdode.m, eqn1d.m, hwsol1.m   Contents

Using slopef.m

We want to plot the slopefield of the first order ODE $x' \,=\, f(t,x)$ over a user-designated window $a \,\leq\, t \,\leq\, b$, $c \,\leq\, x \,\leq\, d$.
  1. Make the appropriate changes in init.m.
    ftx = '$f(t,x)$'; (RHS of $x' \,=\, f(t,x)$)
    initax = [$a$,$b$,$c$,$d$]; (desired window size)
    Save then type init in the command window to initialize the variables (or copy-and-paste in the Emporium).
    (Unles otherwise specified, we will use N = 20; as originally written in init.m.

  2. Type slopef(ftx,N)

  3. If the resulting plot does not show all of the general behavior for the ODE solution, you may have to choose new $t$ and/or $x$-values for initax, then do Items 1 and 2 again.


Michael Renardy