Skip to content
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

Full modal integral does not give correct results #246

Closed
chrisbrahms opened this issue Oct 13, 2021 · 2 comments · Fixed by #247
Closed

Full modal integral does not give correct results #246

chrisbrahms opened this issue Oct 13, 2021 · 2 comments · Fixed by #247

Comments

@chrisbrahms
Copy link
Collaborator

I have two separate combination of modes, both TM01+HE21, but with HE21 rotated by π/4 in one case and -π/4 in the other. This creates LP11 modes with different orientations:
image

If I now calculate the plasma nonlinear polarisation for both of these using TransModal with full=true, I don't get the same result. I can fix this, however, by changing from pcubature_v to hcubature_v:
image

The reason appears to be that pcubature starts by evaluating at three angles, θ = [0, π, 2π], and then never goes any further (I got this by printing xs inside pointcalc!). In the vertical case, it only actually runs pointcalc! once, so I get

julia> transform_vert(nl_vert, Eω_vert, 0.0);
pointcalc eval at 
        r=[6.25e-5, 6.25e-5, 6.25e-5, 0.000125, 0.000125, 0.000125, 0.0, 0.0, 0.0]
        θ/π=[1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0]
@chrisbrahms
Copy link
Collaborator Author

It appears this is the exact same problem as in JuliaMath/Cubature.jl#24

@chrisbrahms
Copy link
Collaborator Author

chrisbrahms commented Oct 13, 2021

I think the problem is actually more general than this, to the extent that the full modal integration doesn't actually work at all. I cannot seem to get pcubature to evaluate the integrand anywhere other than 0, π and 2π for any combination of modes. For the horizontal mode example above, I get several iterations of the integral, but still only at those angles. Same for a diagonal version

pointcalc eval at 
        r=[0.00012498117616851275, 0.00012498117616851275, 0.00012498117616851275, 1.8823831487239906e-8, 1.8823831487239906e-8, 1.8823831487239906e-8, 0.00012483065354241814, 0.00012483065354241814, 0.00012483065354241814, 1.693464575818664e-7, 1.693464575818664e-7, 1.693464575818664e-7, 0.00012452997091241938, 0.00012452997091241938, 0.00012452997091241938, 4.700290875806249e-7, 4.700290875806249e-7, 4.700290875806249e-7, 0.00012407985264930883, 0.00012407985264930883, 0.00012407985264930883, 9.201473506911763e-7, 9.201473506911763e-7, 9.201473506911763e-7, ...]
        θ/π=[1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 0.0, ...]

This can also be seeen in the difference between pcubature and hcubature in the plot above: not only do the curves agree for hcubature, but the peak value of the nonlinear polarisation is different as well!

@chrisbrahms chrisbrahms changed the title Full modal integral does not give correct results for some mode shapes Full modal integral does not give correct results Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant