ENGR-25_Lec-21_Integ_Diff.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.

Slides:



Advertisements
Similar presentations
SECOND-ORDER DIFFERENTIAL EQUATIONS
Advertisements

ENGR-25_Tutorial_P9-34_Accelerating_Pendulum.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer,
MTH55_Lec-53_Fa08_sec_8-4_Eqns_Quadratic_in_Form.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-14_Sp14_sec_9-2_1st_Linear_ODEs.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-04_Sec_2-1_Fcn_Intro.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
A second order ordinary differential equation has the general form
Ch 3.3: Complex Roots of Characteristic Equation Recall our discussion of the equation where a, b and c are constants. Assuming an exponential soln leads.
Ch 3.4: Repeated Roots; Reduction of Order
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 31 Ordinary Differential Equations.
Ch 3.5: Repeated Roots; Reduction of Order
MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
Differential Equations and Boundary Value Problems
Differential Equations
Module 1 Introduction to Ordinary Differential Equations Mr Peter Bier.
ENGR-25_Lec-23_ODEs_Euler_Numerical.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE.
PART 7 Ordinary Differential Equations ODEs
Boyce/DiPrima 9 th ed, Ch 3.1: 2 nd Order Linear Homogeneous Equations-Constant Coefficients Elementary Differential Equations and Boundary Value Problems,
MTH55_Lec-63_sec_9-4b_Log_Change_Base.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
MTH55_Lec-13_sec_3-3a_3Var_Lin_Sys.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
ENGR-25_Linear_Equations-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Solving ODE.
MTH55_Lec-49_sec_8-2_Derive_Quadratic_Eqn.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
ENGR-43_Lec-04b_2nd_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Registered.
ISAT 412 -Dynamic Control of Energy Systems (Fall 2005)
MTH16_Lec-14_sec_10-1_Infinite_Series.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
ENGR-25_MATLAB_OverView-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Licensed Electrical & Mechanical Engineer
Licensed Electrical & Mechanical Engineer
ENGR-25_Linear_Equations-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Engr/Math/Physics 25 Chp8.
Licensed Electrical & Mechanical Engineer
MTH16_Lec-14_Sp14_sec_9-2_1st_Linear_ODEs.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
Fin500J Topic 6Fall 2010 Olin Business School 1 Fin500J: Mathematical Foundations in Finance Topic 6: Ordinary Differential Equations Philip H. Dybvig.
ENGR-25_Prob_10-25_Catenary_Solution.ppt.ppt 1 Bruce Mayer, PE ENGR/MTH/PHYS25: Computational Methods Bruce Mayer, PE Registered.
MTH55_Lec-10_sec_3-1_2Var_LinSys_ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
MTH55_Lec-46_sec_7-6b_2Var_Radical_Eqns.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
ENGR-25_MATLAB_OverView-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_EXCEL_Integration_Tutorial-Example.pptx 1 Bruce Mayer, PE ENGR/MTH/PHYS25: Computational Methods Bruce Mayer, PE Registered.
ENGR-25_Lec-22_ODE_MATLAB.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-65_Fa08_sec_9-5b_Logarithmic_Eqns.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
ENGR-43_Lec-04b_2nd_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Registered.
MTH55_Lec-26_sec_5-7_PolyNom_Eqns-n-Apps.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-14_sec_9-4_ODE_SlopeFields_Euler.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-55_sec_8-5b_Rational_InEqual.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
MTH55_Lec-17_sec_4-3a_Absolute_Value.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer,
Ch 3.4: Complex Roots of Characteristic Equation Recall our discussion of the equation where a, b and c are constants. Assuming an exponential soln leads.
Only One Word for Review Review Engineering Differential Equations The Second Test.
MTH55_Lec-45_7-6a_Radical_Equations.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
Math 3120 Differential Equations with Boundary Value Problems
MTH55_Lec-48_sec_8-1a_SqRt_Property.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
MTH55_Lec-54_sec_8-5a_PolyNom_InEqual.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
Ch 1.1: Basic Mathematical Models; Direction Fields Differential equations are equations containing derivatives. The following are examples of physical.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical Calculus and Differential Equations.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
ENGR-43_Lec-04a_1st_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Licensed Electrical.
Differential Equations
ENGR-43_Lec-04b_2nd_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Registered.
1 Week 3 First-order ordinary differential equations (ODE) 1.Basic definitions 2.Separable ODEs 3.ODEs reducible to separable form 4.Linear first-order.
ENGR-25_Linear_Regression_Tutorial.ppt 1 Bruce Mayer, PE Engineering-25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer.
Licensed Electrical & Mechanical Engineer
Licensed Electrical & Mechanical Engineer
A second order ordinary differential equation has the general form
Licensed Electrical & Mechanical Engineer
Class Notes 18: Numerical Methods (1/2)
Licensed Electrical & Mechanical Engineer
Registered Electrical & Mechanical Engineer
Prob 9-28 Solution Tutorial
Presentation transcript:

