DOC PREVIEW
CSUN ME 501A - Numerical Solutions of Boundary

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 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 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Numerical Solutions of BoundaryNumerical Solutions of Boundary--value Problems in value Problems in ODEsODEsLarry CarettoMechanical Engineering 501ASeminar in Engineering AnalysisNovember 18, 20042Outline• Review last two classes• Boundary value problems with ordinary differential equations• Shoot and try method to use existing initial value problem algorithms• Finite difference approaches• Introduction to finite elements• Finite element solutions to boundary value problems3Review Concepts• Finite-difference equation consistentwith the differential equation if both equations give the same result as h → 0• A numerical method is convergent with the ODE solution numerical solution approaches the actual solution as h → 0• Control accuracy of by step-size control– Use the order of the global truncation error with error estimates for control4Review Stability• Unstable solutions (exact or numerical) grow without bound• Test stability of numerical methods by examining stable ODE y’ = –ay• Define growth factor G = yn+1/ynand get limits on h such that |G| < 1• Explicit Euler requires ah < 2• Implicit trapezoid unconditionally stable• Choose h for accuracy and stability5Review Simultaneous ODEs• Apply same algorithms used for single ODEs– Must apply each step and substep to all equations in system– Key is having consistent x and y values in determination of fi(x,y)– All yivalues in y must be available at the same x point when computing the fi– E.g., in Runge-Kutta we must evaluate k1for all equations before finding k26Review Stiff Systems• Basic problem is that there are several length or time constants (eigenvalues) in the system– If one is negative and large in magnitude compared to others, this will set stability– Such terms quickly drop to zero and do not affect physical solution, but , they force small h for stability– Use implicit approaches such as Gear’s method which require special techniques typical of implicit methods27Boundary-value Problems• Convert a second order differential equation into two first order equations()⎪⎩⎪⎨⎧==⇒⎟⎠⎞⎜⎝⎛=zyxdxdzzdxdydxdyyxdxyd,,,,22φφ• Consider two sets of conditionsbzaybyay==⇒== )0()0()0(')0(???)0()0()()0(==⇒== zaybLyay8Boundary Value Problems II• Usual approach – transforming higher order equations into first order equations – assumes that we have boundary conditions for first derivatives• Cannot use these directly if we have boundary conditions at two different locations of the independent variable• Develop new methods or adapt initial value problem approach9Boundary Value Problems III• Initial condition for new variable (z in example problem) unknown, but we can guess an initial condition• With initial condition for z we can integrate equations from x = 0 to x = L• Can then test value of y(L) found from integration from boundary condition• Adjust guess of z(0) and repeat integration until convergence10Shoot and Try• Look at single, second order equation: y’’ = φ(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 y(L) and compare to desired result11Shoot and Try II• Iteration notation– m is iteration index–z(m)(0) is initial guess of z for iteration m–y(m)(L) is value of y at x = L found from numerical integration at iteration m– y(L) is known boundary value– Define error, E = y(m)(L) – y(L) • Iterate, adjusting z(m)(0) until |E| < desired error12Shoot and Try III• Use any method for integrating initial value problem with y(0) and zm(0)– First guess: z(0)(0) = [y(L) – y(0)]/L– Next: z(1)(0) = [2y(L) – y(0)(L) – y(0)]/L • For subsequent tries use linear interpolation to get correct boundary())()()()()0()0()0()0()1()1()()1()()1()1(LyLyLyLyzzzzmmmmmmm −−−−+−−−+=313Shoot and Try Example• Solve y’’ = x2y3y’ – (y’)2yx with y(0) = 0 and y(1) = 1• System of two eqations is y’ = z and z’ = x2y3z – z2yx • Initial guess z(m)(0) = [y(L) – y(0)]/L = [ 1 – 0 ] / 1 = 1• Use fourth-order Runge-Kutta method with h = 0.01• Initial result, y(0)(L) = 0.94799614Shoot and Try Example II• Next: z(1)(0) = [2y(L) – y(0)(L) – y(0)]/L = [(2)(1) – 0. 947996 – 1]/1 = 1.0520039• Result: y(1)(L=1) = 0.993029• Interpolation formula for all other guesses())()()()()0()0()0()0()1()1()()1()()1()1(LyLyLyLyzzzzmmmmmmm −−−−+−−−+=()056909.1947996.01947996.09933029.010520039.11)0()2(=−−−+=z15Shoot and Try Results-4.2x10-141.0000000001.059726184-1.78x10-80.9999999821.059726163-3.10x10-50.9999694051.05969092-0.006700.9933029251.05200391-0.05200.94799613210Errory(m)(L)z(m)(0)m16Computation of Gradients• Boundary value problems often solve for a potential where some flux is the gradient of a potential– Species diffusion is gradient of mass fraction– Heat flux is gradient of temperature– Velocity is gradient of velocity potential• Want to compute fluxes at boundaries• Shoot and try gives gradients, z = dy/dx17Physical Example• One dimensional heat transfer with constant properties (A is area normal to heat flow, ∆x is differential length)– q is heat flux (units of W/m2)– Energy balance: AqIN(x)+A∆xSV= Aqout (x+∆X)–Svis energy source per unit volume (units of W/m3) – Divide by A∆x and rearrange terms–[qIN(x)–qout (x+∆x)]/∆x+ SV= 018Physical Example II• Continue derivation by looking at limit as ∆x approaches zero– In this limit, [qIN(x)–qout (x+∆x)]/∆x+ SV= 0 becomes –dq/dx + Sv= 0– Substitute Fourier law, q = –k dT/dx, to get k d2T/dx2+ Sv= 0 (k units: W/m·K)– Consider source proportional to T: Sv= bTso b has units of W/m3 ·K– Result: k d2T/dx2+ bT = 0419Physical Example III• Divide by k and define a2= b/k to get equation d2T/dx2+ a2T = 0– Units of b/k are W/m3 ·K divided by W/m ·K or m-2so a has units of m-1– Boundary conditions: T(0) = TA; T(L) = TB• At node i, a2T = a2Tiand we write d2T/dx2= (Ti+1+ Ti-1–2Ti)/h2+O(h2) where h is uniform step size, ∆x• We ignore O(h2) terms in equation 20Exact Solution• Look at results for with L = 1, TA= 0 at x = 0, TB= 1 at x = L, and a = 2• Compare to exact solution for temperature and heat fluxes


View Full Document
Download Numerical Solutions of Boundary
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 Boundary 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 Boundary 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?