Mathematica Asked on December 10, 2021
I tried to use the Boole function to limit the boundaries of an interpolation function I created when integrating, and noticed that despite this condition, the function will always call extrapolated values outside the boundaries I set.
The interpolation function is in this case "g" and it depends on "betaangleJULY2" and "alphaangle".
g = Interpolation[newvalues, InterpolationOrder -> 3]
this is the domain : {0., 0.524}, {0., 6.28}
I try to test whether or not my function Tmaxc12 > g and "betaangleJULY2" is supposed to go from 0 to 30 degrees (radian) and so I tried to limit it with a Boole function.
In[254]:= vx = -vxvalC12;
vy = -3 vyvalC12;
vz = -3 vzvalC12;
U = 100000;
phi = 0;
Table[Boole[
Tmaxc12[vx, vy, vz, U, phi, theta]/e >=
g[betaangleJULY2[vx, vy, vz, U, phi, theta],
alphaangle[vx, vy, vz, U, phi, theta]]]*
Boole[0*Pi/180 <= betaangleJULY2[vx, vy, vz, U, phi, theta] <=
30*Pi/180], {theta, 0, Pi, Pi/10}]
During evaluation of In[254]:= InterpolatingFunction::dmval: Input value {2.18527,-1.89255} lies outside the range of data in the interpolating function. Extrapolation will be used.
During evaluation of In[254]:= InterpolatingFunction::dmval: Input value {1.86016,-2.56999} lies outside the range of data in the interpolating function. Extrapolation will be used.
During evaluation of In[254]:= InterpolatingFunction::dmval: Input value {1.56691,-2.78155} lies outside the range of data in the interpolating function. Extrapolation will be used.
During evaluation of In[254]:= General::stop: Further output of InterpolatingFunction::dmval will be suppressed during this calculation.
Out[259]= {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}
As you can see it tries to input values out of the domain "{0., 0.524}, {0., 6.28}" g is running. Why does it do that? Is there another way to limit it?
Important note : I’m trying to use the Boole in a 5-dimensional numerical integral, and the whole point is to use a method to limit it to regions of interest using the Boole. Here is the integral i’m trying to solve. It does work, but takes into account extrapolated values outside the domain g :
In[125]:=
sigmainterp1d[U_, theta1_] :=
NIntegrate[
Boole[Tmaxc12[0, 0, vz, U, phi, theta]/e >=
g[betaangleJULY2[0, 0, vz, U, phi, theta],
alphaangle[0, 0, vz, U, phi, theta]]]*
Boole[0*Pi/180 <= betaangleJULY2[0, 0, vz, U, phi, theta] <=
30*Pi/180]*Re[sigmaC122[theta, U]]*Sin[theta]*
Pvel[vz, VfitzC12]*10.^28, {vz, -4. vzvalC12, 4 vzvalC12}, {theta,
theta1*Pi/180, 180*Pi/180}, {phi, 0.0, 2. Pi},
Method -> {"GlobalAdaptive"}, PrecisionGoal -> 5,
WorkingPrecision -> 16];
sigmainterp1d[100000, 0] // Timing
During evaluation of In[125]:= 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.
During evaluation of In[125]:= NIntegrate::eincr: The global error of the strategy GlobalAdaptive has increased more than 2000 times. The global error is expected to decrease monotonically after a number of integrand evaluations. Suspect one of the following: the working precision is insufficient for the specified precision goal; the integrand is highly oscillatory or it is not a (piecewise) smooth function; or the true value of the integral is 0. Increasing the value of the GlobalAdaptive option MaxErrorIncreases might lead to a convergent numerical integration. NIntegrate obtained 2.3727490154535548735693937998327047145339710592518816987229221851`66. and 1.60422523089379523516466753746888488557616912696333443390413927214`66. for the integral and error estimates.
Out[126]= {12.3598, 2.372749015453555}
```
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP