Here I have a $\Psi$ function with a few arguments:
\[CapitalPsi][r1_, r2_, Nsize_, c_, eta_] := \[CapitalPsi][r2, r1, Nsize, c, eta] = \!\( \*UnderoverscriptBox[\(\[Sum]\), \(n2 = 1\), \(Nsize\)]\(( \*UnderoverscriptBox[\(\[Sum]\), \(n1 =
1\), \(n2\)]\(c[\([n1]\)]\)[\([n2]\)] \*SqrtBox[ FractionBox[\(64 \*SuperscriptBox[\((eta)\), \(6\)]\), \(n1 \((n1 + 1)\) n2 \((n2 +
1)\)\)]] \*SuperscriptBox[\(E\), \(\(-eta\)*\((r1 + r2)\)\)] \((LaguerreL[
n1 - 1, 2, 2*eta*r1] LaguerreL[n2 - 1, 2, 2*eta*r2] +
LaguerreL[n2 - 1, 2, 2*eta*r1] LaguerreL[n1 - 1, 2,
2*eta*r2])\))\)\);
$c$ is the coefficient that is stored as a 47x47 matrix and can be download here
Here comes the interesting thing:
First get rid of the dummy dimension
c = Import["~/Downloads/c.mat"];
c = ArrayReshape[c, Dimensions[c]~DeleteCases~1];
Then plot vs integrate:
Plot[\[CapitalPsi][r1, 0.01, 47, c, 0.675314001427934]^2*r1*r1, {r1,40,50}]
NIntegrate[\[CapitalPsi][r1, 0.01, 47, c, 0.675314001427934]^2*r1*
r1, {r1, 40, 50}]
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 r1 near {r1} = {44.8631}. NIntegrate obtained 2420.258935677104
and 347.10349104798587
for the integral and error estimates. >>
= 2420.26
But how could it be? The plot seems smooth but it seems there is a divergence in the integral that the singular point at 44.8631 contribute to the majority of the integral (2420.258935677104 out of 2420.26)
Update:
To make it easier for people to get the coefficient matrix $c$, you can also do it in this way:
URLSave["https://drive.google.com/uc?export=download&id=\1lZeEfZ1I2UmVaHJ_hRAZqtgkipI8P6su", "c.mat"]
c = Import["c.mat"]
c = ArrayReshape[c, Dimensions[c]~DeleteCases~1];
c
, not an expression we can't evaluate. $\endgroup$Import[]
command that downloaded the data. Not sure if ufile.io supports that. Here are some discussions on Meta about ways to make large amounts of data or code available on SE: (1351), (1520), (2145). (I like pastebin, because I can inspect the code easily in a browser before deciding whether to download it into Mathematica.) $\endgroup$URLSave
did not work for me, so I copied the data here:c = ToExpression@Import["https://pastebin.com/raw/jMWZasFN", "Text"];
, which also doesn't expire. $\endgroup$