MIT ADTU’s MIT School of Engineering, Pune Subject: Differential Equation and Transform Techniques Unit-V Numerical Solution of Ordinary Differential equations Many ordinary differential equations can be solved by analytical methods. However majority of differential equations appearing in physical problems cannot be solved analytically. Thus it becomes Imperative to discuss their solution by numerical methods. The different methods are 1) Euler’s Method Consider the differential equation dy f x, y with the initial condition y y0 at dx x x0 Suppose we want to solve the equation we use the following approximation y1 y0 h f x0 , y0 , y2 y1 h f x1 , y1 , And so on, In general y n1 y n h f xn , y n , n 0,1, 2, To obtain the solution with desired accuracy, one has to take a smaller value of h , hence the solution is obtained very slowly. Due to this the method is rarely used. The more accurate method will be obtained by the modified method. ILLUSTRATIONS Ex.1. Use Euler’s method to solve the equation dy 1 xy dx Subject to the conditions at x 0, y 1find y 0.4 Solution: - given f x , y 1 xy , h 0.1, x0 0, y0 1 and h y1 y0 h f x0 , y0 1 0.1 f 0,1 1 0.11 0 1 1.1 y2 y1 h f x1 , y1 1.1 0.1 f 0.1,1.1 30 0.5 6 1.1 0.11 0.11.1 1.211 y3 y2 h f x2 , y2 1.211 0.1 f 0.2,1.211 1.211 0.11 0.2 1.211 1.3352 y4 y3 h f x3 , y3 1.3352 0.1 f 0.3,1.3352 1.3352 0.11 0.3 1.3352 1.4752 y3 y2 h f x2 , y2 1.211 0.1 f 0.2,1.211 1.211 0.11 0.2 1.211 1.3352 2) Modified Euler’s Method To start, we use Euler’s formula to find value of y at x x1 , therefore y1 y0 h f x0 , y0 To find more correct approximation at x x1 , we use Euler’s modified iteration formula h n 1 n y1 y 0 f x0 , y 0 f x1 , y1 , n 1, 2, ……….. (1) 2 1 n i.e. new y old y h Meanslope , where Mean slope f x0 , y 0 f x1 , y1 2 1 2 n1 n by making use of (1) we can obtain approximations y1 , y1 ,, y1 , y1 . This 0 process is repeated till no significant change occurs. i e. y1 n1 y1 n we call this as y1 Then y1 is more correct approximation at x x1 To find the value of y at x x2 , the above procedure is repeated in the interval x1 , x2 (note x2 x1 h ) ILLUSTRATIONS Ex.1. Use modified Euler’s method to solve h 0.2 dy x y 2 , y 0 1 to calculate y 0.4 taking dx Solution: - given f x , y x y 2 , h 0.2, x0 0, y0 1 Step 1: to find y1 y x 0.2 by Euler’s method y10 y0 h f x0 , y0 1 0.2 0 1 0.8 2 by modified Euler’s method h y11 y0 f x0 , y0 f x1 , y10 2 1 0.2 f 0,1 f 0.2, 0.8 2 1 0.2 1 0.44 0.8560 2 h y12 y0 f x0 , y0 f x1 , y11 2 1 0.2 f 0,1 f 0.2, 0.8560 2 1 0.2 1 0.5327 0.8467 2 y1 y x 0.2 0.8467 Step 2: to find y1 y x 0.4 by Euler’s method 2 y2 0 y1 h f x1 , y1 0.8467 0.2 0.2 0.8467 0.7962 by modified Euler’s method h y21 y1 f x1 , y1 f x2 , y2 0 2 0.8467 0.2 f 0.2, 0.8467 f 0.4, 0.7962 2 0.8467 0.2 0.5193 0.2340 0.7728 2 h y2 2 y1 f x1 , y1 f x2 , y21 2 0.8467 0.2 f 0.2, 0.8467 f 0.4, 0.7728 2 0.8467 0.2 0.5193 0.1972 0.7765 2 y2 y x 0.4 0.7765 Ex.2. Use modified Euler’s method to solve dy x 2 y, y 0 1 to calculate y 0.1 taking dx h 0.05 Sol: - given f x , y x 2 y , h 0.05, x0 0, y0 1 Step 1: to find y1 y x 0.05 by Euler’s method y10 y0 h f x0 , y0 1 0.05 0 1 1.05 by modified Euler’s method h y11 y0 f x0 , y0 f x1 , y10 2 1 0.05 f 0,1 f 0.05,1.05 2 1 0.05 1 1.0525 1.0513 2 h y12 y0 f x0 , y0 f x1 , y11 2 1 0.05 f 0,1 f 0.05,1.0513 2 1 0.05 1 1.0538 1.0513 2 y1 y 05 1.0513 Step 2: to find y2 y x 0.1 by Euler’s method y2 0 y1 h f x1 , y1 1.0513 0.05 0.05 1.0513 1.1040 2 by modified Euler’s method h y21 y1 f x1 , y1 f x2 , y2 0 2 1.0513 0.05 f 0.1,1.0513 f 0.1,1.1040 2 1.0513 0.05 1.0538 1.114 1.1055 2 h y2 2 y1 f x1 , y1 f x2 , y21 2 1.0513 0.05 f 0.05,1.0513 f 0.1,1.1055 2 1.0513 0.05 1.0538 1.1155 1.1055 2 y2 y x 0.1 1.1055 EXERCISE Ex.1. Use Euler’s method to solve the equation dy x y, y 0 0 find y 0.4 dx Ex.2. Use Modified Euler’s method to find the value of y satisfying the equation dy logx y , y 1 2 for x 1.2 and x 1.4 dx Ex.3. Use Modified Euler’s method to find the value of y satisfying the equation d y yx , y 0 1for x 0.1 take h 0.05 d x yx Session -7 Numerical Solution of Ordinary Differential equations by Runge-Kutta Method Notes: 1) Runge-Kutta Method of fourth order The fourth order Runge-kutta method is most commonly used.Working rule for finding the increment k of y corresponding to an increment h of x by Runge-kutta method dy from f x, y , y x0 y0 is as follows: dx k h Calculate successively k1 h f x0 , y 0 , k 2 h f x0 , y0 1 , 2 2 k h k 3 h f x0 , y 0 2 , 2 2 1 k 4 h f x0 h, y0 k 3 Finally compute k k1 2k 2 2k 3 k 4 6 Which gives the required approximate value y1 y0 k ILLUSTRATIONS Ex.1. Use fourth order Runge- Kutta method to solve dy dx x y , y 0 1 to calculate y at x = 0.2 Solution: - given f x , y x y , h 0.2, x0 0, y0 1 Step 1: to find y1 y x 0.2 k1 h f x0 , y0 0.2 0 1 0.2 k h 0.2 0.2 k2 h f x0 , y0 1 0.2 f 0 ,1 2 2 2 2 0.2 0 0.1 1 0.1 0.2191 k h 0.2 0.2191 k3 h f x0 , y0 2 0.2 f 0 ,1 2 2 2 2 0.2 0 0.1 1 0.1095 0.2120 k4 h f x0 h, y0 k3 0.2 f 0 0.2,1 0.2120 0.2 0 0.1 1 0.1095 0.2120 k 1 k1 2k2 2k3 k4 6 1 0.2 2 0.2191 2 0.2120 0.2377 6 0.2167 y1 y x 0.2 y0 k 1.2167 Ex.2. Use fourth order Runge- Kutta method to solve dy 1 , y 0 1 to find dx x y y at x = 0.4 taking h=0.2 Solution: - given f x , y 1 , h 0.2, x0 0, y0 1 x y Step 1: to find y1 y x 0.2 1 k1 h f x0 , y0 0.2 0.2 0 1 k h 0.2 0.2 k2 h f x0 , y0 1 0.2 f 0 ,1 2 2 2 2 1 0.2 0.167 0.1 1.1 k h 0.2 0.167 k3 h f x0 , y0 2 0.2 f 0 ,1 2 2 2 2 1 0.2 0.169 0.1 1.0835 k4 h f x0 h, y0 k3 0.2 f 0 0.2,1 0.169 1 0.2 0.1461 0.2 1.169 k 1 k1 2k2 2k3 k4 6 1 0.2 2 0.167 2 0.169 0.1461 6 0.1697 y1 y x 0.2 y0 k 1.1697 Step 2: to find y2 y x 0.4 1 k1 h f x1 , y1 0.2 0.146 0.2 1.1697 k h 0.2 0.146 k2 h f x1 , y1 1 0.2 f 0.2 ,1.1697 2 2 2 2 1 0.2 0.1296 0.3 1.2497 k h 0.2 0.1296 k3 h f x1 , y1 2 0.2 f 0.2 ,1.1697 2 2 2 2 1 0.2 0.1303 0.3 1.2345 k4 h f x1 h, y1 k3 0.2 f 0.2 0.2,1.1697 1.1303 1 0.2 0.1176 0.4 1.3 k 1 k1 2k2 2k3 k4 6 1 0.146 2 0.1296 2 0.1303 0.1176 6 0.1306 y2 y x0.4 y1 k 1.3003 EXERCISE Ex.1. Use fourth order Runge- Kutta method to solve y 1.2 and y 1.4 dy log x y , y 1 2 to find dx Ex.2. Use fourth order Runge- Kutta method to solve dy x 2 y 2 , y 1 1.5 to find dx y 1.2 with h 0.1 Introduction:Theory of probabilityhad its origin in mid-eighteenth century studies in games of chance related to dice throw gambling. Almost every human activity involves some kind of chance elements and the role for thetheory of probability to play. As time progressed, probability theory found its way into many applications not only in Engineering and Science but also in the fields like Actuarial Science, Agriculture, Commerce, Medicine and Psychology. Theorems on Probability: A) If A and B are any two events then P ( A B )= P( A) P( B) P ( A B) B) P( A B) P( A) P( B / A) and P ( A B ) P ( B ) P ( A / B ) C) Baye’sTheorem: If A1 , A2 , ..., An are mutually exclusive events whose union is the sample space and A is any event, then P( Ak / A) P( Ak ) P( A / Ak ) n P( A ) P( A / A ) k l k k Ex. 1: Among six books, there are two volume of one book. These books are arranged in a random order on a shelf. Find the probability that the two volumes are always together. Solution:Six books can be arranged on a shelf in 6! = 720 ways, thus n =720 The probability that the two books are always together is P= = 240 1 720 3 Ex.2: Two cards are drawn from a well shuffled pack of 52 cards. Find the probability that they are both kings if i) the first card drawn is replaced, ii)first card drawn is not replaced. Ans : 1/169, 1/221 Exercise Ex.1:Three coins are tossed simultaneously . Find the probability of getting at least two heads. Ans :1/2 Ex.2:A box contains 3 red and 2 blue marbles. The box B contains 2 red and 8 blue marbles. A fair coin is tossed. If the coin shows Head , a marble is chosen from the box A, if it shows tail, a marble is chosen from box B. find the probability that a red is chosen. Ans : 2/5 Ex.3: Urn I contains 6 white and 4 black balls and urn II contains 4 white and 5 black balls. From urn I, two balls aretransferred to urn II without noticing the colour. Sample of size 2 is then drawn without replacement from urn II. What is the probability that the sample contains exactly one white ball. Ans :4/5 ------------------------------------------------------------------------------------------------------------------------------- Session -7 Probability Distributions: Binomial Probability Distribution: It is used when the experiment has only two outcomes. Then probability of ‘r’ successes in ‘n’ trials is given by n r B(n,p,r)= p(r)= Cr p q nr ; r= 0, 1, 2, … Where p=probability of success q =probability of failure Remark :A) p+q =1 B) Mean of a Binomial distribution is m=np C) Standard deviation of a Binomial distribution is npq Ex.1: An unbiased coin is thrown 10 times. Find the probability of getting exactly 6 heads, at least 2 heads. Solution:Here n=10, p=0.5, q=0.5 10 6 i)Probability of getting exactly 6 heads = P(6)= C6 p q 4 = 10 C6 (0.5) 6 (0.5) 4 = 10C6 (0.5)10 = 0.2051 ii)Probability of getting at least 2 heads = p(r 2)= p(2)+p(3)+…+p(10)=1- p(0)-p(1) = 1 - 10C0 (0.5) 0 (0.5)10 - 10 C1 (0.5)1 (0.5) 9 = 1 – 0.000977 – 0.00977 = 0.9893 Ex.2 : The mean and variance of a binomial distribution are 6 and 2 respectively. Find p(r 1). Solution :Given mean = 6 and variance = 2 Which implies np=6 and npq = 2 Solving we get q=1/3, p=1-q = 2/3 , n = 9 p(r 1) = 1 – p(0) = 0.999949 Exercise Ex.1: A random variable is X with B(n=6, p). Find p if 9P(R=4)=P(R=2). Ans : p=1/4 Ex.2:A die is rolled six times. Find the probability that at least two 4’s appear.Ans : p = 0.6 (approx) ------------------------------------------------------------------------------------------------------------------------------- Session-08 Poisson Distribution: It is a limiting case of a Binomial distribution with n , p 0 and mean that is np remaining finite. Therefore the ‘ r ‘ successes in a large number of trials ‘ n’ with small number of probability success p in eachtrial is given by mr em p(r)= ; r! r= 0, 1, 2, … Remark :A) p+q =1 B) Mean of a Poisson distribution is m=np C)Standard deviation of a Poisson distribution is np Ex.1: Assuming that the probability of an indivisual coal minor being killed in a mine accidents during a year is 1/2400. Calculate the probability in a mine employing 200 miners there will be at least one fatal accident in a year. Solution : Given p=1/2400 , n=200 m = np = 0.083 p(r)= mr em ; r! r= 0, 1, 2, … (0.083) r e ( 0.083) = r! The probability in a mine employing 200 miners there will be at least one fatal accident in a year is p(r 1) = 1 – p(0) = 1 – 0.92 p(r 1) = 0.08 Ex.2 : In a Poisson distribution if P(r=1)=2P(r=2), find P(r=3). Solution :InPoisson distribution probability of r successes is given by p(r)= mr em ; r! p(r=1)= me m r= 0, 1, 2, … and m 2em p(r=2)= 2 P(r=1)=2P(r=2) me m = 2 m =1 P(r=3) = m 2em 2 1e 1 = 0.0613 3! Exercise Q.1) In a certain factory turning out razor blades, there is a small chance of 1/500 for any blade to be defective. The blades are supplied in a packets of 10. Use Poisson distribution to calculate the approximate number of packets containing no defective and two defective blades, in a consignment of 10,000 packets. Ans : 9802, 2. Q.2)The accidents per shift in a factory are given by the table : Accidents per shift Frequency 0 1 2 3 4 5 142 158 67 27 5 1 Fit a Poisson distribution to the above table and calculate the frequencies as per Poisson fit. Ans : p(0)=0.3697, p(1)=0.36785, p(2)=0.183, p(3)=0.0607, p(4)=0.0151, p(5)=0.003 Corresponding theoretical frequencies are 148, 147, 73, 24, 6, 1 respectively. ------------------------------------------------------------------------------------------------------------------------------- Session-9 Normal Distribution : Normal distribution curve is given by the equation y 2 2 1 e ( x ) / 2 2y Normal variable z is defined as , When x x1 , z= x x , z=0 z=z1 (say) P( x x1 ) = P(0 z z1) ……. (probability of z between z=0 and z=z1 ) z1 = f ( z )dz ………. (normal probability 0 integral) = area under standard normal curve between z=0 and z=z1 Remark :A) The total area under the normal curve ( which is symmetric about x ) is given by y dx 1 Ex.1:In a certain examination test, 2000 students appeared in a subject of statistics. Average marks obtained were 50% with standard deviation 5%. How many students do you expect to obtain more than 60% of marks, supposing that marks are distributed normally? (z=2, A=0.4772) = 5%=5/100=0.05 Solution : =50%=50/100= 0.5, x1 60% = 60/100=0.6 z1 x1 = 0.6 0.5 =2 0.05 P(0 z 2)=0.4772 A(z=2)=0.4772 P( x 0.6 )=P( z 2 ) =0.5 P(0 z 2) = 0.5 0.4772 P( x 0.6 ) = 0.0228 Number of students expected to get more than 60% marks = 0.0228 approximately. 200 = 46 students Ex.2: In a distribution exactly normal , 7% of the items are under 35 and 89% are under 63. Find the mean and standard deviation of the distribution. Solution : Given that A(<35)=0.07 and A(>63)=0.11 That is p(x<35)=0.07 and p(x>63)=0.11 When x=35 , z When x=63 , z 35 63 z1 z2 Area A1 = p(0<z< z1 )= 0.43 andArea A2 = p(0<z< z 2 ) Therefore 35 corresponds to z1= 1.48 = 0.39 corresponds to z2= 1.23 z1 = - 1.48 Solving these two equations we get =50.3, =10.33 and 63 z 2 = 1.23 Exercise Q.1) X is a normal variate with mean 30 and S.D. 5, find the probabilities that i) ii) | iii)| [Given : A(z=0.8)=0.2881, A(z = 1) = 0.3413, A(z =2)=0.4772, A(z =3)= 0.4986] Ans : i) 0.7653 ii) 0.0014 iii) 0.3174 Q.2)In a distribution normal, 31% of the items are under 45 and 8% are over 64. Find the mean and S.D. of the Distribution.[Given : ] Ans : mean = 50, S.D.= 6 Q.3) In a test on 2000 electric bulbs, it was found that the life of a particular make, was normally distributed with an Average life of 2040 hours and S.D. of 60 hours. Estimate the number bulbs likely to burn for i)more than 2150 hours ii)less than 1950 hours iii)more than 1920 and less than 2160 hours. Given :A(z = 1.833) = 0.4664, A(z = 1.5) = 0.4332, A(z = 2) = 0.4772 Ans : i)67 ii )137 iii)1909 -------------------------------------------------------------------------------------------------------------------------------
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )