Milestone 3 - ODE Solvers
Time dependent source term
As a next step, we want to incorporate the annual change of the insolation and consider a simplified EBM, where we only average the coefficients in space but not in time. We apply the area averaging to our coefficients to get
where we keep the time dependence of the solar source term.
As mentioned in the previous sections, due to the complexity of the solar forcing term, this model is somewhat difficult to solve analytically. However, this time, we take the chance to consider numerical approximation methods, so-called ODE solvers, to numerically calculate an (approximate) ODE solution to (1).
Typically, in ODE literature, a problem of the following form is considered
where is the unknown function we want to compute with initial conditions and the right-hand-side operator . We can reformulate our problem (1) into this typical ODE notation for the choice
Remark: There is extensive knowledge on the theory on existence and uniqueness of solutions for ordinary differential equations in the literature. The existence and uniqueness of solutions for ODEs depends on the continuity properties of the right-hand-side . The most famous results are the Lemma of Peano (existence of solutions) and the Lemma of Picard-Lindelöf (uniqueness of solutions). We refer the interested reader to the standard literature on ODEs.
Some examples:
Arnold, V. I. (1992). Ordinary differential equations. Springer Science & Business Media.
Butcher, J. C. (2016). Numerical methods for ordinary differential equations. John Wiley & Sons.
ODE Solvers
Comment: We emphasize that there are typically full courses dedicated to the topic of construction and analysis of numerical methods for ODEs. The focus is often on the state-of-the-art method class: the Runge–Kutta Method (implicit and explicit versions). In this course we focus on simpler methods, namely the forward and backward Euler schemes, that are sufficient in terms of efficiency for the problems we are interested in. However, we encourage the interested reader to look for more sophisticated methods and apply them for our problem and see if there is an efficiency gain possible.
The Euler method
There are many ways to derive and motivate the Euler time-integration method. We choose the idea of an approximation to the time integral when giving the integral form of the ODE solution.
Consider the ODE
Formally, the solution is given by
The problem is of course that the solution is needed to compute the right-hand-side time integral.
We first consider a discretization of the time axis into small time steps
We start with the known initial value
To obtain the solution at the next time step, , we look at the integral formula
and make the simplest approximation to the integral via a rectangular quadrature rule:
We can use the left-sided rule,
or the right-sided rule,
Now that we have an approximation for , we can proceed analogously for , ,
The first variant is called explicit as the new value can be directly computed with the information that is known at the current time level . The second variant is implicit as the new unknown solution also appears on the right-hand side inside the function . Hence, an algebraic equation needs to be solved for every time step. This equation is non-linear or linear, depending on the function .
These two methods are the simplest variants of an ODE solver and are formally first-order accurate approximations (can be shown via Taylor expansion). This means that in general the solutions of the Euler methods are not exact solutions of the ODE, but have an (numerical) error. First-order accuracy means that the error of the numerical approximation depends linearly on the time-step size , i.e., the error behaves like . Hence, by decreasing the time-step size, the error gets smaller. However, at the same time, the number of time steps gets larger, i.e., the amount of computations increases. As a consequence, we aim to choose the time-step size as large as possible, but small enough to obtain the desired accuracy in our numerical simulation.
Remark: It is easy to generate a second-order time-integration method based on the Euler methods. For instance, the implicit Crank–Nicolson scheme is
which results when approximating the integral with a trapezoidal rule, i.e., by considering half of the explicit plus half of the implicit Euler update.
Stability of the explicit and implicit Euler methods
When deciding between the explicit or implicit Euler variants, one might get tempted to use directly the much simpler explicit Euler method: every solution can be directly computed without solving an algebraic (possibly non-linear) equation. However, the simplicity of the explicit nature comes at a hefty price: the choice of the size of is not arbitrary anymore, but needs to be small enough due to stability reasons.
As an example, let us consider the ODE
with the analytical solution .
Since is a complex number, we can write it as . Therefore, we get
which shows that the real part corresponds to the amplitude of the solution (which grows in time for and decreases for ) and that the imaginary part is the oscillatory part.
We can consider a perturbed initial condition,
where is small compared to . The exact solution is then
If we compare the two solutions,
we see that only for non-positive real parts, , the difference stays small in time even when considering a small perturbation. The problem is called stable for . We want to have numerical methods that are numerically stable when solving stable problems!
If we apply first the explicit Euler formula to solve the problem, we get
If we look at the amplitude of the numerical solution we obtain
which shows that is the amplification factor of the explicit Euler method. We can investigate for which values of this factor is smaller than to obtain:
We need that the product is within the marked red circle to keep the numerical amplification factor smaller than !
The red circle defines the numerical stability region of the explicit Euler method and indicates that for guaranteed numerical stability, the size of is limited.
Example: Consider the ODE
The red circle stability area gives a maximum time step size of , which shows that the time-step size can get very low for large values of . Such problems are sometimes also referred to as stiff problems.
The advantage of the explicit Euler method is the simplicity and the computationally cheap algorithm. The downside is that the size of the time step can be very low due to numerical stability issues.
If we consider now the implicit Euler method for our simple ODE (12), we obtain
In this simple case, we can directly solve the implicit equation!
The amplification factor is now , which gives the stability region of the implicit Euler method:
This shows that the implicit Euler scheme is stable for all values of , except for the ones inside the blue circle. In particular, the scheme is unconditionally stable for all choices of in case .
Hence, the big advantage of the implicit variant is that can be chosen arbitrarily regarding the stability and only needs to be chosen for accuracy reasons.
Temporal equilibrium simulation
In conclusion, we have now all the tools available to solve our time dependent area-averaged EBM with either explicit or implicit Euler in time.
The only open question is how we can reach equilibrium in time for our simulation. We need to realize that the source term is periodic in time (with a period of one year). Hence, we are looking for a numerical solution that changes within the year, but then repeats itself for every following year afterwards. Once we have reached such an annual state, we consider that our simulation of the climate system has reached equilibrium and no further change of the annual temperature will occur unless the problem definition (e.g. the parametrizations) is changed again.
In practice, we have to compare the yearly temperature solutions with each other, until the difference from one year to the next is smaller than a given tolerance. Among the different choices of norms to compute the yearly solutions, the simplest option is to compute the Euclidean norm of the data vectors in time.
Created by Gregor Gassner and Andrés Rueda-Ramírez with contributions by Simone Chiocchetti, Daniel Bach, Sophia Horak, Philipp Baasch, Benjamin Bolm, Erik Faulhaber, and Luca Sommer. Last modified: April 02, 2026. Website built with Franklin.jl and the Julia programming language.