# 8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred.

## Presentation on theme: "8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred."— Presentation transcript:

8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred to as a differential equation. A first order differential equation: Example:

8-2 Example: A second-order differential equation: Example:

8-3 Taylor Series Expansion Fundamental case, the first-order ordinary differential equation: Integrate both sides The solution based on Taylor series expansion:

8-4 Example : First-order Differential Equation Given the following differential equation: The higher-order derivatives:

8-5 The final solution:

8-6 xOne TermTwo TermsThree TermsFour Terms 11111 1.111.31.331.331 1.211.60.721.728 1.311.92.172.197 1.412.22.682.744 1.512.53.253.375 1.612.83.884.096 1.713.14.574.913 1.813.45.325.832 1.913.76.136.859 21478 Table: Taylor Series Solution

8-7

8-8 General Case The general form of the first-order ordinary differential equation: The solution based on Taylor series expansion:

8-9 Euler’s Method Only the term with the first derivative is used: This method is sometimes referred to as the one-step Euler’s method, since it is performed one step at a time.

8-10 Example: One-step Euler’s Method Consider the differential equation: For x =1.1 Therefore, at x=1.1, y=1.44133 (true value).

8-11

8-12 Errors with Euler`s Method Local error: over one step size. Global error: cumulative over the range of the solution. The error  using Euler`s method can be approximated using the second term of the Taylor series expansion as If the range is divided into n increments, then the error at the end of range for x would be n .

8-13 Example: Analysis of Errors

8-14 Table: Local and Global Errors with a Step Size of 0.1. xExact solution Numerical Solution Local Error(%) Global Error(%) 11100 1.11.44133331.4-2.8677151 1.21.97066671.884-2.300406-4.3978349 1.32.5962.46-1.9003595-5.238829 1.43.32533333.136-1.6038492-5.6936648 1.54.16666673.92-1.396-5-92 1.65.1284.82-1.1960478-6.0062402 1.76.21733335.844-1.0508256-6.004718 1.87.44266677-0.9315657-5.947689 1.98.8128.296-0.8321985-5.8556514 210.3333339.74-0.7483871-5.7419355

8-15 xExact solution Numerical Solution Local Error(%) Global Error(%) 11100 1.051.21016671.2-0.8401047 1.11.44133331.4205-0.7400555-1.4454209 1.151.69451.6625-0.6589948-1.8884627 1.21.97066671.927-0.5920162-2.2158322 1.252.27083332.215-0.5357798-2.4587156 1.32.5962.5275-0.4879301-2.6386749 1.352.94716672.8655-0.4467568-2.771023 1.43.32533333.23-0.4109864-2.8668805 1.453.73153.622-0.3796507-2.9344768 1.54.16666674.4025-0.352-2.98 Table: Local and Global Errors with a Step Size of 0.05.

8-16 xExact solution Numerica l Solution Local Error(%) Global Error(%) 1.554.63183334.4925-0.3274441-3.0081681 1.65.1284.973-0.3055122-3.0226209 1.655.65616675.485-0.2858237-3.0261956 1.76.21733336.0295-0.2680678-3.0211237 1.756.81256.6075-0.2519878-3.0091743 1.87.44266677.22-0.2373701-2.9917592 1.858.10883337.868-0.2240355-2.9700121 1.98.8128.5525-0.2118323-2.9448479 1.959.55316679.2745-0.2006316-2.9170083 210.33333310.035-0.1903226-2.8870968 Table: Local and Global Errors with a Step Size of 0.05 (continued).

8-17 xExact solutionNumerical SolutionLocal Error(%)Global Error(%) 11100 1.021.08161071.08-0.1489137 1.041.16648531.163232-0.1408219-0.2789005 1.061.2546881.24976-0.1334728-0.392767 1.081.34628271.339648-0.1267688-0.4928138 1.11.44133331.43296-0.120629-0.5809436 1.21.97066671.95312-0.0963464-0.8903924 1.32.5962.56848-0.0793015-1.0600924 1.43.32533333.28704-0.0667201-1.1515638 1.54.16666674.1168-0.057088-1.1968 1.65.1285.06876-0.049506-1.2137285 1.76.21733336.14192-0.0434055-1.212953 1.87.44266677.35328-0.0384092-1.2010032 1.98.8128.70784-0.0342563-1.1820245 210.33333310.2136-0.0307613-1.1587097 Table: Local and Global Errors with a Step Size of 0.02.

8-18 Modified Euler’s Method Use an average slope, rather than the slope at the start of the interval : a.Evaluate the slope at the start of the interval b.Estimate the value of the dependent variable y at the end of the interval using the Euler’s metod. c.Evaluate the slope at the end of the interval. d.Find the average slope using the slopes in a and c. e.Compute a revised value of the dependent variable y at the end of the interval using the average slope of step d with Euler’s method.

8-19 Example : Modified Euler’s Method

8-20

8-21 Second-order Runge-Kutta Methods The modified Euler’s method is a case of the second- order Runge-Kutta methods. It can be expressed as

8-22 The computations according to Euler’s method: 1.Evaluate the slope at the start of an interval, that is, at (x i,y i ). 2.Evaluate the slope at the end of the interval (x i+1,y i+1 ) : 3.Evaluate y i+1 using the average slope S 1 of and S 2 :

8-23 Third-order Runge-Kutta Methods The following is an example of the third-order Runge- Kutta methods :

