assign8-09 - MATH 573 ASSIGNMENT 8 Before beginning the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
MATH 573 ASSIGNMENT 8 Before beginning the problems in this assignment, copy the following files from the web page http://www.math.rutgers.edu/~falk/math573/matlab-prog.html to your home di- rectory. The use of these files will greatly simplify these problems. euler.m This file contains the function euler(FunFcn,tspan,y0,n) that takes as inputs the name of a function enclosed in quotes (e.g., ’ocnfcn’) which is the right hand side of the differential equation, a vector tspan = [t0, tfinal] of the initial and final times, the initial condition y0 (it must be a column vector), and the number of subintervals n . The output is [t,y] , where t is a column vector containing the times t 0+ h, . . . , tfinal at which the approximate solution is computed and y is a matrix whose ith row contains an approximation to the solution [ y 1 ( t 0+ i h ) , y 2 ( t 0+ i h ) , . . . , y m ( t 0+ i h )], where m is the number of components in the vector y0 . It implements Euler’s method with constant step size h = ( tfinal - t 0) /n . rk2.m This file contains the function rk2(FunFcn,tspan,y0,n) which has the same inputs and outputs as Euler’s method. It implements Heun’s method with constant step size h = ( tfinal - t 0) /n . ocfcn.m This file contains the function ocnfcn(t,y) which takes as inputs a value of t and a column vector y and returns a column vector given by the function F(t,y) which is the right hand side of the differential equation y 0 ( t ) = F ( t, y ). In this function, y and F are scalar functions with F = 1 - 2 ty . vdpfcn1.m
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/16/2010 for the course MATH FIN 621 taught by Professor Paulfeehan during the Spring '09 term at Rutgers.

Page1 / 3

assign8-09 - MATH 573 ASSIGNMENT 8 Before beginning the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online