New answers tagged

4 votes
Accepted

On solving a first order nonlinear differential equation

You can force a solvable explicit differential equation by taking the derivative of the equation $$ 2\cos(2x)x'+3\sin(3x')x''=x'+x''\\~\\ x''=\frac{(2\cos(2x)-1)x'}{1-3\sin(3x')} $$ For the initial ...
  • 4,829
0 votes

Solving 2D Poisson equation with nonhomogeneous boundary conditions (Dirichlet) and a source

Here is a more complex implementation of the explicit SOR iteration with the compact 8-point stencil for higher accuracy. It is also Multithreaded in Cython if you wish to benchmark your CPU and post ...
1 vote
Accepted

Solving 2D Poisson equation with nonhomogeneous boundary conditions (Dirichlet) and a source

Here is a basic implementation of solving the problem $-\Delta u = f$ using matrix-free methods, which are prefereble for large PDE discretizations. The efficiency could be improved in the Laplacian ...
  • 1,242
1 vote
Accepted

Why is this scipy.root code not converging?

After playing around with this a bit, I am almost certain that this is a conditioning issue. I discovered this by attempting to solve the problem with the initial guess being the result from ...
  • 1,242
3 votes

Why is this scipy.root code not converging?

My suggestion would be to use an ODE solver combined with the method of lines instead of trying to use a non-linear system solver. Here's an example of what this might look like: ...
  • 342

Top 50 recent answers are included