New answers tagged

0

To be honest, I do not understand what you are asking about. I suspect, what you are concerned about is the fact that when you increase the density of your grid points, the solutions drastically change, insteaded of gradually improving and converging to the actual solution. So I could only offer my attempt to find a method for numerical solution that does ...


3

Regarding performance, Python is definitely the bottleneck. I have experienced the same issue with a 2D Euler code I had developed, even with vectorised operations everywhere possible. It was actually even worse, as I was using solve_ivp time schemes which reallocated memory at every step... You can try and profile your code to see where the bottlenecks are. ...


1

The way I computed the solution in the linked answer is the classical one: I just took a reference solution (assuming the code was correct, i.e. the numerical solution I found is the right one) with a small enough step size $h$, say $h=10^{-9}$. Then I computed the solution with smaller $h$s and for each one of those $h$ I computed the $|| e_h ||$ in a ...


2

I am by no means experienced with the wave equation, but I think the issue comes from the imposition of the periodic BCs. The periodic boundary conditions can be imposed by using ghost points: you do as if you were considering an extended system which, in Python terms, would have the state vector: u_extend=[u[-1], u[0], u[1], ..., u[M-1], u[M], u[0]] The ...


Top 50 recent answers are included