Rezolvarea ecuaţiilor şi sistemelor de ecuaţii diferenţiale ordinare (II)

Similar documents
S#ff ODEs and Systems of ODEs

Modeling & Simulation 2018 Lecture 12. Simulations

Syntax. Arguments. Solve m oderately stifo DEsand DAEs;trapezoidalrule. 1 of :34

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Fourth Order RK-Method

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

Differential Equations (Mathematics) Evaluate the numerical solution using output of ODE solvers.

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Scientific Computing: An Introductory Survey

HIGHER ORDER METHODS. There are two principal means to derive higher order methods. b j f(x n j,y n j )

MATH 350: Introduction to Computational Mathematics

CS520: numerical ODEs (Ch.2)

Remark on the Sensitivity of Simulated Solutions of the Nonlinear Dynamical System to the Used Numerical Method

Solving ODEs and PDEs in MATLAB. Sören Boettcher

Solving PDEs with PGI CUDA Fortran Part 4: Initial value problems for ordinary differential equations

Ordinary differential equations - Initial value problems

COMPARATIVE DISCUSSION ABOUT THE DETERMINING METHODS OF THE STRESSES IN PLANE SLABS

8.1 Introduction. Consider the initial value problem (IVP):

Applied Numerical Analysis

NUMERICAL SOLUTION OF ODE IVPs. Overview

Math 128A Spring 2003 Week 11 Solutions Burden & Faires 5.6: 1b, 3b, 7, 9, 12 Burden & Faires 5.7: 1b, 3b, 5 Burden & Faires 5.

MTH 452/552 Homework 3

CHAPTER 5: Linear Multistep Methods

Solving Ordinary Differential equations

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

ON THE QUATERNARY QUADRATIC DIOPHANTINE EQUATIONS (II) NICOLAE BRATU 1 ADINA CRETAN 2

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

9.6 Predictor-Corrector Methods

Research Article Diagonally Implicit Block Backward Differentiation Formulas for Solving Ordinary Differential Equations

16.7 Multistep, Multivalue, and Predictor-Corrector Methods

Modelling the Steady State Characteristic of ph Neutralization Process: a Neuro-Fuzzy Approach

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

Part IB Numerical Analysis

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by

Numerical Methods for Differential Equations

Teorema Reziduurilor şi Bucuria Integralelor Reale Prezentare de Alexandru Negrescu

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 2. Predictor-Corrector Methods

Applied Math for Engineers

Ecuatii si inecuatii de gradul al doilea si reductibile la gradul al doilea. Ecuatii de gradul al doilea

Numerical Differential Equations: IVP

Numerical Methods for Differential Equations

Southern Methodist University.

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

Ordinary Differential Equations II

The Chemical Kinetics Time Step a detailed lecture. Andrew Conley ACOM Division

Initial value problems for ordinary differential equations

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

QUASI-ANALYTIC SOLUTIONS OF FIRST-ORDER PARTIAL DIFFERENTIAL EQUATIONS USING THE ACCURATE ELEMENT METHOD

A New Block Method and Their Application to Numerical Solution of Ordinary Differential Equations

Numerical Methods. Scientists. Engineers

Solving Ordinary Differential Equations

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

10.34: Numerical Methods Applied to Chemical Engineering. Lecture 19: Differential Algebraic Equations

U.P.B. Sci. Bull., Series A, Vol.73, Iss. 4, 2011 ISSN

1 Ordinary Differential Equations

Differential Equations

Ordinary Differential Equations II

Numerical Methods for the Solution of Differential Equations

Sisteme cu logica fuzzy

4.4 Computing π, ln 2 and e

Gradul de comutativitate al grupurilor finite 1

Astrodynamics (AERO0024)

Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers

16.7 Multistep, Multivalue, and Predictor-Corrector Methods

multistep methods Last modified: November 28, 2017 Recall that we are interested in the numerical solution of the initial value problem (IVP):

M-RICh v0.5 MATLAB Rate Integrator for Chemical equations

Advanced methods for ODEs and DAEs. Lecture 9: Multistep methods/ Differential algebraic equations

COSC 3361 Numerical Analysis I Ordinary Differential Equations (II) - Multistep methods

2 Numerical Methods for Initial Value Problems

Initial value problems for ordinary differential equations

Linear Multistep Methods I: Adams and BDF Methods

Review for Exam 2 Ben Wang and Mark Styczynski

CHAPTER 10: Numerical Methods for DAEs

