PIVMat Function Reference<< Prev | Next >> 
vec2scal
Converts a vector field into a scalar field

Description
S = vec2scal(V) returns scalar field(s) S given by the norm of the 
vector field(s) V. The vector field(s) V can be obtained from loadvec 
or loadset and the scalar field(s) S can be displayed by showscal. 
 
S = vec2scal(V,MODE) specifies the conversion MODE: 
   norm            norm (ux^2 + uy^2)^(1/2); by default. 
   ux, uy          x or y component of the vector field 
   en, ken         kinetic energy, norm^2 / 2 
   rad, deg        velocity angle (tan(angle)=vy/vx), in rad or deg 
   curl (or rot)   curl (vorticity field) 
   absrot          absolute value of the curl 
   div             2D divergence (dux/dx + duy/dy) 
   ens             enstrophy (=square of vorticity) 
   strain          norm of the strain rate, sqrt(s1^2 + s2^2), 
                   where s1 and s2 are the 2D strain eigenvalues. 
   q               Q-criterion, Q = rot^2 - (strain^2)/2 
   eps             squared strain rate, s1^2 + s2^2 
   duxdx, duxdy, duydx, duydy      spatial derivatives  (du_i / dx_j) 
Adding '-' (minus sign) before MODE (e.g., '-rot') inverts the result. 
 
The resulting scalar field S contains the following fields: 
   x,y:                 vectors containing the X and Y coordinates 
   w:                   matrix of scalar elements 
   namex, unitx, namey, unity: strings for the name and unit of coord 
   namew, unitw:        strings for the name and unit of the matrix w 
   name:                name of the VEC file from which originates V 
   setname:             name of the current directory 
   history:             Remind from which command S has been obtained 
 
The scalar fields built from derivatives (e.g., rot, div, ens etc.) 
are computed from 2nd-order centered differences. 
Specify 'rot1', 'div1' etc. to use 1st-order finite differences (in 
this case, the resulting field is decreased by 1 unit, and the x and y 
coordinates are interpolated). 
 
S = vec2scal(FILE) is a shortcut for S = vec2scal(loadvec(FILE)). 
 
By default, vectors with a zero component are considered as erroneous, 
and are not used for the computation of the derivative fields (rot, 
div, eps, duxdx, ...). If however you want to keep them in the 
computation, specify  vec2scal(V,MODE,'keepzero'). 
  Limitation: This option works only with 1st-order derivatives 
  (rot1, div1...) - it is not yet implemented for 2nd-order derivatives 
  (rot, div...). 
 
vec2scal(...), without output argument, shows the result with showscal. 
 
Examples
 
  showscal(vec2scal(v,'div')); 
  showscal(vec2scal(filterf(loadset,2),'rot')); 
  stat_rot = statf(vec2scal(v,'rot')); 
  vec2scal *.vec 
 
See Also
showvec, showscal, gradientf, operf. 

 Previous: vec2matNext: vortex 

2005-2007 PIVMat Toolbox 1.60