+ All Categories
Home > Documents > 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical...

551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical...

Date post: 11-Apr-2021
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
43
1 551614:Advanced Mathematics for Mechatronics Numerical solution for ODEs School of Mechanical Engineering
Transcript
Page 1: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

1

551614:Advanced Mathematics for Mechatronics

Numerical solution for ODEsSchool of Mechanical Engineering

Page 2: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

2

Prescribed text :

Numerical Method for Engineering, Seventh Edition, Steven C.Chapra, Raymond P. Canale.,McGraw Hill 2014

Page 3: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

3

Recommended reading :

Numerical Methods for Engineers and Scientists, Amos

Gilat and Vish Subramaniam, Wiley,2008

Numerical Methods Using MATLAB, John.H.Methews.,

Kurtis D.Fink.,Prentice Hall , Fourth Edition,2004

ระเบียบวธีิเชิงตวัเลขในงานวศิวกรรม, ปราโมทย์ เดชะ

อาํไพ., สาํนกัพิมพแ์ห่งจุฬาลงกรณ์มหาวิทยาลยั พ.ศ.2556

Page 4: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

4

Course Description

Truncation errors and the Taylor seriesNumerical Solutions for ODEsFinite difference methodOptimization

Page 5: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

5

Errors in Numerical Solutions

Truncation ErrorsRound-Off ErrorsTotal Error• Local Error• Global Error

Page 6: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

6

Truncation Errors :The Taylor series

( ) ( ) ( ) ( ) +

∆++

∆+

∆+=+

iii xn

nn

xxii dx

fdnx

dxfdx

dxdfxxfxf

!!2!1 2

22

1

( ) ( )ii xfxf ≅+1

Zero-order approximation

First-order approximation

( ) ( )ix

ii dxdfxxfxf

!11∆

+=+

Page 7: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

7

The Taylor series

( ) 2.125.05.015.01.0 234 +−−−−= xxxxxfapproximation

Page 8: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

8

The Remainder for the Taylor Series Expansion

Page 9: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

9

Truncation Errors: Example3 5 7 9

sin( )3! 5! 7! 9!x x x xx x= − + − + +

sin 0.52359886 6π π = =

sin 0.56π =

Taylor’s series expansion:

The exact value:

The Zero-order approximation;

The truncation error: 0.5 0.5235988 0.0235988TRE = − = −

Page 10: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

10

Truncation Errors: Example3 5 7 9

sin( )3! 5! 7! 9!x x x xx x= − + − + +

6sin 0.49967426 6 3!π π π = − =

sin 0.56π =

Taylor’s series expansion:

The exact value:

The first-order approximation;

The truncation error: 0.5 0.4996742 0.0003258TRE = − =

Page 11: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

11

Round-Off Errors

Page 12: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

12

Total Error

TrueError TrueSolution NumericalSolution= −

The true error:

The true relative error:

TrueRelativeError TrueSolution NumericalSolutionTrueSolution

−=

Page 13: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

13

Total Error

The Global Error is the total discrepancy due to past as well as present stepsThe Local Error refers to the error incurred over a single step. It is calculated with a Taylor series expansion.

Page 14: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

14

The Global ErrorThe relative global error:

%TheGlobalError 100TrueSolution NumericalSolutionTrueSolution

−= ×

Page 15: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

15

The Total Error: Example

Page 16: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

16

The Total Error: Example

3.21875 5.25%TheGlobalError 100 63.13.21875

−= × =

The percent relative global error (Step 1);

The percent relative global error (Step 2);

3 5.875%TheGlobalError 100 95.83

−= × =

Page 17: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

17

The Total Error: Example

3 22 12 20 8.5y x x x= − + − +

( ) ( ) ( )2 3 42 3 4

2 3 42! 3! 4!i i i

localx x x

x x xd f d f d fEdx dx dx

∆ ∆ ∆= + +

Exact estimates of the errors in Euler’s method

2

4

4

6 24 2012 24

12

y x xy x

d fdx

= − + −= − +

= −

Problem statement:

Page 18: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

18

The Total Error: Example

22

2

33

44

6(0) 24(0) 20 (0.5) 2.52

12(0) 24 (0.5) 0.53 212 (0.5) 0.03125

4 3 2

l

l

l

E

E

E

− + −= = −

− += =

×−

= = −× ×

2 3 4 2.03125localtotal l l lE E E E= + + = −

The percent relative local error (Step 1);

%TheLocalError= 100 63.1localtotalE

TrueSolution× =

Page 19: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

19

The Total Error: Example

22

2

33

44

6(0.5) 24(0.5) 20 (0.5) 1.18752

12(0.5) 24 (0.5) 0.3753 2

12 (0.5) 0.031254 3 2

l

l

l

E

E

E

− + −= = −

− += =

×−

= = −× ×

2 3 4 0.84375localtotal l l lE E E E= + + = −

The percent relative local error (Step 2);

0.84375%TheLocalError= 100 28.13

−× =

Page 20: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

20

Numerical Solutions for ODEs

Introduction to Ordinary Differential Equations (ODE)

Page 21: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

21

Study Objectives

• Solve Ordinary differential equation (ODE) problems.

• Appreciate the importance of numerical method in solving ODE.

