Problem Set 8 Slope Fields and Differential

Problem Set 8
Slope Fields and Differential Equations
Matlab Computing MATH 210-01 Fall 2015
December 22, 2015
Due: Friday, November 6, 2015
Read: Matlab Week 8 Handout
Instructions: To complete a problem set, you must submit a folder labeled Yourlastname_PS# to Dropbox no later than midnight on the due date above. For example, if I were to complete this assignment, my
folder would be named Emerick_PS7. In this folder, an m-file is to be submitted for each problem such
that when the m-file is executed, the output (as presented in Matlab) is the solution to the problem.
Each m-file must be saved as Yourlastname_PS#_No#.m. For example, if I were submitting the answer to
Question Number 1 on Problem Set 1, the m-file for that problem would be saved as Emerick_PS1_No1.m.
Each m-file should be well commented and be free of extraneous lines and commands. Also, each m-file
must output only what the problem asked to be outputted. Failure to abide by these simple homework
submission guidelines may result in a deduction of points at my discretion. Remember: if you don’t know
what a command does, you can always use Matlab’s help command or the internet...
Name:
Score:
1
Problem Set 7
December 22, 2015
MATH 210-01
For each problem below submit a separate m-file with a title comment that describes the objective of the
m-file. Always remember to begin your m-file (after the title comment) with close all; and clear
all;. Also, for any problems that require a plot, the title size, label size, etc should follow the default
figure settings discussed in class and on the handout.
1.] Create an m-file that outputs the slope field for the following autonomous differential equations:
(a)
(b)
(c)
(d)
dy
dt
dy
dt
dy
dt
dy
dt
= 4y 2 − 16
= y − y3
=1+
=e
−y
1
2
cos y
sin(y)
Separate each part with a double percent sign and label your graphs appropriately. Be sure you do
not plot too many points as this makes the slope field look stupid.
2.] Create an m-file that computes the numerical solution to the following logistic initial value
problem
dy
y
= ry 1 −
,
y(0) = y0 ,
dt
K
for parameter values r > 0, K > 0 and an initial value y0 . Your m-file should plot the solution to
the equation on the slope field. Plot at least two solutions on the same graph, one with y0 > K
and another with y0 < K.
3.] Create an m-file that computes the numerical solution to the following initial value problem
y y
dy
= ry 1 −
−1
dt
M
m
y(0) = y0 ,
for parameter values r > 0, m > 0, and M > 0 and an initial value y0 . Your m-file should plot
the solution to the equation on the slope field. Plot at least three solutions on the same graph, one
with y0 < m, m < y0 < M , and one with y0 > M .
2