Module1: Numerical Solution of Ordinary Differential Equations. Lecture 6. Higher order Runge Kutta Methods

Size: px
Start display at page:

Download "Module1: Numerical Solution of Ordinary Differential Equations. Lecture 6. Higher order Runge Kutta Methods"

Transcription

1 Module1: Numerical Solution of Ordinary Differential Equations Lecture 6 Higher order Runge Kutta Methods Keywords: higher order methods, functional evaluations, accuracy

2 Higher order Runge Kutta Methods The local error of RK4 is O(h 5 ) while the global error is O(h 4 ). If the solution of IVP is to be obtained for t in the interval (0,1] with h=0.1 using RK4, then the solution is to be computed at 10 grid points t=0.1, 0.2,,1.0. At each grid point four functional evaluations are required. This way, the solution at t=1 requires 40 functional evaluations and the accuracy will be of order If Euler method is to be used then h= will yield the desired accuracy of Accordingly, the solution is to be computed at grid points to reach to t=1.this means Euler method requires10,000 functional evaluations (one for each grid point) to compute approximate solution at t=1. Evidently, RK4 is very efficient and saves lots of computational effort. We can further improve the efficiency by employing still higher order Runge-Kutta methods. The higher order methods, say of order 5 and 6 are developed on the same lines. These are more efficient as the higher accuracy is achieved with less computational effort as compared to lower order methods. Runge-Kutta method ( say of order 4) is applied for obtaining approximate solution y 1 at t=t 1 =t+h for IVP with chosen value of h. The value of h is then halved and the solution is again obtained at t 1. Now 7 functional evaluations are needed to compute y1. If the difference between two solutions is not substantial then the approximation is accepted. Otherwise, the iteration (halving h) is repeated again till the desired accuracy is achieved. Each halving h will require 4+7 functional evaluations. This way higher accuracy can be achieved with more computational effort. In another approach, higher performance with less computational effort is achieved when the Runge-Kutta methods of different orders are used to move from one grid point to the next point. One such method known as Runge-Kutta Fehlberg method is based on the formulae (1.19) given below. In this, two estimates are obtained for y k+1 using RK method of global error O(h 4 ) and O(h 5 ) with six functional evaluations.

3 K f( t, y ) 1 k k h h K2 f( tk, yk K1) 4 4 3h 3h 9h K3 f( tk, yk K1 K2) h 1932h 7200h 7296h K4 f( tk, yk K1 K2 K3) h 3680h 845h K5 f( tk h, yk K1 8hK2 K3 K4) h 8h 3544h 1859h 11h K6 f( tk, yk K1 2hK2 K3 K4 K5) h yˆ k 1 yk [ K1 K3 K4 K5] h y k 1 yk [ K1 K3 K4 K5 K6] Error y ˆ k 1 yk 1 [ K1 K3 K 4 K5 K6] h (1.19) Since the lower order method is of order four, the step size adjustment factor s can be computed as s T i 1 14 / ˆ Here, ε is the accuracy requirement and T is the truncation errort y y i 1 i 1 i 1. If the desired accuracy is not achieved the solution is iterated taking new value of h. Depending upon error requirement the step size h can be increased or decreased. The solution y k+1 of desired accuracy is obtained at t k+1 =t k +sh. The method is known as RKF45. To implement the method, the user specifies the allowable smallest step size h min, largest step size h max and the maximum allowable local truncation error ε. The following algorithm is used to solve IVP using RKF45 formulae with self adjusting variable step sizes:

4 Algorithm RKF45 [Step 1] set k=0, t=a=t 0, y=y k, h=h max, flag=1 [Step 2] while (flag==1) repeat steps 3-7 [Step 3] compute y, yˆ andr yˆ y k 1 k 1 k 1 k 1 [Step 4] compute s [Step 5] if s >h max then h=h max else if (s<h min ) exit else h=s [Step 6] if ( R ) flag=0 [Step 7] go to step 2 [Step 8] t=t+h, y=yk+1, k++; flag=1 [Step 9] if( t<=b) goto step 2 [Step 10] stop Example 1.8: Solve IVP using y 2ty 2, y( 0) Solution: the matlab code for solving the system is given as function dydt= rkf4(t,y) dydt=y.^2.2*t; [t,y]=ode45(@rkf4,[0 1], 1); %[0 1]-time span, 1-initial condition t y Table 1.6 Solution of example 1.8

5 Example 1.9: find the solution of IVP using higher order order Runge-Kutta method RKF45 given in (1.19) in the interval (0,2) taking h max=0.25, hmin=0.01 and accuracy as dy 2 y t 1; y( 0) 0. 5 dt Solution: The detailed solution of the problem is worked out in the excel sheet rkf45.xls h t y k1 k2 k3 k4 k5 Kk6 y Table 1.7 Details of Solution of example 1.9 tk+1 y5 exact tk+1 y5 exact Table 1.8 Comparison with exact Solution of example 1.9

