0
votes

Iam beginner to matlab. Still learning it.Recently i have been asked to compute curl of three velocity components and plot its contour w.r.t circumferential angle along x-axis and radius along y-axis. The data u,v and w is pre-calculated by me as follows

u = V * Cos(beta) * cos(alpha); % V is velocity in m/s and alpha,beta are angles in radians

similarly

v = V * cos(beta) * sin(alpha);

w = V * sin(alpha)

Someone recently commented out saying that to enable mat lab's curl functionality my u,v and w data should be in Cartesian coordinate. I relied saying that though my initial data is in spherical coordinates(V,alpha,beta) but iam using coordinate conversion on u,v and w and transforming my data to Cartesian coordinate.

He further replied saying that "not only u,v,w should be Cartesian but its relative data x,y,z should also need to be Cartesian coordinate"

I dint get it. Can anyone say what he was trying to say or if i can use the curl functionality in matlab

I shall be gretful for your help and answer

1

1 Answers

1
votes

I have not tried the function, but as far as it concerns the coordinates u, v, w defines the force for each gridspace from x, y, z. However, the help on mathworks homepage says that x, y, z

must be monotonic, but do not need to be uniformly spaced.

This may be a trouble for spherical coordinates, when transformed to cartesians. I assume that weakly monotonic for any coordinate (but not all of them) would work, but spherical coordinates does not apply for that. What you could try is to transform the coordinates but make sure that the grid is monotonic. I mean, you make sure the grid in Cartesian coordinates is kept monotonic instead of the spherical.

So the answer is then more explicitly x, y, z, need to be non decreasing with at least 1 coordinate at the time which is increasing, but the force of each point can have the value of spherical coordinate transformed to its corresponding Cartesian value.

Except for this I would like to advise you to use the formal definition of spherical coordinates, which defines alpha as the angle from z to the xy-plane (alpha = 0 is the z-axis). I would also recommend you to use the more common coordinate names. r, phi and theta.