DOC PREVIEW
CSUN ME 501A - Finite-difference Solutions

This preview shows page 1-2 out of 6 pages.

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

Unformatted text preview:

Outline FiniteFinite difference Solutions of BoundaryBoundary value Problems in ODEs Review last class Boundary value problems with ordinary differential equations Shoot and try method to use existing initial value problem algorithms Introduction to finite difference approaches Larry Caretto Mechanical Engineering 501AB Seminar in Engineering Analysis Complete discussion of finite difference approaches Compare to shooting methods shoot and try November 23 2004 Classroom call in 800 882 0125 Technical problems 800 600 9978 2 Review Problem Review Shoot and Try All numerical solutions are based on initial value problems Cannot use these directly if we have boundary conditions at two different locations of the independent variable Two choices Look at single second order equation y f x y y y 0 a and y L b Define z y y z to get two first order equations z f x y z and y z Use shoot and try method as follows Guess initial condition for z 0 y 0 typically guess z 0 0 y L y 0 L Solve equations for numerical y at x L yL m and compare to desired result Use initial value solvers in a trial and error mode shoot and try Develop new methods 3 4 Review Shoot and Try II Review Finite Differences yL m Based on value of E y L adjust z m 0 until E desired error After first try with z 0 0 y L y 0 L try z 1 0 2y L y 0 L y 0 L For subsequent tries use linear interpolation to give correct boundary condition z m 0 z m 1 0 z m 1 0 z m 1 0 y L yL m 1 yL m yL m 1 5 Place a set of nodes over the region between x0 xmin to xN xmax Number nodes from 0 to N so that x h xN x0 N for uniform grid spacing Substitute finite difference expressions for derivatives to convert differential equation to finite difference equation Solve resulting system of algebraic equations for nodal values 6 1 Review Example Review Example Equations Replace differential equation d2T dx2 a2 T 0 by finite difference equation Ti 1 Ti 1 2Ti h2 a2 Ti 0 Finite difference equations in matrix form with a2h2 2 1 0 0 M M 0 O h2 error term not used in solution but is present in results Have a system of simultaneous linear equations Ti 1 a2h2 2 Ti Ti 1 0 T0 TA and TN TB from boundary conditions Result is tridiagonal matrix 1 0 0 L 0 2 1 1 2 0 1 L L 0 0 0 M 1 M O O M M 1 T1 TA T 0 2 T3 0 M M M M M M 1 TN 2 0 2 TN 1 TB 0 0 0 M M 0 L 2 0 0 0 L 7 8 Thomas Algorithm Thomas Algorithm II General format for tridiagonal equations Gauss elimination upper triangular form B0 C0 A B 1 1 0 A2 0 0 M M 0 0 0 0 0 C1 L L 0 0 0 0 B2 C2 L 0 A3 B3 0 M M O M 0 0 L BN 1 0 L 0 AN 0 x0 D0 0 x1 D1 0 x2 D2 0 M M M M M C N 1 xN 1 DN 1 BN xN DN 9 Thomas Algorithm III 1 E 0 0 1 0 0 0 0 M M 0 0 0 0 0 0 0 x0 F0 x F 1 1 x2 F2 M M M M L 1 E N 1 xN 1 FN 1 L 0 1 xN FN L 0 0 0 L 0 E2 L 0 1 0 M O M 0 0 0 M 0 E1 1 0 M 0 0 Have to find Ei and Fi 10 Result h 1 a 2 T0 0 TN 1 Forward computations Initial E0 C0 B0 F0 D0 B0 Apply equations below for i 1 N 1 Ei Ci Bi Ai Ei 1 At final point Fi xN FN Di Ai Fi 1 Bi Ai Ei 1 DN AN FN 1 BN AN E N 1 Back substitute xi Fi Eixi 1 11 Input Forward Calculations Back 12 substitute 2 Numerical Results Results on previous chart for h 0 1 N 10 with TA 0 TB 1 a 2 and L 1 Compare to exact solution below Results and error on next chart T TA cos aL T B sin ax TA cos ax sin aL q x 0 k qx L i 0 1 2 3 4 5 6 7 8 9 10 xi 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 0 dT dx ka x 0 dT k dx Exact Ti 0 0 21849 0 42826 0 62097 0 78891 0 92541 1 02501 1 08375 1 09928 1 07099 1 x L TB TA cos aL sin aL ka TA TB cos aL sin aL Shoot Err 0 0 0000046 0 0000090 0 0000127 0 0000155 0 0000169 0 0000169 0 0000150 0 0000116 0 0000065 0 13 FDM Error 0 0 00070 0 00134 0 00187 0 00224 0 00242 0 00238 0 00211 0 00160 0 00089 0 Boundary Gradients xi 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 0 Ti 0 0 21918 0 42960 0 62284 0 79115 0 92783 1 02739 1 08585 1 10088 1 07188 1 Exact Ti 0 0 21849 0 42826 0 62097 0 78891 0 92541 1 02501 1 08375 1 09928 1 07099 1 Error 0 0 00070 0 00134 0 00187 0 00224 0 00242 0 00238 0 00211 0 00160 0 00089 0 Error and Error Order Get overall measure of error like norm of a vector Typically use maximum error in absolute value or root mean squared RMS error N 10 has emax 0 00242 and eRMS 0 00183 For N 100 emax 0 0000241 and eRMS 0 0000173 Second order error in solution RMS 1 N N i 1 2 i 1 N N T i 1 exact Tnumerical i2 16 Error Comparison Shooting method used 4th order RungeKutta compared to second order for finite difference methods Fourth order for finite differences based on compact expressions Use gradients with second order error dT 3T0 4T1 T2 k dx x x0 2h 3TN 4TN 1 TN 2 dT k q N k dx x xN 2h q0 k x qexact k i 0 1 2 3 4 5 6 7 8 9 10 h q k Error 0 2 1995 1 0 2 1995 01 1 9153 1 1 9153 01 2 2357 2 1999 9332 9155 03618 00036 01786 00021 Use second order central difference operator 2fi fi 1 fi 1 2 fi f 17 2 fi O h 4 2 2 h 1 12 18 3 Compact Expressions Compact Expressions II What does this 2 fi O h 4 f mean 2 2 Apply to y a2y …


View Full Document
Download Finite-difference Solutions
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 Finite-difference Solutions 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 Finite-difference Solutions 2 2 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?