FINITE DIFFERENCE METHOD

INTERACTIVE E-BOOK

Ordinary Differential Equations

MAJOR

GENERAL

 On non Internet Explorer browsers, the equations may not show up.

As an alternative or if you prefer,

you can see the pdf version of the ebook instead

Title

An interactive e-book for illustrating Finite Difference Method of solving ordinary differential equations

Creator

Autar K Kaw

Subject and Keywords

Finite Difference Method, Ordinary Differential Equations, Mathcad, Maple, Mathematica, Matlab, Simulations.

Description

interactive E-book for illustrating the Finite Difference Method for solving ordinary differential equations.  It includes links to examples, simulations in Mathcad, Maple, Mathematica, and Matlab for the algorithm, and a PowerPoint presentation.

Publisher

Holistic Numerical Methods Institute,

College of Engineering,

University of South Florida, Tampa, FL 33620-5350.

Contributors

Autar Kaw

Format

Text/HTML

Last Revised

May 4, 2006

Identifier

http://numericalmethods.eng.usf.edu/ebooks/finitediff_08ode_ebook.pdf

Language

English

Rights

http://numericalmethods.eng.usf.edu/rights.htm

 

Table of Contents

Background

           What are ordinary differential equations?          

           A Primer on Ordinary Differential Equations

           Finite Difference Method for Ordinary Differential Equations

           PowerPoint presentation

Example

           Pressure Vessel Problem

Simulation of the Finite Difference Method ([MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB])

Back to TOC

Background

This is an example of how an instructor of a Numerical Methods course can develop an E-book on a single topic by using resources that are only available at the Holistic Numerical Methods Institute (HNMI) Website.

Although one of the primary advantages of a web-based resource is that one can use documents outside of its own domain, we are particularly using this example as a way to illustrate the holistic nature of the resources available at HNMI.   You are welcome to modify and edit this e-book to suit your purpose.

Using the textbook document written in MS Word 2000 as a foundation, it was made interactive within MS Word 2000 by putting bookmarks and hyperlinks to background information, PowerPoint presentations, Mathcad simulations, historical anecdotes, multiple choice tests, problem sets, etc.   Then the MS Word 2000 file was saved as a webpage and that is what you are about to read here.

 

 

Back to TOC

Finite Difference Method for Ordinary Differential Equations

            An example of a boundary value ordinary differential equation is

              (1)

The value of condition is given at the boundaries, that is, at r= 5 and r=8.  This method is used to solve boundary value ordinary differential equations.  The derivatives in such ordinary differential equation are substituted by finite divided differences approximations, such as

             

                                                                                          (2a, b)

            Such substitutions convert the ordinary differential equation into a linear equation (but with more than one unknown). By writing the resulting linear equation at different points at which the ordinary differential equation is valid, we get simultaneous linear equations that can be solved by using techniques such as Gaussian Elimination, Gauss-Siedel method, etc.

               The method is best illustrated by a physical example. Take the case of a pressure vessel that is being tested in the laboratory to check its ability to withstand pressure.  For a thick pressure vessel of inner radius a and outer radius b, the differential equation for the radial displacement u of a point along the thickness is given by

                                                                                                  (3)

        Assume that the inner radius  a= 5″ and the outer radius b= 8″, and the material of the pressure vessel is ASTM36 steel. The ultimate strength of this type of steel is 36 ksi. Two strain gages that are bonded tangentially at the inner and the outer radius measure normal tangential strain as

                   

                                                                                                       (4a, b)

at the maximum needed pressure. Since the radial displacement and tangential strain are related simply by

            ,                                                                                                                        (5)

then

           

                                                             (6)

            The two boundary conditions will allow us to solve the boundary value ordinary differential equation to find radial displacement as a function of radial location. How will this help us in determining if it will safely withstand the pressure. The maximum normal stress in the pressure vessel is at the inner radius  and is given by        

                                                                                 (7)

where

             Young’s modulus of steel (E= 30 Msi)

             Poisson’s ratio (0.3)

Having calculated the maximum stress we can calculate the factor of safety, FS

as

                                                                                  (8)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 At node  in the pressure vessel,

                                                                                     (9)

                                                                                                 (10)

Substituting these approximation from equations (9) and (10) in equation (3)

                                                                                   (11)

                                   (12)

 

Let us break the thickness,  of the pressure vessel to  nodes, that is is node  and  is node . That means we have  unknowns.

We can write the above equation for nodes.  This will give us (n-1) equations.  At the edge nodes,  and , we use the boundary conditions of

           

           

            This gives a total of equations. So we have  unknowns and  linear equations. These can be solved by any of the numerical methods used for solving simultaneous linear equations.

            Let us show the calculations for  that is a total of 6 nodes. This gives

           

                

                 

At node ,                                                   (13)

At node                                                                   (14)

           

                                                                          (15)

At node   

                

                                                                           (16)

 

At node  

           

                                                                         (17)

At node   

           

                                                                         (18)

At node  

                                                                                           (19)

Writing Equation (13) to (19) in matrix form gives

     =

            The above equations are a tridiagonal system of equations and special algorithms such as Thomas’ algorithm can be used to solve such a system of equations.

           

           

           

           

           

           

To find the maximum stress,  it is given by equation (7) as

           

           

           

           

           

                       

                       

The maximum stress in the pressure vessel then is

           

                   

So the factor of safety  from equation (8) is

           

The differential equation has an exact solution and is given by the form

                                                                                                              (20)

where  and  are found by using the boundary conditions at  and .

           

             

giving

           

           

Thus

                                                                                               (21)

                                                                                  (22)

           

                  

                   

The true error,  is

           

                

The absolute relative true error,  is

           

                 

The approximation

           

is first order accurate, that is , the true error is of .

        The approximation

                                                                                              (21)

is second order accurate, that is , the true error is

            Mixing these two approximations will result in the order of accuracy of and, that is.

           So it is better to approximate

                                                                                                         (22)

because this equation is second order accurate.

Repeating the problem with this approximation,

At node i in the pressure vessel,

                                                                                    (23)

                                                                                              (24)

Substituting Equations (23) and (24) in Equation (3) gives

           

                   (25)

At node

            ”                                                                                            (26)

At node

           

                                                                        (27)

At node  

           (28)

           

At node  

           (29)

           

At node   

        (30)

           

At node  

            ”                                                                                (31)

Writing Equation (26) to (31) in matrix form gives

     =

            The above equations are a tridiagonal system of equations and special algorithms such as Thomas’ algorithm can be used to solve such equations.

           

           

           

           

           

           

           

                       

                       

           

                    

 Therefore, the factor of safety  is

           

           

                

           

                

 

 

 

 

 

 

 

 

Table 1. Comparisons of radial displacements from two methods.

 

r

u exact

u 1st order

t|

u 2nd order

t|

5

0.0038731

0.0038731

0.0000

0.0038731

0.0000

5.6

0.0036110

0.0036165

1.5160×10-1

0.0036115

1.4540×10-2

6.2

0.0034152

0.0034222

2.0260×10-1

0.0034159

1.8765×10-2

6.8

0.0032683

0.0032743

1.8157×10-1

0.0032689

1.6334×10-2

7.4

0.0031583

0.0031618

1.0903×10-1

0.0031586

9.5665×10-3

8

0.0030769

0.0030769

0.0000

0.0030769

0.0000

 

Simulation of the Finite Difference Method ([MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB])          

           

h=240