MATLAB: Fluid Flow - Curl of a Vector Field

  • #1
Tallus Bryne
35
8
TL;DR Summary
Looking for a mathematical description of what exactly the MATLAB curl function does when doing something like [curlz, cav] = curl(x,y,u,v).
I am working with some data which represents the fluid position and velocity for each point of measurement as an x, y, u, and v matrix (from particle image velocimetry). I have done things like circulation, and discretizing the line integral involved was no problem. I am stuck when trying to calculate the vorticity at each point. Lets say each x, y, u, v matrix is NxN. I would like to find a NxN matrix which represents the curl of the associated velocity field. I'm aware of the curl function on MATLAB and how [curlz, cav] = curl(x,y,u,v) will do the job just fine. What I'm really wondering is how exactly MATLAB's curl function does this calculation, or just how it would be done on paper in a simple case. Aside from a solution, I'd also appreciate any advice or hints.
 
Physics news on Phys.org
  • #2
From the "Algorithms" section of the documentation:

curl computes the partial derivatives in its definition by using finite differences. For interior data points, the partial derivatives are calculated using central difference. For data points along the edges, the partial derivatives are calculated using single-sided (forward) difference.
 
  • Like
Likes FactChecker
  • #3
Wow. I don't know how many times I looked over that documentation page, even up to the previous section "Numerical Curl and Angular Velocity" and was somehow blind to the "Algorithms" each time. Appreciate the quick response, thanks!
 

Similar threads

Replies
5
Views
415
  • MATLAB, Maple, Mathematica, LaTeX
Replies
16
Views
5K
  • Introductory Physics Homework Help
Replies
3
Views
88
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
146
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
883
  • Calculus
Replies
3
Views
1K
Replies
54
Views
3K
Replies
33
Views
3K
Back
Top