Numerical Methods - Initial Value Problems for ODEs

Exponential Integrators

Differential Equations


Numerical Integration of Equations of Motion

5.6 Multistep Methods

The Milne error estimator for stiff problems

The family of Runge Kutta methods with two intermediate evaluations is defined by

Habilitation Thesis. Periodic solutions of differential systems: existence, stability and bifurcations

THE MATLAB ODE SUITE

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take

The Initial Value Problem for Ordinary Differential Equations

Numerical solution of ODEs

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations

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

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Chapter 9 Implicit Methods for Linear and Nonlinear Systems of ODEs

NUMERICAL ANALYSIS SYLLABUS MATHEMATICS PAPER IV (A)

Time stepping methods

Soluţii juniori., unde 1, 2

Transcription:

Rezolvarea ecuaţiilor şi sistemelor de ecuaţii diferenţiale ordinare (II) Metode multipas Prof.dr.ing. Universitatea "Politehnica" Bucureşti, Facultatea de Inginerie Electrică Suport didactic pentru disciplina Metode numerice, 2016-2017 1/30

Cuprins Introducere 1 Introducere Unipas vs. multipas Formule de integrare numerica Newton-Cotes 2 Metode Milne explicite Metode Adams-Bashforth 3 Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) 4 COMSOL Matlab 2/30

Unipas vs. multipas Unipas vs. multipas Formule de integrare numerica Newton-Cotes dx dt = f(x, t) x(t B ) x(t A ) = tb t A f(x, t) dt tb x(t B ) = x(t A )+ f(x, t) dt t A Soluţia se va calcula numeric în punctele discrete t 0 = t0, t 1,...,t n = T Unipas t A = t j t A = t j+1 Multipas t A = t j t A = t j+m tj+1 x(t j+1 ) = x(t j )+ f(x, t) dt t j tj+m x(t j+m ) = x(t j )+ f(x, t) dt t j x j+1 = x j + I I tj+1 f(x, t) dt x j+m = x j + I I tj+m f(x, t) dt t j t j j = 0, n 1, x 0 este cunoscut; j = 0, n m, x 0 este cunoscut; 3/30

Unipas vs. multipas Unipas vs. multipas Formule de integrare numerica Newton-Cotes Metode unipas - folosesc informaţii din intervalul [t j, t j+1 ] Metode θ x j + x j+1 = h [ θf(x j, t j )+(1 θ)f(x j+1, t j+1 ) ] Dacă θ = 1 - metoda este explicită (Euler explicit) Dacă θ 1 - metoda este implicită (θ = 0 - Euler implicit, θ = 1/2 - trapeze); necesită în general rezolvarea unei ecuaţii algebrice neliniare la fiecare pas de integrare. Metode Runge-Kutta 4/30

Unipas vs. multipas Unipas vs. multipas Formule de integrare numerica Newton-Cotes Metode unipas - folosesc informaţii din intervalul [t j, t j+1 ] Metode θ x j + x j+1 = h [ θf(x j, t j )+(1 θ)f(x j+1, t j+1 ) ] Metode Runge-Kutta x j + x j+1 = I unde I t j+1 t j f(x, t) dt I = h ν b i f(x(t j + c i h), t j + c i h) i=1 unde x(t j + c i h) nu sunt cunoscute şi sunt aproximate cu formule liniare ale unor valori calculate succesiv. 5/30

Unipas vs. multipas Unipas vs. multipas Formule de integrare numerica Newton-Cotes Metode unipas - folosesc informaţii din intervalul [t j, t j+1 ] Metode θ x j + x j+1 = h [ θf(x j, t j )+(1 θ)f(x j+1, t j+1 ) ] Metode Runge-Kutta - explicite x j+1 = x j + hφ, j = 0,...,n 1 (1) ν Φ = b i K i (2) i=1 K 1 = f(x j, t j ) (3) K i i 1 = f(x j + h a ip K p, t j + c i h) i = 2,...,ν (4) p=1 6/30

Unipas vs. multipas Unipas vs. multipas Formule de integrare numerica Newton-Cotes Metode unipas - folosesc informaţii din intervalul [t j, t j+1 ] Metode θ x j + x j+1 = h [ θf(x j, t j )+(1 θ)f(x j+1, t j+1 ) ] Metode Runge-Kutta - implicite x j+1 = x j + hφ, j = 0,...,n 1 (5) ν Φ = b i K i (6) i=1 K 1 = f(x j, t j ) (7) ν = f(x j + h a ip K p, t j + c i h) i = 2,...,ν (8) K i p=1 7/30

