Mah 46: Homework Soluions Gregory Handy [.] One of he well-known phenomenological (capuring he phenomena, bu no necessarily he mechanisms) models of cancer is represened by Gomperz equaion dn d = bn ln(n/k) (a) Solve his equaion wih N() = N using he subsiuion u = ln(n/k), o obain he soluion N() = K exp( Ae b ), where A = ln(n /K). (b) Plo he soluion as a funcion of ime for K =, N =., b =. Illusrae wih a plo and describe in words wha happens o he umor dynamics if he growh rae b is varied. Compare wih he logisic dynamics dn d = bn(n K). (a) We sar by considering he subsiuion u = ln(n/k). Solving for N yields Differeniaing boh sides wih respec o yields N() = Ke u(). dn d = Keu() du d. We can plug in he above componens ino our ODE o find Ke u du d = bkeu u du d = bu. Using separaion of variables and hen inegraing, we find Wriing his in erms of N(), we have du u = bd ln(u) = b + C u() = Ae b. ln(n/k) = Ae b N() = K exp(ae b ). We can now use our iniial condiion o solve for he consan A Thus, our final soluion is N() = N N = K exp(a) A = ln(n /k). N() = K exp( Ae b ), wih A = ln(n /K).
b=. b=. b=..9.8 Gomperz Logisic.9.8 Gomperz Logisic.9.8 Gomperz Logisic.7.7.7.6.6.6 N(). N(). N()..4.4.4.3.3.3.2.2.2.... Figure : Plo of he soluions for he Gomperz equaion and he logisic equaion. Noe he change in he x-axis beween he plos. (b) The soluion plo (wih varying levels of b) of he Gomperz equaion can be found in Fig.. increasing b, we find ha he graph increases significanly faser. We can also solve he logisic equaion using separaion of variaions, or solve i numerically using ode4 (I oped for he numerical mehod). These plos can also be found in Fig.. Comparing hese wo curves, we find ha ha he Gomperz equaion increases faser han he logisic equaion. [.2] Do he following exercises for hese funcions: (a) f(x, y) = y 2 sin x (b) f(x, y) = exp(.(x 2 + y 2 )) Find f,,, gradien of f. (compuing) Visualize he surface and he level curves given by he equaion z = f(x, y) in MATLAB. Explore differen funcions for ploing: mesh, meshz, meshc, surface and see wha hey do. (a) We firs consider f(x, y) = y 2 sin x. We find f = [y2 sin x] = y 2 cos(x). = 2 [y 2 sin x] = [y 2 sin x] = [2y sin x] = 2y cos x Since f is a coninuous, well-behaving funcion, we know immediaely ha = 2y cos x. 2
Lasly, he gradien of f is ( f, f ) = ( y 2 cos(x), 2y sin(x) ). 4 2 z 2 4 y x Figure 2: Plo of f(x, y) = y 2 sin x. (b) We firs consider f(x, y) = exp(.(x 2 + y 2 )). We find f = [exp(.(x2 + y 2 ))] =.2x exp(.(x 2 + y 2 )). = 2 [exp(.(x 2 + y 2 ))] = [exp(.(x 2 + y 2 ))] = [.2y exp(.(x2 + y 2 ))] =.4yx exp(.(x 2 + y 2 )) Since f is a coninuous, well-behaving funcion, we know immediaely ha =.4yx exp(.(x2 + y 2 )). Lasly, he gradien of f is ( f, f ) = (.2x exp(.(x 2 + y 2 )),.2y exp(.(x 2 + y 2 )) ). 3
z. y x Figure 3: Plo of f(x, y) = exp(.(x 2 + y 2 )). [.3] Concenraion of nuiens in a Peri dish (shallow pool of nuriens) can be described by c(x, y) = C exp( α(x 2 + y 2 )). A baceria is siing a he poin (, ) and moves in he direcion of increasing nuriens concenraion. In which direcion will i move? Draw a picure. Where will i end up? By he problem saemen, we can assume C, α >. In order o find he direcion of movemen, we need o find he gradien a he poin (, ), c(x, y) = 2αC x exp( α(x 2 + y 2 )) c(x, y) = 2αC y exp( α(x 2 + y 2 )). I follows ha ( c(x, y), ) c(x, y) = ( 2αC exp( 2α), 2αC exp( 2α)). (, ) Thus, he baceria will wan o decrease is x-posiion, while increasing is y-posiion. The baceria will coninue o climb up he concenraion gradien unil he gradien is (, ). Looking a he above formula, his will occur when x = and y =. Figure 4: Plo of he baceria a (, ) on he concenraion surface c(x, y) = C exp( α(x 2 + y 2 )). The black line uses he gradien o show he direcion ha he baceria will move. 4
The following wo problems refer o he one-dimensional diffusion equaion u = Du xx [.4] Find he seady sae soluion of he one-dimensional diffusion equaion wih boundary condiions u x (, ) = c, u(l, ) = c 2, x [, L]. Plo i. We can find he seady sae soluion by seing u =. I follows ha we are lef wih he following ODE u xx =. Inegraing once, we find u x = k. From he boundary condiion u x (, ) = c, we know ha k = c. Inegraing his equaion again yields u(x) = c x + k 2. Using he oher boundary condiion u(l, ) = c 2, we find c 2 = c L + k 2 k 2 = c 2 c L. Thus, our final soluion is u(x) = c x + (c 2 c L) Choosing L =, c =, and c 2 = 2, we plo his seady sae soluion on Fig.. 2.8.6 u(x).4.2.2.4.6.8 x Figure : Seady sae soluion. [.] In an experimen a subsance of concenraion A is released ino a narrow ube a x =, =. I difuses along he ube wih diffusion consan D =. Deecors are seup along he ube a all locaions x >. They can deec he subsance if he concenraion is above % of A. (a) Wha is he furhes locaion X() where he deecor will be responding a ime? (Hin: You will need o solve he diffusion equaion before you find X(). Use fundamenal soluion approach.) (b) Skech he ime evoluion of X()
(a) Given he fundamenal soluion of he diffusion equaion we know our soluion akes he form u(x, ) = Γ(x, ) = e x2 /(4D), e (x y)2 /(4D) f(y)dy, where u(x, ) = f(x) is our iniial condiion. For his problem, we have u(x, ) = = e (x y)2 /(4D) Aδ(y )dy A e x2 /(4D) = A e x2 /(4), where we have aken D = in he las equaliy. Now, we are ineresing in X(), he furhes locaion ha is able o deec u(x, ).A. Thus, seing he above soluion equal o.a and solving for x yields A e x2 /(4) =.A e x2 /(4) =. ( x2 = ln. ) 4 ( X() = 4 ln. ) (b) Taking A =, we can use MATLAB o plo X(). We see ha iniially his poin increases, before going back o zero. This makes sense, since as increases from, he soluion will spread ou, and hus X() will increase. However as, he soluion will flaen ou, and no poins will be above he % hreshold, and so X() will decrease back o. Run he code on he nex page o produce a movie of his soluion evolving wih ime. 4 3 X() 2 2 3 4 Figure 6: Plo of X(). 6
clear; clc; close all; A=; D = ; = [:.:3]; x=[:.:]; u = zeros(lengh(x),lengh()); for i = :lengh() u(:,i) = A/sqr(4*pi*D*(i)).*exp(-x.^2./(4*D*(i))); end deecor=sqr(-log(.*sqr(4*pi*d*))*4*d.*); % makes a movie ha plos he soluions and he % deecor poin for i = :lengh() hold off plo(x,u(:,i), linewidh,.) hold on plo(real(deecor(i)),.*a,., markersize,2, color, black ) se(gca, fonsize,6) xlabel( x, fonsize,6) ylabel( u(x,), fonsize,6) ile_emp=sprinf( ime=%.2f,(i)); ile(ile_emp) axis([ ]) pause(.) end %% figure(2); plo(,real(deecor), linewidh,.) se(gca, fonsize,6) xlabel(, fonsize,6) ylabel( X(), fonsize,6) 7