Making a 3xn matrix for the Schroedinger equation.

So I have this spatially discretised form of the schrodingers equation, which I am trying to turn in to a 3xn coefficient matrix, which I can evaluate using the 'eig' function.
How the matrix should look like is given, and all the variables in the equation are also give. It's a long equation so i have attached and image of it. Any ideas on how I would go about doing this?
This is what I have so far, it's very basic and I am new to matlab.
clear all
clc
hbar = (6.636e-34)/(2*pi);%plack's reduced constant
q = 1.6e-19; % charge on an electron
mfe = 9.11e-31; % mass of a free electron
dz = 1e-10; % mesh spacing
bh = 1 ; % barrier height
ww = 130e-10; % well width
bm = 0.1; % effective mass barrier
wm = 0.063; % effective mass in well
A = -(hbar^2)/(2*(dz^2)*q);
z = 190e-10;
v = bh
for z = 0:10e-10:190e-10;
if z > 30e-10 && z < 160e-10;
m = wm;
else
m = bm;
a = (A/m);
b = (2.*(A/m) - v);
c = (A./m);
mat = [b c 0 ; a b c; 0 a b];
Eig = eig(mat);
end
end
Any useful pointers on this would be appreciated.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 14 May 2015

Commented:

on 11 May 2022

Community Treasure Hunt

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

Start Hunting!