# Tag Info

13

I'll write the equation short as $$\ddot x(t)+c\dot x(t)=a(t,x(t))$$ to separate the "easy" linear parts from the non-linear and forcing terms. On the first method The claimed order of the method is two, the implemented order is one. This is due to the implementation of the first derivative as a one-sided difference quotient. Changing that to the ...

4

Let's do it for the left boundary point $x=a$, and for simplicity assume $a=0$. To implement $u_x$=0 at $x$=0, assume the function $u(x)$ is even in the vicinity of $x$=0, and let the grid points be $x_0=0$, $x_1=h$, etc. Then, using the symmetry of the function, $u(-x_1)=u(x_1)$, the second derivative evaluated with the standard second-order accurate ...

1

I know this is a little bit late, but there's a third party library in Python which solve PDEs using FD, it is called findiff. Check it out.

1

Anyone still interested in an answer, see this article: P. Y. P. Chen and B. A. Malomed, "Lanczos-Chebyshev pseudospectral methods for wave-propagation problems," Mathematics Computers Simulation, vol. 82, no. 6, pp. 1056–1068, Feb. 2012. In this published method, Crank-Nicholson forward difference method is used with an inner iterative step to ...

Top 50 recent answers are included