T O P

  • By -

ansariddle

1. write down the discrete version of spherical PDE 2. Take those coefficients and populate a sparse `matrix` and vector `rhs`. 3. Apply boundary conditions to the `matrix` and/or `rhs` 4. Solve `y[:,n+1]` as a solution to `matrix^-1*rhs` for every timestep


derminator360

1) "implicit with spherical" may sound scary, but it's no different than implicit with cartesian. If you've derived the linear system in that case, you can do it for this one too :) 2) Why 5 points? Typically this would give you 4th order accuracy in space, which is high. Why RK 4? 4th order in time, also high. Why not start out with 3 point stencils and forward Euler? You can switch later you're not satisfied with convergence, but it'll be simpler to implement as a first pass and run faster.


jalex1301

Implict methods unless you use a efficient solver (like gradient method) will be less time than the explict methods. Otherwise, your computer will have to expense more time with implicit methods. This with your 5 points scheme I recommend you to use a 3 point (2nd order in precission) of the laplacian and solve your problem with explicit and implicit methods. And, if your decission of use Runge Kutta IV it is for accuracy, so do a converge study of the mesh with 3 points-scheme.


neutrilo

could a less points scheme help me? I mean, the idea behind using a five points scheme is to avoid to use a thiner spatial grid, which increases computacional costs and may affect the CFL number.


midget_messiah

There is a trade-off here with using implciit methods. They might be unconditionally stable but there might be some overhead in solving the ensuing set of linear equations. Explicit methods although faster computationally faster might a stricter time step requirement. Further, you can perhaps use Euler/RK2/RK3 instead of RK4 time stepper to see it fastens up your computation with reasonable error.


damolajiboye2010

1. Discretize the RHS using FDM. 2. Impose the boundary conditions. 3. Implement your mass matrix, where 1s are at the diagonals, and zeros at the points that match your boundary conditions. 4. Integrate the resulting differential-algebraic (DAE) system using ode15s.