Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Jupyter notebook Assignment 5/assign05.ipynb

535 views
Kernel: SageMath 7.5

MTH 337. Differential Equations.

Problem Set 5

38 points

Due Monday, February 27, 2017 at 11:59 PM.

Michael Thomas Lynn

Problem 1 (8 points): Consider the following predator-prey system \begin{align*} \frac{dR}{dt} & = 2R - 1.2 RF \\ \frac{dF}{dt} & = -F + 0.9 RF, \end{align*} where R=R(t)R = R(t) is the population of the prey at time tt and F=F(t)F = F(t) is the population of the predator at time tt.

a. How would you modify this system to include the effect of hunting the prey at a rate of α\alpha units of prey per unit time?

Solution:

dRdt=2R1.2RFα\frac{dR}{dt} = 2R-1.2RF - \alpha

b. How would you modify this system to include the effect of hunting of the predators at a rate proportional to the number of predators?

Solution:

dFdt=F+0.9RFαF\frac{dF}{dt} = -F+0.9RF - \alpha F

c. Suppose the predators discover a second, unlimited source of food, but they still prefer to eat prey when they can catch them. How would you modify this system to include this assumption.

Solution:

dFdt=αF+0.9RF\frac{dF}{dt} = \alpha F + 0.9RF

d. Suppose the predators discover a second source of food that is limited in supply. How would you modify this system to include this assumption.

Solution:

dFdt=αF(1FN)+0.9RF\frac{dF}{dt} = \alpha F(1-\frac{F}{N})+0.9RF

Problem 2 (15 points): Consider the equation d2ydt2+kmy=0 \frac{d^2 y}{dt^2} + \frac{k}{m} y = 0 for the motion of a simple harmonic oscillator.

a. Consider the function y(t)=cosβty(t) = \cos \beta t. Under what conditions on β\beta is y(t)y(t) a solution to the differential equation?

Solution:

In order to find where β \beta is a solution to the differential equation, we must replace all the yy in the original differential equation with the function cosβtcos \beta t from y(t).

The above action yields,β2cos(βt)+kmcos(βt)=0 - \beta ^2 cos(\beta t) + \frac{k}{m}cos(\beta t) = 0

Now factor out the (kmβ2)(\frac{k}{m} - \beta^2) to get,

(kmβ2)cos(βt)(\frac{k}{m} - \beta^2)cos(\beta t)

now solve for β\beta,

KM\sqrt{\frac{K}{M}}

now find the initial conditions using what we know, c1=1,c2=0 c_1 = 1, c_2 = 0

b. Rewrite the initial value problem y+y=0y'' + y = 0, y(0)=1y(0) = 1, and y(0)=0y'(0) = 0 as a system.

Hint: Let v=yv = y'.

Solution:

The systems looks like the following.

v=yv = y'v+y=0v' + y = 0

and the initial conditions are y(0)=1 y(0) = 1 v(0)=0 v(0) = 0

c. What initial condition (t=0t = 0) in the yvyv-plane corresponds to this solution?

Solution:

The inititial conditions y(0)=1y(0) = 1 and v(0)=0v(0)=0 correspond to the solution.

d. In terms of kk and mm, what is the period of this solution?

Solution:

The period in terms of m and k is 2πkm\frac{2\pi}{\sqrt{\frac{k}{m}}}

e. Use Sage to graph the solution curve in the yvyv-plane that corresponds to this solution when m=1m = 1 and k=1k = 1 (with initial conditions y(0)=1y(0) = 1 and v(0)=0v(0) = 0).

Solution:

v, y, t = var('v y t') F = [-cos(t), -sin(t)] P = desolve_system_rk4(F, [v, y], ics = [0,0,1], ivar = t, end_points = 10, step = 0.01) Q = [ [j,k] for i,j,k in P] l = line(Q, axes_labels=['$y(t)$','$v(t)$'], fontsize=10, color = 'green') l
Image in a Jupyter notebook

