Calculating Curl from Velocity field input in column vectors

2 visualizzazioni (ultimi 30 giorni)
I have a block of experimental data, [X,Y,Ux,Uy]. The X,Y are almost evenly spaced, but a few points have been removed from them due to bad data and small deviations from nominal for the points (i.e. on point might be at [12,4] and another point at [11.97,3.74] when the perfect rectangular grid would put the point at [12,3.75]). There are 1298 points of data, each with an X, Y, Ux, and Uy. I'm attempting to compute the curl of the field. From my understanding, I need to create a grid, i.e.
[Xg,Yg] = ndgrid(X,Y)
This creates a matrix for each of Xg and Yg of 1298x1298. However, I'm unclear on how to handle (Ux,Uy). These are still column vectors. Calling the curl function I get:
[curlz,cav]=curl(Xg,Yg,Ux,Uy)
Error using _curl_
U,V must all be size 2x2 or greater
I understand I need to reshape them into a matrix form, but am unclear how to reorder this data to be in the correct matrix form. Do I need to create a matrix of points for Ux and Uy that is 1298x1298 with each column a repeat of the other columns?
Thank you for any assistance.

Risposta accettata

Chad Greene
Chad Greene il 17 Nov 2015
Sounds like your data are essentially scattered data, so you'll need to grid them before computing curl. Different versions of Matlab have different gridding algorithms, but none of them are perfect. The first thing I'd try is gridfit to get gridded Ux and gridded Uy, then compute the curl.

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by