필터 지우기
필터 지우기

Matlab's curl function and its limitation?

조회 수: 7 (최근 30일)
Rizwana
Rizwana 2014년 2월 17일
댓글: John D'Errico 2014년 9월 5일
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

답변 (1개)

Alberto
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
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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by