Initialisierung

Clear[a,k,κ,α,β,R,T,En,V0,m,L]
SetOptions[Plot,LabelStyle->{FontFamily->"Helvetica",FontSize->16}];
h=6.626068*10^-34;
ℏ=h/(2 π);
me=9.10938188 (10^(-31));
eV=1.60217646 (10^(-19));
nm=(10^(-9));

ΦI[x_]:=Exp[I k x]+R Exp[-I k x]
ΦII[x_]:=α Exp[κ x]+β Exp[-κ x]
ΦIII[x_]:=T Exp[I k x]

sol=Solve[{ΦI[0]==ΦII[0],ΦI'[0]==ΦII'[0],ΦII[L]==ΦIII[L],ΦII'[L]==ΦIII'[L]},{R,T,α,β}]

k=(Sqrt[((2 m En)/(ℏ^2))]);
κ=(Sqrt[((2 m (V0-En))/(ℏ^2))]);

m=me;
V0=10 eV;
(*En=0.6 eV;
a=0.2nm;*)
Clear[En,a,L]

sol1=sol;

Probability amplitude:

p1[x_]=((Abs[(ΦI[x]/.sol1)])^2);
p2[x_]=((Abs[(ΦII[x]/.sol1)])^2);
p3[x_]=((Abs[(ΦIII[x]/.sol1)])^2);
p[x_]=Piecewise[{{p1[x],x<0},{p2[x],0≤x≤L},{p3[x],x>L}},x];

Wave function:

ψ1[x_]=ΦI[x]/.sol1;
ψ2[x_]=ΦII[x]/.sol1;
ψ3[x_]=ΦIII[x]/.sol1;
ψ[x_]=Piecewise[{{ψ1[x],x<0},{ψ2[x],0≤x≤L},{ψ3[x],x>L}},x];

ShowCodeButton:=DynamicModule[{mode=1(*show*)},SelectionMove[EvaluationNotebook[],All,EvaluationCell];
SetOptions[NotebookSelection[EvaluationNotebook[]],CellOpen->False];
Button[Dynamic[If[mode==1,"Show code","Hide code"]],If[mode==1,SelectionMove[EvaluationNotebook[],All,EvaluationCell];
SelectionMove[EvaluationNotebook[],Previous,Cell];SetOptions[NotebookSelection[EvaluationNotebook[]],CellOpen->True];
mode=2,
(*else*)
SelectionMove[EvaluationNotebook[],All,EvaluationCell];
SelectionMove[EvaluationNotebook[],Previous,Cell];SetOptions[NotebookSelection[EvaluationNotebook[]],CellOpen->False];
mode=1
]
]
]

Plot probability

ShowCodeButton
Manipulate[Block[{En=Energie eV,L=L1 nm},
pmax=(2(1+R\[Conjugate]R)/.sol1)/V0 eV;
Show[{Plot[Evaluate[p[x nm]/pmax],{x,-5,5},Frame->True,PlotRange->{-0.3 V0/eV,1.2 V0/eV},Axes->None,PlotPoints->2000,ImageSize->600,FrameLabel->{"Position [nm]","Energy [eV]"},Epilog->Inset[Text[Style["|T((|)^2)= "<>ToString[Re[(T\[Conjugate]T/.sol1)[[1]]],TraditionalForm]<>"\n|R((|)^2)= "<>ToString[Re[(R\[Conjugate]R/.sol1)[[1]]],TraditionalForm],16,FontFamily->"Helvetica"]],Scaled[{0.72,0.8}],{Left,Top}]],Graphics[{LightGray,Opacity[0.5],Rectangle[{0/nm ,0},{L/nm,V0/eV}],Rectangle[{-6,0},{6,-V0/eV}],Red,Line[{{-6,En/eV},{0/nm,En/eV}}](*,Green,Line[{{-6,(R\[Conjugate]R/.sol1)[[1]]},{-a/nm,(R\[Conjugate]R/.sol1)[[1]]}}],Blue,Line[{{a/nm,(T\[Conjugate]T/.sol1)[[1]]},{6,(T\[Conjugate]T/.sol1)[[1]]}}]*)}]}]],{{Energie,0.01,"Energie [eV]"},0.01,0.999V0/eV,ControlType->Slider,Appearance->"Labeled"},{{L1,1.0,"Barriere [nm]"},0.0001,2,ControlType->Slider,Appearance->"Labeled"},LabelStyle->Large,SaveDefinitions->True]

Plot real part of wave function

ShowCodeButton
Manipulate[Block[{En=Energie eV,L=L1 nm},
Show[{Plot[Evaluate[Re[ψ[x nm]]],{x,-5,5},Frame->True,PlotRange->{-0.3 V0/eV,1.2 V0/eV},Axes->None,PlotPoints->2000,ImageSize->600,FrameLabel->{"Position [nm]","Energy [eV]"},Epilog->Inset[Text[Style["|T((|)^2)= "<>ToString[Re[(T\[Conjugate]T/.sol1)[[1]]],TraditionalForm]<>"\n|R((|)^2)= "<>ToString[Re[(R\[Conjugate]R/.sol1)[[1]]],TraditionalForm],16,FontFamily->"Helvetica"]],Scaled[{0.72,0.8}],{Left,Top}]],Graphics[{LightGray,Opacity[0.5],Rectangle[{0/nm ,0},{L/nm,V0/eV}],Rectangle[{-6,0},{6,-V0/eV}],Red,Line[{{-6,En/eV},{0/nm,En/eV}}](*,Green,Line[{{-6,(R\[Conjugate]R/.sol1)[[1]]},{-a/nm,(R\[Conjugate]R/.sol1)[[1]]}}],Blue,Line[{{a/nm,(T\[Conjugate]T/.sol1)[[1]]},{6,(T\[Conjugate]T/.sol1)[[1]]}}]*)}]}]],{{Energie,0.01,"Energie [eV]"},0.01,0.999V0/eV,ControlType->Slider,Appearance->"Labeled"},{{L1,1.0,"Barriere [nm]"},0.0001,2,ControlType->Slider,Appearance->"Labeled"},LabelStyle->Large,SaveDefinitions->True]