MathWorks - Mobile View
  • Inicie sesión con su cuenta de MathWorksInicie sesión con su cuenta de MathWorks
  • Access your MathWorks Account
    • Mi Cuenta
    • Mi perfil de la comunidad
    • Asociar Licencia
    • Cerrar sesión
  • Productos
  • Soluciones
  • Educación
  • Soporte
  • Comunidad
  • Eventos
  • Obtenga MATLAB
MathWorks
  • Productos
  • Soluciones
  • Educación
  • Soporte
  • Comunidad
  • Eventos
  • Obtenga MATLAB
  • Inicie sesión con su cuenta de MathWorksInicie sesión con su cuenta de MathWorks
  • Access your MathWorks Account
    • Mi Cuenta
    • Mi perfil de la comunidad
    • Asociar Licencia
    • Cerrar sesión

Vídeos y webinars

  • MathWorks
  • Vídeos
  • Videos Home
  • Buscar
  • Videos Home
  • Buscar
  • Contáctese con ventas
  • Software de prueba
  Register to watch video
  • Description
  • Full Transcript
  • Code and Resources

Solving ODEs in MATLAB, 9: The MATLAB ODE Suite

From the series: Solving ODEs in MATLAB

Cleve Moler, MathWorks

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

Learn More

Explore more resources from Cleve Moler
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:

15:21
Solving ODEs in MATLAB, 1: Euler, ODE1
9:51
Solving ODEs in MATLAB, 10: Tumbling Box
14:16
Solving ODEs in MATLAB, 11: Predator-Prey Equations
10:24
Solving ODEs in MATLAB, 12: Lorenz Attractor and Chaos
9:37
Solving ODEs in MATLAB, 3: Classical Runge-Kutta, ODE4

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: .

Select web site

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

  • Contáctese con ventas
  • Software de prueba

Explorar productos

  • MATLAB
  • Simulink
  • Software para estudiantes
  • Soporte para hardware
  • File Exchange

Probar o comprar

  • Descargas
  • Software de prueba
  • Contáctese con ventas
  • Precios y licencias
  • Cómo comprar

Aprender a utilizar

  • Documentación
  • Tutoriales
  • Ejemplos
  • Vídeos y webinars
  • Formación

Obtener soporte

  • Ayuda para la instalación
  • Respuestas
  • Consultoría
  • Centro de licencias
  • Contactar con soporte

Acerca de MathWorks

  • Ofertas de empleo
  • Sala de prensa
  • Misión social
  • Contáctese con ventas
  • Acerca de MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks es el líder en el desarrollo de software de cálculo matemático para ingenieros

Descubra…

  • Select a Web Site United States
  • Patentes
  • Marcas comerciales
  • Política de privacidad
  • Antipiratería
  • Estado

© 1994-2021 The MathWorks, Inc.

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

Únase a la conversación