Skip to content
MathWorks - Mobile View
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
MathWorks
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out

Videos and Webinars

  • MathWorks
  • Videos
  • Videos Home
  • Search
  • Videos Home
  • Search
  • Contact sales
  • Trial software
5:34 Video length is 5:34.
  • Description
  • Full Transcript
  • Code and Resources

Solving ODEs in MATLAB, 9: The MATLAB ODE Suite

From the series: Solving ODEs in MATLAB

The MATLAB documentation provides two charts summarizing the features of each of the seven functions in the MATLAB ODE suite.

Related MATLAB code files can be downloaded from MATLAB Central

 

We can get to documentation for the MATLAB ODE Suite by entering this command at the MATLAB prompt-- doc ode45. This will bring us to an extensive documentation for MATLAB ode45 that includes among other things this chart that compares MATLAB ODE solvers. There are seven of them and this compares their various attributes. As we've said before, MATLAB ode45 is the workhorse. It's a nonstiff solver with medium accuracy that is the first one you should try, and we use it most of the time.

I have a soft heart in my heart for MATLAB ode23. It's a nonstiff solver with low accuracy, but its accuracy that's appropriate for graphics work because the step size it chooses is appropriate for most graphics work. MATLAB ode113 we haven't talked about it yet, there could be a comma between the 1 and the 13 here because this is a variable order method where the order varies all the way from 1 to 13. It's a multi-step method that saves history.

If, you know about these things, it's an Adams-Moulton method. I associate this with worked done at Jet Propulsion Laboratory years ago for computing orbits of planets and satellites, which of course are very smooth and go on for years. It can have very high accuracy requirements.

Then there are the stiff solvers. There are four of them-- 15s, 23s, and the twins, the trapezoid rules. 15s is the primary stiff solver, low to medium accuracy. If you find ode45 is slow, taking lots of steps-- indication that the problem is stiff-- try 15s.

23s can be as a low order method, low accuracy, and used at crude error tolerances. We haven't talked about mass matrices. This is where there's a matrix in front of the derivative term, and this can be used with constant mass matrices. And then the two routines with T's in their name are based on the trapezoidal rule, and they're for use with problems without any numerical damping. You can see the documentation for more details on the trapezoid methods.

That's the MATLAB ODE Suite seven solvers, three for nonstiff problems and four for stiff problems. You may well get through with never using anything but ode45 may well serve all your needs.

There's a second chart in the documentation that summarizes all the options that are available through the ODE Set function. We've briefly mentioned the tolerances, RelTol and AbsTol-- the output function-- these are available in all seven of the solvers.

There are various other functions-- various other options-- available for more specialized work, including event handling, providing a Jacobian to the stiff solvers so they don't have to work so hard taking numerical differences, options associated with the mass matrices, providing a limit on the step size. These are all our options that can be specified through ode Set for more specialized work with the ODE solvers.

Download Code and Files

Download the code in this video

Related Products

  • MATLAB

Explore more resources from Cleve Moler

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper
Related Information
Related Information
Learn differential equations

Feedback

Featured Product

MATLAB

  • Request Trial
  • Get Pricing

Up Next:

Throw a rectangular box with sides of three different lengths into the air. You can get the box to tumble stably about its longest axis or its shortest axis. But if you try to make it tumble about it middle axis, you will find the motion is unstable.
9:51
10: Tumbling Box
View full series (12 Videos)

Related Videos:

14:16
Solving ODEs in MATLAB, 11: Predator-Prey Equations
14:16
Solving ODEs in MATLAB, 8: Systems of Equations
15:21
Solving ODEs in MATLAB, 1: Euler, ODE1
9:37
Solving ODEs in MATLAB, 3: Classical Runge-Kutta, ODE4
6:46
Solving ODEs in MATLAB, 6: ODE45

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • Switzerland (English)
  • Switzerland (Deutsch)
  • Switzerland (Français)
  • 中国 (简体中文)
  • 中国 (English)

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contact sales
  • Trial software

MathWorks

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Discover…

Explore Products

  • MATLAB
  • Simulink
  • Student Software
  • Hardware Support
  • File Exchange

Try or Buy

  • Downloads
  • Trial Software
  • Contact Sales
  • Pricing and Licensing
  • How to Buy

Learn to Use

  • Documentation
  • Tutorials
  • Examples
  • Videos and Webinars
  • Training

Get Support

  • Installation Help
  • MATLAB Answers
  • Consulting
  • License Center
  • Contact Support

About MathWorks

  • Careers
  • Newsroom
  • Social Mission
  • Customer Stories
  • About MathWorks
  • Select a Web Site United States
  • Trust Center
  • Trademarks
  • Privacy Policy
  • Preventing Piracy
  • Application Status

© 1994-2022 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Join the conversation