```
import math
import matplotlib.pyplot as plt
import numpy as np 
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from sympy import Symbol
from scipy import integrate
from sympy import Integral, integrate
from scipy.integrate import quad
from sympy import simplify
from sympy import integrate, init_printing
from sympy.abc import T,S,U
u=np.linspace(-1.5,1.5,10)
v=np.linspace(-1.5,1.5,10)
w=np.arange(0,1,0.8)
t=np.linspace(0,10)
s=np.linspace(0,2*np.pi)
## parte uno Graficar Fx,Fy,Fz
umesh,vmesh,wmesh=np.meshgrid(u,v,w,indexing='ij')
def F(u,v,w):
    l=w*(math.e**u)
    m=(math.e**v)-u
    o=w
    return np.array([l,m,o])
lmesh,mmesh,omesh=F(umesh,vmesh,wmesh)
fig1=plt.figure('Campo vectorial F')
ax=fig1.gca(projection='3d')
ax.set_xlabel('$Fx $')
ax.set_ylabel('$Fy $')
ax.set_zlabel('$Fz $')
ax.quiver(umesh,vmesh,wmesh,lmesh,mmesh,omesh,length=0.3)
### grafica de campo en una Esfera
fig2 = plt.figure('Representacion de F en una Superficie')
am = fig2.add_subplot(111, projection='3d')
 
def sphere(r):
    p = np.linspace(0, 2 * np.pi, 20)
    q = np.linspace(0, np.pi, 20)
    x = r * np.outer(np.cos(p), np.sin(q))
    y = r * np.outer(np.sin(p), np.sin(q))
    z = r * np.outer(np.ones(np.size(p)), np.cos(q))
    return x,y,z

x,y,z = sphere(3)
xmesh,ymesh,zmesh=F(x,y,z)
am.set_xlabel('$x $')
am.set_ylabel('$y $')
am.set_zlabel('$z $')
am.quiver(x,y,z,xmesh,ymesh,zmesh,length=0.15)
am.plot_surface(x, y, z, rstride=4, cstride=4, color='darkviolet')

##graficas de campo en curvas
print('se tomara la curva recta ')
X=t
Y=2*t-5
Z= 64-14*t
a=Z*(math.e**X)
b=(math.e**Y)-X
c=Z
fig=plt.figure('F representado en una traectoria recta')
ay=fig.gca(projection='3d')
ax.set_xlabel('$x $')
ax.set_ylabel('$y $')
ax.set_zlabel('$z $')
ay.plot(X,Y,Z,'g')
ay.plot(a,b,c,'y')
##calculo de integrales de linea recta
init_printing(use_latex="mathjax")
fT= 2*math.e**(2*T-5)+(64-14*T)*math.e**T+194*T-896
f=lambda  T:2*math.e**(2*T-5)+(64-14*T)*math.e**T+194*T-896
I1=quad(f, 0, 10)
print(integrate(fT,T))
print('el trabajo ejercido sobre la trayectoria recta definida es: ',I1)
### Grafica de campo en una curva cerrada en este caso seria un circulo
L=3*np.cos(s)
M=3*np.sin(s)
N=5
A=N*(math.e**L)
B=(math.e**M)-L
C=N
fig3=plt.figure('F representado en una traectoria curva cerrada')
az=fig3.gca(projection='3d')
az.plot(L,M,N,'b')
az.plot(A,B,C,'g')
U=Symbol('U')
### calcu de integrales de de linea curva cerrada
f1=lambda  U:3*np.cos(U)*(math.e**(3*np.sin(U))-3*np.sin(U))-15*np.sin(U)*math.e**(3*np.cos(U))
print('np.exp(3*np.sin(t))+5*np.exp(3*np.cos(t))+3*np.cos(t)')
I2=quad(f1, 0, 2*np.pi)
#print(integrate(3*np.cos(U)*(np.e(3*sen(U))-3*np.sin(U))-15*np.sin(U)*np.e(3*np.cos(U)),U).doit())
print('el trabajo ejercido sobre la trayectoria curva cerrada definida es: ',I2)

plt.show()
```


```
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

n = 100

theta = np.linspace(0, 2.*np.pi, n)
phi = np.linspace(0, 2.*np.pi, n)
theta, phi = np.meshgrid(theta, phi)
c, a = 4, 1
x = (c + a*np.cos(theta)) * np.cos(phi)
y = (c + a*np.cos(theta)) * np.sin(phi)
z = a * np.sin(theta)

fig = plt.figure()
ax1 = fig.add_subplot(121, projection='3d')
ax1.set_zlim(-3,3)
ax1.plot_surface(x, y, z, rstride=5, cstride=5, color='r', edgecolors='k')
ax1.view_init(36, 26)
ax2 = fig.add_subplot(122, projection='3d')
ax2.set_zlim(-3,3)
ax2.plot_surface(x, y, z, rstride=5, cstride=5, color='b', edgecolors='w')
ax2.view_init(0, 0)
ax2.set_xticks([])
plt.show()
```


```
import numpy as np
from scipy.integrate import tplquad
 
R = 4
r = 1
 
# Volume integral
# Order of integration is z, rho, theta
f1 = lambda z, rho, theta: 2 * rho
# set theta limits
a, b = 0, 2 * np.pi
# set rho limits
rho_low = lambda rho: R - r
rho_high = lambda rho: R + r
# set z limits
z_low = lambda theta, rho: 0
z_high = lambda theta, rho: np.sqrt(r**2 - (rho - R)**2)
# calculate integral
V, _ = tplquad(f1, a, b, rho_low, rho_high, z_low, z_high)
print(V)
```

    78.95683520871499


8454a05f50670ca4a6a689c8c36fb499789d7650
ipynb
Jupyter Notebook
datos/colabs/Copy of integraldelinea.ipynb
Sekilloda/sekilloda.github.io
1a272eb607400a71a2971569e6ac2426f81661f7
MIT
datos/colabs/Copy of integraldelinea.ipynb
Sekilloda/sekilloda.github.io
1a272eb607400a71a2971569e6ac2426f81661f7
MIT
datos/colabs/Copy of integraldelinea.ipynb
Sekilloda/sekilloda.github.io
1a272eb607400a71a2971569e6ac2426f81661f7
MIT
Qwen/Qwen-72B
1. YES
2. YES