Ohm - 5 months ago 48

Python Question

I am working on implementing the Alternating direction implicit method to solve FitzHugh–Nagumo reaction diffusion model. I have found a Python implementation example for it in a blog, but I think there is an error in the method - in the stencil presented here:

Shouldn't it be half time step size multiplying the reaction term ** f** ?

Answer

Replacing the difference quotients by the differential quotients, one gets

```
U_t = D/2 * U_xx + D/2 * U_yy + Δt*f
```

in both instances, which is not the equation

```
U_t = D * (U_xx + U_yy) + f
```

that was the originally posed task.

So the coefficients should be `1/(Δt/2)`

as it was at `U_t`

, `D/(Δp^2)`

at `U_pp`

, `p=x,y`

and `1`

for `f`

.

It seems the formula is a mix-up of the one with difference quotients and the next stage where it gets multiplied by `Δt/2`

.

And in that next formula one does not need new constants as indeed `α_p=σ_p`

, `p=x,y`

and then you are right that the factor of `f`

should be `Δt/2`

.