ENGR-25_Lec-21_Integ_Diff.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Chp9: ODE’s Numerical Solns

ENGR-25_Lec-21_Integ_Diff.ppt 2 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals  List Characteristics of Linear, MultiOrder, NonHomgeneous Ordinary Differential Equations (ODEs)  Solve ANALYTICALLLY, Linear, 2 nd Order, NonHomogeneous, Constant Coefficient ODEs  Use MATLAB to determine Numerical Solutions to Ordinary Differential Equations (ODEs)

ENGR-25_Lec-21_Integ_Diff.ppt 3 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Differential Equations  Ordinary Diff Eqn  Partial Diff Eqn  PDE’s Not Covered in ENGR25 Discussed in More Detail in ENGR45  Examining the ODE, Note that it: is LINEAR → y, dy/dt, d 2 y/dt 2 all raised to Power of 1 2 nd ORDER → Highest Derivative is 2 is NONhomogenous → RHS  0; –i.e., y(t) has a FORCING Fcn f(t) has CONSTANT Coefficients

ENGR-25_Lec-21_Integ_Diff.ppt 4 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Numerical ODE Solution  Today we’ll do some MTH25  We’ll “look under the hood” of NUMERICAL Solutions to ODE’s  The BASIC Game- Plan for even Sophisticated Solvers: Given a STARTING POINT, y(0) Use ODE to find dy/dt at t=0 ESTIMATE y 1 as

ENGR-25_Lec-21_Integ_Diff.ppt 5 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Numerical Solution - 1  Notation  Exact Numerical Method (impossible to achieve) by Forward Steps  Now Consider y n+1 tntn ynyn t n+1 t tt

ENGR-25_Lec-21_Integ_Diff.ppt 6 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Numerical Solution - 2  The diagram at Left shows that the relationship between y n, y n+1 and the CHORD slope y n+1 tntn ynyn t n+1 t tt  The problem with this formula is we canNOT calculate the chord slope exactly We Know Only Δt & y n, but NOT the NEXT Step y n+1 The Analyst Chooses Δt Chord Slope Tangent Slope

ENGR-25_Lec-21_Integ_Diff.ppt 7 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Numerical Solution -3  However, we can calculate the TANGENT slope at any point FROM the differential equation itself  The Basic Concept for all numerical methods for solving ODE’s is to use the TANGENT slope, available from the R.H.S. of the ODE, to approximate the chord slope  Recognize dy/dt as the Tangent Slope

ENGR-25_Lec-21_Integ_Diff.ppt 8 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Euler Method – 1 st Order  Solve 1 st Order ODE with I.C.  ReArranging  Use: [Chord Slope]  [Tangent Slope at start of time step]  Then Start the “Forward March” with Initial Conditions

ENGR-25_Lec-21_Integ_Diff.ppt 9 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Euler Example  Consider 1 st Order ODE with I.C.  Use The Euler Forward-Step Reln  See Next Slide for the 1 st Nine Steps For Δt = 0.1  But from ODE  So In This Example:

ENGR-25_Lec-21_Integ_Diff.ppt 10 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Euler Exmpl Calc ntntn ynyn f n = – y n +1 y n+1 = y n +  t f n Plot Slope

ENGR-25_Lec-21_Integ_Diff.ppt 11 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Euler vs Analytical  The Analytical Solution

ENGR-25_Lec-21_Integ_Diff.ppt 12 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Analytical Soln  Let u = −y+1  Then  Sub for y & dy in ODE  Separate Variables  Integrate Both Sides  Recognize LHS as Natural Log  Raise “e” to the power of both sides

ENGR-25_Lec-21_Integ_Diff.ppt 13 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Analytical Soln  And  Thus Soln u(t)  Sub u = 1−y  Now use IC  The Analytical Soln

ENGR-25_Lec-21_Integ_Diff.ppt 14 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Predictor-Corrector - 1  Again Solve 1 st Order ODE with I.C.  Mathematically  This Time Let: Chord slope  average of tangent slopes at start and END of time step  BUT, we do NOT know y n+1 and it appears on the RHS... Avg of the Tangent Slopes at (t n,y n ) & (t n+1,y n+1 )

ENGR-25_Lec-21_Integ_Diff.ppt 15 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Predictor-Corrector - 2  Use Two Steps to estimate y n+1  First → PREDICT*  Use y* in the Avg Calc  Then Correct  Then Start the “Forward March” with the Initial Conditions

