From b33a273d57d0783f9c83cf484769329a9b3128c0 Mon Sep 17 00:00:00 2001 From: Shuhei Ohno Date: Mon, 10 Jun 2024 01:44:12 +0900 Subject: [PATCH] Add tests for MorsePotential and PoschlTeller, Close #43 --- src/MorsePotential.jl | 12 +-- src/PoschlTeller.jl | 10 +- test/MorsePotential.jl | 54 ++++++++++ test/PoschlTeller.jl | 70 ++++++++++++- test/result/MorsePotential.log | 50 +++++++++ test/result/PoschlTeller.log | 179 ++++++++++++++++++++++++--------- test/runtests.jl | 2 +- 7 files changed, 310 insertions(+), 67 deletions(-) diff --git a/src/MorsePotential.jl b/src/MorsePotential.jl index 03b0da6..895e0cf 100644 --- a/src/MorsePotential.jl +++ b/src/MorsePotential.jl @@ -27,10 +27,9 @@ function V(model::MorsePotential, r) end # eigenvalues -function E(model::MorsePotential; n::Int=0) - n_max = nₘₐₓ(model) - if !(0 ≤ n ≤ n_max) - throw(DomainError("n = $n, n_max = $n_max", "n must be non-negative and smaller than n_max: 0 ≤ n ≤ n_max.")) +function E(model::MorsePotential; n::Int=0, nocheck=false) + if !(0 ≤ n ≤ nₘₐₓ(model) || nocheck) + throw(DomainError("(n,nₘₐₓ(model)) = ($n,$(nₘₐₓ(model)))", "This function is defined for 0 ≤ n ≤ nₘₐₓ(model).")) end Dₑ = model.Dₑ k = model.k @@ -52,9 +51,8 @@ end # eigenfunctions function ψ(model::MorsePotential, r; n::Int=0) - n_max = nₘₐₓ(model) - if !(0 ≤ n ≤ n_max) - throw(DomainError("n = $n, n_max = $n_max", "n must be non-negative and smaller than n_max: 0 ≤ n ≤ n_max.")) + if !(0 ≤ n ≤ nₘₐₓ(model)) + throw(DomainError("(n,nₘₐₓ(model)) = ($n,$(nₘₐₓ(model)))", "This function is defined for 0 ≤ n ≤ nₘₐₓ(model).")) end if !(0 ≤ r) throw(DomainError("r = $r", "r must be non-negative: 0 ≤ r.")) diff --git a/src/PoschlTeller.jl b/src/PoschlTeller.jl index 821d3f7..3135a68 100644 --- a/src/PoschlTeller.jl +++ b/src/PoschlTeller.jl @@ -21,10 +21,10 @@ function nₘₐₓ(model::PoschlTeller) end # eigenvalues -function E(model::PoschlTeller; n::Int=0) +function E(model::PoschlTeller; n::Int=0, nocheck=false) n_max = nₘₐₓ(model) - if !(0 ≤ n ≤ n_max) - throw(DomainError("(n,n_max) = ($n,$n_max)", "This function is defined for 0 ≤ n ≤ n_max.")) + if !(0 ≤ n ≤ nₘₐₓ(model) || nocheck) + throw(DomainError("(n,nₘₐₓ(model)) = ($n,$(nₘₐₓ(model)))", "This function is defined for 0 ≤ n ≤ nₘₐₓ(model).")) end λ = model.λ m = model.m @@ -37,8 +37,8 @@ end # eigenfunctions function ψ(model::PoschlTeller, x; n::Int=0) n_max = nₘₐₓ(model) - if !(0 ≤ n ≤ n_max) - throw(DomainError("(n,n_max) = ($n,$n_max)", "This function is defined for 0 ≤ n ≤ n_max.")) + if !(0 ≤ n ≤ nₘₐₓ(model)) + throw(DomainError("(n,nₘₐₓ(model)) = ($n,$(nₘₐₓ(model)))", "This function is defined for 0 ≤ n ≤ nₘₐₓ(model).")) end λ = model.λ mu = n_max - n + 1 diff --git a/test/MorsePotential.jl b/test/MorsePotential.jl index 9fa07ec..4a4c9af 100644 --- a/test/MorsePotential.jl +++ b/test/MorsePotential.jl @@ -199,3 +199,57 @@ end println("""``` """) + + +# 0 < Eₙ₊₁ - Eₙ for 0 ≤ n ≤ nₘₐₓ + + +println(raw""" +#### Recurrence Relation between $E_{n+1}$ and $E_n$ + +```math +\begin{equation} +\left\{ \, + \begin{aligned} + 0 < \Delta E && 0 \leq n \leq n_\mathrm{max} \\ + \Delta E < 0 && \mathrm{otherwise} + \end{aligned} +\right. +\end{equation} +``` + +```math +\Delta E = E_{n+1} - E_n +``` + +```math +n_\mathrm{max} = \left\lfloor\frac{2 D_{\mathrm{e}}-h \nu_0}{h \nu_0}\right\rfloor +``` + +```""") + +@testset "0 < Eₙ₊₁ - Eₙ for 0 ≤ n ≤ nₘₐₓ" begin + println(" n Eₙ ΔE") + for n in 0:nₘₐₓ(MP)+5 + Eₙ₊₁ = E(MP, n=n+1, nocheck=true) + Eₙ = E(MP, n=n, nocheck=true) + ΔE = Eₙ₊₁ - Eₙ + @printf("%2d %+9.6f %+9.6f ", n, Eₙ, ΔE) + if n ≤ nₘₐₓ(MP) + print("0 < ΔE ") + acceptance = 0 < ΔE + else + print("ΔE < 0 ") + acceptance = ΔE < 0 + end + @test acceptance + println(acceptance ? "✔" : "✗") + if nₘₐₓ(MP) == n + println("----------------------------------- nₘₐₓ(MP) = ", nₘₐₓ(MP)) + end + end +end + +println("""``` +""") + diff --git a/test/PoschlTeller.jl b/test/PoschlTeller.jl index 1c6fd3c..7f9a9f0 100644 --- a/test/PoschlTeller.jl +++ b/test/PoschlTeller.jl @@ -152,8 +152,8 @@ are given by the sum of 2 Taylor series: @testset "∫ψₙ*Hψₙdx = <ψₙ|H|ψₙ> = Eₙ" begin ψHψ(PT, x; n=0, Δx=0.005) = V(PT,x)*ψ(PT,x,n=n)^2 - PT.ℏ^2/(2*PT.m)*conj(ψ(PT,x,n=n))*(ψ(PT,x+Δx,n=n)-2*ψ(PT,x,n=n)+ψ(PT,x-Δx,n=n))/Δx^2 - println(" λ | n | analytical | numerical ") - println("--- | -- | ----------------- | ----------------- ") + println(" λ | n | m | ℏ | x₀ | analytical | numerical ") + println("--- | -- | --- | --- | --- | ----------------- | ----------------- ") for λ in [1,2,3] for n in 0:λ-1 for m in [1.0,exp(1)] @@ -164,7 +164,7 @@ are given by the sum of 2 Taylor series: numerical = quadgk(x -> ψHψ(PT, x, n=n, Δx=0.001), -Inf, Inf, atol=1e-4)[1] acceptance = iszero(analytical) ? isapprox(analytical, numerical, atol=1e-3) : isapprox(analytical, numerical, rtol=1e-5) @test acceptance - @printf("%.1f | %2d | %.1f |%.1f |%.1f |%17.12f | %17.12f %s\n", λ, n, m, ℏ, x₀, analytical, numerical, acceptance ? "✔" : "✗") + @printf("%.1f | %2d | %.1f | %.1f | %.1f |%17.12f | %17.12f %s\n", λ, n, m, ℏ, x₀, analytical, numerical, acceptance ? "✔" : "✗") end end end @@ -174,4 +174,66 @@ end PT = PoschlTeller(λ=1.0, m=1.0, ℏ=1.0) println("""``` -""") \ No newline at end of file +""") + + +# 0 < Eₙ₊₁ - Eₙ for 0 ≤ n ≤ nₘₐₓ + + +println(raw""" +#### Recurrence Relation between $E_{n+1}$ and $E_n$ + +```math +\begin{equation} +\left\{ \, + \begin{aligned} + 0 < \Delta E && 0 \leq n \leq n_\mathrm{max} \\ + \Delta E < 0 && \mathrm{otherwise} + \end{aligned} +\right. +\end{equation} +``` + +```math +\Delta E = E_{n+1} - E_n +``` + +```math +n_\mathrm{max} = \left\lfloor \lambda \right\rfloor - 1 +``` + +```""") + +@testset "0 < Eₙ₊₁ - Eₙ for 0 ≤ n ≤ nₘₐₓ" begin + for PT in [ + PoschlTeller(λ=2, m=1.0, ℏ=1.0, x₀=1.0), + PoschlTeller(λ=3, m=1.0, ℏ=1.0, x₀=1.0), + PoschlTeller(λ=4, m=1.0, ℏ=1.0, x₀=1.0), + PoschlTeller(λ=10, m=1.0, ℏ=1.0, x₀=1.0), + ] + @show PT + println(" n Eₙ ΔE") + for n in 0:nₘₐₓ(PT)+5 + Eₙ₊₁ = E(PT, n=n+1, nocheck=true) + Eₙ = E(PT, n=n, nocheck=true) + ΔE = Eₙ₊₁ - Eₙ + @printf("%2d %+9.6f %+9.6f ", n, Eₙ, ΔE) + if n ≤ nₘₐₓ(PT) + print("0 < ΔE ") + acceptance = 0 < ΔE + else + print("ΔE < 0 ") + acceptance = ΔE < 0 + end + @test acceptance + println(acceptance ? "✔" : "✗") + if n == nₘₐₓ(PT) + println("----------------------------------- nₘₐₓ(PT) = ", nₘₐₓ(PT)) + end + end + println() + end +end + +println("""``` +""") diff --git a/test/result/MorsePotential.log b/test/result/MorsePotential.log index 1087ed2..15296b5 100644 --- a/test/result/MorsePotential.log +++ b/test/result/MorsePotential.log @@ -887,4 +887,54 @@ are given by the sum of 2 Taylor series: 0.1 | 9 | -0.026741858566 | -0.026742018376 ✔ ``` +#### Recurrence Relation between $E_{n+1}$ and $E_n$ + +```math +\begin{equation} +\left\{ \, + \begin{aligned} + 0 < \Delta E && 0 \leq n \leq n_\mathrm{max} \\ + \Delta E < 0 && \mathrm{otherwise} + \end{aligned} +\right. +\end{equation} +``` + +```math +\Delta E = E_{n+1} - E_n +``` + +```math +n_\mathrm{max} = \left\lfloor\frac{2 D_{\mathrm{e}}-h \nu_0}{h \nu_0}\right\rfloor +``` + +``` + n Eₙ ΔE + 0 -0.097414 +0.010033 0 < ΔE ✔ + 1 -0.087381 +0.009488 0 < ΔE ✔ + 2 -0.077893 +0.008943 0 < ΔE ✔ + 3 -0.068951 +0.008398 0 < ΔE ✔ + 4 -0.060553 +0.007852 0 < ΔE ✔ + 5 -0.052701 +0.007307 0 < ΔE ✔ + 6 -0.045393 +0.006762 0 < ΔE ✔ + 7 -0.038631 +0.006217 0 < ΔE ✔ + 8 -0.032414 +0.005672 0 < ΔE ✔ + 9 -0.026742 +0.005127 0 < ΔE ✔ +10 -0.021615 +0.004582 0 < ΔE ✔ +11 -0.017033 +0.004037 0 < ΔE ✔ +12 -0.012996 +0.003492 0 < ΔE ✔ +13 -0.009505 +0.002946 0 < ΔE ✔ +14 -0.006558 +0.002401 0 < ΔE ✔ +15 -0.004157 +0.001856 0 < ΔE ✔ +16 -0.002301 +0.001311 0 < ΔE ✔ +17 -0.000989 +0.000766 0 < ΔE ✔ +18 -0.000223 +0.000221 0 < ΔE ✔ +----------------------------------- nₘₐₓ(MP) = 18 +19 -0.000002 -0.000324 ΔE < 0 ✔ +20 -0.000327 -0.000869 ΔE < 0 ✔ +21 -0.001196 -0.001414 ΔE < 0 ✔ +22 -0.002610 -0.001959 ΔE < 0 ✔ +23 -0.004570 -0.002505 ΔE < 0 ✔ +``` + diff --git a/test/result/PoschlTeller.log b/test/result/PoschlTeller.log index 4d66acf..bb141e2 100644 --- a/test/result/PoschlTeller.log +++ b/test/result/PoschlTeller.log @@ -249,56 +249,135 @@ are given by the sum of 2 Taylor series: ``` ``` - λ | n | analytical | numerical ---- | -- | ----------------- | ----------------- -1.0 | 0 | 1.0 |1.0 |1.0 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 1.0 |1.0 |2.7 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 1.0 |2.7 |1.0 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 1.0 |2.7 |2.7 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 2.7 |1.0 |1.0 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 2.7 |1.0 |2.7 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 2.7 |2.7 |1.0 | -0.500000000000 | -0.499999884228 ✔ -1.0 | 0 | 2.7 |2.7 |2.7 | -0.500000000000 | -0.499999884228 ✔ -2.0 | 0 | 1.0 |1.0 |1.0 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 1.0 |1.0 |2.7 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 1.0 |2.7 |1.0 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 1.0 |2.7 |2.7 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 2.7 |1.0 |1.0 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 2.7 |1.0 |2.7 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 2.7 |2.7 |1.0 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 0 | 2.7 |2.7 |2.7 | -2.000000000000 | -2.000000092516 ✔ -2.0 | 1 | 1.0 |1.0 |1.0 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 1.0 |1.0 |2.7 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 1.0 |2.7 |1.0 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 1.0 |2.7 |2.7 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 2.7 |1.0 |1.0 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 2.7 |1.0 |2.7 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 2.7 |2.7 |1.0 | -0.500000000000 | -0.499999981862 ✔ -2.0 | 1 | 2.7 |2.7 |2.7 | -0.500000000000 | -0.499999981862 ✔ -3.0 | 0 | 1.0 |1.0 |1.0 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 1.0 |1.0 |2.7 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 1.0 |2.7 |1.0 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 1.0 |2.7 |2.7 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 2.7 |1.0 |1.0 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 2.7 |1.0 |2.7 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 2.7 |2.7 |1.0 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 0 | 2.7 |2.7 |2.7 | -4.500000000000 | -4.500000231846 ✔ -3.0 | 1 | 1.0 |1.0 |1.0 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 1.0 |1.0 |2.7 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 1.0 |2.7 |1.0 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 1.0 |2.7 |2.7 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 2.7 |1.0 |1.0 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 2.7 |1.0 |2.7 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 2.7 |2.7 |1.0 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 1 | 2.7 |2.7 |2.7 | -2.000000000000 | -2.000000666708 ✔ -3.0 | 2 | 1.0 |1.0 |1.0 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 1.0 |1.0 |2.7 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 1.0 |2.7 |1.0 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 1.0 |2.7 |2.7 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 2.7 |1.0 |1.0 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 2.7 |1.0 |2.7 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 2.7 |2.7 |1.0 | -0.500000000000 | -0.500000668186 ✔ -3.0 | 2 | 2.7 |2.7 |2.7 | -0.500000000000 | -0.500000668186 ✔ + λ | n | m | ℏ | x₀ | analytical | numerical +--- | -- | --- | --- | --- | ----------------- | ----------------- +1.0 | 0 | 1.0 | 1.0 | 1.0 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 1.0 | 1.0 | 2.7 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 1.0 | 2.7 | 1.0 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 1.0 | 2.7 | 2.7 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 2.7 | 1.0 | 1.0 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 2.7 | 1.0 | 2.7 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 2.7 | 2.7 | 1.0 | -0.500000000000 | -0.499999884228 ✔ +1.0 | 0 | 2.7 | 2.7 | 2.7 | -0.500000000000 | -0.499999884228 ✔ +2.0 | 0 | 1.0 | 1.0 | 1.0 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 1.0 | 1.0 | 2.7 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 1.0 | 2.7 | 1.0 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 1.0 | 2.7 | 2.7 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 2.7 | 1.0 | 1.0 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 2.7 | 1.0 | 2.7 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 2.7 | 2.7 | 1.0 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 0 | 2.7 | 2.7 | 2.7 | -2.000000000000 | -2.000000092516 ✔ +2.0 | 1 | 1.0 | 1.0 | 1.0 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 1.0 | 1.0 | 2.7 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 1.0 | 2.7 | 1.0 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 1.0 | 2.7 | 2.7 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 2.7 | 1.0 | 1.0 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 2.7 | 1.0 | 2.7 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 2.7 | 2.7 | 1.0 | -0.500000000000 | -0.499999981862 ✔ +2.0 | 1 | 2.7 | 2.7 | 2.7 | -0.500000000000 | -0.499999981862 ✔ +3.0 | 0 | 1.0 | 1.0 | 1.0 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 1.0 | 1.0 | 2.7 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 1.0 | 2.7 | 1.0 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 1.0 | 2.7 | 2.7 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 2.7 | 1.0 | 1.0 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 2.7 | 1.0 | 2.7 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 2.7 | 2.7 | 1.0 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 0 | 2.7 | 2.7 | 2.7 | -4.500000000000 | -4.500000231846 ✔ +3.0 | 1 | 1.0 | 1.0 | 1.0 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 1.0 | 1.0 | 2.7 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 1.0 | 2.7 | 1.0 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 1.0 | 2.7 | 2.7 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 2.7 | 1.0 | 1.0 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 2.7 | 1.0 | 2.7 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 2.7 | 2.7 | 1.0 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 1 | 2.7 | 2.7 | 2.7 | -2.000000000000 | -2.000000666708 ✔ +3.0 | 2 | 1.0 | 1.0 | 1.0 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 1.0 | 1.0 | 2.7 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 1.0 | 2.7 | 1.0 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 1.0 | 2.7 | 2.7 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 2.7 | 1.0 | 1.0 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 2.7 | 1.0 | 2.7 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 2.7 | 2.7 | 1.0 | -0.500000000000 | -0.500000668186 ✔ +3.0 | 2 | 2.7 | 2.7 | 2.7 | -0.500000000000 | -0.500000668186 ✔ +``` + +#### Recurrence Relation between $E_{n+1}$ and $E_n$ + +```math +\begin{equation} +\left\{ \, + \begin{aligned} + 0 < \Delta E && 0 \leq n \leq n_\mathrm{max} \\ + \Delta E < 0 && \mathrm{otherwise} + \end{aligned} +\right. +\end{equation} +``` + +```math +\Delta E = E_{n+1} - E_n +``` + +```math +n_\mathrm{max} = \left\lfloor \lambda \right\rfloor - 1 +``` + +``` +PT = PoschlTeller(2, 1.0, 1.0, 1.0) + n Eₙ ΔE + 0 -2.000000 +1.500000 0 < ΔE ✔ + 1 -0.500000 +0.500000 0 < ΔE ✔ +----------------------------------- nₘₐₓ(PT) = 1 + 2 +0.000000 -0.500000 ΔE < 0 ✔ + 3 -0.500000 -1.500000 ΔE < 0 ✔ + 4 -2.000000 -2.500000 ΔE < 0 ✔ + 5 -4.500000 -3.500000 ΔE < 0 ✔ + 6 -8.000000 -4.500000 ΔE < 0 ✔ + +PT = PoschlTeller(3, 1.0, 1.0, 1.0) + n Eₙ ΔE + 0 -4.500000 +2.500000 0 < ΔE ✔ + 1 -2.000000 +1.500000 0 < ΔE ✔ + 2 -0.500000 +0.500000 0 < ΔE ✔ +----------------------------------- nₘₐₓ(PT) = 2 + 3 +0.000000 -0.500000 ΔE < 0 ✔ + 4 -0.500000 -1.500000 ΔE < 0 ✔ + 5 -2.000000 -2.500000 ΔE < 0 ✔ + 6 -4.500000 -3.500000 ΔE < 0 ✔ + 7 -8.000000 -4.500000 ΔE < 0 ✔ + +PT = PoschlTeller(4, 1.0, 1.0, 1.0) + n Eₙ ΔE + 0 -8.000000 +3.500000 0 < ΔE ✔ + 1 -4.500000 +2.500000 0 < ΔE ✔ + 2 -2.000000 +1.500000 0 < ΔE ✔ + 3 -0.500000 +0.500000 0 < ΔE ✔ +----------------------------------- nₘₐₓ(PT) = 3 + 4 +0.000000 -0.500000 ΔE < 0 ✔ + 5 -0.500000 -1.500000 ΔE < 0 ✔ + 6 -2.000000 -2.500000 ΔE < 0 ✔ + 7 -4.500000 -3.500000 ΔE < 0 ✔ + 8 -8.000000 -4.500000 ΔE < 0 ✔ + +PT = PoschlTeller(10, 1.0, 1.0, 1.0) + n Eₙ ΔE + 0 -50.000000 +9.500000 0 < ΔE ✔ + 1 -40.500000 +8.500000 0 < ΔE ✔ + 2 -32.000000 +7.500000 0 < ΔE ✔ + 3 -24.500000 +6.500000 0 < ΔE ✔ + 4 -18.000000 +5.500000 0 < ΔE ✔ + 5 -12.500000 +4.500000 0 < ΔE ✔ + 6 -8.000000 +3.500000 0 < ΔE ✔ + 7 -4.500000 +2.500000 0 < ΔE ✔ + 8 -2.000000 +1.500000 0 < ΔE ✔ + 9 -0.500000 +0.500000 0 < ΔE ✔ +----------------------------------- nₘₐₓ(PT) = 9 +10 +0.000000 -0.500000 ΔE < 0 ✔ +11 -0.500000 -1.500000 ΔE < 0 ✔ +12 -2.000000 -2.500000 ΔE < 0 ✔ +13 -4.500000 -3.500000 ΔE < 0 ✔ +14 -8.000000 -4.500000 ΔE < 0 ✔ + ``` diff --git a/test/runtests.jl b/test/runtests.jl index 4028a6e..91c94ee 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -10,7 +10,7 @@ using LaTeXStrings using SpecialFunctions @testset "Antique.jl" begin - for model in [:HydrogenAtom, :CoulombTwoBody] # Antique.models + for model in [:MorsePotential, :PoschlTeller] # [:HydrogenAtom, :CoulombTwoBody] # Antique.models result = @capture_out begin include("./$(model).jl") end