green's theorem
unknown
matlab
2 years ago
444 B
3
Indexable
clc clear all close all syms x y r theta F=input("enter the vecotr in terms of i j k") integrand=diff(F(2),x)-diff(F(1),y); polarint=r*subs(integrand,[x,y],[r*cos(theta),r*sin(theta)]) sol=int(int(polarint,r,0,3),theta,0,2*pi) P=inline(vectorize(F(1)),'x','y') Q=inline(vectorize(F(2)),'x','y') x=linspace(-3.2,3.2,10); y=x; [X,Y]=meshgrid(x,y); U=P(X,Y); V=Q(X,Y); quiver(X,Y,U,V) hold on fplot(3*cos(theta),3*sin(theta),[0 2*pi]) axis equal
Editor is loading...