6 Exercise Apply Eulers method to solve the initial value problems in the interval (0,1]: y 2y 3t, y( 0) 2 y 2ty, y( 0) x y, y( 0) y Take h=0.1 and compare with exact solutions. Reduce h=0.05 and again solve the two IVPs. 1.2 Apply modified Euler method to IVPs in Ex. 1.1 with h=0.1. Compare the effort and accuracy achieved in two methods. 1.3 Can Eulers method be applied to solve the following IVP in the interval (0,2) y () t 4 y 2, y( 0) Show that Eulers method and modified Eulers method fail to approximate the solution yt () 3/ 2 8t of the IVP / y () t 6y 13, y( 0) Solve the following IVP using Runge Kutta method of order two and four: y () t t 2 y 2, y() 1 0 at t 2using h=0.5 y () t y sin x, y( 0) 2 at t 1using h=0.1

over The idea is to construct an algorithm to solve the IVP ODE (9.1)

over The idea is to construct an algorithm to solve the IVP ODE (9.1) Runge- Ku(a Methods Review of Heun s Method (Deriva:on from Integra:on) The idea is to construct an algorithm to solve the IVP ODE (9.1) over To obtain the solution point we can use the fundamental theorem

More information

over The idea is to construct an algorithm to solve the IVP ODE (8.1)

over The idea is to construct an algorithm to solve the IVP ODE (8.1) Runge- Ku(a Methods Review of Heun s Method (Deriva:on from Integra:on) The idea is to construct an algorithm to solve the IVP ODE (8.1) over To obtain the solution point we can use the fundamental theorem

More information

Homework Set 5 (Sections )

Homework Set 5 (Sections ) Homework Set 5 (Sections.4-.6) 1. Consider the initial value problem (IVP): = 8xx yy, yy(1) = 3 a. Do 10 steps of Euler s Method, using a step size of 0.1. Write the details in the table below. Work to

More information

ChE 400: Applied Chemical Engineering Calculations Tutorial 6: Numerical Solution of ODE Using Excel and Matlab

ChE 400: Applied Chemical Engineering Calculations Tutorial 6: Numerical Solution of ODE Using Excel and Matlab ChE 400: Applied Chemical Engineering Calculations Tutorial 6: Numerical Solution of ODE Using Excel and Matlab Tutorial 6: Numerical Solution of ODE Gerardine G. Botte This handout contains information

More information

7.1 First-order initial-value problems

7.1 First-order initial-value problems 7.1 First-order initial-value problems A first-order initial-value problem (IVP) is a first-order ordinary differential equation with a specified value: d dt y t y a y f t, y t That is, this says that

More information

LAB #8 Numerical Methods

LAB #8 Numerical Methods LAB #8 Numerical Methods Goal: The purpose of this lab is to explain how computers numerically approximate solutions to differential equations. Required tools: Matlab routine dfield ; numerical routines

More information

Module 2: Single Step Methods Lecture 4: The Euler Method. The Lecture Contains: The Euler Method. Euler's Method (Analytical Interpretations)

Module 2: Single Step Methods Lecture 4: The Euler Method. The Lecture Contains: The Euler Method. Euler's Method (Analytical Interpretations) The Lecture Contains: The Euler Method Euler's Method (Analytical Interpretations) An Analytical Example file:///g /Numerical_solutions/lecture4/4_1.htm[8/26/2011 11:14:40 AM] We shall now describe methods

More information

Jason Yalim. Here we perform a few tasks to ensure a clean working environment for our script.

Jason Yalim. Here we perform a few tasks to ensure a clean working environment for our script. Table of Contents Initialization... 1 Part One -- Computation... 1 Part Two -- Plotting... 5 Part Three -- Plotting Incorrectly... 7 Part Four -- Showing Output Adjacent to Code... 8 Part Five -- Creating

More information

Euler s Methods (a family of Runge- Ku9a methods)

Euler s Methods (a family of Runge- Ku9a methods) Euler s Methods (a family of Runge- Ku9a methods) ODE IVP An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: The equation is coupled with an

More information

Homework 14 solutions

Homework 14 solutions Section 9.1: Ex 1,5,10,15,16 Section 9.: Ex 1,8,9; AP 1-5,9 Section 9.3: AP 1-5 Section 9.1 Homework 14 solutions 1. (a) Show that y( is a solution to the differential equation by substitution. (b) Find

More information

(Part - 1) P. Sam Johnson. April 14, Numerical Solution of. Ordinary Differential Equations. (Part - 1) Sam Johnson. NIT Karnataka.

(Part - 1) P. Sam Johnson. April 14, Numerical Solution of. Ordinary Differential Equations. (Part - 1) Sam Johnson. NIT Karnataka. P. April 14, 2015 1/51 Overview We discuss the following important methods of solving ordinary differential equations of first / second order. Picard s method of successive approximations (Method of successive

More information

Application 7.6A The Runge-Kutta Method for 2-Dimensional Systems

Application 7.6A The Runge-Kutta Method for 2-Dimensional Systems Application 7.6A The Runge-Kutta Method for -Dimensional Systems Figure 7.6. in the text lists TI-85 and BASIC versions of the program RKDIM that implements the Runge-Kutta iteration k (,, ) = f tn xn

More information

ODEs occur quite often in physics and astrophysics: Wave Equation in 1-D stellar structure equations hydrostatic equation in atmospheres orbits

ODEs occur quite often in physics and astrophysics: Wave Equation in 1-D stellar structure equations hydrostatic equation in atmospheres orbits Solving ODEs General Stuff ODEs occur quite often in physics and astrophysics: Wave Equation in 1-D stellar structure equations hydrostatic equation in atmospheres orbits need workhorse solvers to deal

More information

A Study on Numerical Exact Solution of Euler, Improved Euler and Runge - Kutta Method

A Study on Numerical Exact Solution of Euler, Improved Euler and Runge - Kutta Method A Study on Numerical Exact Solution of Euler, Improved Euler and Runge - Kutta Method Mrs. P. Sampoornam P.K.R Arts College for Women, Gobichettipalayam Abstract: In this paper, I will discuss the Runge

More information

Mathematics for chemical engineers

Mathematics for chemical engineers Mathematics for chemical engineers Drahoslava Janovská Department of mathematics Winter semester 2013-2014 Numerical solution of ordinary differential equations Initial value problem Outline 1 Introduction

More information

Finite difference methods

Finite difference methods Finite difference methods Siltanen/Railo/Kaarnioja Spring 8 Applications of matrix computations Applications of matrix computations Finite difference methods Spring 8 / Introduction Finite difference methods

More information

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations)

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) MATLAB sessions: Laboratory 3 1 MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) In this session we look at basic numerical methods to help us understand

More information

Ordinary Differential Equations

Ordinary Differential Equations Next: Partial Differential Equations Up: Numerical Analysis for Chemical Previous: Numerical Differentiation and Integration Subsections Runge-Kutta Methods Euler's Method Improvement of Euler's Method

More information

ODE IVP. An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable:

ODE IVP. An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: Euler s Methods ODE IVP An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: The equation is coupled with an initial value/condition (i.e., value

More information

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations)

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) In this session we look at basic numerical methods to help us understand the fundamentals of numerical approximations.

