- #1

MrMuscle

- 12

- 1

- TL;DR Summary
- Hello, I am trying to find the solution of Schrödinger equation on matlab. However, when I apply boundary conditions, MATLAB only gives me the solution with both coefficients 0. I want to find the solution : Asin(n*pi*x/L)

You can see my code below. Could you please tell me where is my mistake?

Thanks in advance!

Hello, I am trying to find the solution of Schrödinger equation on matlab. However, when I apply boundary conditions, MATLAB only gives me the solution with both coefficients 0. I want to find the solution : Asin(n*pi*x/L)

You can see my code below. Could you please tell me where is my mistake?

Thanks in advance!

clear,clc %Solution of Schrödinger eqn with 1-D infinite well

syms WF(x) V(x) %WF is the wavefunction, V(x) is the potential

syms hbar m L E positive %E energy, L length of the well, m mass, hbar reduced Planck

V(x)=0 %Potential

Sch=((-hbar^2)/(2*m))*diff(WF,x,2)+V*WF==E*WF %Schrödinger equation

Solution1=dsolve(Sch) %Solution without applying boundary conditions

%BOUNDARY CONDITIONS

cond1=WF(0)==0;

cond2=WF(L)==0;

conds=[cond1 cond2];

Solution2=dsolve(Sch,conds) %Solution with applying boundary conditions.

You can see my code below. Could you please tell me where is my mistake?

Thanks in advance!

clear,clc %Solution of Schrödinger eqn with 1-D infinite well

syms WF(x) V(x) %WF is the wavefunction, V(x) is the potential

syms hbar m L E positive %E energy, L length of the well, m mass, hbar reduced Planck

V(x)=0 %Potential

Sch=((-hbar^2)/(2*m))*diff(WF,x,2)+V*WF==E*WF %Schrödinger equation

Solution1=dsolve(Sch) %Solution without applying boundary conditions

%BOUNDARY CONDITIONS

cond1=WF(0)==0;

cond2=WF(L)==0;

conds=[cond1 cond2];

Solution2=dsolve(Sch,conds) %Solution with applying boundary conditions.