Mah 467 Homework Se : some soluions > wih(deools): wih(plos): Warning, he name changecoords has been redefined Problem :..7 Find he fixed poins, deermine heir sabiliy, for x( ) = cos x e x > plo(cos(x) - exp(x),x = -5*Pi..Pi,y=-..); y 4 8 6 4 x I is easier o visualize ploing he curves of cos x and e x separaely: > plo({cos(x),exp(x)},x = -5*Pi..Pi,y = -.4..);.5 y.5 4 8 6 4 x.5 The fixed poins are a he inersecions of hese wo curves. Le s find he firs few numerically, specifying he inervals for he numerical soluion, which we know from he behaviour of cos x: > x := fsolve(exp(x)-cos(x),x,-..); x := fsolve(exp(x)-cos(x),x,-pi..-);
x := fsolve(exp(x)-cos(x),x,-pi..-); x := fsolve(exp(x)-cos(x),x,-*pi..-pi); x3 := fsolve(exp(x)-cos(x),x,-3*pi..-*pi); x4 := fsolve(exp(x)-cos(x),x,-4*pi..-3*pi); x :=. x := -.969579 x := -4.79759 x3 := -7.8535938 x4 := -.995596 We observe ha he roos xk for k are close o he zeros of cos x, since e x is small: > evalf(seq(-(k-/)*pi,k=..4)); -4.738898, -7.85398635, -.9955749 From he sign of cos x, we can see ha he fixed poins xk are sable if k is odd, and unsable if k is even. We can deduce he qualiaive behaviour of he soluions from he fixed poins and heir sabiliy. Direc numerical inegraion using Maple gives: > eqp := diff(x(),) = exp(x()) - cos(x()); iniconds := [[x()=],[x()=],[x()=-],[x()=-],[x()=-4],[x()=x],[x() =-5],[x()=-7], [x()=-8]]: DEplo(eqp,x(),=..8,x=-9..,iniconds,linecolor=black,sepsi ze=.); > eqp := x( ) = e x( ) cos ( x( ) ) e x 4 6 8 x() 4 6 8 A closed-form analyical soluion is no available, since i would require he inegraion of e x cos x.
Problem :..8 We seek a dynamical sysem yielding he given flow. A possible answer is given by d x( ) = ( x + ) x( x ) d > eqp := diff(x(),) = (x()+)^ * x() * (x()-): iniconds := [[x()=-.5],[x()=-],[x()=-.8],[x()=],[x()=.], [x()=],[x()=.]]: DEplo(eqp,x(),=..5,x=-..3,iniconds,linecolor=black,seps ize=.); 3 x() 3 4 5 This is one of many possible answers; ohers are obained by muliplying he vecor field by g( x ), where g is posiive excep possibly a one or more of he fixed poins. Problem 3:..3 - he Skydiver > m := m : g := g : k := k : eqp3 := diff(v(),) = g - k*v()^/m; k v( ) eqp3 := v( ) = g m The command odeadvisor indicaes he soluion mehod for his firs-order ODE. > odeadvisor(eqp3); [_quadraure] To find he soluion, we separae variables, and inegrae; he inegraion of ( a v ) (-) (where gm a = ) is bes performed using parial fracions. Maple can also solve his equaion k analyically: dsolve(eqp3);
v( ) = anh g m k ( + _C) m k g m k mg In fac, his soluion is only valid if m, g and k are all posiive, and if < v( ). I seems ha k Maple auomaically made hese assumpions; in his case hey are jusified, bu his example shows ha in general Maple s analyical soluions are no always reliable: do he calculaions by hand, and show your working! (you can use Maple o check, if you like). Tha is, he soluion produced by Maple is only he general soluion for a < v( ) (he problem is o ake care wih absolue value signs...). We can find he paricular soluion saisfying he iniial condiion v( ) = : > solp3 := rhs(dsolve({eqp3,v()=})); g m k anh g m k m solp3 := k Now we can use Maple o find he asympoic behaviour: > limi(solp3,=infiniy); g m k anh g m k m lim k Evidenly, now (finally!) Maple is concerned abou he sign of he variables. Le s ry specifying ha all variables are posiive: > limi(solp3,=infiniy) assuming (g>,m>,k>); g m k k This gives he correc erminal velociy. We can wrie he formula for v( ) in erms of he erminal velociy V: vsol := simplify(subs(m=k*v^/g,solp3)) assuming (k>,v>); vsol := anh g V V This answer is much more easily obained by he graphical mehod. We plo dv d agains v (choosing some values of he variables): g := : m :=.: k := : plo(g - k*v*v/m,v=-.5...5); m := m : g := g : k := k :
5 v.5.5.5.5 5 Now le s use he numbers given: The average velociy is (in f/sec) Vavg := (34-)/6; evalf(vavg); 735 Vavg := 9 5.58669 ds The disance ravelled as a funcion of ime is s( ) saisfying = v and s( ) =. d s := in(vsol,) assuming (V>,g>); V ln anh g V ln anh g + V V s := g g This soluion doesn look oo correc: i is giving negaive argumens of he ln funcion (and is hus complex-valued). Le s ry o help Maple a bi, by performing he appropriae subsiuion by hand... s := In(vsol,) assuming (V>,g>); > s3 := value(suden[changevar](au=*g/v,s,au)); > s := subs(au=*g/v,s3); s := anh g d V V s3 := V ln ( cosh( τ) ) g V ln cosh g V s := g > g := 3.: := 6: s; dis := 34-;
> g := 3.: := 6: s; dis := 34-; solve(s=dis,v);.35596 V ln cosh 3735. V dis := 93-5.58669 In he command solve, Maple aemps an analyical soluion; in his case i ges i wrong (I m no sure why; bu he given value is he average velociy compued previously, which canno also be he erminal velociy). For a problem wih purely floaing-poin soluions, we should use fsolve (and look for he posiive soluion): Verm := fsolve(s=dis,v,v=..infiniy); Verm := 65.685485 From his value of he erminal velociy, we can compue he drag consan k. Noe ha he weigh (in pounds) is mg. weigh := 6.: kdrag := solve(sqr(weigh/k)=verm,k); kdrag :=.373537 > m := m : g := g : k := k : s := s : := : Problem 4:.3. - Auocaalysis The fixed poins are readily found o be and k_ a k_ (-) > fp4 := k_*a*x - km_*x^; solve(fp4,x); fp4 := k_ a x km_ x, k_ a km_ x = is unsable, he oher fixed poin is sable. We can do a quick graphical analysis, and plo some ypical soluions, if we assume values for he consans: a := : k_ := : km_ := : plo(fp4,x=-.5...5);. x.4...4.6.8..4..4.6 > DEplo(diff(x(),)=a*k_*x()-km_*x()^,x(),=..5,x=-...,[[x()=-.],[x()=.],[x()=.7],[x()=.7]],linecolor=black)
,[[x()=-.],[x()=.],[x()=.7],[x()=.7]],linecolor=black) ;.5 x().5 3 4 5 Problem 5:.3.3 - Tumour growh We plo he vecor field and some soluions for some values of a and b: > a :=.: b :=.75: plo(-a*n*ln(b*n),n=..);.5 N..4.6.8..4.6.8.5.5 Clearly he fixed poin N = is unsable, and N = is sable. b > DEplo(diff(N(),)=-a*N()*ln(b*N()),N(),=..5,N=-...,[[N ()=.],[N()=.],[N()=.8]],linecolor=black);
.5 N().5 3 4 5 Problem 6:.4.7 - Pichfork bifurcaion > f6 := (x,a) -> a*x - x^3; f6 := ( x, a) a x x 3 We plo he hree vecor fields nex o each oher, using he array funcion: p6a := plo(f6(x,-),x=-.5...5,y=-..,ickmarks=[,]): p6b := plo(f6(x,),x=-.5...5,y=-..,ickmarks=[,]): p6c := plo(f6(x,),x=-.5...5,y=-..,ickmarks=[,]): > plos6 := array(..,..3): plos6[,]:=p6a: plos6[,]:=p6b: plos6[,3]:=p6c: display(plos6); y y y x x x
For a, here is a unique fixed poin a x =, which is sable; for a < his is found by linear sabiliy analysis (since f () = a < ), while for a =, linear sabiliy analysis does no prove sabiliy (decay owards he origin is slower han exponenial - see he nex problem), bu a look a he plo of x 3 shows ha he origin is sable. If < a, here are hree fixed poins, a x =, x = a and x = a. Now f () = a is posiive, so he origin is unsable, while he oher wo fixed poins are sable, wih f = a. This is also apparen from he graphs. > Problem 7:.4.9 - Criical slowing down Rese variables: x := x : > eqp7 := diff(x(),) = - x()^3; eqp7 := x( ) = x( ) 3 Find he analyical soluion wih arbirary iniial condiion: xsa := dsolve({eqp7,x()=x},x()) assuming x>; xsb := dsolve({eqp7,x()=x},x()) assuming x<; xsz := dsolve({eqp7,x()=},x()); xsa := x( ) = + x xsb := x( ) = + x xsz := x( ) = > limi(xsa,=infiniy); limi(xsb,=infiniy); lim x( ) = lim x( ) = So he soluions approach zero for arbirary iniial condiions; however, he decay is proporional o, no exponenial. dx We plo he soluions of his equaion and of = x on he same graph: d lineq := diff(x(),) = -x(): linsoln := dsolve({lineq,x()=},x()); crisoln := dsolve({eqp7,x()=},x()); linsoln := x( ) = e ( )
crisoln := x( ) = + > plo([rhs(linsoln),rhs(crisoln)],=..); 8 6 4 4 6 8 dx Noe ha he soluion o = x 3 decays much more rapidly iniially, bu hen slows down once d x <. Problem 8:.5. - Reaching origin in finie ime The origin x = is a sable fixed poin for any real < c. We plo a few represenaive vecor fields: > plo(-x^(/),x=..,ickmarks=[,]); plo(-x^,x=..4,-4...5,ickmarks=[,]); plo(-x^,x=..,y=-4...5,ickmarks=[,]);
We know ha for c =, he decay owards he origin is exponenial, and x approaches asympoically. When < c, he decay is slower han exponenial, as we derived in Problem 7. So he only possibiliy for he soluion o decay o zero in finie ime is for c <. The ime aken from x = o x = is T = in(-/x^c,x=..); x ( c + ) T = lim x + c When < c, he limi diverges; when c =, T is also infinie ( T = lim ln x). When c <, he ime is finie: T = in(-/x^c,x=..) assuming c < ; Problem 9:.5. - Blow-up T = c dy We know ha soluions y( ) of = + y blow up in finie ime. Now for < x, he soluions x( ) d dx of = + x grow more rapidly han y( ), since x < x for < x. Thus he soluions x( ) mus d also blow up in finie ime. This is no ye a complee argumen, hough, since i is only valid for < x; bu since + x, we know ha soluions beginning a any iniial condiion x will reach x = a he laes a ime = x; and since we reach x = in finie ime, we can hen begin he comparison wih y( ). An alernaive argumen: suppose x( ) = x. The ime aken o diverge (reach x = ) is given by T = In(/(+x^),x=x..infiniy);
T = x d + x x If his is finie for all x, hen we have finie-ime blow-up. Bu we have T < In(/(+x^),x=-infiniy..infiniy): so In(/(+x^),x=-..) + *In(/(+x^),x=..infiniy): and inroducing appropriae comparisons, we find T < In(/,x=-..) + *In(/(+x^),x=..infiniy); T < dx + d - + x x Thus an esimae of he upper bound for he blow-up ime for any iniial condiion is > in(,x=-..) + *in(/(+x^),x=..infiniy); evalf(%); (clearly finie) π + 3.5779637 The acual upper bound is in(/(+x^),x=-infiniy..infiniy); evalf(%); 5 sin π.338478 We plo some numerical soluions: DEplo(diff(x(),)=+x()^(),x(),=..3,x=-3..5,[[x()=-.]],sepsize=.,linecolor=black); π 4 x().5.5.5 3