More information

Approximate Solutions to Differential Equations Slope Fields (graphical) and Euler s Method (numeric) by Dave Slomer

Approximate Solutions to Differential Equations Slope Fields (graphical) and Euler s Method (numeric) by Dave Slomer Approximate Solutions to Differential Equations Slope Fields (graphical) and Euler s Method (numeric) by Dave Slomer Leonhard Euler was a great Swiss mathematician. The base of the natural logarithm function,

More information

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane. Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 2018 16 Lecture 16 May 3, 2018 Numerical solution of systems

More information

Exercises for a Numerical Methods Course

Exercises for a Numerical Methods Course Exercises for a Numerical Methods Course Brian Heinold Department of Mathematics and Computer Science Mount St. Mary s University November 18, 2017 1 / 73 About the class Mix of Math and CS students, mostly

More information

Comparison of Some Evolutionary Algorithms for Approximate Solutions of Optimal Control Problems

Comparison of Some Evolutionary Algorithms for Approximate Solutions of Optimal Control Problems Australian Journal of Basic and Applied Sciences, 4(8): 3366-3382, 21 ISSN 1991-8178 Comparison of Some Evolutionary Algorithms for Approximate Solutions of Optimal Control Problems Akbar H. Borzabadi,

More information

Numerical Solutions of Differential Equations (1)

Numerical Solutions of Differential Equations (1) Numerical Solutions of Differential Equations (1) Euler method Sources of error Truncation Round-off error Error balance in numerical integration Euler Method Many differential equations don't have an

More information

Lecture 22: Rules for Solving IVP

Lecture 22: Rules for Solving IVP cs412: introduction to numerical analysis 12/7/10 Lecture 22: Rules for Solving IVP Instructor: Professor Amos Ron Scribes: Yunpeng Li, Pratap Ramamurthy, Mark Cowlishaw, Nathanael Fillmore 1 Review Recall

More information

Exercises C-Programming

Exercises C-Programming Exercises C-Programming Claude Fuhrer (claude.fuhrer@bfh.ch) 0 November 016 Contents 1 Serie 1 1 Min function.................................. Triangle surface 1............................... 3 Triangle

More information

Ordinary differential equations solving methods

Ordinary differential equations solving methods Radim Hošek, A07237 radhost@students.zcu.cz Ordinary differential equations solving methods Problem: y = y2 (1) y = x y (2) y = sin ( + y 2 ) (3) Where it is possible we try to solve the equations analytically,

More information

