DOC PREVIEW
CSUN ME 501B - Numerical Solutions of the Diffusion Equation

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Numerical Diffusion Equation March 18 2009 Outline Numerical Solutions of the Diffusion Equation Review last class Numerical solutions of the diffusion equation in one space dimension Larry Caretto Mechanical Engineering 501AB Explicit algorithm Stability of algorithms Crank Nicholson algorithm Fully implicit algorithm DuFort Frankel algorithm Seminar in Engineering Analysis March 18 2009 2 Review Numerical Analysis Review Finite Difference Grids Transform differential equation into a system of algebraic equations Obtain solution for discrete points in domain Two basic approaches finite differences and finite elements Start with finite elements Get expressions for derivatives and measure of error with their use Grid notation for four independent variables x y z and t x0 xmin xN xmax xi xi 1 xi y0 ymjn yM ymax yj yj 1 yj z0 zmkn zK zmax zk zk 1 zk t0 tmin tL tmax tn tn 1 tn Dependent variable u x y z t at discrete points u xi yj zk tn Use notation below for this value of u 3 Review Truncation Error 1 dn f n n 0 n dx m x a n x a 1 dn f n n m 1 n dx x a n x a Terms used Truncation error m Can write truncation error as single term at unknown location derivation based on the theorem of the mean m 1 dn f n n m 1 n dx x a n x a 1 d m 1 f m 1 dx m 1 x a m 1 x 5 ME 501B Engineering Analysis 4 Review Order of the Error If we truncate series after m terms f x n u ijk u xi y j z k t n Derivative expressions have error that is proportional to hn This power n is called the order of the error Use notation O hn to indicate this error Reducing step size by a factor of a reduces nth order error by an h 2 1 2 h1 n 6 1 Numerical Diffusion Equation March 18 2009 Review Derivative Expressions Find f and f for sin at x 1 Second order central First order error first derivatives f f f i i 1 i O h h f f i 1 fi i O h h fi Second order error first derivatives f i 2 4 f i 1 3 f i f i O h 2 2h f i f i 2 4 f i 1 3 f i O h 2 2h Second derivative f i fi fi f i 1 f i 1 O h 2 2h f i 1 f i 1 2 f i h2 O h2 7 f i 1 f i 1 O h 2 2h f i 1 f i 1 2 f i O h2 h2 sin 1 1 sin 1 1 2 sin 1 fi 1 2 f i sin 1 1 sin 1 1 2 1 sin 1 01 sin 1 01 sin 1 01 sin 1 01 2 sin 1 2 01 fi 01 2 sin 1 001 sin 1 001 fi 2 001 sin 1 001 sin 1 001 2 sin 1 fi 8 001 2 fi Review Roundoff Error Figure 2 1 Effect of Step Size on Error Possible in derivative expressions from subtracting close differences Example f x ex f x ex h ex h 2h and error at x 1 is e1 h e1 h 2h e 1 E 01 1 E 01 1 E 02 1 E 03 Error 3 004166 2 722815 E 2 718282 4 5 x10 3 2 0 1 Second order error Slope of a log error log h plot is order n log 10 log h 5 Slope order 2 1 E 00 1 E 04 1 E 05 1 E 06 1 E 07 2 7185536702 2 7180100139 E 2 718281828459 4 5 x10 9 2 0 0001 2 71828210028724 2 71828155660388 E 2 718281828 5 9 x10 9 2 0 0000001 1 E 08 1 E 09 1 E 10 1 E 11 1 E 17 1 E 15 1 E 13 1 E 11 1 E 09 1 E 07 1 E 05 1 E 03 1 E 01 Step Size 9 Numerical PDE Solutions Diffusion Equation Define a finite difference grid in the independent variables x y z t Place grid points on region boundary whose values are found from boundary conditions for the problem At some grid location convert differential equation into a finite difference equation Apply difference formulas derived for ordinary derivatives to partial derivatives Use notation to consider different coordinate directions n u 2u Apply to diffusion equation 2 t x i Grids xi x0 i x and tn t0 n t Try finite difference expressions below to get simple finite difference equation Observe truncation error in process Neglect truncation error to get set of algebraic equations to solve n 11 ME 501B Engineering Analysis u u n 1 uin i O t and t i t n 2u u n u n 2u n i 1 i 1 2 i O x 2 2 x i x 12 2 Numerical Diffusion Equation March 18 2009 Diffusion Equation II Explicit FTCS Method Method just derived is called explicit method can solve one equation at a time Substitute finite difference expressions into differential equation uin 1 uin u n u n 2u n i 1 i 1 2 i O t x 2 x t uin 1 Ignore truncation error solve for uin 1 n 1 i u t u u 1 2 x t2 uin x 2 n i 1 n i 1 t Obtain potential at x xi and t tn 1 in terms of u values at old time step t n ui 1 uin 1 1 2 x t2 uin f uin 1 uin 1 1 2 f uin x 2 uin uni 1 uni 1 uin 1 x f t x 2 uin 1 does not depend on other u values at the new time step n 1 13 Explicit Method Example Explicit Method Results f 0 16 Pick 1 x 0 25 Nx 4 t 0 01 f t x 2 1 01 25 2 0 16 Pick initial ui0 1000 and boundaries un0 un4 0 for time 0 n 0 Apply uin 1 f uin 1 uin 1 1 2 f uin u11 f u00 u20 1 2 f u10 0 16 0 1000 0 68 1000 840 1 u2 f u10 u30 1 2 f u20 0 16 1000 1000 0 68 1000 1000 u31 f u20 u40 1 2 f u30 0 16 1000 0 0 68 1000 840 14 Repeat for subsequent time steps i 0 i 1 i 2 i 3 i 4 x 0 00 x 0 25 x 0 50 x 0 75 x 1 00 t 0 1000 1000 1000 1000 1000 n 0 t 0 0 1000 1000 1000 0 n 1 t 0 01 0 840 1000 840 0 n 2 t 0 02 0 731 2 948 8 731 2 0 n 3 t 0 03 0 649 879 2 649 0 n 4 t 0 …


View Full Document

CSUN ME 501B - Numerical Solutions of the Diffusion Equation

Download Numerical Solutions of the Diffusion Equation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Numerical Solutions of the Diffusion Equation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Numerical Solutions of the Diffusion Equation and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?