I have two sets of equations:
$q = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}F(q,\phi;z,\beta,\Delta, J) $
$\phi = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}G(q,\phi;z,\beta, \Delta, J) $
As you may see they are self-consistent equations, the main problem is that the expressions for $F$ and $G$ quite involved, so the integration over $z$ can only be achieved by a numerical integration.
My goal is to these self-consistent equations for several values of the parameters $\Delta$ and $\beta$, then plot $x(\beta)$ for different values of $\Delta$. The problems I'm proceeding in the following way:
The functions $F$ and $G$ are actually fractions with a common denominator I define as
Den[\[CapitalDelta]_, J_, \[Beta]_, q_, \[Phi]_, z_] =
(1/\[CapitalDelta])*Integrate[Exp[(-2^(-1))*(q - \[Phi])*\[Beta]^2*J^2*t^2]*
Cosh[\[Beta]*J*Sqrt[q]*z*t], {t, 1 - \[CapitalDelta]/2, 1 + \[CapitalDelta]/2}]
Then we comput the full functions $F$ and $G$, defined as fractionq and fraction$\phi$ in the latex code
fractionq[\[CapitalDelta]_, J_, \[Beta]_, q_, \[Phi]_] = 1/\[CapitalDelta]*Integrate[Exp[-1/2 (q-\[Phi]) \[Beta]^2 J^2 t^2] (t^2 Cosh[\[Beta] J Sqrt[q] z t]- z t /(\[Beta] J Sqrt[q])Sinh[\[Beta] J Sqrt[q]z t]),{t, 1-\[CapitalDelta]/2,1+\[CapitalDelta]/2}]/Den[\[CapitalDelta], J, \[Beta], q, \[Phi], z]
fraction\[Phi][\[CapitalDelta]_, J_, \[Beta]_, q_, \[Phi]_] = 1/\[CapitalDelta]*Integrate[Exp[-1/2 (q-\[Phi]) \[Beta]^2 J^2 t^2] t^2 Cosh[\[Beta] J Sqrt[q] z t],{t, 1-\[CapitalDelta]/2,1+\[CapitalDelta]/2}]/Den[\[CapitalDelta], J, \[Beta], q, \[Phi], z]
We then prepare the HoldForm of the numerical integration over $z$
RHSq[\[CapitalDelta]_, J_, \[Beta]_, q_, \[Phi]_]:= NIntegrate[1/Sqrt[2 Pi] Exp[-1/2 z^2] fractionq[\[CapitalDelta], J, \[Beta], q, \[Phi]], {z, -Infinity, Infinity},
PrecisionGoal->4, WorkingPrecision->10, AccuracyGoal->10, MinRecursion->2]
RHS\[Phi][\[CapitalDelta]_, J_, \[Beta]_, q_, \[Phi]_]:= NIntegrate[1/Sqrt[2 Pi] Exp[-1/2 z^2] fraction\[Phi][\[CapitalDelta], J, \[Beta], q, \[Phi]], {z, -Infinity, Infinity},
PrecisionGoal->4, WorkingPrecision->10, AccuracyGoal->10, MinRecursion->2]
And finally we defined the ordered pair {RHSq, RHS$\phi$} to which we are going to apply a function (either FixedPoint, Nest, NestWhile) in order to solve iteratively for several values of $\beta$ and $\Delta$.
newpairs[\[CapitalDelta]_, J_, \[Beta]_][{q_, \[Phi]_}]:={RHSq[\[CapitalDelta], J, \[Beta], q, \[Phi]], RHS\[Phi][\[CapitalDelta], J, \[Beta], q, \[Phi]]}
Table[FixedPoint[newpairs[0.2, 1, \[Beta]],{1.5,1}],{\[Beta],\[Beta]list}]
where $\beta$list is just a list of the different values of $\beta$ I want to generate.
TemperatureList = Table[i, {i, 0.0002, 2.0002, 0.02}]
\[Beta]list = 1/TemperatureList
The following are the error outputs displayed while running this routine:
NIntegrate::inumri "The integrand ... has evaluated to Overflow, Indeterminate, or Infinity for all
sampling points in the region with boundaries
{{-[Infinity],-3.000000000}}"
General::stop "Further output of NIntegrate::inumri will be suppressed during this
calculation"
NIntegrate::write "tag Times in -z is Protected"
several times
βlist
. Can you edit your question to include it? $\endgroup$FixedPoint
rather thanFindRoot
? On my five-year-old MacBook,FindRoot
returns a root of the equationnewpairs[0.2, 1, 1][{q, \[Phi]}] == {q, \[Phi]}
(i.e., $\beta = 1$) in a little over one minute, which seems like a reasonable time frame if you want to do 100 $\beta$ values.FixedPoint
takes longer (it's been running for five minutes so far without an output), but you may have some particular reason that you need to use it. $\endgroup$