8-24 The computational steps for the third-order method: 1.Evaluate the slope at (x i,y i ). 2.Evaluate a second slope S 2 estimate at the mid-point in of the step as 3.Evaluate a third slope S 3 as 4.Estimate the quantity of interest y i+1 as

8-25 Fourth-order Runge-Kutta Methods 1.Compute the slope S 1 at (x i,y i ). 2.Estimate y at the mid-point of the interval. 3.Estimate the slope S 2 at mid-interval. 4.Revise the estimate of y at mid-interval

8-26 5.Compute a revised estimate of the slope S 3 at mid- interval. 6.Estimate y at the end of the interval. 7.Estimate the slope S 4 at the end of the interval 8.Estimate y i+1 again.

8-27 Predictor-Corrector Methods Unless the step sizes are small, Euler’s method and Runge-Kutta may not yield precise solutions. The Predictor-Corrector Methods iterate several times over the same interval until the solution converges to within an acceptable tolerance. Two parts: predictor part and corrector part.

8-28 Euler-trapezoidal Method Euler’s method is the predictor algorithm. The trapezoidal rule is the corrector equation. Eluer formula (predictor): Trapezoidal rule (corrector): The corrector equation can be applied as many times as necessary to get convergence.

8-29 Example 8-6: Euler-trapezoidal Mehtod

8-30

8-31

8-32

8-33 Milne-Simpson Method Milne’s equation is the predictor euqation. The Simpson’s rule is the corrector formula. Milne’s equation (predictor): For the two initial sampling points, a one-step method such as Euler’s equation can be used. Simpsos’s rule (corrector):

8-34 Example 8-7: Milne-Simpson Mehtod 111 1.11.107891.15782 1.21.232391.33215 Assume that we have the following values, obtained from the Euler-trapezoidal method in Example 8-6.

8-35

8-36 The computations for x=1.3 are complete.

8-37 The Milne predictor equation for estimating y at x=1.4: The corrector formular:

8-38

8-39 Least-Squares Method The procedure for deriving the least-squares function: 1.Assume the solution is an nth-order polynomial: 2.Use the boundary condition of the ordinary differential equation to evaluate one of (b o,b 1,b 2,…,b n ). 3.Define the objective function:

8-40 4.Find the minimum of F with respect to the unknowns (b 1,b 2, b 3,…,b n ), that is 5.The integrals in Step 4 are called the normal equations; the solution of the normal equations yields value of the unknowns (b 1,b 2, b 3,…,b n ).

8-41 Example 8-8: Least-squares Method First, assume a linear model is used:

8-42

8-43 xTrue y ValueNumerical y ValueError (%) 01. - 0.21.02021.09387.2 0.41.08331.18759.6 0.61.19721.28127.0 0.81.37711.37500.0 1.01.64871.46688-10.9 Table: A linear model for the least-squares method

8-44 Next, to improve the accuracy of estimates, a quadratic model is used:

8-45

8-46

8-47 xTrue y ValueNumerical y ValueError (%) 01. - 0.21.02021.0022-1.8 0.41.08331.06740.0 0.61.19721.19560.0 0.81.37711.386680.0 1.01.64871.64110.0 Table: A quadratic model for the least-squares method

8-48 Galerkin Method Example: Galerkin Method The same problem as Example 8-8. Use the quadratic approximating equation.

8-49

8-50 Table: Example for the Galerkin method xTrue y valueNumerical y valueError (%) 01. -- 0.21.02020.98160.0 0.41.08331.03160.0 0.61.19721.15000.0 0.81.37711.33680.0 1.01.64871.59210.0

8-51 Higher-Order Differential Equations Second order differential equation: Transform it into a system of first-order differential equations.

8-52 In general, any system of n equations of the following type can be solved using any of the previously discussed methods:

8-53 Example: Second-order Differential Equation

8-54 Table: Second-order Differential Equation Using a Step Size of 0.1 Ft X (ft) Y (ft) Exact ZExact Y (ft) 00-0.02314810 0 0.10.000275-0.0231481-0.0023148-0.0231344-0.0023144 0.20.0005444-0.0231206-0.0046296-0.0230933-0.004626 0.30.0008083-0.0230662-0.0069417-0.0230256-0.0069321 0.40.0010667-0.0229854-0.0092483-0.0229319-0.0092302 0.50.0013194-0.0228787-0.0115469-0.0228125-0.0115177 0.60.0015667-0.0227468-0.0138347-0.0226681-0.0137919 0.70.0018083-0.0225901-0.0161094-0.0224994-0.0160505 0.80.0020444-0.0224093-0.0183684-0.0223067-0.018291 0.90.002275-0.0222048-0.0206093-0.0220906-0.020511

8-55 Table: Second-order Differential Equation Using a Step Size of 0.1 Ft (continued) X (ft) Y (ft) Exact ZExact Y (ft) 10.0025-0.0219773-0.0228298-0.0218519-0.0227083 20.0044444-0.0185565-0.0434305-0.0183333-0.04296663 30.0058333-0.0134412-0.0298019-0.0131481-0.0588194 40.0066667-0.007187-0.0704998-0.0068519-0.0688889 50.0069444-0.0003495-0.07463520.00000000-0.071228 60.00666670.0065157-0.07187470.0068519-0.0688889 70.00583330.0128532-0.062440660.0131481-0.0588194 80.00444440.0181074-0.04711070.0183333-0.042963 90.00250.0217227-0.02721830.0278519-0.0227083 100.0000000.0231435-0.004665230.02314810.000000

Download ppt "8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred."

Similar presentations