Docsity

Math 151B Homework #1: Well-Posed Problems and Population Growth Model, Assignments of Mathematics

Toggle sidebar
bg1
Math 151B Homework #1 – due Friday 1/16, in class
1. Well posed
Which of the following problems is well posed?
a. y0=y/√t, 1 ≤t≤2, y(1) = 0.
Answer:
The y derivative of f(t, y ) is bounded on the convex domain, and f(t, y ) is continuous on
the domain. Thus the problem is well-posed.
b. y0=√y, 0 ≤t≤1, y(0) = 1.
Answer:
This fails to have a bound on ∂f /∂y if ybecomes close to 0. However, dy/dt > 0 for all
y > 0 and this is a growth equation. Thus ywill never near zero, and the problem is well
posed.
c. y0=ty,−1≤t≤1, y(−1) = 1.
Answer:
|∂f /∂y|=|t| ≤ 1. Well-posed.
2. Euler’s method
A simple model for population growth with limited resources is
dy
dt =y(a−by)
where yis the population, ais the growth rate in absence of environmental pressures, and
bis the effect of resource limitation. Let a= 1, b= 10−4,y(0) = 100, and let time be
measured in years.
a. Use Euler’s method to compute the population each year for the next ten years.
Answer:
function [t,w] = euler(fname,a,b,alpha,N)
f = str2func(fname);
h = (b-a)/N;
t(1) = a;
w(1) = alpha;
for i = 1:N
w(i+1) = w(i) + h*f(t(i),w(i));
t(i+1) = t(i)+h;
endfor
endfunction
pf3
pf4

Partial preview of the text

Download Math 151B Homework #1: Well-Posed Problems and Population Growth Model and more Assignments Mathematics in PDF only on Docsity!

Math 151B Homework #1 – due Friday 1/16, in class

  1. Well posed

Which of the following problems is well posed?

a. y′^ = y/

t, 1 ≤ t ≤ 2, y(1) = 0. Answer: The y derivative of f (t, y) is bounded on the convex domain, and f (t, y) is continuous on the domain. Thus the problem is well-posed.

b. y′^ =

y, 0 ≤ t ≤ 1, y(0) = 1.

Answer: This fails to have a bound on ∂f /∂y if y becomes close to 0. However, dy/dt > 0 for all y > 0 and this is a growth equation. Thus y will never near zero, and the problem is well posed.

c. y′^ = ty, − 1 ≤ t ≤ 1, y(−1) = 1. Answer: |∂f /∂y| = |t| ≤ 1. Well-posed.

  1. Euler’s method

A simple model for population growth with limited resources is

dy dt

= y(a − by)

where y is the population, a is the growth rate in absence of environmental pressures, and b is the effect of resource limitation. Let a = 1, b = 10−^4 , y(0) = 100, and let time be measured in years.

a. Use Euler’s method to compute the population each year for the next ten years. Answer:

function [t,w] = euler(fname,a,b,alpha,N) f = str2func(fname); h = (b-a)/N; t(1) = a; w(1) = alpha; for i = 1:N w(i+1) = w(i) + h*f(t(i),w(i)); t(i+1) = t(i)+h; endfor endfunction

b. Use Taylor’s method of order two to compute the population each year for the next ten years.

c. Answer:

function [t,w] = taylor2(fname,fpname,a,b,alpha,N) f = str2func(fname); fp = str2func(fpname); h = (b-a)/N; t(1) = a; w(1) = alpha; for i = 1:N phi = f(t(i),w(i)) + 0.5hfp(t(i),w(i)); w(i+1) = w(i) + h*phi; t(i+1) = t(i)+h; endfor endfunction

Plot both of these approximations along with the exact answer

y =

a/b 1 +

a−by 0 by 0

e−at

Answer:

a = 1; b = 10^-4; y0 = 100; hold on; clearplot; gnuplot_set key left;

t = 0:1:10; y = (a/b)./(1+((a-b100)/(b100))exp(-at)); plot(t,y,";Exact;");

[t,w] = euler("popgrowth",0,10,y0,10); plot(t,w,";Euler;-+2");

[t,w] = taylor2("popgrowth","popgrowth_prime",0,10,y0,10); plot(t,w,";Taylor2;-*3");

print -dpsc2 euler.ps hold off;

and L is the bound on the y derivative of f , so L = 10. Then

|yi − wi| ≤

(e10(ti)^ − 1)

≤

(e^10 ti^ − 1)

For ti ≥ 0 .1, the error bound is larger than the actual error. Thus theorem 5.9 is still valid.