Curl in Polar Coordinates

12 vues (au cours des 30 derniers jours)
Spencer
Spencer le 13 Juin 2011
Réponse apportée : Wiky le 24 Déc 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

Réponses (3)

Paulo Silva
Paulo Silva le 13 Juin 2011

Bjorn Gustavsson
Bjorn Gustavsson le 13 Juin 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 le 24 Déc 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

Catégories

En savoir plus sur Geology dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by