Application 2.4 Implementing Euler's Method

Application 2.4 Implementing Euler's Method Application 2.4 Implementing Euler's Method One's understanding of a numerical algorithm is sharpened by considering its implementation in the form of a calculator or computer program. Figure 2.4.13 in

More information

Workpackage 5 - Ordinary Differential Equations

Workpackage 5 - Ordinary Differential Equations Mathematics for I Workpackage 5 - Ordinary Differential Equations Introduction During this laboratory you will be introduced to some of Matlab s facilities for solving ordinary differential equations (ode).

More information

Math/CS 467/667 Combined Programming 2 and Homework 2. The Shu Oscher Method

Math/CS 467/667 Combined Programming 2 and Homework 2. The Shu Oscher Method The Shu Oscher Method Your work should be presented in the form of a typed report using clear and properly punctuated English. Where appropriate include full program listing and output. If you choose to

More information

Post Processing, Visualization, and Sample Output

Post Processing, Visualization, and Sample Output Chapter 7 Post Processing, Visualization, and Sample Output Upon successful execution of an ADCIRC run, a number of output files will be created. Specifically which files are created depends upon how the

More information

=.1( sin(2πx/24) y) y(0) = 70.

=.1( sin(2πx/24) y) y(0) = 70. Differential Equations, Spring 2017 Computer Project 2, Due 11:30 am, Friday, March 10 The goal of this project is to implement the Euler Method and the Improved Euler Method, and to use these methods

More information

MATH2071: LAB 2: Explicit ODE methods

MATH2071: LAB 2: Explicit ODE methods MATH2071: LAB 2: Explicit ODE methods 1 Introduction Introduction Exercise 1 Euler s method review Exercise 2 The Euler Halfstep (RK2) Method Exercise 3 Runge-Kutta Methods Exercise 4 The Midpoint Method

More information

Direction Fields; Euler s Method

Direction Fields; Euler s Method Direction Fields; Euler s Method It frequently happens that we cannot solve first order systems dy (, ) dx = f xy or corresponding initial value problems in terms of formulas. Remarkably, however, this

More information

4 Visualization and. Approximation

4 Visualization and. Approximation 4 Visualization and Approximation b A slope field for the differential equation y tan(x + y) tan(x) tan(y). It is not always possible to write down an explicit formula for the solution to a differential

More information

Math 104: Euler s Method and Applications of ODEs

Math 104: Euler s Method and Applications of ODEs Math 104: Euler s Method and Applications of ODEs Ryan Blair University of Pennsylvania Tuesday January 29, 2013 Ryan Blair (U Penn) Math 104:Euler s Method and Applications of ODEsTuesday January 29,

More information

Math 225 Scientific Computing II Outline of Lectures

Math 225 Scientific Computing II Outline of Lectures Math 225 Scientific Computing II Outline of Lectures Spring Semester 2003 I. Interpolating polynomials Lagrange formulation of interpolating polynomial Uniqueness of interpolating polynomial of degree

More information

POLYMATH Example for the Numerical Solution of ODEs

POLYMATH Example for the Numerical Solution of ODEs for the Numerical Solution of ODEs Differential Equations... 1 POLYMATH 5.0... 2 POLYMATH 6.0... 15 The equations & methods outlined here provide a framework with which one could create programs or spreadsheets

More information

Suppose we want to find approximate values for the solution of the differential equation

Suppose we want to find approximate values for the solution of the differential equation A course in differential equations Chapter 2. Numerical methods of solution We shall discuss the simple numerical method suggested in the last chapter, and explain several more sophisticated ones. We shall

More information

The listing says y(1) = How did the computer know this?

The listing says y(1) = How did the computer know this? 18.03 Class 2, Feb 3, 2010 Numerical Methods [1] How do you know the value of e? [2] Euler's method [3] Sources of error [4] Higher order methods [1] The study of differential equations has three parts:.

More information

Discontinuous Galerkin Sparse Grid method for Maxwell s equations

Discontinuous Galerkin Sparse Grid method for Maxwell s equations Discontinuous Galerkin Sparse Grid method for Maxwell s equations Student: Tianyang Wang Mentor: Dr. Lin Mu, Dr. David L.Green, Dr. Ed D Azevedo, Dr. Kwai Wong Motivation u We consider the Maxwell s equations,

More information

Math Homework 3

Math Homework 3 Math 0 - Homework 3 Due: Friday Feb. in class. Write on your paper the lab section you have registered for.. Staple the sheets together.. Solve exercise 8. of the textbook : Consider the following data:

More information

Part I: Theoretical Background and Integration-Based Methods

Part I: Theoretical Background and Integration-Based Methods Large Vector Field Visualization: Theory and Practice Part I: Theoretical Background and Integration-Based Methods Christoph Garth Overview Foundations Time-Varying Vector Fields Numerical Integration

More information

Mathematical Methods and Modeling Laboratory class. Numerical Integration of Ordinary Differential Equations

