Ordinary differential equaltions:

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Example Project and Numerical Integration Computational Neuroscience 03 Lecture 11.
Formal Computational Skills
Chapter 6 Differential Equations
TNPL JoongJin-Cho Runge-kutta’s method of order 4.
Numeriska beräkningar i Naturvetenskap och Teknik 1. Numerical differentiation and quadrature Discrete differentiation and integration Trapezoidal and.
Ordinary Differential Equations
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 32 Ordinary Differential Equations.
Differential Equations and Boundary Value Problems
Numerical Solutions to ODEs Nancy Griffeth January 14, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Solving ODE.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Most physically significant large-scale atmospheric circulations have time scales on the order of Rossby waves but much larger than the time scales.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Computer Animation Algorithms and Techniques
Workshop on Stochastic Differential Equations and Statistical Inference for Markov Processes Day 3: Numerical Methods for Stochastic Differential.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Performance & Stability Analysis.
Numerical Methods for Solving ODEs Euler Method. Ordinary Differential Equations  A differential equation is an equation in which includes derivatives.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
Integration for physically based animation CSE 3541 Matt Boggus.
Numerical Analysis – Differential Equation
Today’s class Ordinary Differential Equations Runge-Kutta Methods
Ordinary Differential Equations
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Solving Ordinary Differential Equations
1 Week 11 Numerical methods for ODEs 1.The basics: finite differences, meshes 2.The Euler method.
Numerical Integration Methods
Numerical Methods for Partial Differential Equations
Part 7 - Chapter 25.
Lecture 4: Numerical Stability
Laplace Transforms Chapter 3 Standard notation in dynamics and control
Integrators of higher order
1.3 Exponential and Sinusoidal Signals
Ordinary Differential Equations
Nodal Methods for Core Neutron Diffusion Calculations
ECE 576 – Power System Dynamics and Stability
Mechanical Engineering at Virginia Tech
525602:Advanced Numerical Methods for ME
Numerical integration for physically based animation
Class Notes 18: Numerical Methods (1/2)
Numerical Solutions of Ordinary Differential Equations
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L4&5.
Class Notes 19: Numerical Methods (2/2)
CSE 245: Computer Aided Circuit Simulation and Verification
Chapter 27.
Part 7 - Chapter 25.
WELCOME TO MY CLASS NUMERICAL METHOD Name : Masduki
Numerical Analysis Lecture 37.
Scientific Computing Lab
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L2.
MATH 175: NUMERICAL ANALYSIS II
Numerical Analysis Lecture 2.
Numerical Integration Methods
Solving the differential equation by Using the Runge-Kutta's
Numerical solution of first-order ordinary differential equations
Need for Numerical Developments within COSMO J
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L6.
Boundary value problems:
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L3 KFUPM.
Ch5 Initial-Value Problems for ODE
Numerical Computation and Optimization
6th Lecture : Numerical Methods
Chapter 2 A Survey of Simple Methods and Tools
EE 616 Computer Aided Analysis of Electronic Networks Lecture 12
CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L7 KFUPM.
Linear boundary value problems:
Numerical solution of first-order ordinary differential equations 1. First order Runge-Kutta method (Euler’s method) Let’s start with the Taylor series.
Modeling and Simulation: Exploring Dynamic System Behaviour
Presentation transcript:

Ordinary differential equaltions: Solutions by finite difference schemes

Ordinary differential equations 1st order ode Taylor expansion of x(t) about time t we thus have an approximation for x(t+dt) in terms of x(t) this is the (explicit) Euler discretization scheme

we can get a better approximation if we take two steps to get from t to t+dt first get an approximation for x(t+dt/2) using the Euler discretization then make the full step using the function evaluated at this midpoint this is the 2nd order Runge-Kutta discretization

Example: Analytic solution: Euler method: So this misses the term as expected Runge-Kutta method: So this misses the term, as expected

#include <stdio.h> #include <stdlib.h> #include <math.h> /* set up the finite-difference parameters */ const int runLength=1000; const double delta_t=0.01; /* set up the function prototypes */ double Euler(double x,double t); double RungeKutta(double x,double t); double function(double x,double t); void printData(double *xEuler,double *xRungeKutta); main() { /* define the arrays to store the data */ double xEuler[runLength]={0.0},xRungeKutta[runLength]={0.0},t=0.0; /* set the initial conditions */ xEuler[0]=1.0; xRungeKutta[0]=1.0; /* evolve the solutions using the two integration methods */ for(int n=0;n<runLength-1;++n){ xEuler[n+1]=Euler(xEuler[n],t); xRungeKutta[n+1]=RungeKutta(xRungeKutta[n],t); t=t+delta_t; } printData(xEuler,xRungeKutta);

general 2nd order ode: write as two first order equations solve using 2nd order Runge-Kutta half step full step

Example: Simple harmonic oscillator Initial conditions: Analytic solution: i.e. Runge-Kutta method:

Choosing an algorithm: accuracy how accurate is the algorithm? how accurate does the answer need to be? efficiency can I use a different, more efficient algorithm? can I implement the current algorithm more efficiently? stability is the algorithm stable? Can I avoid instabilities?

Numerical stability: numerical methods approximate continuous differential equations by discrete difference equations the difference equations may exhibit instabilities even if the continuous differential equations don’t two possible reasons are: time-step problems competing solutions

Time-step problems: e.g. has the analytic solution which is a decaying exponential The Euler approximation has Which we can analyze by changing dt good solution ------------------------- vanishing solution-------------------- decaying oscillations--------------- constant amplitude oscillations--- increasing amplitude oscillations-

=1.0)

Competing solutions: e.g. with boundary conditions: has the analytic solution which is a decaying exponential: However, the general solution is there are small errors in any finite difference scheme these errors have the effect of introducing some of the growing mode solution. This leads to a numerical solution which grows, rather than decays.