Can someone help me with this MATLAB question?

62 Views Asked by At

Let $F=\left[\dfrac{y}{x^2+y^2}, \dfrac{-x}{x^2+y^2}\right]$. Use quiver to draw a plot of $F$ in the region $-1\le x, y\le 1$. Compute $\dfrac{\theta F_2}{\theta x}-\dfrac{\theta F_1}{y}$ and verify that it vanishes. Apply potential to get a potential equation $f$ for $F$. Integrate $F$ along the curve $\gamma(t)=[\cos(t), \sin(t)]$, $0\le t\le \frac{\pi}{2}$, and compare with $f(0,1)-f(1,0)$. Then integrate $F$ along the same curve, but with $0\le t\le2\pi$. How do you explain the result? Does the result seem consistent with your quiver plot?

Image of Original Question

I am having trouble with this question. I have looked into quiver function but I am not too good with matlab so please help.

1

There are 1 best solutions below

0
On

@Jean-Claude Arbaut already explained the result, so it remains to post the code:

% quiver plot
[x,y]= meshgrid(-1:0.05:1);
quiver(x,y,y./(x.^2+y.^2),-x./(x.^2+y.^2));
axis tight

% check the condition symbolically
syms x y
F= [y/(x^2+y^2),-x/(x^2+y^2)];
simplify(diff(F(2),x)-diff(F(1),y))

% find the potential
f= potential(F,[x y])    

% symbolic integration
syms t
gamma= [cos(t),sin(t)];
result1 = int(subs(F,[x,y],gamma)*jacobian(gamma),0,pi/2)
result2 = int(subs(F,[x,y],gamma)*jacobian(gamma),0,2*pi)