Problem in computing the curl of 2D velocity vector field

조회 수: 7 (최근 30일)
Emanuele Spinosa
Emanuele Spinosa 2014년 12월 3일
편집: Andreas Passos 2021년 2월 25일
Hi everyone,
I'm trying the compute the curl of a 2D velocity vector field using the function
[curlz,cav] = curl(X,Y,UU,VV);
X, Y are generated using meshgrid. However I obtain a matrix of NaNs and + - Inf ... Do you know what's happening? I think I followed the correct instructions from the Matlab Help... Please let me know.
Emanuele
  댓글 수: 2
Thorsten
Thorsten 2014년 12월 3일
편집: Thorsten 2014년 12월 3일
No, we don't know what's happening because you have not told us how you computed X, Y, UU and VV. Please do so and provide the code...
Andreas Passos
Andreas Passos 2021년 2월 25일
편집: Andreas Passos 2021년 2월 25일
Hi, I want to calculate the curl from a single trajectory.
Basically, I want to identify if the trajectory rotates clockwise of anti-clock wise and measure the rotation speed.
I use something like the below:
x = data(:,1);
y = data(:,2);
u = data(:,3);
v = data(:,4);
V = [u v];
R = [x y];
curlRes = curl(V,R);
The result is 0 everywhere.
I also tried [curlz,cav] = curl(x,y,u,v) and it gives the follwoing error
'Index in position 1 is invalid. Array indices must be positive integers or logical values.'
the vectors u,v contain negative values as well as they indicate the velocity direction
Thank you

댓글을 달려면 로그인하십시오.

채택된 답변

Emanuele Spinosa
Emanuele Spinosa 2014년 12월 3일
I sorted out the problem, however it seems that the curl is too big at the extremes of the domain... any idea how to fix this?
  댓글 수: 1
Andreas Passos
Andreas Passos 2021년 2월 25일
How did you sort the problem, I have the same issue. Can you explain please?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Youssef  Khmou
Youssef Khmou 2014년 12월 3일
Generally, the input velocity matrices may contain NaNs, try :
sum(isnan(UU(:))); % must be zero if there is no NaN, same for VV
  댓글 수: 1
Emanuele Spinosa
Emanuele Spinosa 2014년 12월 3일
yes, they're both 0, both for UU and VV... can it depend on X and Y matrices?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by