Skip to main content

All Questions

0 votes
1 answer
182 views

Using Crank-Nicolson to solve Non-Linear Schrödinger equation in Python

I aim to solve the (non-linear) Schrodinger equation using the Crank-Nicolson method in Python. Here are my two functions. ...
FairyLiquid's user avatar
2 votes
0 answers
173 views

Error in implementation of Crank-Nicolson method applied to 1D TDSE?

Some context, I've posted this question on physics SE and stack overflow. The former had nothing to offer, the latter had a great commenter that agreed with the phase looking off being one of the ...
MinimalCodingIQ's user avatar
6 votes
2 answers
389 views

Is the diffusion equation with Neumann and Dirichlet BCs well-posed?

I am considering the following diffusion equation: $$\frac{\partial f}{\partial t} = \frac{\partial}{\partial x}[D(x,t)\frac{\partial f}{\partial x}]$$ over a grid ...
R Thompson's user avatar
2 votes
2 answers
122 views

Stability of Crank-Nicolson for $u_t = iu_{xx}+2iu$

I want to use the Crank-Nicolson scheme to solve the equation $$u_t = iu_{xx}+2iu$$ Here's the analysis: Suppose we make a grid, with $k = dt$ and $h = dx$, the usual notation, and also $u_j^n = u(...
Rick Joker's user avatar
2 votes
1 answer
4k views

Applying Neumann boundaries to Crank-Nicolson solution in python

Consider the heat equation $$u_t = \kappa u_{xx}$$ with boundary conditions of $$u(x,0)=0\\ u(0,t)=100\\ u(l,t)=0$$ Numerical analysis by pyton can be done with ...
Googlebot's user avatar
  • 131
0 votes
1 answer
1k views

Crank–Nicolson method for nonlinear differential equation

I want to solve the following differential equation from a paper with the boundary condition: The paper used the Crank–Nicolson method for solving it. I think I understand the method after googling ...
Physicist's user avatar
  • 217
1 vote
1 answer
631 views

How can I numericaly solve a convection-diffusion equation with a large diffusion term?

I want to numerically solve the advection-diffusion equation: \begin{equation} u_t(x,t) + cu_x(x,t) = v u_{xx}(x,t) \end{equation} for $x \in [0,1]$ and $t \geq 0$ subject to the boundary conditions ...
fabian's user avatar
  • 113
1 vote
1 answer
409 views

Numerical Solution of non-linear diffusion equation using Finite Differencing

I'm trying to solve the following non-linear diffusion equation: $$ \frac{\partial}{\partial t} u(x,t)= \frac{\partial^{2}}{\partial x^{2}}u(x,t)^{3}$$ $$ -1\leq x \leq1, t \geq 0 $$ with the boundary ...
brokenseas's user avatar