-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continuity error with the function mathieu_modcem1 #12267
Comments
Thanks for reporting the issue.
Can you post the code that you used to produce the plot please?
I think I see what is happening,
would like to confirm.
Sincerely,
…-Lucas Roberts
On May 29, 2020, at 5:21 AM, brumann ***@***.***> wrote:
When looking at the shape of the derivative of the modified Mathieu function of order 1, it appears that there is a continuity problem.It sees to be a sign problem, I thought it would come from a square root branch mistake, but I cannot find that in the Mathieu function defined in Abramowitz and staging.
Here are the parameters to use to obtain the graph given:
q vary from 5 to 30 (200 points)
m = 6
x = 0.856
function ussed sp.mathieu_modcem1(m, q, x)[1]
Thank you in advance for your response.
Sincerely,
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thank you for your answer
In fact for my code I was just using the mathieu fonction inside a Newton's method and this one was finding an erroneous value. Sincerely |
On my side I can confirm that I see the same thing in master w/python 3.6
unfortunately it isn't what I thought it was and looks like it goes into the fortran codes. |
Some notes that may prove helpful to those who speak fortran:
scipy/scipy/special/functions.json Line 948 in f57e5bf
which leads to the source scipy/scipy/special/specfun_wrappers.c Line 525 in f57e5bf
and that calls the fortran: scipy/scipy/special/specfun_wrappers.c Line 537 in f57e5bf
and the fortran source starts here: scipy/scipy/special/specfun/specfun.f Line 11872 in 42e50b4
not immediately clear to me why an
|
The explanation of this problem is that the algorithm requires finding the root of a function that has multiple roots, and within a certain parameter region the initial estimate for the location of the root is poor such that the secant method root finding converges to a different root. The Fortran function scipy/scipy/special/specfun/specfun.f Lines 1402 to 1406 in 7815f95
with KD=1 , M=6 and Q=25.0 works fine but Q=25.25 shows the problem. CVA2 calls CV0 to obtain the initial estimate for A scipy/scipy/special/specfun/specfun.f Lines 764 to 769 in 7815f95
and then calls REFINE to improve itscipy/scipy/special/specfun/specfun.f Lines 1797 to 1801 in 7815f95
It is best illustrated by the following plot. According to the file header, all this Fortran code was taken from the book "Computation of Special Functions" by Zhang and Jin, 1996, Wiley and Sons. To proceed any further with this probably requires the assistance of someone who has a copy of the book. |
When looking at the shape of the derivative of the modified Mathieu function of order 1, it appears that there is a continuity problem.It sees to be a sign problem, I thought it would come from a square root branch mistake, but I cannot find that in the Mathieu function defined in Abramowitz and stegun.
Here are the parameters to use to obtain the graph given:
Thank you in advance for your response.
Sincerely,
The text was updated successfully, but these errors were encountered: