time -independe​nt-Schrodi​nger-like-​1D-pde

5 views (last 30 days)
pritha
pritha on 18 Jan 2024
Commented: pritha on 1 Feb 2024
I have [-\nabla^2+ (h*G(x)+H(x)) ] y(x) = h^2 y(x), where, for a range of x values, G(x) and H(x) values are known (not their functions are known). How to solve h and y(x) simultaneously.

Answers (1)

Amish
Amish on 22 Jan 2024
Hi Pritha,
I see that you are looking for a way to solve time-independent Schrödinger-like 1D Partial Differential Equation. Solving the time-independent Schrödinger-like 1D PDE, where "G(x)" and "H(x)" are given as data points rather than as analytical functions, typically requires numerical methods.
The equation you've provided resembles the time-independent Schrödinger equation with a potential "V(x) = hG(x) + H(x)", and you're looking to solve for the eigenvalues "h^2" and corresponding eigenfunctions "y(x)".
Follwing are the high-level steps you might do using the finite difference methods:
  1. Discretize the Spatial Domain
  2. Discretize the Equation
  3. Construct the Matrix Equation
  4. Solve the Eigenvalue Problem
  5. Post-Process
You can find a generic MATLAB code for the same below:
% Assuming that the Gx and Hx are vectors containing the values of G(x) and H(x) at discrete points x
N = length(Gx); % Number of points
dx = x(2) - x(1); % Uniform spacing
% Make a tridiagonal matrix for the discretized -nabla^2 operator
main_diag = -2 * ones(N, 1) / dx^2;
off_diag = ones(N-1, 1) / dx^2;
laplacian_matrix = diag(main_diag) + diag(off_diag, 1) + diag(off_diag, -1);
% Add the potential terms to the diagonal
A = laplacian_matrix + diag(h*Gx + Hx);
% Solve the eigenvalue problem
[eigenvectors, eigenvalues] = eig(A);
% Extract eigenvalues and convert them to h^2
h_squared = diag(eigenvalues);
The above code assumes the conditions of a uniform grid and boundary conditions that the wavefunction "y(x)" goes to zero at the boundaries of the domain.
Here are some of the documentation links for your reference:
Hope this helps!
  2 Comments
pritha
pritha on 22 Jan 2024
Thanks for you reply Amish. I'm getting "Unrecognized function or variable 'h'." while running. Could you suggest how to solve this?
pritha
pritha on 1 Feb 2024
Here eigen values are 'h' not 'h^2' and it is also multiplied with the potential G(x). So it cant be extracted simply from eig(A). Could you please help me out?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!