{VERSION 4 0 "IBM INTEL LINUX22" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "restart;\nwith(DEtoo ls):" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 21 "A very simple example" } }{PARA 0 "" 0 "" {TEXT -1 114 "As our very first exercise we will have a look at the differential equation which describes the radioactive d ecay." }}{PARA 0 "" 0 "" {TEXT -1 106 "In the first command line we st ate the problem and asign the differential equation to the expression \+ dgl1:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "dgl1:=diff(y(t),t)=-k*y(t) ;" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 339 "The maple-function d solve will find a solution to the differential equation. Its first arg ument contains the differential equation along with the initial condit ion y(0)=1. If one leaves the initial condition apart, maple will dete rmine a solution of the differential equation which depends on a const ant. We will have a look at this later." }}{PARA 0 "" 0 "" {TEXT -1 46 "The solution is passed to the expression sol1:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 36 "sol1 := dsolve(\{dgl1,y(0)=1.\},y(t));" }}{PARA 0 " " 0 "" {TEXT -1 206 "The function unnapply will convert the solution i nto a function y_1(t,k); it makes sense to formulate y_1 as a function of both, t and k, because it allows us to plot the function for diffe rent values of k." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "y_1 := unapply (subs(sol1,y(t)),t,k);" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 80 " We can calculate the limit of y_1(t) as t tends to infinity, in depend ence of k:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "limit (y_1(t,k),t=inf inity);" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 65 "Finally we have the solution for k=1.0, k=0.5, and k=0.1 plotted:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 47 "plot([y_1(t,1),y_1(t,0.5),y_1(t,0.1)],t=0..10);" }} }{SECT 0 {PARA 3 "" 0 "" {TEXT -1 14 "Second example" }}{PARA 0 "" 0 " " {TEXT -1 132 "Here we consider the differential equation y' = 3-2y. \+ Find the solution for the initial value y(0)=1! Store it as a function y_2(t)!" }{MPLTEXT 1 0 105 "\ndgl2 := diff(y(t),t) = 3-2*y(t);\nsol2 \+ := dsolve(\{dgl2,y(0)=1.\},y(t));\ny_2 := unapply(subs(sol2,y(t)),t); " }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "We now wish to plot a \+ direction field. We use the function DEplot:\n" }{MPLTEXT 1 0 50 "DEpl ot(dgl2,y(t),t=0..2,\{[0.5,1],[0.5,3]\},y=0..5);" }{TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 310 "It plots the direction field together wi th the curves hitting the points (0.5,1.0) and (0.5,3.0).\nFind now th e (unique) solutions for the differential equation with the initial co nditions y'(0)=-1,0 and y'(0)=1.5! Use the operator D(y)(0=-1.0),e.g. \+ to state the problem in the call of dsolve! Plot the curves!\n" } {MPLTEXT 1 0 273 "sol2a := dsolve(\{dgl2,y(0)=1.\},y(t));\ny_2a := una pply(subs(sol2a,y(t)),t);\nsol2b := dsolve(\{dgl2,D(y)(0)=-1.0\},y(t)) ;\ny_2b := unapply(subs(sol2b,y(t)),t);\nsol2c := dsolve(\{dgl2,D(y)(0 )=1.5\},y(t));\ny_2c := unapply(subs(sol2c,y(t)),t);\nplot([y_2a(t),y_ 2b(t),y_2c(t)],t=0..2);" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 13 "Third example" }}{PARA 0 "" 0 "" {TEXT -1 528 "Find solutions for the diffe rntial equation xy' + ay = bx^2! Do not specify initial values to get \+ a general solution first. Define now a to be 2 and b to be 4. For this combination of parameters plot the function within x=-4,...,4 and y=- 4,...,4 for integration constants of _C1=0, _C1=0-5 and _C1=-0.5. One \+ convenient way to do so is to get a function in x and _C1 by adding _C 1 as a third argument in the call of unapply. Vary now a and b! Are th ere principal differences between even and odd a? Which value for a is not fine?" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "dgl3 := x*diff(y(x), x) + a*y(x) = b*x*x;\nsol3 := dsolve(\{dgl3\},y(x));\na:=2.0; b:=4.0; \ny_3 := unapply(subs(sol3,y(x)),x,_C1);\nplot([y_3(x,0),y_3(x,0.5),y_ 3(x,-0.5)],x=-4..4,y1=-4..4);" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 14 "Fourth example" }}{PARA 0 "" 0 "" {TEXT -1 205 "For this exercise we \+ need to solve transcendent equations numerically. In Maple we can use \+ the function fsolve. For example, if we wish to calculate a solution o f ln(x)=sin(x), we would use it as follows:\n" }{MPLTEXT 1 0 27 "x0 := fsolve(ln(x)=sin(x));" }{TEXT -1 235 "\nFind now a general solution o f the differential equation y' + axy = 1! For a=2 determine the consta nt such that the curve hits the points (0,1.0), (0,0.5) and (0,-0.5) r espectively. Plot a direction field and of course these curves!\n" } {MPLTEXT 1 0 287 "dgl4 := diff(y(x),x) + a*x*y(x) = 1.0;\na:=2.0;\nsol 4 := dsolve(\{dgl4\},y(x));\ny_4 := unapply(subs(sol4,y(x)),x,_C1);\nD Eplot(dgl4,y(x),x=-4..4,y=-4..4);\nt1:=fsolve(y_4(0,c)=1.0);\nt2:=fsol ve(y_4(0,c)=-0.5);\nt3:=fsolve(y_4(0.5,c)=-1.0);\nplot([y_4(x,t1),y_4( x,t2),y_4(x,t3)],x=-4..4,y1=-4..4);" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 12 "The pendulum" }}{PARA 0 "" 0 "" {TEXT -1 647 "Finally we would \+ like to look at the differntial equation describing the motion of the \+ pendulum more in detail. Use the notation a (al)'' +b(al)' + c sin(al) = 0 where (al) denotes the angle alpha. Before trying to find a solut ion of the nonlinear differential equation, make sure you have saved y our worksheet. Solve the linearised differential equation. Find reason able initial conditions (think of the description of the physical prob lem: what is the initial velocity of the body and where is it released ?) and examine the behaviour of the solution for different values of t he coefficients. Plot the function for a=c=1.0 and b=(0.1, 1.0, 2.0)! \n" }{MPLTEXT 1 0 260 "dgl5 := a*diff(al(t),t,t) + b*diff(al(t),t) + c *al(t) = 0.;\nsol5 := dsolve(\{dgl5,D(al)(0)=0.,al(0)=d\},al(t));\na:= 1.0; c:=1.0;\nal_ex := unapply(subs(sol5,al(t)),t,b);\nal_b2 := limit( al_ex(t,b),b=2.0);\nd:=0.01;\nplot([al_ex(t,1.0),al_ex(t,0.1),al_b2(t) ],t=0..10);" }}}}{MARK "4 1 3" 176 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }