solving first order ordinary differential equations with matlab n.
Download
Skip this Video
Download Presentation
Solving First Order Ordinary Differential Equations with Matlab

Loading in 2 Seconds...

play fullscreen
1 / 9

Solving First Order Ordinary Differential Equations with Matlab - PowerPoint PPT Presentation


  • 241 Views
  • Uploaded on

Solving First Order Ordinary Differential Equations with Matlab. Oct. 2, 2008. Example Problem. Consider an 80 kg paratrooper falling from 600 meters. The trooper is accelerated by gravity, but decelerated by drag on the parachute

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Solving First Order Ordinary Differential Equations with Matlab' - dolan-watkins


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
example problem
Example Problem
  • Consider an 80 kg paratrooper falling from 600 meters.
  • The trooper is accelerated by gravity, but decelerated by drag on the parachute
  • This problem is from Cleve Moler’s book called Numerical Computing with Matlab
governing equation
Governing Equation
  • m= paratrooper mass (kg)
  • g= acceleration of gravity (m/s^2)
  • V=trooper velocity (m/s)
  • Initial velocity is assumed to be zero
preparing to solve numerically
Preparing to Solve Numerically
  • First, we put the equation in the form
  • For our example, the equation becomes:
solving numerically
Solving Numerically
  • There are a variety of ODE solvers in Matlab
  • We will use the most common: ode45
  • We must provide:
  • a function that defines the function derived on previous slide
  • Initial value for V
  • Time range over which solution should be sought
the function
The Function

function rk=f(t,y)

mass=80;

g=9.81;

rk=-g+4/15*y^2/mass;

Save as f.m

The name of m.file has be saved as the same as the name of the function you define in this .m file.

the solution
The Solution

clear all

timerange=[0 30]; %seconds

initialvelocity=0; %meters/second

[t,y]=ode45(@f, timerange, initialvelocity)

plot(t,y)

xlabel(‘time(s)’)

ylabel(‘velocity (m/s)’)

Saved as example1.m

options are available to
Options are available to:
  • Change relative or absolute error tolerances
  • Maximum number of steps
  • etc.