Unipas vs. multipas Unipas vs. multipas Formule de integrare numerica Newton-Cotes Metode multipas - folosesc informaţii din intervalul [t j, t j+m ] Metode liniare multipas 1 Calculul unui pas nou x j+m se face folosind relaţia a 0 x j +a 1 x j+1 + a m x j+m = h[b 0 f(x j, t j )+b 1 f(x j+1, t j+1 )+ b m f(x j+m, t j+m )] a i şi b i sunt aleşi convenabil (convergenţă); a m = 1; dacă b m = 0 metoda este explicită; dacă b m 0 metoda este implicită; cazul m = 1, a 0 = 1 (din motive de convergenţă), b 0 = θ, b 1 = 1 θ metode unipas de tip θ. 1 Există şi metode neliniare multipas. 8/30

Unipas vs. multipas Formule de integrare numerica Newton-Cotes Formule de integrare numerică Newton-Cotes Algoritmii multipas pentru rezolvarea ODE se bazează pe formulele de cuadratură Newton-Cotes (formule de integrare numerică scrise pentru reţele de discretizare uniformă). 1 Formule NC "închise" - folosesc inclusiv valorile în capete. Se folosesc în calculul integralelor definite şi în rezolvarea ODE cu metodele multipas implicite. 2 Formule NC "deschise" - nu folosesc valorile în capete. Se folosesc în rezolvare ODE cu metodele multipas explicite. 9/30

Formule Newton-Cotes închise Unipas vs. multipas Formule de integrare numerica Newton-Cotes Grid uniform x 0, x 1,...,x n, pas h f i = f(x i ) Formulele conţin f 0 şi f n. n (gradul Pasul Numele uzual Formula Eroarea polinomului) h al formulei locală 1 x 1 x 0 trapezului h 2 (f 0 + f 1 ) O(h 3 ) 2 x 1 x 0 = x 2 x 0 2 Simpson 1/3 h 3 (f 0 + 4f 1 + f 2 ) O(h 5 ) 3 x 1 x 0 = x 3 x 0 3 Simpson 3/8 3h 8 (f 0 + 3f 1 + 3f 2 + f 3 ) O(h 5 ) 10/30

Formule Newton-Cotes deschise Unipas vs. multipas Formule de integrare numerica Newton-Cotes Grid uniform x 0, x 1,...,x n, pas h f i = f(x i ) Formulele nu conţin f 0 şi f n. Gradul Pasul Numele uzual Formula Eroarea polinomului h al formulei locală 0 x 1 x 0 = x 2 x 0 2 1 x 1 x 0 = x 3 x 0 3 regula dreptunghiului 2hf 1 O(h 3 ) sau punctului din mijloc trapezului 3h 2 (f 1 + f 2 ) O(h 3 ) 2 x 1 x 0 = x 4 x 0 4 regula lui Milne 4h 3 (2f 1 f 2 + 2f 3 ) O(h 5 ) 11/30

Metode Milne explicite Metode Milne explicite Metode Adams-Bashforth x j+m = x j + I I tj+m t j f(x, t) dt j = 0, n m, x 0 este cunoscut; Integrala I se aproximează cu formule Newton-Cotes deschise. m = 2 NC cu 1 punct interioar x j+2 = x j + 2hf(x j+1, t j+1 ) 12/30

