Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ok I just asked the Copilot AI, Copilot gives me the answer:⚠️ Likely Cause: r_uvN is a symbolic expression, not a callable function The monte_carlo_integral function expects a Python callable—something like lambda u,v: ... or a def-defined function. But r_uvN(u, v) is a symbolic expression, and Sage doesn’t automatically convert it into a callable for GSL-based numerical integration.

That’s why your result is near-zero: the integrator is likely sampling r_uvN as a constant or failing silently to evaluate it properly. try this:

f_uv = lambda u, v: r_uvN(u, v).n()
sNL = monte_carlo_integral(f_uv, [0, 0], [2*pi, 2*pi], 10000)

and it gives :(79.04914441964019, 0.27982586027289974) which is ok