Curl in Polar Coordinates

19 views (last 30 days)
Spencer
Spencer on 13 Jun 2011
Answered: Wiky on 24 Dec 2018
Hello All,
I was wondering if anyone knows of an m-file that can calculate the curl in polar coordinates. I have all x,y,z,u,v,w data in Cartesian coordinates and should be able to convert it to polar without a problem, but I don't know where to go from there.
Thanks,
Spence

Answers (3)

Paulo Silva
Paulo Silva on 13 Jun 2011
doc cart2pol

Bjorn Gustavsson
Bjorn Gustavsson on 13 Jun 2011
I think it is easiest to calculate the curl in Cartesian coordinates and then transform the result to polar coordinates. Especially as you have the data in Cartesian coordinates. Then you avoid the hassle of doing the non-Cartesian curl, and one interpolation...

Wiky
Wiky on 24 Dec 2018
The below function calculates the "CURL" of a vector field in all three coordinate systems.i.e Rectangular, Cylindrical and Spherical.
Where V is field vector, X spacial vector.
%%%%%%%%%%%%%% Code of Curl in Polar Coordinates %%%%%%%%%%%%%%%
function Curl = Curl_sym(V,X,coordinate_system)
switch coordinate_system
case {'cartesian','Cartesian'}
Curl=curl(V,X);
case {'cylindrical','Cylindrical'}
Curl = [(1/X(1))*diff(V(3),X(2))-diff(V(2),X(3)), diff(V(1),X(3))-diff(V(3),X(1)), (1/X(1))*diff(X(1)*V(2),X(1))-diff(V(1),X(2))];
case {'spherical','Spherical'}
Curl = [(1./X(1)*diff(V(3),X(2))-diff(V(2),X(3))) (diff(V(1),X(3))-diff(V(3),X(1))) 1./X(1)*(diff(X(1).*V(2),X(1))-diff(V(1),X(2)))];
end
end

Categories

Find more on Geology in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!