diff eq (honors) - lab 2
direction fields



in lab

  1. (follow along with demonstration) plot a direction field for y'=y using VectorPlot. (this is an example of the malthusian growth rate equation from hw 1) overlay the graph of e^t on the on the direction field. plot trajectories for y'=y using StreamPlot. identify equilibrium solutions and asymptotic behaviour based on an initial condition y'(0). given any initial condition y(t_0) = y_0, does there exist a solution? if so, for what values of t?

for homework

turn in print outs of your mathematica worksheets, with any extraneous work cut out, on the due date listed on the homework page. write your name and the lab number at the top. though you may get help from me or your classmates, all of your code should be typed in (not copied) by yourself. where appropriate, write problem numbers and explanations/comments by hand on your printouts (namely, parts (b) and (c) should be written by hand.)
  1. consider a logistic equation y'= y - 0.2 y^2. (you may think of y as representing population at time t, with y being birth rate and 0.2 y^2 being death rate as in hw 1.) for this ode, do the following:
    (a) plot a direction field (you may use VectorPlot or StreamPlot or both, and you may want to experiment with the x,y (or t,y) ranges of the plot to get a good picture).
    (b) explain the asymptotic behaviour of the solutions in terms of an intial value of y(0). identify equilibrium solutions.
    (c) does there exist a solution for any initial condition y(t_0) = y_0, and if so, is it unique and does the solution exist for all values of t? if not, why not?
  2. do (a), (b) and (c) as above for this case of torricelli's law (again from hw 1): y'=-sqrt(y)
  3. do (a), (b) and (c) as above for ode: y'=-y/t
  4. do (a), (b) and (c) as above for ode: y'=-t/y
  5. overlay your plots from lab 1 hw question 2 with a direction field (for this I'd prefer you to use VectorPlot) for the ode: y'=2t.

help

see the lab 1 page for general mathematica resources. for the topics for today, see the relevant how to or examples on mathematica stack exchange

addendum

here is some mathematica code for how to plot several trajectories on top of the direction field for our example of y'=y:
dirfield = VectorPlot[{1, y}, {x, -5, 5}, {y, -5, 5}];
Do[p[i] = Plot[i*Exp[x], {x, -5, 5}, PlotRange -> {-5, 5}], {i, -5, 5}];
tab1 = Table[p[i], {i, -5, 5}];
tab2 = Append[ptab, dirfield];
Show[tab2]


labs page
course home