0
$\begingroup$

Assuming we are given the initial condition for an ODE such that:

$$ \begin{cases} x' = f(x,t) \\ x(t_0) = x_0 \end{cases} $$

We are going to solve it numerically using AB2.

We know that the first iteration of AB2 produces $x_{2}$ using $x_{1}$ and $x_0$.

So it need two nodes to start. but we have only one node given in initial condition. I never paid attention to this until I myself wanted to code the AB2 algorithm.

What should I do to find $x_{1}$?

$\endgroup$
0

2 Answers 2

1
$\begingroup$

As you say, you could use a forward method like Euler or RK2 to compute the next solution and then continue with AB2.

Another option is to compute a backward step; As you know the derivative at any point, you could evaluate it at $x_0$ to approximate the value of $x$ at the previous time, using backward difference approximation of derivative: $$\frac{x_0 - x_{-1}}{h} = x'(t_0, x_0) \rightarrow x_{-1} = x_0 - h \ x'(t_0, x_0) $$

where $h$ is the time step.

$\endgroup$
0
$\begingroup$

Ok I think I found the answer by myself. In situations like this we can use another method that only need one node, to approximate the second node $x_1$.

So one should take the initial condition $x_0$ and then use a numerical method (for example forward Euler) to approximate the next node $x_1$ then uses these two nodes to boot up the AB2 iterations.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.