Mathematical Methods and Modeling Laboratory class. Numerical Integration of Ordinary Differential Equations Mathematical Methods and Modeling Laboratory class Numerical Integration of Ordinary Differential Equations Exact Solutions of ODEs Cauchy s Initial Value Problem in normal form: Recall: if f is locally

More information

Homework Set #2-3, Math 475B

Homework Set #2-3, Math 475B Homework Set #2-3, Math 475B Part I: Matlab In the last semester you learned a number of essential features of MATLAB. 1. In this instance, you will learn to make 3D plots and contour plots of z = f(x,

More information

An Introduction to Flow Visualization (1) Christoph Garth

An Introduction to Flow Visualization (1) Christoph Garth An Introduction to Flow Visualization (1) Christoph Garth cgarth@ucdavis.edu Motivation What will I be talking about? Classical: Physical experiments to understand flow. 2 Motivation What will I be talking

More information

Computational Economics and Finance

Computational Economics and Finance Computational Economics and Finance Part I: Elementary Concepts of Numerical Analysis Spring 2015 Outline Computer arithmetic Error analysis: Sources of error Error propagation Controlling the error Rates

More information

User-Defined Function

User-Defined Function ENGR 102-213 (Socolofsky) Week 11 Python scripts In the lecture this week, we are continuing to learn powerful things that can be done with userdefined functions. In several of the examples, we consider

More information

Thursday 1/8 1 * syllabus, Introduction * preview reading assgt., chapter 1 (modeling) * HW review chapters 1, 2, & 3

Thursday 1/8 1 * syllabus, Introduction * preview reading assgt., chapter 1 (modeling) * HW review chapters 1, 2, & 3 Topics and Syllabus Class # Text Reading I. NUMERICAL ANALYSIS CHAPRA AND CANALE A. INTRODUCTION AND MATLAB REVIEW :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::Week

More information

dy = dx y dx Project 1 Consider the following differential equations: I. xy II. III.

dy = dx y dx Project 1 Consider the following differential equations: I. xy II. III. Project 1 Consider the following differential equations: dy = dy = y dy x + sin( x) y = x I. xy II. III. 1. Graph the direction field in the neighborhood of the origin. Graph approximate integral curves

More information

From the output we see that the largest eigenvalue of B is about (ii) Use the inverse power method to find the smallest eigenvalue.

From the output we see that the largest eigenvalue of B is about (ii) Use the inverse power method to find the smallest eigenvalue. . Let B be the matrix given by.8635.735.9593.5685.65.735.8984.7439.6447.553.9593.7439.699.635.643.5685.6447.635.056.430.65.553.643.430.5505 (i) Use the power method to find the largest eigenvalue. The

More information

Numerical Methods Lecture 7 - Optimization

Numerical Methods Lecture 7 - Optimization Numerical Methods Lecture 7 - Optimization Topics: numerical optimization - Newton again - Random search - Golden Section Search READING : text pgs. 331-349 Optimization - motivation What? Locating where

More information

Euler s Method for Approximating Solution Curves

Euler s Method for Approximating Solution Curves Euler s Method for Approximating Solution Curves As you may have begun to suspect at this point, time constraints will allow us to learn only a few of the many known methods for solving differential equations.

More information

Math 133A, September 10: Numerical Methods (Euler & Runge-Kutta) Section 1: Numerical Methods

Math 133A, September 10: Numerical Methods (Euler & Runge-Kutta) Section 1: Numerical Methods Math 133A, September 10: Numerical Methods (Euler & Runge-Kutta) Section 1: Numerical Methods We have seen examples of first-order differential equations which can, by one method of another, be solved

More information

Volumes of Solids of Revolution Lecture #6 a

Volumes of Solids of Revolution Lecture #6 a Volumes of Solids of Revolution Lecture #6 a Sphereoid Parabaloid Hyperboloid Whateveroid Volumes Calculating 3-D Space an Object Occupies Take a cross-sectional slice. Compute the area of the slice. Multiply

More information

Vector Field Visualization: Introduction

Vector Field Visualization: Introduction Vector Field Visualization: Introduction What is a Vector Field? A simple 2D steady vector field A vector valued function that assigns a vector (with direction and magnitude) to any given point. It typically

More information

37 Self-Assessment. 38 Two-stage Runge-Kutta Methods. Chapter 10 Runge Kutta Methods

37 Self-Assessment. 38 Two-stage Runge-Kutta Methods. Chapter 10 Runge Kutta Methods Chapter 10 Runge Kutta Methods In the previous lectures, we have concentrated on multi-step methods. However, another powerful set of methods are known as multi-stage methods. Perhaps the best known of

More information

1 a = [ 5, 1, 6, 2, 4, 3 ] 4 f o r j i n r a n g e ( i + 1, l e n ( a ) 1) : 3 min = i

