import numpy as np
from scipy.integrate import dblquad
def integrand_u(x, y):
rsq = x**2 + y**2
num = y * (1 - np.exp(-rsq))
denom = 2 * rsq
return -num/ denom if rsq != 0 else 0
def integrand_v(x, y):
rsq = x**2 + y**2
num = x * (1 - np.exp(-rsq))
denom = 2 * rsq
return num / denom if rsq != 0 else 0
result_u, error_u = dblquad(
integrand_u,
0, 2*np.pi,
lambda x: 0, lambda x: 2*np.pi,
epsabs=1e-8,
epsrel=1e-8
)
result_v, error_v = dblquad(
integrand_v,
0, 2*np.pi,
lambda x: 0, lambda x: 2*np.pi,
epsabs=1e-8,
epsrel=1e-8
)
int_u, err_u=dblquad(integrand_u, -np.inf, np.inf, -np.inf, np.inf)
int_v, err_v=dblquad(integrand_v, -np.inf, np.inf, -np.inf, np.inf)
print(f"Integral of u(x,y) from x=0 to 2π and y=0 to 2π: {result_u}")
print(f"Integral of v(x,y) from x=0 to 2π and y=0 to 2π: {result_v}")
print(f"Estimated error for u(x,y): {error_u}")
print(f"Estimated error for v(x,y): {error_v}")
print(f"Unbounded integral of u(x,y): {int_u}")
print(f"Unbounded integral of v(x,y): {int_v}")
print(f"Error in unbounded integral of u(x,y): {err_u}")
print(f"Error in unbounded integral of v(x,y): {err_v}")
To embed this project on your website, copy the following code and paste it into your website's HTML: