[Go to the Notes on Diffy Qs home page]

# Notes on Diffy Qs - Sage demos for section 1.2

Press the *Evaluate* button below to launch the Sage demonstration.
You may have to wait a little before the graph
appears. Be patient. To change the function, you should edit the code and press
the *Evaluate* button again. Note that Sage ignores any line starting with
a pound sign #, so those lines are simply comments for a human.

## Slope field

Here we plot the slope field of \(y' = f(x,y)\) where you can
change the \(f(x,y)\) in the code, several possibilities are given.
The default range is -2 to 2 in both x and y and you can change this as
well by modifying the given variables.

If you do not need a fixed aspect ratio (x and y units are the same),
remove the "aspect_ratio=1," from the above.
If you want to plot more little lines, you can change the
"plot_points=20" parameter.

## Slope field and solution

In this demonstration we plot the slope field and have the compute draw
a solution with a certain initial condition \(y(x_0)=y_0.\) The initial
point is drawn as a red dot. Again you can change both the function
and initial condition by editing the code and evaluating.