Professional Documents
Culture Documents
MATLAB Experiment 10
MATLAB Experiment 10
MATLAB Experiment 10
-PRASHANT MEHLAWAT
16BCE0910
Write the MATLAB program to verify the Stroke’s Theorem for vector field and visualize it.
ANS.
CODE-
clc
clearvars
syms x y z r t
F=[z x y];
Ft=subs(F,[x,y,z],R);
drt=diff(R,t);
Fdr=dot(Ft,drt);
LHS=int(Fdr,t,0,2*pi)
curlF=curl(F,[x,y,z])
ndS=simplify(cross(diff(S,r),diff(S,t)))
RHS=int(int(dot(curlF,ndS),r,0,2),t,0,2*pi)
SCREENSHOT-
2. Verify stokes' Theorem for F=(2x-y)i-yz2 j+y2z k where S is the upper half surface
of the surface of the sphere x2+y2+z2=1 and C is its boundary.
ANS.
CODE-
clc
clearvars
syms x y z r t
F=[2*x-y y*z*z -y^2*z]
Ft=subs(F,[x,y,z],R);
drt=diff(R,t);
Fdr=dot(Ft,drt);
LHS=int(Fdr,t,0,2*pi)
curlF=curl(F,[x,y,z])
ndS=simplify(cross(diff(S,r),diff(S,t)))
RHS=int(int(dot(curlF,ndS),r,0,1),t,0,2*pi)
SCREENSHOT-