Ordinary Differential Equations. Outline Announcements: –Homework II: Solutions on web –Homework III: due Wed. by 5, by e-mail Homework II Differential.

Slides:



Advertisements
Similar presentations
Lecture on Numerical Analysis Dr.-Ing. Michael Dumbser
Advertisements

Numerical Computation Lecture 4: Root Finding Methods - II United International College.
Intro to modeling April Part of the course: Introduction to biological modeling 1.Intro to modeling 2.Intro to biological modeling (Floor) 3.Modeling.
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Response to a Sinusoidal Input Frequency Analysis of an RC Circuit.
Dynamics of a four-bar linkage
Differential Equations Math Review with Matlab: Finding Solutions to Differential Equations S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department.
CS&E 1111 ExIFs IFs and Nested IFs in Excel Objectives: Using the If function in spreadsheets Nesting If functions.
More Flow Control Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Ordinary Differential Equations
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
Ordinary Differential Equations. Outline Announcements: –Homework II: Solutions on web –Homework III: due Wed. by 5, by Structs Differential Equations.
Linear Systems What is the Matrix?. Outline Announcements: –Homework III: due Wed. by 5, by Office Hours: Today & tomorrow, 11-1 –Ideas for Friday?
Constrained Fitting Calculation the rate constants for a consecutive reaction with known spectrum of the reactant A = (A A + A B + A C ) + R = C E T =
Initial-Value Problems
Ordinary Differential Equations. Outline Announcements: –Homework II: Solutions on web –Homework III: due Wed. by 5, by Homework II Differential.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
CISE301_Topic8L31 SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2,
Ordinary Differential Equations (ODEs)
CISE301_Topic8L1KFUPM1 CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Numerical Solution of Ordinary Differential Equation
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 10. Ordinary differential equations. Initial value problems.
Fin500J Topic 7Fall 2010 Olin Business School 1 Fin500J Mathematical Foundations in Finance Topic 7: Numerical Methods for Solving Ordinary Differential.
1 Chapter 6 Numerical Methods for Ordinary Differential Equations.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Section 8.1 – Systems of Linear Equations
Section 6.1: Euler’s Method. Local Linearity and Differential Equations Slope at (2,0): Tangent line at (2,0): Not a good approximation. Consider smaller.
Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Autumn 2008 EEE8013 Revision lecture 1 Ordinary Differential Equations.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Analytical vs. Numerical Minimization Each experimental data point, l, has an error, ε l, associated with it ‣ Difference between the experimentally measured.
Rules of differentiation REVIEW:. The Chain Rule.
Hydroinformatics: Session4 Dr Ivan Stoianov Room 328B Dr Andrew Ireson (Room 304) Mr Juan Rodriguez-Sanchez (411A) Mr Baback.
Computational Methods for Design Lecture 4 – Introduction to Sensitivities John A. Burns C enter for O ptimal D esign A nd C ontrol I nterdisciplinary.
Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.
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.
Hank Childs, University of Oregon Lecture #6 CIS 410/510: Advection (Part 1)
Beginning Programming for Engineers
Ordinary Differential Equations (ODEs) 1Michael Sokolov / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Michael Sokolov ETH Zurich, Institut.
Linear Systems What is the Matrix?. Outline Announcements: –Homework III: due Today. by 5, by –Ideas for Friday? Linear Systems Basics Matlab and.
Numerical Analysis – Differential Equation
Chapter 10 ordinary differential equations (ODEs) Chapter 11 systems of ODEs (6 th edition)
Introduction to the Runge-Kutta algorithm for approximating derivatives PHYS 361 Spring, 2011.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Lecture 6: Time Response 1.Time response determination Review of differential equation approach Introduce transfer function approach 2.MATLAB commands.
Announcements Read Chapters 11 and 12 (sections 12.1 to 12.3)
Intro to Simulink April 15, Copyright , Andy Packard. This work is licensed under the Creative Commons.
Please remember: When you me, do it to Please type “numerical-15” at the beginning of the subject line Do not reply to my gmail,
Part 6 Chapter 21 Adaptive Methods and Stiff Systems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
ME451 Kinematics and Dynamics of Machine Systems Numerical Integration. Stiffness: Implicit Methods. October 30, 2013 Radu Serban University of Wisconsin-Madison.
Dr. Mujahed AlDhaifallah ( Term 342)
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Linear Constant-Coefficient Difference Equations
Ordinary Differential Equations
Sec 21: Generalizations of the Euler Method Consider a differential equation n = 10 estimate x = 0.5 n = 10 estimate x =50 Initial Value Problem Euler.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
Notes 3.4 – SOLVING MULTI-STEP INEQUALITIES
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
CISE301_Topic8L71 CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2,
Differential Equations
SLOPE FIELDS & EULER’S METHOD
SLOPE FIELDS & EULER’S METHOD
Differential Equations
Ordinary differentiall equations
Coordinate Transformation in 3D Final Project Presentation
1.8 Matrices.
1.8 Matrices.
Presentation transcript:

