Class Note for MATH 456 at UMass(1)
Class Note for MATH 456 at UMass(1)
Popular in Course
Popular in Department
This 8 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Massachusetts taught by a professor in Fall. Since its upload, it has received 12 views.
Reviews for Class Note for MATH 456 at UMass(1)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
Chapter 2 Introduction to ODEs In the following short chapter we will summarize some easy and e icient methods for solving simple rst order Ordinary Di erential Equations ODEs In order to use the appropriate method to obtain the solution of a given ODE we must be able to classify the type of ODE we have at hand 21 Classi cation In general we classify di erential equations as either partial or ordinary For now we examine only ordinary di erential equations In general however most models are usually comprised of several a system partial or ordinary di erential equations Another reason that ordinary di erential equations ODEs are important is that techniques of solution for partial di erential equations PDEs can stem from those in ordinary di erential equations So learning how to solve ODEs will be useful by itself or in conjuction to solving PDEs To choose the appropriate method of solution for a given ODE you must nd out what type of ODE you have ODEs are categorized among other things as linearnon linear ordinarypartial Also we usually refer to the order of the ODE as well as to whether it is homogeneous or not The following examples should be helpful in understanding how this classi cation system works dy o a 73 5 1st order linear non homogeneous ODE 0 3g 9y2 1st order non linear homogeneous ODE o 32 y 0 1st order linear homogeneous ODE o 3327quot 93y 9 2nd order linear non homogeneous ODE o 7 22 4y 0 1st order non linear homogeneous ODE Try to gure out based on the examples above how naming of ODEs works You probably understand from the above how we determine the order of an ODE based on the order of the derivative in the equation How about linearity Do you see it Linearity refers to the power of y For instance anything with y2 and higher is non linear Similarly if a derivative was raised to a power such as 275 then it is also non linear Now determining whether an ODE is homogeneous or not is a di erent story The idea as you may have noticed is to bring all terms which include y7s on one side of the equation If by doing so the other side of the equation is 0 then you have a homogeneous ODE Otherwise you have a non homogeneous ODE Math 456Spring 2006 Dr Alexandros Sopasakis page 9 22 Solving rst order homogeneous ODEs Now that you have learned some of the basics about the names of these equations you will put them to use in order to decide which method to choose in order to obtain their solutions If you correctly identi ed the ODE then you will be able to solve it It is not the point of our class to review all methods of solution for a given ODE Instead we emphasize on the ones we will probably put to use during our study of mathematical models In that respect we start by studying methods of solution for 1st order homogeneous ODEs 221 Nonlinear rst order homogeneous ODEs It may sound surpricing but some of the easiest rst order ODEs to solve are the nonlinear homoge neous ones Let us examine for example the following non linear 1st order homogeneous di erential equation ay yz or otherwise also written as adiy y2 x with the following initial condition y1 71 We will present the solution of this equation based on the separation of variables method We outline this method of solution for such an ODE below 1 Separate variables dy i da 212 7 r 2 lntegrate both sides 1 d da i da y 5v which gives 1 if ln C 21 y do not forget the constant of integration 0 To evaluate C we use the initial condition y1 5 If on the other hand no initial condition is provided then C will be part of the nal solution for this equation Note that the initial condition y1 5 implies that for a 1 then y 5 Substituting these values to equation 21 above we obtain 0 7 71111 72 Thus equation 21 becomes 1 if ln 7 2 y That7s it We solved this di erential equation How do we know that we solved it Easy Do you see any derivatives left If not then we are done The equation is solved In this case we can even go further and solve it for y itself something that is not always necessary or sometimes even possible 1 7 ln 7 g y Ok so now we can take care of the non linear homogeneous type rst order ODEs Let7s now see how we can solve the linear ones Math 456Spring 2006 Dr Alexandros Sopasakis page 10 222 Linear rst order ODEs In this case we will in fact see a method which not only solves the linear rst order homogeneous ODEs but the non homogeneous ones also Let7s rst look at a typical example for such an equation d Ty 7 2y 5 with the following initial condition y0 0 x We outline the steps of the solution below 1 Rewrite the equation in a canonical form 1 py Note that luckily enough our equation is already in this form 2 Obtain the integrating factor M which is de ned to be M af x dz In our case the integrating factor for this ODE is M f72dz 6721 3 Multiply both sides of the ODE with the integrating factor u My pmy MW You can then group the left and the right hand sides as follows WY WW In our case we multiply the ODE with u and obtain dy 721 6 dm 7 my 6 2z5 We then can rewrite the above as 72zy 56721 4 lntegrate both sides This has the e ect that always the left hand side derivative disappears In our example this gives e zzy 5e 2z C or rather 5 72zy 726721 0 As previously we can nd the value 0 by substituting the initial conditions In our example we are given that y 0 when m 0 Thus substituting on the above we obtain 5 0 0 0 if C e 26 which implies that C 52 Therefore our equation becomes 5 5 721 i if 721 7 e y i 26 2 Note that this is really our solution for the ODE We can even solve it for y as follows 5 5 y 7 7621 2 2 Math 456Spring 2006 Dr Alexandros Sopasakis page 11 23 Numerical solutions to ODEs In this section we will learn how to solve a number of di erent types of ODEs using a computer and applying some well known and very e ective numerical algorithms We start our exposition with a simple but robust method 231 Euler s method This method is simple to learn and will essentially allow us to solve almost any type of ODE which we will come across Naturally we implement this method in the computer but in fact for simple problems you could possibly obtain the solution with a calculator or even by hand The starting point is to write your ODE in the following form7 y fx7y where fz7 y corresponds to any other term in your ODE For instance looking back at the equation zy yz which we solved earlier we would rewrite it as7 In this case therefore fz7y Once this is established the method iterates in the computer with the following formula7 Euler7s method yn yn hfzn7 yn where here h denotes the step size in z The iteration counter 72 starts at 0 and will go on until we produce the solution required by the problem For instance recall that the initial condition for our ODE was provided to be y1 5 In this case for n 0 we have that 0 1 and yo 5 with which to start the iteration of our method The only thing which may be left up to you unless speci cally given by the problem is how big the step size h should be chosen to be Euler7s method is not exact In fact it almost always includes errors and the solution predicted is only an approximation to the true solution The bigger the step size h the bigger the errors to our solution So if you would like to have a very accurate solution then you must take a very small step size h and therefore you must iterate several times Let us assume that you would like to obtain the solution y when z 10 for the following ODE zy 127 with initial condition y1 71 Remember that we rewrite the ODE rst So here fz7y yZz Since the step size h is not speci ed you are free to choose So if you take h 1 then you would have to iterate Euler7s method 9 times since you are starting at z 1 and need to reach z 10 with this h The following table shows the result of the computer output and how each y is produced after each iteration of the method7 n H 0 l 1 2 3 4 5 6 7 8 9 z 1 2 3 4 5 6 7 8 9 10 y 71 75 742 737 734 732 731 729 728 72801 fxy 5 08 04 03 02 01 01 01 008 007 Math 456Spring 2006 Dr Alexandros Sopasakis page 12 So the solution at z 10 is y 72801 using a step size of h 1 ls this correct In fact we can check this since we have found earlier the exact solution to be i 1 y T lnz 1 Let us compare7 side by side7 the approximate solution produced by Euler7s method above with this exact solution in the table below z 1 2 3 4 5 6 7 8 9 10 yam 71 750 741 737 734 732 73104 72983 72884 72801 year 1 759 747 741 738 735 73395 73247 73128 73028 This gives that y 72801 for z 10 while the equivalent exact solution is y 3028 The absolute error between the two being 0227 and the relative error 075 We can not help but wonder how much better we could possibly do if we decrease the step size h 5 In that case of course it would take us 18 iterations starting at z 1 to reach z 10 We display some of these results in the table below n 0 1 2 3 4 15 16 17 18 z 1 15 2 25 3 85 9 95 10 yam 71 766 755 749 745 73091 73037 72989 72944 year 1 771 759 752 747 73185 73128 73076 73028 This time the absolute error between the exact and approximate solutions for z 10 is 0084 while the relative error is just 000003 Huge improvement for a little bit extra work for the computer 232 RungeKutta Method We now present an even more accurate method which although it is slightly more complicated to program in the computer can also solve an ODE of the type7 y f7 Usually the Runge Kutta method is more accurate than the Euler method for the same value of the step size h The Runge Kutta method goes as follows 1 yn1 yn 6k1 2k2 2k3 k4 Where k1 yn 1 1 k2 han ihvyn ikl 1 1 k3 han h7yn 51 k4 hvyn k3 Just so that we can see the di erences between the Euler and Runge Kutta methods we solve the same exact ODE as before7 zy 127 with initial condition y1 71 Math 456Spring 2006 Dr Alexandros Sopasakis page 13 for a step size of just h 1 The results are shown in the table below i n H 0 l 1 2 3 4 5 6 7 8 9 x 1 2 3 4 5 6 7 8 9 10 yEW 71 75 742 737 734 732 73104 72983 72884 72801 1ng 71 757 746 741 737 735 73342 73199 73083 72986 yew 71 759 747 741 738 735 73395 73247 73128 73028 Based on these results you can make up your mind about which method is best and compare the di erences for yourself 24 Higher order ODEs In fact the numerical schemes just presented are much more powerful than you might think In this section we will see that we can use these methods not just for rst order ODEs but also for higher order We will learn a method which allows us to reduce any higher order ODE into a system of rst order ODEs The bene t is that once we obtain such a system of rst order ODEs we can use an equivalent version of Euler or Runge Kutta method in order to solve that system 241 Reduction of order Suppose for instance that we wish to solve a third order ODE such as y 33 7 2y 0 22 The method goes as follows We start by de ning 3 as many as the derivatives new variables u1u2 and ug via U1 27 U2 1 us 13 23 Now we take derivatives on both sides of the above and obtain ui yC 12 y 7 13 W Note that in fact we can replace ym above by solving our 3rd order equation 22 for ym 7311 2y Therefore in fact 13 7314211 But based on 23 we can also replace the y7s with the corresponding ul or ug Therefore we can write U3 as 13 7311 2y 73112 2u1 Summarizing this analysis we have ul y uz u2 yH u3 y 73112 2u1 We will rewrite the above once more in a nicer format by reordering the us and inserting a zero if no corresponding u exists in that row u OuL 1u2 Oug u OuL Oug 1u3 13 2nL 7 Bug Oug Math 456Spring 2006 Dr Alexandros Sopasakis page 14 In this format it is not that hard to see that we can write this system into a matrix as follows U AU where A MOO 1 0 0 1 73 0 In this format it is now clear that our original single 3rd order ODE 22 has been transformed to a reduced 1st order system of three ODEs In general this method can take a single nth order ODE and transform it into a system of 71 rst order ODEs Once you have such a system you can apply Euler or Runge Kutta method to solve it The following simple example should be illustrative of this procedure Example Solve the following ODE using Euler7s method Obtain the solution for m 1 y 7 y m with initial conditions y0 0y 0 1 24 We start by reducing the 2nd order ODE into a system of 2 rst order ODEs To do this we follow the procedure outlined previously We rst de ne 2 new variables ul and 112 as follows U1y 7121 Now we di erentiate both sides ui y u y and eliminate y by solving 24 Thus 112 y m y and replace y here with ul Thus 11 y u2 0u11u2 112 y u1 1u10u2 To make the notation clearer we rename ul U and 112 V Thus we have the following two equations U V F U V where Fm U V V GUV where GUV U We are now ready to apply Euler7s method for this system Before we start though we should also translate the initial conditions to correspond to U and V Starting with y0 0 and since y ul U then we have that U0 0 Similarly the other initial condition yO 1 becomes V0 1 since y ug V Euler7s method for our system is equivalent to the following Un1 Un hFn U V V711 Vn hGn U V The following table provides the solution assuming a step size of h 2 1n11011 2 3 4 5 1 x 0 2 4 6 8 1 U 0 2 4 616 864 11606 V 1 1 108 124 148 1816 Math 4567Spring 2006 Dr Alexandros Sopasakis page 15 Thus when z 1 we obtain the approximate solution to be U ul 116 and V ug 182 This solves our problem Well not really Remember that the original question was to solve for y not U7 V7111 or even for ug However we know that y ul Thus y m 116 when z 1 Just to Check our solution if we reduce the step size to h 1 and iterate 10 times we obtain the solution to be y m 124 when z 1 If the step size becomes h 01 and we iterate 100 times we obtain y m 13388 Last if we reduce the step size to h 001 and iterate 1000 times we obtain that y m 13492 In other words we can safely believe that y m 134
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'