Adams-Bashforth algorithm

68 Views Asked by At

So i got a project and I've been trying to solve it, but I just don't know how to start, and I haven't found an example similar to this one. So if you could guide me a little bit I would really appreciate it.

Giving the Cauchy $$y'=-y^2$$ $$y(0)=1$$

which has the exact solution $y(x)=1/(1+x)$. Using the Adams-Bashforth procedure for $h=0.5$ and $0.25$ solve the problem for the following interval $[0,5]$.

I didn't learned this algorithm in school and online I can't find similar examples, so if you could guide me a bit it would really help me!

1

There are 1 best solutions below

1
On BEST ANSWER

You just need to write the recurrence. For example, if you look at AB method with $s=2$, the numerical scheme is the following:

$y_{n+2}=y_{n+1}-\frac{k}{2}f(t_n,y_n) +\frac{3k}{2}f(t_{n+1},y_{n+1})$.

It's a second order method, and you can compute $y_1$ ($y_0$ is of course given, and it's $y_0=1$, since it's the initial data!) with explicit Euler method.

In your specific example, $f$ is given by $f(t,y)=f(y)=-y^2$, and $k$ is your step size $h$.

It's just a for loop where you update at each time-step $y_{n+1},y_n$.