Ordinary Differential Equations

Outline Announcements: –Homework II: Solutions on web –Homework III: due Wed. by 5, by Homework II Differential Equations Numerical solution of ODE’s Matlab’s ODE solvers

Homework II Good job Something I learned: –logical addressing I=some logical test of A A(logical(I)) are elements in A where true mean(data(data~=-999)) nargin Final FourierStuff

nargin Matlab functions can be polymorphic--the same function can be called with different numbers and types of arguments –Example: plot(y), plot(x,y), plot(x,y,’rp’); In a function, nargin and nargout are the number of inputs provided and outputs requested by the caller. Even more flexibility using vargin and vargout

nargin Simplest application of nargin is to override default parameters function [x,y]=ll2xy(lat,lon,ref,R) if(nargin<3) R= *1000; ref=[ , ]; %default ref is Boston elseif(nargin==4) if(length(ref)~=2)%ref must be R R=ref; ref=[ , ]; %default ref is Boston else R= *1000; end

The Final (Fourier) Analysis Use myfft to get spectrum (a & b) myfft.m FourierMat.m t,temp a,b,f a,b,f,t x (temp)

Fourier Analysis Spectrum tells you about time series –dominant frequencies –underlying statistical processes Could use FourierMat to filter data >>alp=a;blp=b; >>alp(13:end)=0;blp(13:end)=0; >>xlp=FourierMat(alp,blp,f,t);

Differential Equations Ordinary differential equations (ODE’s) arise in almost every field ODE’s describe a function y in terms of its derivatives The goal is to solve for y

Example: Logistic Growth Similar to swan problem on PS3 N(t) is the function we want (number of animals)

Numerical Solution to ODEs In general, only simple (linear) ODEs can be solved analytically Most interesting ODEs are nonlinear, must solve numerically The idea is to approximate the derivatives by subtraction

Euler Method

Simplest ODE scheme, but not very good “1st order, explicit, multi-step solver” General multi-step solvers: (weighted mean of f evaluated at lots of t’s)

Runge-Kutta Methods Multi-step solvers--each N is computed from N at several times –can store previous N’s, so only one evaluation of f/iteration Runge-Kutta Methods: multiple evaluations of f/iteration:

Matlab’s ODE solvers Matlab has several ODE solvers: –ode23 and ode45 are “standard” RK solvers –ode15s and ode23s are specialized for “stiff” problems –several others, check help ode23 or book

All solvers use the same syntax: t, N0, {options, params …}) odefile is the name of a function that implements f –function f=odefile(t, N, {params}), f is a column vector –t is either [start time, end time] or a vector of times where you want N –N0= initial conditions –options control how solver works (defaults or okay) –params= parameters to be passed to odefile Matlab’s ODE solvers

Example: Lorenz equations Simplified model of convection cells In this case, N is a vector =[x,y,z] and f must return a vector =[x’,y’,z’]