# A Implicit Euler method with adaptive time step and step doubling

#### the_dane

For Initial Value problems I want to implement an ODE solver for implicit Euler method with adaptive time step and use step doubling to estimate error. I have found some reading stuff about adaptive time step and error estimation using step doubling but those are mostly related to RK methods. I can't find how the error estimating formulas look like for the implicit (Backward Euler) method.

Have any of you worked with this topic and can help me find the right formulas to implement? I am mostly confused about how to update the size timestep each at each step.

( I have looked at this article but it does not really help me find what I am looking for https://www.newcastle.edu.au/__data/assets/pdf_file/0020/22565/50_Adaptive-backward-Euler-time-stepping-with-truncation-error-control-for-numerical-modelling-of-unsatuarted-fluid-flow.pdf )

Last edited:
Related Differential Equations News on Phys.org

#### DrClaude

Mentor
For Initial Value problems I want to implement an ODE solver for implicit Euler method with adaptive time step and use step doubling to estimate error. I have found some reading stuff about adaptive time step and error estimation using step doubling but those are mostly related to RK methods. I can't find how the error estimating formulas look like for the implicit (Backward Euler) method.
The error estimate is simply the absolute value of the difference in the dependent variable(s) when advancing using a given step $h$ and half that step, $h/2$.

To figure out how to modify the step if the error estimate is outside an acceptable range, you can take inspiration from how it is implemented in GSL:

#### hilbert2

Gold Member
You could try to test it first for some relatively simple example, such as the equation of motion of a classical mechanical particle that hits a very hard wall from the left side. The "wall" could be modelled with a (dimensionless) potential energy like

$V(x) = \left\{\begin{array}{c} 0,\hspace{20pt}x<0 \\ 10^4 x,\hspace{20pt}x>0\end{array}\right.$

or

$V(x) = \left\{\begin{array}{c} 0,\hspace{20pt}x<0 \\(x+1)^{20} \hspace{20pt}x>0\end{array}\right.$

If the timestep is too long, the particle will bounce back with a speed that clearly breaks conservation of energy.

"Implicit Euler method with adaptive time step and step doubling"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving