Skip to main content
deleted 7 characters in body
Source Link

An update from hardmath's comment: here are the equationsequation I'm attempting to solve is the time-dependent Schroedinger equation, with no potential. $$i \hbar \frac{ \partial }{ \partial t} u(x, t) = - \frac{ \hbar^{2} }{2m} \frac{\partial^2}{\partial x^2} u(x, t)$$ Applying the Crank-Nicolson method results in (for me): $$u_{j}^{n+1}+\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n+1}-2u_{j}^{n+1}+u_{j-1}^{n+1}}{\Delta x^2}= u_{j}^{n}-\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n}-2u_{j}^{n}+u_{j-1}^{n}}{\Delta x^2}$$ Superscript is for time stepping, subscript for space stepping. $$A_{l} u^{n+1} = A_{r} u^{n}$$ where: $$A_{l} = \begin{pmatrix} 1-\alpha & \alpha & \cdots & \cdots & 0 \\ \alpha & 1-2\alpha & \alpha & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \alpha & 1-2\alpha & \alpha \\ 0 & \cdots & \cdots & \alpha & 1-\alpha \\ \end{pmatrix}$$ $$A_{r} = \begin{pmatrix} 1-\beta & \beta & \cdots & \cdots & 0 \\ \beta & 1-2\beta & \beta & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \beta & 1-2\beta & \beta \\ 0 & \cdots & \cdots & \beta & 1-\beta \\ \end{pmatrix}$$ The coefficients $\alpha$ and $\beta$ collect terms arising from applying the Crank-Nicolson method to the form of the Schroedinger equation I'm attempting to solve here (and working with natural units $\hbar=m=1$): $$\alpha = \frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ $$\beta = -\frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ The matrices are diagonally symmetric, except the corners, where the boundary conditions imposed (Dirichlet: $u(x_{min},t)=u(x_{max},t)=0$) result in elements 'outside' the matrices being known as $0$ and changing the corner elements appropriately.

An update from hardmath's comment: here are the equations I'm attempting to solve the time-dependent Schroedinger equation, with no potential. $$i \hbar \frac{ \partial }{ \partial t} u(x, t) = - \frac{ \hbar^{2} }{2m} \frac{\partial^2}{\partial x^2} u(x, t)$$ Applying the Crank-Nicolson method results in (for me): $$u_{j}^{n+1}+\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n+1}-2u_{j}^{n+1}+u_{j-1}^{n+1}}{\Delta x^2}= u_{j}^{n}-\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n}-2u_{j}^{n}+u_{j-1}^{n}}{\Delta x^2}$$ Superscript is for time stepping, subscript for space stepping. $$A_{l} u^{n+1} = A_{r} u^{n}$$ where: $$A_{l} = \begin{pmatrix} 1-\alpha & \alpha & \cdots & \cdots & 0 \\ \alpha & 1-2\alpha & \alpha & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \alpha & 1-2\alpha & \alpha \\ 0 & \cdots & \cdots & \alpha & 1-\alpha \\ \end{pmatrix}$$ $$A_{r} = \begin{pmatrix} 1-\beta & \beta & \cdots & \cdots & 0 \\ \beta & 1-2\beta & \beta & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \beta & 1-2\beta & \beta \\ 0 & \cdots & \cdots & \beta & 1-\beta \\ \end{pmatrix}$$ The coefficients $\alpha$ and $\beta$ collect terms arising from applying the Crank-Nicolson method to the form of the Schroedinger equation I'm attempting to solve here (and working with natural units $\hbar=m=1$): $$\alpha = \frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ $$\beta = -\frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ The matrices are diagonally symmetric, except the corners, where the boundary conditions imposed (Dirichlet: $u(x_{min},t)=u(x_{max},t)=0$) result in elements 'outside' the matrices being known as $0$ and changing the corner elements appropriately.

An update from hardmath's comment: the equation I'm attempting to solve is the time-dependent Schroedinger equation, with no potential. $$i \hbar \frac{ \partial }{ \partial t} u(x, t) = - \frac{ \hbar^{2} }{2m} \frac{\partial^2}{\partial x^2} u(x, t)$$ Applying the Crank-Nicolson method results in (for me): $$u_{j}^{n+1}+\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n+1}-2u_{j}^{n+1}+u_{j-1}^{n+1}}{\Delta x^2}= u_{j}^{n}-\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n}-2u_{j}^{n}+u_{j-1}^{n}}{\Delta x^2}$$ Superscript is for time stepping, subscript for space stepping. $$A_{l} u^{n+1} = A_{r} u^{n}$$ where: $$A_{l} = \begin{pmatrix} 1-\alpha & \alpha & \cdots & \cdots & 0 \\ \alpha & 1-2\alpha & \alpha & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \alpha & 1-2\alpha & \alpha \\ 0 & \cdots & \cdots & \alpha & 1-\alpha \\ \end{pmatrix}$$ $$A_{r} = \begin{pmatrix} 1-\beta & \beta & \cdots & \cdots & 0 \\ \beta & 1-2\beta & \beta & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \beta & 1-2\beta & \beta \\ 0 & \cdots & \cdots & \beta & 1-\beta \\ \end{pmatrix}$$ The coefficients $\alpha$ and $\beta$ collect terms arising from applying the Crank-Nicolson method to the form of the Schroedinger equation I'm attempting to solve here (and working with natural units $\hbar=m=1$): $$\alpha = \frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ $$\beta = -\frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ The matrices are diagonally symmetric, except the corners, where the boundary conditions imposed (Dirichlet: $u(x_{min},t)=u(x_{max},t)=0$) result in elements 'outside' the matrices being known as $0$ and changing the corner elements appropriately.

