I have following equation:

where $\delta_c=\frac{1}{2}\arcsin\left(\frac{\Omega_c}{h^2_c}\right)$ and I want to make a $\Omega_c(h_c)$ plot.

I have tried to solve it via NIntegrate and NSolve.

function[a_, b_, \[Delta]_] := NIntegrate[Sqrt[b(Cos[1/2 ArcSin[a/b]]^2 - Cos[\[Delta]]^2) + a (1/2 ArcSin[a/b] - \[Delta])], {\[Delta], 1/2 ArcSin[a/b] - \[Pi], 1/2 ArcSin[a/b]}]

NSolve[function[a, 0.1, \[Delta]] == \[Pi], a, Reals]

  • $\begingroup$ If you have tried something, please add it to the question. You're significantly more likely to get help if people don't have to redo all the things you did (starting already from copying the equation into MMA by hand, as there's no code for it) $\endgroup$
    – Lukas Lang
    Commented Jun 13, 2018 at 10:43
  • 2
    $\begingroup$ conflict: Functionparameter \Delta and integrationvariable \Delta. You should omit the parameter in the functiondefinition. $\endgroup$ Commented Jun 13, 2018 at 11:20

1 Answer 1

function[Ω_?NumericQ, h_?NumericQ] := 
NIntegrate[Sqrt[h^2 (Cos[1/2 ArcSin[Ω/h^2]]^2 - Cos[δ]^2) + Ω *(1/2 ArcSin[Ω/h^2] - δ)],
{δ, 1/2 ArcSin[Ω/h^2] - π, 1/2 ArcSin[Ω/h^2]}, 
Method -> "AdaptiveQuasiMonteCarlo"];

I used Method -> "AdaptiveQuasiMonteCarlo" in NDSolve,because is fast.

ContourPlot[function[Ω, h] == Pi, {h, -2, 2}, {Ω, -1/10, 1}, FrameLabel -> Automatic, 
PlotPoints -> 10] // Quiet

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.