New answers tagged

2

The problem with output from parallel processes is that they all go through ssh tunnels, and there is no guarantee in what order they will arrive. Even if you use Send/Recv to sequentialize them. You could do the following: mpirun -np 8 program_script where program_script: #!/bin/bash your_program > program.out$PMPI_RANK and then for i in `seq 1 8` ;...


1

Runge-Kutta methods solve equations of the form $$\dot y = \frac{\mathrm{d} y}{\mathrm{d} t} = F(t,y(t)),$$ where $y$ can be multidimensional. The first step is reconducting your equation to this form. Starting from $$ \begin{cases} \dot x_n(t) = \frac{p_n(t)}{m} = f(p_{n}(t))& \\ \dot p_n(t) = -k \left[\left(x_n(t)-x_{n-1}(t)\right) + \...


1

I'm not sure why you think your system of ODEs cannot be solved by using RK4, but I think the easiest way to do this is using DifferentialEquations.jl. Basically you have $2n$ unknowns and $2n$ ODEs, which should be good to solve as long as you have their initial conditions. I think you could look at an example for system of ODEs here from their official ...


1

It is to be expected that the weights become large, see Figure 3.2-2 in Fornberg's book A Practical Guide to Pseudospectral Methods. It shows the weights of the first derivative on a uniform grid, but I expect the same trends apply also to second derivatives on non-uniform grids. Having said that, I doubt that it makes much sense for you to make your ...


2

I agree with what @davidhigh suggested: 300 gridpoints is too much. In the 1988 paper, Fornberg said that ...the order of accuracy is generally $n-m+1$ for which 300 grid points would lead to 299th order of accuracy if I understood you correctly.


Top 50 recent answers are included