Math Manual

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

gauss divergence 2nd sum

from sympy.physics.vector import *


from sympy import var,pprint,integrate,sqrt
var('x,y,z,a')
v=ReferenceFrame('v')
F=4*v[0]*v.x-2*v[1]**2*v.y+v[2]**2*v.z
G=divergence(F,v)
F=F.subs([(v[0],x),(v[1],y),(v[2],z)])
print("Given vector is F=")
pprint(F)
G=G.subs([(v[0],x),(v[1],y),(v[2],z)])
print("Divergence of F=")
pprint(G)
soln=integrate(G,[y,0,sqrt(4-x**2)],[z,0,3],[x,0,2])
print("\n I=",soln)

OUTPUT:Given vector is F=
2 2
4⋅x v_x + -2⋅y v_y + z v_z
Divergence of F=
-4⋅y + 2⋅z + 4

I= -32 + 21*pi

gauss divergence 3rd sum

from sympy.physics.vector import *


from sympy import var,pprint,integrate,sqrt
var('x,y,z,a')
v=ReferenceFrame('v')
F=4*v[0]*v.x+v[1]*v.y+v[2]*v.z
G=divergence(F,v)
F=F.subs([(v[0],x),(v[1],y),(v[2],z)])
print("Given vector is F=")
pprint(F)
G=G.subs([(v[0],x),(v[1],y),(v[2],z)])
print("Divergence of F=")
pprint(G)
soln=integrate(G,[x,0,(6-2*z-y)/2],[y,0,6-2*z],[z,0,3])
print("\n I=",soln)

OUTPUT:Given vector is F=
4⋅x v_x + y v_y + z v_z
Divergence of F=
6

I= 54

You might also like