ENGR-25_Lec-21_Integ_Diff.ppt 16 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Predictor-Corrector Example  Solve ODE with IC  The Corrector step  The next Step Eqn for dy/dt = f(t,y)= –y+1  Numerical Results on Next Slide

ENGR-25_Lec-21_Integ_Diff.ppt 17 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Predictor-Corrector Example n Slope

ENGR-25_Lec-21_Integ_Diff.ppt 18 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Predictor-Corrector  Greatly Improved Accuracy

ENGR-25_Lec-21_Integ_Diff.ppt 19 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods ODE Example:  Euler Solution with ∆t = 0.25  The Solution Table

ENGR-25_Lec-21_Integ_Diff.ppt 20 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Compare Euler vs. ODE45 Euler SolutionODE45 Solution Euler is Much LESS accurate

ENGR-25_Lec-21_Integ_Diff.ppt 21 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Compare Again with ∆t = Euler SolutionODE45 Solution Smaller ∆T greatly improves Result

ENGR-25_Lec-21_Integ_Diff.ppt 22 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods MatLAB Code for Euler % Bruce Mayer, PE % ENGR25 * 04Jan11 % file = Euler_ODE_Numerical_Example_1201.m % y0= 37; delt = 0.25; t= [0:delt:10]; n = length(t); yp(1) = y0; % vector/array indices MUST start at 1 tp(1) = 0; for k = 1:(n-1) % fence-post adjustment to start at 0 dydt = 3.9*cos(4.2*yp(k))^2-log(5.1*tp(k)+6); dydtp(k) = dydt % keep track of tangent slope tp(k+1) = tp(k) + delt; dely = delt*dydt delyp(k) = dely yp(k+1) = yp(k) + dely; end plot(tp,yp, 'LineWidth', 3), grid, xlabel('t'),ylabel('y(t) by Euler'),... title('Euler Solution to dy/dt = 3.9cos(4.2y)-ln(5.1t+6)')

ENGR-25_Lec-21_Integ_Diff.ppt 23 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods MatLAB Command Window for ODE45 >> dydtfcn 3.9*(cos(4.2*yf))^2-log(5.1*tf+6); >> [T,Y] = ode45(dydtfcn,[0 10],[37]); >> plot(T,Y, 'LineWidth', 3), grid, xlabel('T by ODE45'), ylabel('Y by ODE45')

ENGR-25_Lec-21_Integ_Diff.ppt 24 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods All Done for Today Carl Runge Carl David Tolmé Runge Born: 1856 in Bremen, Germany Died: 1927 in Göttingen, Germany

ENGR-25_Lec-21_Integ_Diff.ppt 25 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Appendix

ENGR-25_Lec-21_Integ_Diff.ppt 26 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 2 nd Order ODE SUMMARY-1  If NonHomogeneous Then find ANY Particular Solution  Next HOMOGENIZE the ODE  The Soln to the Homog. Eqn Produces the Complementary Solution, y c  Assume y c take this form

ENGR-25_Lec-21_Integ_Diff.ppt 27 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 2 nd Order ODE SUMMARY-2  Subbing yc = Ae s t into the Homog. Eqn yields the Characteristic Eqn  Find the TWO roots that satisfy the Char Eqn by Quadratic Formula  Check FORM of Roots  If s 1 & s 2 → REAL & UNequal Decaying Contant(s)

ENGR-25_Lec-21_Integ_Diff.ppt 28 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 2 nd Order ODE SUMMARY-3  If s 1 & s 2 → REAL & Equal, then s 1 = s 2 =s Decaying Line  If s 1 & s 2 → Complex Conjugates then Decaying Sinusoid  Add Particlular & Complementary Solutions to yield the Complete Solution

ENGR-25_Lec-21_Integ_Diff.ppt 29 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 2 nd Order ODE SUMMARY-4  To Find Constant Sets: (G 1, G 2 ), (m, b), (B 1, B 2 ) Take for COMPLETE solution  Find Number-Values for the constants to complete the solution process Yields 2 eqns in 2 for the 2 Unknown Constants

ENGR-25_Lec-21_Integ_Diff.ppt 30 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Finite Difference Methods - 1  Another way of thinking about numerical methods is in terms of finite differences.  Use the Approximation  And From the Differential Eqn  From these two equations obtain:  Recognize as the Euler Method

ENGR-25_Lec-21_Integ_Diff.ppt 31 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Finite Difference Methods - 2  Could make More Accurate by Approximating dy/dt at the Half-Step as the average of the end pts  Recognize as the Predictor-Corrector Method  Then Again Use the ODE to Obtain