I want to solve the following problem.
First, the setup. A function $V(\varphi)$ defined as \begin{multline} V(\varphi)=\frac{\alpha-3}{4}e^{\sqrt{2\alpha}\varphi}+\frac{\alpha-5} {\gamma}e^{(\alpha-1)\sqrt{\frac{2}{\alpha}}\varphi}+\frac{\alpha^2- 7\alpha+4}{\alpha\gamma^2}e^{(\alpha-2)\sqrt{\frac{2}{\alpha}}\varphi}-\\ -\frac{\alpha(\gamma+2)^2}{4\gamma^2}+\frac{(\gamma+2)(3\gamma+14)} {4\gamma^2}-\frac{4}{\alpha\gamma^2}~, \end{multline} where $\varphi$ is a real variable and $\alpha$ is a constant real parameter (specifically I'm interested in $\alpha>(7+\sqrt{33})/2$). $\gamma$ is just $\gamma=2(2-\alpha)/\alpha$.
Then, there is the integral: $$N_e=\int^{\varphi_i}_{\varphi_f} d \varphi\frac{V(\varphi)}{V'(\varphi)},$$ where $\varphi_i$ is defined as $$\varphi_i=\sqrt{\frac{\alpha}{2}}\ln\left(\frac{\alpha^2-7\alpha+4}{(\alpha-3)(\alpha-2)}\right)~,$$ and is negative for $\alpha>(7+\sqrt{33})/2$, while $\varphi_f$ is the (negative) root of the equation $$\frac{1}{2}\left(\frac{V'(\varphi)}{V(\varphi)}\right)^2=1~.$$
My goal is to find the value of $\alpha$ for which $N_e=50$.
My attempt:
Clear["Global`*"]
V[φ_, α_] := ((α - 3)/4)*E^(Sqrt[2*α]*φ) +
((α - 5)/γ)*E^((α - 1)*Sqrt[2/α]*φ) + ((α^2 - 7*α + 4)/(α*γ^2))*
E^((α - 2)*Sqrt[2/α]*φ) - (α*(γ + 2)^2)/(4*γ^2) +
((γ + 2)*(3*γ + 14))/(4*γ^2) - 4/(α*γ^2);
γ = (-2*(α - 2))/α;
ϵ[φ_, α_] := (1/2)*(D[V[φ, α], φ]/V[φ, α])^2;
φi[α_] := Sqrt[α/2]*Log[(α^2 - 7*α + 4)/((α - 3)*(α - 2))];
φf[α_] := φ /. FindRoot[ϵ[φ, α] == 1, {φ, -0.3}];
Ne[(α_)?NumericQ] := NIntegrate[V[φ, α]/D[V[φ, α], φ], {φ, φf[α], φi[α]}];
FindRoot[Ne[α] == 50, {α, 11}]
However, this gives a list of errors most of which are on NIntegrate. For example the first two are
NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in φ near {φ} = {-0.748946837826036636752475288418998372825970122595301559087488385558}. NIntegrate obtained 25.416144461679007` and 2.053555362055963` for the integral and error estimates.
And the last one on FindRoot:
FindRoot::lstol: The line search decreased the step size to within tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the merit function. You may need more than MachinePrecision digits of working precision to meet these tolerances.
I'm not sure how to improve my code. Desirable accuracy for $\alpha$ would be two digits after the decimal point.
Updated the code.
\[Epsilon][\[Alpha]_]=...
(rigth hand side only depends on\[CurlyPhi]
$\endgroup$\[CurlyPhi]_, \[Alpha]_
! $\endgroup$V/V'
. What aboutV'/v
? $\endgroup$