1 a = [ 5, 1, 6, 2, 4, 3 ] 4 f o r j i n r a n g e ( i + 1, l e n ( a ) 1) : 3 min = i Selection Sort Algorithm Principles of Computer Science II Sorting Algorithms This algorithm first finds the smallest element in the array and exchanges it with the element in the first position, then

More information

Computational Economics and Finance

Computational Economics and Finance Computational Economics and Finance Part I: Elementary Concepts of Numerical Analysis Spring 2016 Outline Computer arithmetic Error analysis: Sources of error Error propagation Controlling the error Rates

More information

Truncation Errors. Applied Numerical Methods with MATLAB for Engineers and Scientists, 2nd ed., Steven C. Chapra, McGraw Hill, 2008, Ch. 4.

Truncation Errors. Applied Numerical Methods with MATLAB for Engineers and Scientists, 2nd ed., Steven C. Chapra, McGraw Hill, 2008, Ch. 4. Chapter 4: Roundoff and Truncation Errors Applied Numerical Methods with MATLAB for Engineers and Scientists, 2nd ed., Steven C. Chapra, McGraw Hill, 2008, Ch. 4. 1 Outline Errors Accuracy and Precision

More information

Review Initial Value Problems Euler s Method Summary

Review Initial Value Problems Euler s Method Summary THE EULER METHOD P.V. Johnson School of Mathematics Semester 1 2008 OUTLINE 1 REVIEW 2 INITIAL VALUE PROBLEMS The Problem Posing a Problem 3 EULER S METHOD Method Errors 4 SUMMARY OUTLINE 1 REVIEW 2 INITIAL

More information

RK4. Version 3.0. (updated 12/1/2006) 2001, 2005, 2006 Tomas Co. Michigan Technological University Houghton, MI 49931

RK4. Version 3.0. (updated 12/1/2006) 2001, 2005, 2006 Tomas Co. Michigan Technological University Houghton, MI 49931 RK4 Version 3.0 (updated 12/1/2006) 2001, 2005, 2006 Tomas Co Michigan Technological University Houghton, MI 49931 Table of Contents Description 3 Rationale 3 Special Features 3 Installing the RK4 Add-In

More information

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg Simulation in Computer Graphics Particles Matthias Teschner Computer Science Department University of Freiburg Outline introduction particle motion finite differences system of first order ODEs second

More information

CS205b/CME306. Lecture 9

CS205b/CME306. Lecture 9 CS205b/CME306 Lecture 9 1 Convection Supplementary Reading: Osher and Fedkiw, Sections 3.3 and 3.5; Leveque, Sections 6.7, 8.3, 10.2, 10.4. For a reference on Newton polynomial interpolation via divided

More information

Numerical Analysis Fall. Numerical Differentiation

Numerical Analysis Fall. Numerical Differentiation Numerical Analysis 5 Fall Numerical Differentiation Differentiation The mathematical definition of a derivative begins with a difference approimation: and as is allowed to approach zero, the difference

More information

Clipping Lines. Dr. Scott Schaefer

Clipping Lines. Dr. Scott Schaefer Clipping Lines Dr. Scott Schaefer Why Clip? We do not want to waste time drawing objects that are outside of viewing window (or clipping window) 2/94 Clipping Points Given a point (x, y) and clipping window

More information

Vector Field Visualization: Introduction