Metode Milne explicite Metode Milne explicite Metode Adams-Bashforth x j+m = x j + I I tj+m t j f(x, t) dt j = 0, n m, x 0 este cunoscut; Integrala I se aproximează cu formule Newton-Cotes deschise. m = 3 NC cu 2 puncte interioar x j+3 = x j + 3h 2 (f(x j+1, t j+1 + f(x j+2, t j+2 ) 12/30

Metode Milne explicite Metode Milne explicite Metode Adams-Bashforth x j+m = x j + I I tj+m t j f(x, t) dt j = 0, n m, x 0 este cunoscut; Integrala I se aproximează cu formule Newton-Cotes deschise. m = 4 NC cu 3 puncte interioare x j+4 = x j + 4h 3 (2f(x j+1, t j+1 ) f(x j+2, t j+2 )+2f(x j+3, t j+3 )+O(h 5 ) 12/30

Adams-Bashforth Metode Milne explicite Metode Adams-Bashforth Formula generală a metodelor liniare multipas: a 0 x j + a 1 x j+1 + a mx j+m = h[b 0 f(x j, t j )+b 1 f(x j+1, t j+1 )+ b mf(x j+m, t j+m )] x j+m unde a m = 1 Familia Adams-Bashfort: a m 1 = 1 a i = 0, i < m 1 b m = 0 (metodă explicită) x j+m = x j+m 1 + h[b 0 f(x j, t j )+b 1 f(x j+1, t j+1 )+ b m 1 f(x j+m 1, t j+m 1 )] m 1 x j+m = x j+m 1 + b i f(x j+i, t j+i ) i=0 13/30

Adams-Bashforth Metode Milne explicite Metode Adams-Bashforth Familia Adams-Bashfort: m 1 x j+m = x j+m 1 + b i f(x j+i, t j+i ) i=0 b i se determină astfel încât metoda are ordinul m Metodă, ordin b 0 b 1 b 2 b 3 AB cu 1 pas, ordin 1 1 AB cu 2 paşi, ordin 2 3/2-1/2 AB cu 3 paşi, ordin 3 23/12-16/12 5/12 AB cu 4 paşi, ordin 4 55/24-59/24 37/24-9/24 AB cu un pas este Euler explicit. 14/30

Metode Milne implicite Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) x j+m = x j + I I tj+m t j f(x, t) dt j = 0, n m, x 0 este cunoscut; Integrala I se aproximează cu formule Newton-Cotes închise. Exemplu: m = 2 NC cu 3 puncte x j+2 = x j + h 3 (f(x j, t j + 4f(x j+1, t j+1 + f(x j+2, t j+2 ) Ecuaţie neliniară are nevoie de o estimare iniţială pentru x j+2. Se poate face cu o formulă Milne explicită. Evaluarea primelor puncte se face cu metode unipas. 15/30

Adams-Moulton Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) Formula generală a metodelor liniare multipas: a 0 x j + a 1 x j+1 + a mx j+m = h[b 0 f(x j, t j )+b 1 f(x j+1, t j+1 )+ b mf(x j+m, t j+m )] x j+m unde a m = 1 Familia Adams-Moulton: a m 1 = 1 a i = 0, i < m 1 item b m 0 (metodă implicită) x j+m = x j+m 1 + h[b 0 f(x j, t j )+b 1 f(x j+1, t j+1 )+ b mf(x j+m, t j+m )] x j+m = x j+m 1 + m b i f(x j+i, t j+i ) i=0 16/30

Adams-Moulton Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) Prin eliminarea restricţiei b m = 0 de la AB, metodele devin implicite, şi o metodă cu m paşi poate ajunge la ordinul m+1. Metodă, ordin b 0 b 1 b 2 b 3 AM cu 1 pas, ordin 1 0 1 AM cu 1 pas, ordin 2 1/2 1/2 AM cu 2 paşi, ordin 3 15/12 8/12-1/12 AM cu 3 paşi, ordin 4 9/24 19/24-5/24 1/24 AM cu un pas este Euler implicit (ordinul 1) sau metoda trapezelor (ordinul 2). 17/30

BDF (Gear) Introducere Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) Formula generală a metodelor liniare multipas: a 0 x j + a 1 x j+1 + a mx j+m = h[b 0 f(x j, t j )+b 1 f(x j+1, t j+1 )+ b mf(x j+m, t j+m )] x j+m Dacă b i = 0 i < m şi notând b m = β - metodele se numesc BDF 2 m 1 a i x j+i + x j+m = hβf(x j+m, t j+m ) x j+m i=0 unde h = t i+m t i+m 1 2 Backward Differentiation Formula 18/30

BDF Introducere Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) Coeficienţii undei metode BDF de ordin m se determină pornind de la polinomul Lagrange de ordin m, notat p i,m (t) care trece prin punctele (t i, x i ),...,(t i+m, x i+m ). x (t i+m ) p (t i+m ) şi x (t i+m ) = f(x(t i+m ), t i+m ) 19/30

BDF Introducere Metode Milne implicite Metode Adams-Moulton BDF (metoda lui Gear) Metodă, ordin β a 0 a 1 a 2 a 3 BDF cu 1 pas, ordin 1 1-1 1 BDF cu 2 paşi, ordin 2 2/3 1/3-4/3 1 BDF cu 3 paşi, ordin 3 6/11-2/11 9/11-18/11 1 BDF cu un pas este Euler implicit (ordinul 1). 20/30

COMSOL Matlab COMSOL 21/30

COMSOL Matlab COMSOL 22/30

COMSOL Matlab COMSOL 23/30

COMSOL Matlab Matlab (non-stiff) https://ch.mathworks.com/help/matlab/math/choose-an-ode-solver.html 24/30

COMSOL Matlab Matlab (non-stiff) https://ch.mathworks.com/help/matlab/math/choose-an-ode-solver.html Single-step ode45 is based on an explicit Runge-Kutta (4,5) formula, the Dormand-Prince pair. ode23 is an implementation of an explicit Runge-Kutta (2,3) pair of Bogacki and Shampine. It may be more efficient than ode45 at crude tolerances and in the presence of moderate stiffness. Multi-step ode113 is a variable-step, variable-order Adams-Bashforth-Moulton PECE solver of orders 1 to 13. The highest order used appears to be 12, however, a formula of order 13 is used to form the error estimate and the function does local extrapolation to advance the integration at order 13. It may be more efficient than ode45 at stringent tolerances or if the ODE function is particularly expensive to evaluate. 25/30

COMSOL Matlab Matlab (stiff) https://ch.mathworks.com/help/matlab/math/choose-an-ode-solver.html 26/30

COMSOL Matlab Matlab (stiff) https://ch.mathworks.com/help/matlab/math/choose-an-ode-solver.html Single-step ode23s is based on a modified Rosenbrock formula of order 2. Because it is a single-step solver, it may be more efficient than ode15s at solving problems that permit crude tolerances or problems with solutions that change rapidly. It can solve some kinds of stiff problems for which ode15s is not effective. The ode23s solver evaluates the Jacobian during each step of the integration, so supplying it with the Jacobian matrix is critical to its reliability and efficiency. ode23t is an implementation of the trapezoidal rule using a "free" interpolant. This solver is preferred over ode15s if the problem is only moderately stiff and you need a solution without numerical damping. ode23t also can solve differential algebraic equations (DAEs) Multi-step ode15s, ode23tb 27/30

COMSOL Matlab Matlab (stiff) https://ch.mathworks.com/help/matlab/math/choose-an-ode-solver.html Single-step ode23s, ode23t Multi-step ode15s is a variable-step, variable-order (VSVO) solver based on the numerical differentiation formulas (NDFs) of orders 1 to 5. Optionally, it can use the backward differentiation formulas (BDFs, also known as Gearş method) that are usually less efficient. Like ode113, ode15s is a multistep solver. Use ode15s if ode45 fails or is very inefficient and you suspect that the problem is stiff, or when solving a differential-algebraic equation (DAE). ode23tb is an implementation of TR-BDF2, an implicit Runge-Kutta formula with a trapezoidal rule step as its first stage and a backward differentiation formula of order two as its second stage. By construction, the same iteration matrix is used in evaluating both stages. Like ode23s and ode23t, this solver may be more efficient than ode15s for problems with crude tolerances. 28/30

COMSOL Matlab Matlab (fully-implicit) https://ch.mathworks.com/help/matlab/math/choose-an-ode-solver.html Multi-step ode15i is a variable-step, variable-order (VSVO) solver based on the backward differentiation formulas (BDFs) of orders 1 to 5. ode15i is designed to be used with fully implicit differential equations and index-1 differential algebraic equations (DAEs). The helper function decic computes consistent initial conditions that are suitable to be used with ode15i. 29/30

Referinţe Introducere COMSOL Matlab [Cheney08] W.Cheney, D.Kincaid, Numerical Mathematics and Computing, Brooks/Cole publishing Company,2000. (Capitolele 10 şi 11) Disponibilă la http://www.physics.brocku.ca/courses/5p10/references/cheneykincaid.pdf [Press02] W.H.Press, S.A.Teukolsky, W.T. etterling, B.P. Flannery, Numerical Recipies in C, 2002. (Capitolul 16) Disponibilă la https://www2.units.it/ipl/students_area/imm2/files/numerical_recipes.pdf [Strang&Moler15] Introduction to Differential Equations and the MATLAB ODE Suite - Open Courseware at MIT Disponibil la http://ocw.mit.edu/res-18-009f15 sau https://www.youtube.com/watch?v=zvl88xqysak [Trefethen18] N.Trefethen, Exploring ODEs, SIAM 2018. Disponibil la https://people.maths.ox.ac.uk/trefethen/books.html 30/30