Problem in computing the curl of 2D velocity vector field
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Emanuele Spinosa
le 3 Déc 2014
Modifié(e) : Andreas Passos
le 25 Fév 2021
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 commentaires
Andreas Passos
le 25 Fév 2021
Modifié(e) : Andreas Passos
le 25 Fév 2021
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.
'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
Réponse acceptée
Emanuele Spinosa
le 3 Déc 2014
1 commentaire
Andreas Passos
le 25 Fév 2021
How did you sort the problem, I have the same issue. Can you explain please?
Plus de réponses (1)
Youssef Khmou
le 3 Déc 2014
Generally, the input velocity matrices may contain NaNs, try :
sum(isnan(UU(:))); % must be zero if there is no NaN, same for VV
Voir également
Catégories
En savoir plus sur Matrices and Arrays 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!