diff --git a/README.md b/README.md index 7694354..7be6940 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Related Package: [MathieuFunctions.jl](https://github.com/BBN-Q/MathieuFunctions nu,ck=MathieuExponent(a,q) ``` where `nu` is the characteristic exponent and vector `ck` is the Fourier coefficients of the eigenfunction with `norm(ck)≈1`. -Note that `nu` is reduced to the interval `[0,2]` and `c0` corresponds to `ck[(length(ck)-1)÷2]` with the reduced `nu`. +Note that `nu` is reduced to the interval `[0,2]` and `c0` corresponds to `ck[(length(ck)-1)÷2]` with the reduced `nu`. (For `nu` is real, the procedure actually reduces `nu` into `[0,1]`). ```julia W=MathieuWron(nu,ck::Vector,index::Int) @@ -33,10 +33,22 @@ nu,ck=MathieuExponent(a,q) idx=(length(ck)-1)÷2+1 W=MathieuWron(nu,ck,idx) ``` +In some cases, `W` could be negative. One can replace `nu` with `-nu` and reverse `ck`, i.e., `reverse!(ck)`, to get a positive `W`. +If one prefers a positive `nu`, one can further shift `nu` with `nu+=2`. +In this case, `idx` should be `idx+=1`. +Code example: +```julia +nu=2-nu +reverse!(ck) +idx=idx+=1 +W_new=MathieuWron(nu,ck,idx) +``` +It can be verified that `W_new==-W`. If one knows `nu` (not reduced) and `q`, one can use ```julia W=MathieuWron(nu,q) ``` +During my test, the result is positive with such method. diff --git a/src/char-coeff-new-indexing.jl b/src/char-coeff-new-indexing.jl index b90defb..1432009 100644 --- a/src/char-coeff-new-indexing.jl +++ b/src/char-coeff-new-indexing.jl @@ -118,11 +118,13 @@ function MathieuCharVecWronλ(ν::Real,q::Real) end """ +`W=MathieuWron(ν,q)` or `W=MathieuWron(ν,C_k,index)`. + Return the Wronskian. For Mathieu's equation -y'' + (B_ν - 2 q cos( 2z )) y = 0, +y'' + (a- 2 q cos( 2z )) y = 0, the Wronskian is defined by @@ -130,7 +132,7 @@ the Wronskian is defined by \\frac{\\dot{f} f^*-f \\dot{f^*}}{2i} ``` -where ``f=e^{i\\nu z}\\sum_k{C_{2k}e^{i2kz}}`` with ``\\sum_k{C_{2k}^2}=1`` is the solution of the Mathieu equation and ``f^*`` is its complex conjugate. +where ``f=e^{i\\nu z}\\sum_k{C_{k}e^{i2kz}}`` with ``\\sum_k{C_{k}^2}=1`` is the solution of the Mathieu equation and ``f^*`` is its complex conjugate. """ function MathieuWron(ν,q) _,C_2k,index=MathieuCharVecλ(ν,q)