Matlab's curl function and its limitation?
3 ビュー (過去 30 日間)
古いコメントを表示
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's.
(I further came across this Mupad interface page in matlab. Can someone please let e know if i can solve my problem using that/extending that interface)
I shall be grateful for your help and answer.
Thanks
0 件のコメント
回答 (1 件)
Alberto
2014 年 9 月 5 日
yes you have to transform both velocity vector data and spherical coordinates (r,phi,theta) to Cartesian vector and coordinates.
For example if J(r,theta,phi) = Jr ar + Jtheta atheta + Jphi aphi is velocity vector and (ar, atheta, aphi) are unity vector, and also (r,phi,theta) are spherical coordinates, then:
Jx=(sin(theta).*cos(phi).*Jr)+(cos(theta).*cos(phi).*Jtheta)+(-sin(phi).*Jphi);
Jy=(sin(theta).*sin(phi).*Jr)+(cos(theta).*sin(phi).*Jtheta)+(cos(phi).*Jphi);
Jz=(cos(theta).*Jr)+(-sin(theta).*Jtheta);
x=r.*sin(theta).*cos(phi);
y=r.*sin(theta).*sin(phi);
z=r.*cos(theta);
1 件のコメント
John D'Errico
2014 年 9 月 5 日
Essentially, the function curl does not know what your numbers mean. Numbers are merely that. Only you can assign meaning to a set of coordinates. Are they angles or not?
Should we fear (just a bit) the day when a computer becomes smart enough to know what we want to do without our having to direct it?
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!