Solving ODE w/ Matlab ode45: Error Message Explained

In summary, the conversation discusses the issue of ode45 not being able to converge on a solution for a second-order ODE. The error message indicates that the integration tolerances are not being met and the step size needs to be reduced. The code used to try and solve the ODE is also provided. It is suggested to post the ODE being solved in order to diagnose the problem further.
  • #1
eurekameh
210
0
I'm trying to solve an ODE using matlab's ode45, but I'm receiving the following error:

Warning: Failure at t=4.509803e+01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.136868e-13) at time t.

Can anybody explain what this means?
 
Physics news on Phys.org
  • #2
Sounds like ode45 is having trouble converging on a solution.

In order to diagnose the problem in more detail, you should probably post the ODE you are trying to solve.
 
  • #3
function dxdt = test(t,x)
mu = 398600.64;
dxdt_1 = x(2);
dxdt_2 = (-mu/x(1)^3)*x(1);
dxdt = [dxdt_1;dxdt_2];

It's a second-order ODE and I'm trying to solve it from the time interval of 0 to 28800. When I lower this time interval to something like 50, the program seems to work fine, but anything higher than that, it stops to converge. Here is my code to run it:

t = 0:28800
[t x] = ode45(@test,t,[1000;-7]);
 
  • #4
I don't have the ODE you are trying to solve, only your reformulation for Matlab.
 
  • #5
I'm trying to solve the orbit motion of equation x,doubledot = (-mu/x^3)*x, with an initial condition of x0 = 1000, and xdot,0 = -7.
 
  • #6
Do you know why it's not converging?
 

What is an ODE?

An ODE (ordinary differential equation) is a mathematical equation that describes the relationship between a function and its derivatives. It is commonly used in scientific and engineering fields to model dynamic systems.

What is Matlab ode45?

Matlab ode45 is a function in the Matlab software that solves ODEs numerically using the Runge-Kutta method. It is a popular and efficient method for solving ODEs in engineering and scientific applications.

What does the error message in ode45 mean?

The error message in ode45 indicates that the solver was unable to solve the ODE for the given inputs. This could be due to various reasons such as incorrect input arguments, singularities in the ODE, or numerical instability.

How can I fix the error message in ode45?

To fix the error message in ode45, you can try adjusting the input arguments, checking for any singularities in the ODE, or using a different solver. It is also recommended to carefully review the ODE formulation and initial conditions.

Can I use ode45 for stiff ODEs?

Yes, ode45 can be used for solving stiff ODEs (ordinary differential equations with large differences in time scales). However, it may not be the most efficient solver for stiff ODEs, and other methods such as ode15s or ode23t may be more suitable.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
832
  • Engineering and Comp Sci Homework Help
Replies
1
Views
894
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
7K
Replies
61
Views
778
Back
Top