Problem 3 (3 points): The spreading of cancer cells in the body is called {\em metastasis}. The Liotta-DeLisi model proposed in 1977 for the metastasis of malignant tumors in mice is given by the linear homogeneous system \begin{align*} x' & = - (\alpha + \beta)x \\ y' & = \beta x - \gamma y, \end{align*} where xx is the number of destroyed cancer cells, yy is the number of cells that invade the tissue, and α\alpha, β\beta, and γ\gamma are positive constants depending on the type of cancer. Solve the system and give the physical interpretation for all possible choices of α\alpha, β\beta, and γ\gamma.

Solution: To solve the system we must first recognize that xx'constitutes a seperated semi-autonomous differential equation. Knowing this, we can break xx', which is also dxdt\frac{dx}{dt}, apart onto both sides of the equals sign and solve.

dxdt=(α+β)x\frac{dx}{dt} = -(\alpha + \beta)x1xdx=(α+β)dt\frac{1}{x}dx = -(\alpha + \beta)dt

We integrate to get,

ln(x)+c=(α+β)tln(x) + c = -(\alpha + \beta)t

now we apply some properties of logarithms and some fenagling of constants to get.

x(t)=c(α+βγ)βe(α+β)tx(t) = -c\frac{(\alpha+\beta-\gamma)}{\beta}e^{-(\alpha+\beta)t}

Next we rewrite the second equation as dy+γy=βxdy + \gamma y = \beta x.

Once rewritten in this form, we can see that an integration factor will be neccessary. Next we find an integration factor to solve the second, partially coupled, differnetial equation. μ(x)=eγt \mu (x) = e^{-\gamma t} Now that we have the I.F. we apply the method of the integration factor to find y(t). yeγt=eγtβxeγtγy ye^{-\gamma t} = e^{-\gamma t} \beta x - e^{-\gamma t} \gamma y with some further manipulation, and after plugging x(t) in for x in the y' equation we find. y(t)=ce(α+β)t+ceγt y(t) = ce^{-(\alpha + \beta)t} + ce^{-\gamma t}

Having found the solutions to the system for any values of α\alpha, β\beta and γ\gamma we can conclude that mice are dying any time those three terms are greater than 0.

Problem 4 (12 points):

Consider the system \begin{align*} x' & = y \\ y' & = x - x^3 -y \end{align*}

a. Find the equilibrium points of the system.

Solution:

To find the equilibrium points of the system, set both differential equations = 0. x=y x' = y So, y=0 y = 0 Now we can substitute 0 for y in the second equation. y=xx30 y' = x-x^{3}-0 Rearranging and simplifying at the same time yields. y=x(1x2) y' = x(1-x^{2}) Thus we find the equilibrium solutions to be y=0y = 0, x=0x = 0, x=1x = 1 yielding points (0,0) and (0,1)

b. Determine the xx and yy-nullclines.

Solution:

The nullclines are x = 0, x = 1 and y = 0

c. Use Sage to plot the phase plane for the system. Be sure to draw the xx and yy-nullclines, the direction field, and a sample solution.

from sage.calculus.desolvers import desolve_rk4 x, y, t = var('x y t')
x, y, t = var('x y t') F = [y, x-x^3-y] P = desolve_system_rk4(F,[x, y],ics=[0,0,1],ivar=t,end_points=2,step=0.01) Q = [ [j,k] for i,j,k in P] k = line(Q, axes_labels=['$x(t)$','$y(t)$'], fontsize=11, thickness=1) n = sqrt(F[0]^2 + F[1]^2) F_unit = [F[0]/n, F[1]/n] k += plot_vector_field(F_unit, (x,-3,3), (y,-3,3), axes_labels=['$x(t)$','$y(t)$']) k += implicit_plot(F[0], (x,-3,3), (y,-3,3), color='purple') k += implicit_plot(F[1], (x,-3,3), (y,-3,3), color='green') k
Image in a Jupyter notebook
.