ME 501A Seminar in Engineering Analysis Page 1

Similar documents
NON-CENTRAL 7-POINT FORMULA IN THE METHOD OF LINES FOR PARABOLIC AND BURGERS' EQUATIONS

Equation to Be Solved. Grid i,j Notation. A Small Grid (N = 6, M = 5) Solving the Equations. General Equation in a Matrix

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Formal solvers of the RT equation

Lecture 26 Finite Differences and Boundary Value Problems

One-sided finite-difference approximations suitable for use with Richardson extrapolation

Numerical Heat and Mass Transfer

NUMERICAL DIFFERENTIATION

( ) [ ( k) ( k) ( x) ( ) ( ) ( ) [ ] ξ [ ] [ ] [ ] ( )( ) i ( ) ( )( ) 2! ( ) = ( ) 3 Interpolation. Polynomial Approximation.

2.29 Numerical Fluid Mechanics

Chapter 12. Ordinary Differential Equation Boundary Value (BV) Problems

Solution of Linear System of Equations and Matrix Inversion Gauss Seidel Iteration Method

ME 501A Seminar in Engineering Analysis Page 1

EEE 241: Linear Systems

1 GSW Iterative Techniques for y = Ax

Lecture 21: Numerical methods for pricing American type derivatives

36.1 Why is it important to be able to find roots to systems of equations? Up to this point, we have discussed how to find the solution to

Consistency & Convergence

FTCS Solution to the Heat Equation

PART 8. Partial Differential Equations PDEs

Relaxation Methods for Iterative Solution to Linear Systems of Equations

OPTIMISATION. Introduction Single Variable Unconstrained Optimisation Multivariable Unconstrained Optimisation Linear Programming

Chapter Newton s Method

A new Approach for Solving Linear Ordinary Differential Equations

CHAPTER 4d. ROOTS OF EQUATIONS

Nice plotting of proteins II

Grid Generation around a Cylinder by Complex Potential Functions

Numerical Solution of Ordinary Differential Equations

2 Finite difference basics

Single Variable Optimization

Summary with Examples for Root finding Methods -Bisection -Newton Raphson -Secant

Note 10. Modeling and Simulation of Dynamic Systems

Lecture 13 APPROXIMATION OF SECOMD ORDER DERIVATIVES

6.3.4 Modified Euler s method of integration

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 12

Lecture 2 Solution of Nonlinear Equations ( Root Finding Problems )

4DVAR, according to the name, is a four-dimensional variational method.

Introduction to Vapor/Liquid Equilibrium, part 2. Raoult s Law:

Solution for singularly perturbed problems via cubic spline in tension

Numerical Methods Solution of Nonlinear Equations

1 Matrix representations of canonical matrices

: Numerical Analysis Topic 2: Solution of Nonlinear Equations Lectures 5-11:

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Chapter 4: Root Finding

Lecture 2: Numerical Methods for Differentiations and Integrations

Implicit Integration Henyey Method

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Solution of the Navier-Stokes Equations

Chapter - 2. Distribution System Power Flow Analysis

Chapter 3 Differentiation and Integration

MAE140 - Linear Circuits - Winter 16 Final, March 16, 2016

1 Introduction We consider a class of singularly perturbed two point singular boundary value problems of the form: k x with boundary conditions

Numerical Solutions of a Generalized Nth Order Boundary Value Problems Using Power Series Approximation Method

Numerical Transient Heat Conduction Experiment

The Finite Element Method

Instituto Tecnológico de Aeronáutica FINITE ELEMENTS I. Class notes AE-245

Appendix B. The Finite Difference Scheme

ELE B7 Power Systems Engineering. Power Flow- Introduction

CIS526: Machine Learning Lecture 3 (Sept 16, 2003) Linear Regression. Preparation help: Xiaoying Huang. x 1 θ 1 output... θ M x M

Outline. Review Numerical Approach. Schedule for April and May. Review Simple Methods. Review Notation and Order

Finite Difference Method

MAE140 - Linear Circuits - Fall 10 Midterm, October 28

Newton s Method for One - Dimensional Optimization - Theory

Linear Feature Engineering 11

Finite Element Modelling of truss/cable structures

The Fundamental Theorem of Algebra. Objective To use the Fundamental Theorem of Algebra to solve polynomial equations with complex solutions

Application of B-Spline to Numerical Solution of a System of Singularly Perturbed Problems

Topic 5: Non-Linear Regression

MMA and GCMMA two methods for nonlinear optimization

ORDINARY DIFFERENTIAL EQUATIONS EULER S METHOD

Difference Equations

AERODYNAMICS I LECTURE 6 AERODYNAMICS OF A WING FUNDAMENTALS OF THE LIFTING-LINE THEORY

coordinates. Then, the position vectors are described by

E91: Dynamics. E91: Dynamics. Numerical Integration & State Space Representation

1 Convex Optimization

Chapter 2 - The Simple Linear Regression Model S =0. e i is a random error. S β2 β. This is a minimization problem. Solution is a calculus exercise.

Septic B-Spline Collocation Method for the Numerical Solution of the Modified Equal Width Wave Equation

Numerical Methods. ME Mechanical Lab I. Mechanical Engineering ME Lab I

Limited Dependent Variables

Vector Norms. Chapter 7 Iterative Techniques in Matrix Algebra. Cauchy-Bunyakovsky-Schwarz Inequality for Sums. Distances. Convergence.

Polynomial Regression Models

Boundary Value Problems. Lecture Objectives. Ch. 27

SOLVING NON-LINEAR SYSTEMS BY NEWTON s METHOD USING SPREADSHEET EXCEL Tay Kim Gaik Universiti Tun Hussein Onn Malaysia

ALGORITHM FOR THE CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION

Review of Taylor Series. Read Section 1.2

Section 8.3 Polar Form of Complex Numbers

CISE301: Numerical Methods Topic 2: Solution of Nonlinear Equations

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

Numerical Solution of Ordinary Differential Equations

Lecture 12: Discrete Laplacian

Denote the function derivatives f(x) in given points. x a b. Using relationships (1.2), polynomials (1.1) are written in the form

CSci 6974 and ECSE 6966 Math. Tech. for Vision, Graphics and Robotics Lecture 21, April 17, 2006 Estimating A Plane Homography

Inexact Newton Methods for Inverse Eigenvalue Problems

A Hybrid Variational Iteration Method for Blasius Equation

Numerical Solution of Singular Perturbation Problems Via Deviating Argument and Exponential Fitting

Differentiating Gaussian Processes

Errors for Linear Systems

Numerical Simulation of One-Dimensional Wave Equation by Non-Polynomial Quintic Spline

Report on Image warping

New Method for Solving Poisson Equation. on Irregular Domains

Transcription:

umercal Solutons of oundary-value Problems n Os ovember 7, 7 umercal Solutons of oundary- Value Problems n Os Larry aretto Mechancal ngneerng 5 Semnar n ngneerng nalyss ovember 7, 7 Outlne Revew stff equaton systems efnton of boundary-value problems (VPs) n Os umercal soluton of VPs by shootand-try method Use of fnte-dfference equatons to solve VPs Thomas algorthms for solvng fntedfference equatons from second-order VPs Stff Systems of quatons Some problems have multple eponental terms wth dfferng coeffcents, a, n ep(-at) oeffcents wth large values of a wll requre a small tme step for stablty, but wll not be essentally ero after a short tme after the start of the soluton eed specal algorthms for such systems 3 Solvng Stff Os If you try to solve a stff problem wth a conventonal solver you wll fnd that the soluton s takng ecessve tme Stff solvers do more work per step, but allow larger steps Gear s Method and MTL stff solvers ode5s, ode3s, ode3t, ode3tb Users may have to provde code to complete Jacoban matr, 4 oundary-value Problems ll Os solved so far have ntal condtons only ondtons for all varables and dervatves set at t = only In a boundary-value problem, we have condtons set at two dfferent locatons second-order O d y/d = g(, y, y ), needs two boundary condtons () Smplest are y() = a and y(l) = b Med : ady/d+by = c at =, L 5 oundary-value Problems II Solvng boundary-value problems nte dfferences (consdered later) Shoot-and-try Take an ntal guess of dervatve boundary condtons at = and use an ntal-value routne to get y (comp) (L) at the other boundary ompare the value of y (comp) (L) found from the prevous step to the boundary condton on y(l) Use the dfference between y (comp) (L) and y(l) to terate the ntal value of = dy/d = and contnue untl y (comp) (L) y(l) 6 M 5 Semnar n ngneerng nalyss Page

umercal Solutons of oundary-value Problems n Os ovember 7, 7 Shoot-and-Try ample I Look at sngle, second order equaton: y = g(, y, y ), y() = a and y(l) = b efne = y (y = ) to get two frst order equatons: = g(, y, ) and y = Steps n the shoot and try method Guess ntal condton for () = y (); typcally guess () () = [y(l) y()]/l Solve equatons for y computed (L) and compare to specfed boundary condton, y(l) 7 Shoot-and-Try otaton otaton for shoot and try O: d y/d = g(, y, dy/d) = g(, y, ) System of two frst order OS: = dy/d and d/d = g(, y, ) Varables for teraton m (m) () guess for ntal condton of dy/d at = y (m) (L) result at = L from solvng system of two Os usng (m) () y(l) requred boundary condton at = L rror at teraton m: (m) = y (m) (L) y(l) 8 Shoot-and-Try Iteraton djust (m) () untl (m) = y (m) (L) y(l) s less than the allowed error fter frst try wth () () = [y(l) y()]/l try () () = [y(l) y () (L) y()]/l or subsequent tres use lnear nterpolaton to gve ero error () () () () Set ths to ero () () ( ) () 9 Shoot-and-Try ample II Solve d y/d +6sn(y ) = wth y = at = and y = at = L = Must fnd par of frst order equatons Set dy/d = as one O Orgnal O becomes d/d = 6sn(y) We know y() =, but we need () guess () () = [y(l) y()]/l = ( )/ = Ths gves y () () = 3.887 (RK4, h =.5) Try () () = [y() y () () y()]/l = [() ( 3.887) ] =.887 () = y () (L) y(l) = 3.887 = -3.887 Shoot-and-Try ample III RK4 wth () () =.887 gves y () (L) = 8.68 so () = y () (L) y(l) = 8.68 = 8.68 pply general error formula to get () () () () () ( ) ().887 () 8.68.7993 8.68 3.887 ontnue to apply Runge-Kutta to get y (m) (L=), (m) = y (m) (L) y(l), and (m+) () for (m+) Repeat calculatons wth new value of (m+) () from general error formula untl y (m) (L) y(l) M 5 Semnar n ngneerng nalyss Page

umercal Solutons of oundary-value Problems n Os ovember 7, 7 nte-fference Introducton nte-dfference approach s alternatve to shoot-and-try onstruct grd of step se h (varable h possble) between boundares Smlar to grd used for numercal ntegraton = (), = (L), h = L /, k = + kh Replace dfferental equaton at each nteror node by fnte dfference equaton Solve resultng set of algebrac equatons for nteror ponts usng Thomas algorthm nte fference Grd Grd may be unform or non-unform, but unform s easer and has hgher order truncaton error; note: h = ( )/ ----- -------- ------------- ~ ~ ------- --- 3 - - t each node wrte fnte-dfference equvalent to dfferental equaton Handle boundary condtons at and (smplest f y = y() and y = y(l), but can have gradent or med boundares) 3 4 ample Problem Solve d T/d + a T = nte dfference equaton at node [d T/d + a T] = (T + + T - T )/h + a T + O(h ) = Ignore truncaton error Ignore truncaton error and get fntedfference equaton system T + + T - T + h a T = Have + nodes numbered from to wth boundary condtons at and 5 General oundary ondtons Must be able to handle three knds rchlet specfy varables at boundary eumann specfy boundary gradents Med or thrd knd specfy relatonshp between value and gradent at boundary General format a dt/d + bt = c (med) ed T: a =, b =, c = boundary T Gradent: b =, a =, c = value for dt/d Use drectonal fnte-dfference equaton for boundary gradents, dt/d 6 ample ontnued quaton s T - + ( + h a )T + T + = Specfy boundary values T and T T = T(=) = T and T = T(=L) = T Wth specfed boundary values equatons at = and = - become ( + h a )T + T = T T - + ( + h a )T - = T Resultng system of equatons forms trdagonal matr 7 ample Matr quatons nte-dfference equatons n matr form wth = a h have trdagonal form solved by Thomas lgorthm used wth cubc splne (see end sldes) T T T3 T T 8 T T M 5 Semnar n ngneerng nalyss Page 3

umercal Solutons of oundary-value Problems n Os ovember 7, 7 nalytcal Soluton omparson Look at results for h =. ( = ) wth T =, T =, a = and L = ompare to eact soluton below act gradents also used n comparson T T cos( al) T sn( a) T cos( a) sn( al) dt T T cos( al) q k ka d sn( al) q L k dt d L ka T T cos( al) sn( al) 9 Results of nte-fference alculatons T act T rror...98.849.7..496.486.34 3.3.684.697.87 4.4.795.7889.4 5.5.9783.954.4 6.6.739.5.38 7.7.8585.8375. 8.8.88.998.6 9.9.788.799.89. rror and rror Order Get overall measure of error (lke norm of a vector) Typcally use mamum error (n absolute value) or root-mean-squared (RMS) error = has ma =.4-3 and RMS =.83-3. or =, ma =.4-5 and RMS =.73-5 Second-order error n soluton RMS ( T eact T ) numercal oundary Gradents Use second-order dervatve epressons dt 3T 4T T q k k d h dt 3T 4T T q k k d h -q eact /k h -q/k rror.995..357.368.995..999.36 -.953. -.933.786 -.953. -.955. MTL oundary-value Os MTL has two solvers bvp4c and bvp5c for solvng boundary-value Os bvp5c: fnte dfference code mplements four-stage Lobatto IIIa formula, a collocaton formula that provdes a - contnuous soluton that s ffth-order accurate unformly n [a,b] bvp5c solves algebrac equatons drectly; bvp4c uses analytcal condensaton bvp4c handles unknown parameters drectly Solve Trdagonal quatons nte-dfference equatons n matr for eample problem wth = a h Use Thomas lgorthm for Soluton T T T3 T T 3 4 T T M 5 Semnar n ngneerng nalyss Page 4

umercal Solutons of oundary-value Problems n Os ovember 7, 7 M 5 Semnar n ngneerng nalyss Page 5 5 Thomas lgorthm 3 3 General set of trdagonal equatons 6 Thomas lgorthm II Gauss elmnaton upper trangular form Have to fnd and 7 Thomas lgorthm III orward computatons Intal: = / = / pply equatons below for =, -: t fnal pont ack substtute: = + + 8 Result: h =., a =, T =, T = Input orward alculatons ack substtute Spreadsheet ormulas 9 ormulas here solve only for nteror ponts when fed boundary condtons are specfed 3 Other oundary ondtons General condton a dt/d + bt = c a =, b = for eumann (gradent gven) a =, b = for rchlet (value gven) Wrte gradent usng second order forward ( = ) or backward dfference ( = ) ombne wth equaton for frst node n from the boundary to elmnate term wth second node from boundary Result conforms to trdagonal system

umercal Solutons of oundary-value Problems n Os ovember 7, 7 General oundary ample Look at = boundary; results for = follow smlar dervaton dy 3y 4y y a b y a b y c d h 3a 4a a b y y y c dd these h h h two equatons a y ( ) y y elmnatng y h a ( ) a b y y c h h 3 General oundary ample II quaton just derved s seen to gve correct rchlet result for a =, b = a ( ) a b y y c h h Smlar dervaton at = gves a ( ) a b y y c h h quatons shown here wll work for a = or b =, but at least one must be nonero 3 onlnear Problems Shoot-and-try requres no specal procedures for nonlnear problems or fnte dfference or fnte elements, solve a lneared equaton ample s pendulum equaton d /dt = (-g/l) sn (usually solved wth sn ) Taylor seres: sn = sn + [d(sn )/d] ( ) = sn + cos ( ) Replace sn by lnear result to terate 33 onlnear ample Start wth d /dt = (-g/l) sn Replace sn by lneared seres Wrte n teratve form wth (m+) as new teraton and use (m) n nonlnear terms d (m+) /dt = (-g/l) [sn (m) + cos (m) ( (m+) (m) ) efne = g/l and rearrange d (m+) /dt + (m+) cos (m) = [sn (m) (m) cos (m) ] = r 34 onlnear ample II onvert d (m+) /dt + (m+) cos (m) = r to (lnear) fnte-dfference form n (m+) h r cos Have trdagonal system sn r h h r 35 onlnear ample III Make ntal guesses for () Lnear profle () (t) = () + [(L) ()]t/t nd all nodal values for () usng () to compute the nonlnear terms Repeat the process untl the dfferences between teratons s good enough ompute resduals to test convergence R h h r 36 M 5 Semnar n ngneerng nalyss Page 6

umercal Solutons of oundary-value Problems n Os ovember 7, 7 Summary oundary value problems requre specal treatment Shoot-and-try nte dfferences or fnte elements Shoot-and-try s usually better for nonlnear problems and fnte dfferences are better for lnear ones nte elements are more applcable to comple geometry and 3 problems 37 M 5 Semnar n ngneerng nalyss Page 7