Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 109 characters in body
Source Link

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:

where $\beta$list is just a list of the different values of $\beta$ I want to generate. The following are the error outputs displayed while running this routine:

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:

added 1941 characters in body
Source Link

$x = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}F(x,y;z,T,\Delta) $$q = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}F(q,\phi;z,\beta,\Delta, J) $

$y = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}G(x,y;z,T, \Delta) $$\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$ are horrible (they involve error functions and exponential)quite involved, so in order to compute the Gaussian integral I have to use NIntegrateintegration over $z$ can only be achieved by a numerical integration. I have

My goal is to solve these self-consistent equations for sevaralseveral values of the parameters $\Delta$ and $T$$\beta$, then plot $x(T)$$x(\beta)$ for each valuedifferent values of $\Delta$. The problems I'm having areproceeding in the following way:

  1. There are some problems with NIntegrate, a lot of times it gives me an error indicating overflow, indeterminate form or infinite encountered.
  2. Those values that are successfully computed I have to insert them again until achieving convergence, nevertheless, a lot of those values are very small, hence even after the first iteration it gives back very small values and mathematica crashes, I want to take those values as zero.
  3. I want to find a way to automatize this process. I have used the functions Nest, NestWhile, FixedPoint, and related ones with no avail.

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}]

If someone is ableThen 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 at least shedwhich we are going to apply a lightfunction (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. The following are the error outputs displayed while running this problem I'llroutine:

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 extremely gratefulsuppressed during this
calculation"

NIntegrate::write "tag Times in -z is Protected"

several times

$x = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}F(x,y;z,T,\Delta) $

$y = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}G(x,y;z,T, \Delta) $

As you may see they are self-consistent equations, the main problem is that the expressions for $F$ and $G$ are horrible (they involve error functions and exponential), so in order to compute the Gaussian integral I have to use NIntegrate. I have to solve these self-consistent equations for sevaral values of the parameters $\Delta$ and $T$, then plot $x(T)$ for each value of $\Delta$. The problems I'm having are the following:

  1. There are some problems with NIntegrate, a lot of times it gives me an error indicating overflow, indeterminate form or infinite encountered.
  2. Those values that are successfully computed I have to insert them again until achieving convergence, nevertheless, a lot of those values are very small, hence even after the first iteration it gives back very small values and mathematica crashes, I want to take those values as zero.
  3. I want to find a way to automatize this process. I have used the functions Nest, NestWhile, FixedPoint, and related ones with no avail.

If someone is able to at least shed a light in this problem I'll be extremely grateful

$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. 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

edited tags
Link
Source Link
Loading