• Assess the reliability of the different techniques.

• Select the appropriate method for any particular problem.

Page 22: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

22

Computer Objectives

• Develop programs to solve ODE.• Use software packages to find the solution of

ODE

Page 23: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

23

Learning Objectives of Lesson 1

Recall basic definitions of ODE,• order, • linearity• initial conditions, • solution,

Classify ODE based on( order, linearity, conditions)

Classify the solution methods

Page 24: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

24

Partial Derivatives

u is a function of more than one

independent variable

Ordinary Derivatives

v is a function of one independent variable

Derivatives

Derivatives

dtdv

yu∂∂

Page 25: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

25

Partial Differential Equations

involve one or more partial derivatives of unknown functions

Ordinary Differential Equations

involve one or more

Ordinary derivatives of

unknown functions

Differential EquationsDifferentialEquations

162

2

=+ tvdt

vd 02

2

2

2

=∂∂

−∂∂

xu

yu

Page 26: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

26

Ordinary Differential Equations

)cos()(2)(5)(

)()(:

2

2

ttxdt

tdxdt

txd

etvdt

tdvExamples

t

=+−

=−

Ordinary Differential Equations (ODE) involve one or more ordinary derivatives of unknown functions with respect to one independent variable

x(t): unknown function

t: independent variable

Page 27: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

27

Order of a differential equation

1)(2)()(

)cos()(2)(5)(

)()(:

43

2

2

2

2

=+−

=+−

=−

txdt

tdxdt

txd

ttxdt

tdxdt

txd

etxdt

tdxExamples

t

The order of an ordinary differential equations is the order of the highest order derivative

Second order ODE

First order ODE

Second order ODE

Page 28: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

28

A solution to a differential equation is a function that satisfies the equation.

Solution of a differential equation

0)()(:

=+ txdt

tdxExample

0)()(

)(:Proof

)(

=+−=+

−=

=

−−

tt

t

t

eetxdt

tdx

edt

tdx

etxSolution

Page 29: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

29

Linear ODE

32

2

:

( )( )

( ) ( )( ) 1

t

Examples

dx tx t e

dt

d x t dx tx t

dt dt

− =

− + =

An ODE is linear ifThe unknown function and its derivatives appear to power one

No product of the unknown function and/or its derivatives

Linear ODE

Non-linear ODE

Page 30: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

30

Nonlinear ODE

1)()()(

2)()(5)(

1))(cos()(:ODEnonlinear of Examples

2

2

2

2

=+−

=−

=−

txdt

tdxdt

txd

txdt

tdxdt

txd

txdt

tdx

An ODE is linear ifThe unknown function and its derivatives appear to power one

No product of the unknown function and/or its derivatives

Page 31: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

31

Uniqueness of a solution

byay

xydt

xyd

==

=+

)0()0(

0)(4)(2

2

In order to uniquely specify a solution to an n th order differential equation we need n conditions

Second order ODE

Two conditions are needed to uniquely specify the solution

Page 32: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

32

Auxiliary conditions

Boundary Conditions

• The conditions are not at one point of the independent variable

Initial Conditions

all conditions are at one point of the independent variable

auxiliary conditions

Page 33: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

33

Boundary-Value and Initial value Problems

Boundary-Value Problems

• The auxiliary conditions are not at one point of the independent variable

• More difficult to solve than initial value problem

5.1)2(,1)0(2 2

===++ −

xxexxx t

Initial-Value Problems

The auxiliary conditions are at one point of the independent variable

5.2)0(,1)0(2 2

===++ −

xxexxx t

same different

Page 34: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

34

Classification of ODEODE can be classified in different ways

Order• First order ODE• Second order ODE• Nth order ODE

Linearity• Linear ODE• Nonlinear ODE

Auxiliary conditions• Initial value problems• Boundary value problems

Page 35: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

35

Analytical Solutions

Analytical Solutions to ODE are available for linear ODE and special classes of nonlinear differential equations.

Page 36: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

36

Numerical Solutions

Numerical method are used to obtain a graph or a table of the unknown functionMost of the Numerical methods used to solve ODE are based directly (or indirectly) on truncated Taylor series expansion

Page 37: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

37

Classification of the MethodsNumerical Methods

for solving ODE

Multiple-Step Methods

Estimates of the solution at a particular step are based on information on more than one step

One-Step Methods

Estimates of the solution at a particular step are entirely based on information on the previous step

Page 38: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

38

More Lessons in this unit

Taylor series methodsMidpoint and Heun’s methodRunge-Kutta methodsMultiple step MethodsSolving systems of ODEBoundary value Problems

Page 39: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

39

Page 40: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

40

The sequence of events in the application of

ODEs for engineering problem solving

Page 41: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

Differential equations

Analytical methods• Exact solution

Numerical methods Approximate solution

41

Page 42: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

42

5.82012215.81045.0

23

234

+−+−=

++−+−=

xxxyxxxxy

Page 43: 551614:Advanced Mathematics for Mechatronicsmecha.sut.ac.th/files/551614-Math-1.pdf · Numerical Methods for Engineers and Scientists, Amos Gilat and Vish Subramaniam, Wiley,2008

43

5.82012215.81045.0

23

234

+−+−=

++−+−=

xxxyxxxxy


Recommended