Matlab ODE solver and Convergence question

Additionally, adjusting the tolerances can also affect convergence, so it is important to choose appropriate values for AbsTol and RelTol. In summary, the ode45, ode113, and ode23t solvers in Matlab are usually guaranteed to converge, but it is important to monitor the error estimates and choose appropriate tolerances for optimal convergence.
  • #1
|squeezed>
32
1
Hi all

I am using the ode45, ode113, ode23t (for "stiff" and "nonstiff" problems)... ode Matlab solvers for a system of ODEs. My question has to do with the convergence and the control of the error. Is convergence always guaranteed using these solvers ? Is there a way to check this ?

The only feedback that i m getting from Matlab is the adjustment of the "Relative and Absolute" Tolerances. For example, if Abstol it is too low, Matlab will notify AbsTol was increased to a specific value. However, i never get any errors/messages and everything "looks" to be fine (even though the solution looks weird) - i never know if the solution has converged.

ps I use low tolerances (1e-08 or smaller) for both AbsTol, RelTol.Thanks in advance
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
for the helpYes, convergence is usually guaranteed using these solvers. You can check it by looking at the error estimates given by the solver. These estimates come from the local truncation error and should decrease as the step size decreases. If the errors are not decreasing, then you may want to look for a different numerical method.
 
  • #3
for any help or insights.

I can say that convergence is not always guaranteed when using ODE solvers, including those in Matlab. While these solvers are designed to provide accurate solutions, there are certain factors that can affect their convergence, such as the stiffness of the problem and the chosen tolerances.

To check for convergence, it is important to monitor the error in the solution as the solver progresses. This can be done by setting the 'OutputFcn' property in the solver options to a function that calculates and displays the error. This will help you determine if the solution is converging or not.

Additionally, it is important to carefully choose the tolerances for your problem. Setting them too low can result in the solver taking longer to converge, while setting them too high can result in less accurate solutions. It is recommended to start with higher tolerances and gradually decrease them until a satisfactory solution is obtained.

In conclusion, while ODE solvers can provide accurate solutions, it is important to carefully monitor the convergence and choose appropriate tolerances for your specific problem. It is also helpful to consult with other experts or resources for further insights and troubleshooting.
 

Related to Matlab ODE solver and Convergence question

1. What is Matlab ODE solver and how does it work?

Matlab ODE solver is a built-in function in Matlab that solves ordinary differential equations (ODEs). It uses a variety of numerical methods, such as Runge-Kutta and Adams-Bashforth, to approximate the solution of the ODE at different time points. It works by breaking down the ODE into smaller, simpler equations and using an iterative process to solve for the values at each time step.

2. What are the different types of ODE solvers available in Matlab?

There are two main types of ODE solvers in Matlab: explicit and implicit. Explicit solvers, such as ode45 and ode23, are faster and more accurate for non-stiff ODEs, while implicit solvers, such as ode15s and ode23s, are more suitable for stiff ODEs. There are also specialized solvers for specific types of ODEs, such as ode113 for highly oscillatory ODEs and ode23t for ODEs with rapidly changing behavior.

3. How do I choose the right ODE solver for my problem?

The choice of ODE solver depends on the characteristics of your ODE, such as stiffness and the desired level of accuracy. For non-stiff ODEs, explicit solvers are generally recommended, while implicit solvers are better for stiff ODEs. You can also use the built-in function "ode113" to automatically select the most appropriate solver for your problem based on its characteristics.

4. What is the convergence criterion for ODE solvers in Matlab?

The convergence criterion for ODE solvers in Matlab is typically based on the error tolerance specified by the user. The solver will continue to refine the solution until the error is within the specified tolerance. The default tolerance for most solvers is 1e-6, but this can be changed using the "options" argument in the solver function.

5. How can I improve the convergence of my ODE solver?

There are several ways to improve the convergence of an ODE solver in Matlab. One way is to decrease the error tolerance to a smaller value. Another way is to specify the maximum number of iterations or time steps the solver can take before stopping. Additionally, you can try changing the solver method or using a different solver altogether if the default one is not performing well for your problem.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
967
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Back
Top