Vector Field Visualization: Introduction Vector Field Visualization: Introduction What is a Vector Field? Why It is Important? Vector Fields in Engineering and Science Automotive design [Chen et al. TVCG07,TVCG08] Weather study [Bhatia and Chen

More information

Computer Simulations

Computer Simulations Computer Simulations A practical approach to simulation Semra Gündüç gunduc@ankara.edu.tr Ankara University Faculty of Engineering, Department of Computer Engineering 2014-2015 Spring Term Ankara University

More information

Functions of Two variables.

Functions of Two variables. Functions of Two variables. Ferdinánd Filip filip.ferdinand@bgk.uni-obuda.hu siva.banki.hu/jegyzetek 27 February 217 Ferdinánd Filip 27 February 217 Functions of Two variables. 1 / 36 Table of contents

More information

Num. #1: Recalls on Numerical Methods for Linear Systems and Ordinary differential equations (ODEs) - CORRECTION

Num. #1: Recalls on Numerical Methods for Linear Systems and Ordinary differential equations (ODEs) - CORRECTION Num. #1: Recalls on Numerical Methods for Linear Systems and Ordinary differential equations (ODEs) - CORRECTION The programs are written with the SCILAB software. 1 Resolution of a linear system & Computation

More information

MA FINAL EXAM INSTRUCTIONS VERSION 01 DECEMBER 9, Section # and recitation time

MA FINAL EXAM INSTRUCTIONS VERSION 01 DECEMBER 9, Section # and recitation time MA 6500 FINAL EXAM INSTRUCTIONS VERSION 0 DECEMBER 9, 03 Your name Student ID # Your TA s name Section # and recitation time. You must use a # pencil on the scantron sheet (answer sheet).. Check that the

More information

SYDE 312 UNIT 4: EXTRA QUADRATURE PROBLEMS

SYDE 312 UNIT 4: EXTRA QUADRATURE PROBLEMS SYDE 3 UNIT 4: EXTRA QUADRATURE PROBLEMS Problem E x x + Use f(x) = /x x + You can t use the Matlab gaussquad file in the provided form, because it implements composite Gauss-Legendre quadrature with multiple

More information

Excel Scientific and Engineering Cookbook

Excel Scientific and Engineering Cookbook Excel Scientific and Engineering Cookbook David M. Bourg O'REILLY* Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo Preface xi 1. Using Excel 1 1.1 Navigating the Interface 1 1.2 Entering Data

More information

f xx (x, y) = 6 + 6x f xy (x, y) = 0 f yy (x, y) = y In general, the quantity that we re interested in is

f xx (x, y) = 6 + 6x f xy (x, y) = 0 f yy (x, y) = y In general, the quantity that we re interested in is 1. Let f(x, y) = 5 + 3x 2 + 3y 2 + 2y 3 + x 3. (a) Final all critical points of f. (b) Use the second derivatives test to classify the critical points you found in (a) as a local maximum, local minimum,

More information

SEQUEL Users Manual: Part 2

SEQUEL Users Manual: Part 2 SEQUEL Users Manual: Part 2 Mahesh B. Patil Department of Electrical Engineering Indian Institute of Technology Bombay Mumbai-400076 e-mail: mbpatil@ee.iitb.ac.in SEQUEL Users Manual: Part 2 1 About Part

More information

RK4. Version 2.0 (updated 5/30/2005) 2001, 2005 Tomas Co. Michigan Technological University Houghton, MI 49931

RK4. Version 2.0 (updated 5/30/2005) 2001, 2005 Tomas Co. Michigan Technological University Houghton, MI 49931 RK4 Version 2.0 (updated 5/30/2005) 2001, 2005 Tomas Co Michigan Technological University Houghton, MI 49931 Table of Contents Description 3 Rationale 3 Special Features 3 Installing the RK4 Add-In 4 Activating/Deactivating

More information

Data Visualization. Fall 2017

Data Visualization. Fall 2017 Data Visualization Fall 2017 Vector Fields Vector field v: D R n D is typically 2D planar surface or 2D surface embedded in 3D n = 2 fields tangent to 2D surface n = 3 volumetric fields When visualizing

More information

First of all, we need to know what it means for a parameterize curve to be differentiable. FACT:

First of all, we need to know what it means for a parameterize curve to be differentiable. FACT: CALCULUS WITH PARAMETERIZED CURVES In calculus I we learned how to differentiate and integrate functions. In the chapter covering the applications of the integral, we learned how to find the length of

More information

Dynamic Computation of Runge-Kutta s Fourth-Order Algorithm for First and Second Order Ordinary Differential Equation Using Java

Dynamic Computation of Runge-Kutta s Fourth-Order Algorithm for First and Second Order Ordinary Differential Equation Using Java 211 Dynamic Computation of Runge-Kutta s Fourth-Order Algorithm for First and Second Order Ordinary Differential Equation Using Java Adesola O. Anidu Samson A. Arekete Ayomide O. Adedayo and Adekunle O.

More information

Introduction to Simulink

Introduction to Simulink Introduction to Simulink There are several computer packages for finding solutions of differential equations, such as Maple, Mathematica, Maxima, MATLAB, etc. These systems provide both symbolic and numeric

More information

Validated Solution of Initial Value Problem for Ordinary Differential Equations based on Explicit and Implicit Runge-Kutta Schemes

Validated Solution of Initial Value Problem for Ordinary Differential Equations based on Explicit and Implicit Runge-Kutta Schemes Validated Solution of Initial Value Problem for Ordinary Differential Equations based on Explicit and Implicit Runge-Kutta Schemes Julien Alexandre Dit Sandretto, Alexandre Chapoutot To cite this version:

More information

Math 98 - Introduction to MATLAB Programming. Fall Lecture 2

Math 98 - Introduction to MATLAB Programming. Fall Lecture 2 Reminders Instructor: Chris Policastro Login:!cmfmath98 (username) c a 1numerals (password) Class Website: https://math.berkeley.edu/~cpoli/math98/fall2016.html Assignment Submission: https://bcourses.berkeley.edu

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

2. Solve for x when x < 22. Write your answer in interval notation. 3. Find the distance between the points ( 1, 5) and (4, 3).

2. Solve for x when x < 22. Write your answer in interval notation. 3. Find the distance between the points ( 1, 5) and (4, 3). Math 6 Practice Problems for Final. Find all real solutions x such that 7 3 x = 5 x 3.. Solve for x when 0 4 3x

More information

Name: Signature: Section and TA:

Name: Signature: Section and TA: Name: Signature: Section and TA: Math 7. Lecture 00 (V. Reiner) Midterm Exam I Thursday, February 8, 00 This is a 50 minute exam. No books, notes, calculators, cell phones or other electronic devices are

More information

BME 5742 Bio-Systems Modeling and Control

BME 5742 Bio-Systems Modeling and Control BME 5742 Bio-Systems Modeling and Control Lecture 4 Simulink Tutorial 1: Simulation of the Malthusian and Logistic Models Model Set Up, Scope Set Up Dr. Zvi Roth (FAU) 1 Getting started In the MATLAB command

More information

Parallel implicit ordinary differential equation solver for cuda. Tomasz M. Kardaś

Parallel implicit ordinary differential equation solver for cuda. Tomasz M. Kardaś Parallel implicit ordinary differential equation solver for cuda Tomasz M. Kardaś August 11, 2014 Chapter 1 Parallel Implicit Ordinary Differential Equations Solver A simplest definition of stiffness,

More information

Modelling and Simulation for Engineers

Modelling and Simulation for Engineers Unit T7: Modelling and Simulation for Engineers Unit code: F/503/7343 QCF level: 6 Credit value: 15 Aim This unit gives learners the opportunity to develop their understanding of Ordinary Differential

More information

LECTURE 0: Introduction and Background

LECTURE 0: Introduction and Background 1 LECTURE 0: Introduction and Background September 10, 2012 1 Computational science The role of computational science has become increasingly significant during the last few decades. It has become the

More information

REVIEW I MATH 254 Calculus IV. Exam I (Friday, April 29) will cover sections

REVIEW I MATH 254 Calculus IV. Exam I (Friday, April 29) will cover sections REVIEW I MATH 254 Calculus IV Exam I (Friday, April 29 will cover sections 14.1-8. 1. Functions of multivariables The definition of multivariable functions is similar to that of functions of one variable.

More information

The WENO Method in the Context of Earlier Methods To approximate, in a physically correct way, [3] the solution to a conservation law of the form u t

The WENO Method in the Context of Earlier Methods To approximate, in a physically correct way, [3] the solution to a conservation law of the form u t An implicit WENO scheme for steady-state computation of scalar hyperbolic equations Sigal Gottlieb Mathematics Department University of Massachusetts at Dartmouth 85 Old Westport Road North Dartmouth,

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab This tour introduces the basic notions of programming with Matlab. Contents M-file scripts M-file functions Inline functions Loops Conditionals References M-file scripts A script

More information

Using Modified Euler Method (MEM) for the Solution of some First Order Differential Equations with Initial Value Problems (IVPs).

Using Modified Euler Method (MEM) for the Solution of some First Order Differential Equations with Initial Value Problems (IVPs). Using Modified Euler Method (MEM) for the Solution of some First Order Differential Equations with Initial Value Problems (IVPs). D.I. Lanlege, Ph.D. * ; U.M. Garba, B.Sc.; and A. Aluebho, B.Sc. Department

More information

HSC Mathematics - Extension 1. Workshop E2

HSC Mathematics - Extension 1. Workshop E2 HSC Mathematics - Extension Workshop E Presented by Richard D. Kenderdine BSc, GradDipAppSc(IndMaths), SurvCert, MAppStat, GStat School of Mathematics and Applied Statistics University of Wollongong Moss

More information

HW/SW Codesign. WCET Analysis

HW/SW Codesign. WCET Analysis HW/SW Codesign WCET Analysis 29 November 2017 Andres Gomez gomeza@tik.ee.ethz.ch 1 Outline Today s exercise is one long question with several parts: Basic blocks of a program Static value analysis WCET

More information

Advanced Programming in Engineering Saurabh Srivastava, Thomas Weinhart Martin Robinson, and Stefan Luding MSM, CTW, UTwente, NL

Advanced Programming in Engineering Saurabh Srivastava, Thomas Weinhart Martin Robinson, and Stefan Luding MSM, CTW, UTwente, NL Advanced Programming in Engineering 2011-19115850 Saurabh Srivastava, Thomas Weinhart Martin Robinson, and Stefan Luding MSM, CTW, UTwente, NL Contents Why is this class important for me? What will I learn

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

More information

Civil Engineering Systems Analysis Lecture XV. Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics

Civil Engineering Systems Analysis Lecture XV. Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics Civil Engineering Systems Analysis Lecture XV Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics Today s Learning Objectives Sensitivity Analysis Dual Simplex Method 2

More information

NAG Library Function Document nag_ode_ivp_rk_setup (d02pvc)

NAG Library Function Document nag_ode_ivp_rk_setup (d02pvc) NAG Library Function Document nag_ode_ivp_rk_setup () 1 Purpose nag_ode_ivp_rk_setup () is a setup function which must be called prior to the first call of either of the integration functions nag_ode_ivp_rk_range

More information