Adding in equations.
Source Link

Some pretextcontext, 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 potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, which I had no idea existed!). Hopefully the question has a bit more success here.

An update from hardmath's comment: here are the equations I'm attempting to solve the time-dependent Schroedinger equation, with no potential. $$i \hbar \frac{ \partial }{ \partial t} u(x, t) = - \frac{ \hbar^{2} }{2m} \frac{\partial^2}{\partial x^2} u(x, t)$$ Applying the Crank-Nicolson method results in (for me): $$u_{j}^{n+1}+\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n+1}-2u_{j}^{n+1}+u_{j-1}^{n+1}}{\Delta x^2}= u_{j}^{n}-\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n}-2u_{j}^{n}+u_{j-1}^{n}}{\Delta x^2}$$ Superscript is for time stepping, subscript for space stepping. $$A_{l} u^{n+1} = A_{r} u^{n}$$ where: $$A_{l} = \begin{pmatrix} 1-\alpha & \alpha & \cdots & \cdots & 0 \\ \alpha & 1-2\alpha & \alpha & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \alpha & 1-2\alpha & \alpha \\ 0 & \cdots & \cdots & \alpha & 1-\alpha \\ \end{pmatrix}$$ $$A_{r} = \begin{pmatrix} 1-\beta & \beta & \cdots & \cdots & 0 \\ \beta & 1-2\beta & \beta & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \beta & 1-2\beta & \beta \\ 0 & \cdots & \cdots & \beta & 1-\beta \\ \end{pmatrix}$$ The coefficients $\alpha$ and $\beta$ collect terms arising from applying the Crank-Nicolson method to the form of the Schroedinger equation I'm attempting to solve here (and working with natural units $\hbar=m=1$): $$\alpha = \frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ $$\beta = -\frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ The matrices are diagonally symmetric, except the corners, where the boundary conditions imposed (Dirichlet: $u(x_{min},t)=u(x_{max},t)=0$) result in elements 'outside' the matrices being known as $0$ and changing the corner elements appropriately.

The wave function is $u$, and its superscript indicates its time: so if $n$ is the current time, I am using the Crank-Nicolson method to estimate the wave function at the next time after taking timestep $dt$, $n+1$.

Some pretext, 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 potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, which I had no idea existed!). Hopefully the question has a bit more success here.

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 potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, which I had no idea existed!). Hopefully the question has a bit more success here.

An update from hardmath's comment: here are the equations I'm attempting to solve the time-dependent Schroedinger equation, with no potential. $$i \hbar \frac{ \partial }{ \partial t} u(x, t) = - \frac{ \hbar^{2} }{2m} \frac{\partial^2}{\partial x^2} u(x, t)$$ Applying the Crank-Nicolson method results in (for me): $$u_{j}^{n+1}+\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n+1}-2u_{j}^{n+1}+u_{j-1}^{n+1}}{\Delta x^2}= u_{j}^{n}-\frac{1}{2}\frac{i\Delta t}{\hbar}\frac{-\hbar^{2}}{2m} \frac{u_{j+1}^{n}-2u_{j}^{n}+u_{j-1}^{n}}{\Delta x^2}$$ Superscript is for time stepping, subscript for space stepping. $$A_{l} u^{n+1} = A_{r} u^{n}$$ where: $$A_{l} = \begin{pmatrix} 1-\alpha & \alpha & \cdots & \cdots & 0 \\ \alpha & 1-2\alpha & \alpha & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \alpha & 1-2\alpha & \alpha \\ 0 & \cdots & \cdots & \alpha & 1-\alpha \\ \end{pmatrix}$$ $$A_{r} = \begin{pmatrix} 1-\beta & \beta & \cdots & \cdots & 0 \\ \beta & 1-2\beta & \beta & \cdots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & \cdots & \beta & 1-2\beta & \beta \\ 0 & \cdots & \cdots & \beta & 1-\beta \\ \end{pmatrix}$$ The coefficients $\alpha$ and $\beta$ collect terms arising from applying the Crank-Nicolson method to the form of the Schroedinger equation I'm attempting to solve here (and working with natural units $\hbar=m=1$): $$\alpha = \frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ $$\beta = -\frac{1}{4} \frac{i \Delta t}{ \Delta x^{2} }$$ The matrices are diagonally symmetric, except the corners, where the boundary conditions imposed (Dirichlet: $u(x_{min},t)=u(x_{max},t)=0$) result in elements 'outside' the matrices being known as $0$ and changing the corner elements appropriately.

The wave function is $u$, and its superscript indicates its time: so if $n$ is the current time, I am using the Crank-Nicolson method to estimate the wave function at the next time after taking timestep $dt$, $n+1$.

added link to previous SO post by same user
Source Link
hardmath
  • 3.5k
  • 2
  • 21
  • 41

Some pretext, I've posted this question on physics SE and stack overflowstack overflow. The former had nothing to offer, the latter had a great commenter that agreed with the phase looking off being one of the potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, which I had no idea existed!). Hopefully the question has a bit more success here.

Some pretext, 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 potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, which I had no idea existed!). Hopefully the question has a bit more success here.

Some pretext, 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 potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, which I had no idea existed!). Hopefully the question has a bit more success here.

Source Link
Loading