diff --git a/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.mlx b/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.mlx deleted file mode 100644 index c3f4087..0000000 Binary files a/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.mlx and /dev/null differ diff --git a/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.pdf b/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.pdf index cba2d3c..6cbafba 100644 Binary files a/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.pdf and b/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Comparison.pdf differ diff --git a/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Precision_Tests.mlx b/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Precision_Tests.mlx new file mode 100644 index 0000000..b71c694 Binary files /dev/null and b/exemples/MATLAB_Comparison/MATLAB_Wavefunction_Precision_Tests.mlx differ diff --git a/exemples/MATLAB_Comparison/wavefunction_MATLAB_3.m b/exemples/MATLAB_Comparison/wavefunction_MATLAB_3.m new file mode 100644 index 0000000..85423e3 --- /dev/null +++ b/exemples/MATLAB_Comparison/wavefunction_MATLAB_3.m @@ -0,0 +1,18 @@ +function wavefunction = wavefunction_MATLAB_3(n,x,prec) + + digits(prec); + x = vpa(x); + x_size = numel(x); + + wavefunction = vpa(zeros(x_size, n+1)); + + for index = 1:n+1 + + norm = (2^(-0.5*vpa(index-1))) * (gamma(vpa(index-1)+1)^(-0.5)) * (pi^(-0.25)); + + H = hermiteH(vpa(index-1),x); + + wavefunction(:,index) = norm * exp(-0.5 * x^2) * H; + end + +end \ No newline at end of file diff --git a/exemples/MATLAB_Comparison/wavefunction_MATLAB_4.m b/exemples/MATLAB_Comparison/wavefunction_MATLAB_4.m new file mode 100644 index 0000000..e4d792d --- /dev/null +++ b/exemples/MATLAB_Comparison/wavefunction_MATLAB_4.m @@ -0,0 +1,18 @@ +function wavefunction = wavefunction_MATLAB_4(n,x,prec) + + digits(prec); + x = vpa(x); + x_size = numel(x); + + wavefunction = vpa(zeros(n+1, x_size)); + + for index = 1:n+1 + + norm = (2^(-0.5*vpa(index-1))) * (gamma(vpa(index-1)+1)^(-0.5)) * (pi^(-0.25)); + + H = hermiteH(vpa(index-1),x); + + wavefunction(index,:) = norm * exp(-0.5 * x.^2) .* H; + end + +end \ No newline at end of file