math245lab03

math245lab03 - Math245 Computer Lab set #3, Fall 2008 Solve...

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

View Full Document Right Arrow Icon
Math245 Computer Lab set #3, Fall 2008 Solve the 1-st order ODE by using Matlab We consider the 1-st order ODE in the form dy dt = f ( t,y ) , with initial condition y (0) = y 0 . To obtain the numerical solution to this initial value problem, we will use ODE solver ode45 (Runge-Kutta 4-5th order method) in Matlab package. The simplest use of ode45 is in the following form: [ t, y ] = ode45(@odefun, tspan, initvalue); @odefun : (IN) information of Matlab function file where f ( t,y ) is defined. tspan : (IN) interval of independent variable t , e.g., [t0 tend] (vector with two elements). initvalue : (IN) initial value. t : (OUT) time (independent variable) vector. y : (OUT) solution vector which corresponds to the time vector t . The output variables ( t and y ) are in the row vector form. The structure of these vectors are described as follows. t = t 0 t 1 t 2 . . . t
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 11/08/2009 for the course MATH 245 at USC.

Page1 / 2

math245lab03 - Math245 Computer Lab set #3, Fall 2008 Solve...

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