Difference between revisions of "Hydrodynamics.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Sync syntax/arguments/outputs with current Spinach source)
(Update function See also links and function index membership)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:hydrodynamics.m}} __NOTOC__
 
{{DISPLAYTITLE:hydrodynamics.m}} __NOTOC__
−
 
+
Basic hydrodynamics infrastructure provider that returns first derivative operators with respect to the sample coordinates using periodic boundary conditions; it returns finite-difference or Fourier differentiation matrices correctly normalised for the physical sample dimensions.
−
A basic hydrodynamics infrastructure provider, returns first derivative operators with respect to the three sample coordinates. Periodic boundary conditions are used.
 
  
 
==Syntax==
 
==Syntax==
  
−
[Fx,Fy,Fz]=hydrodynamics(spin_system,parameters)
+
    [Fx,Fy,Fz]=hydrodynamics(parameters)
  
−
==Arguments==
+
==Parameters==
  
−
parameters.dims    - dimensions of the sample (meters),
+
  parameters.dims    - dimensions of the sample (meters),
 
                         one, two, or three-element row
 
                         one, two, or three-element row
 
                         vector
 
                         vector
Line 23: Line 22:
 
                         boundary conditions
 
                         boundary conditions
  
−
==Outputs==
+
==Returns==
−
 
 
−
Fx, Fy, Fz        - derivative matrices, SI units
 
  
−
Note: the direct product order is Z(x)Y(x)X(x)Spin, this cor-
+
  Fx, Fy, Fz        - derivative matrices, SI units
−
      responds to a column-wise vectorization of a 3D array
 
−
      with dimensions ordered as [X Y Z].
 
−
 
 
−
Note: polyadic objects are returned, use inflate() to get the
 
−
      corresponding sparse matrix.
 
−
 
 
−
ilya.kuprov@weizmann.ac.il
 
−
a.j.allami@soton.ac.uk
 
  
 
==Examples==
 
==Examples==
−
 
 
This function is used by [[imaging.m]] context in situations when spatial dynamics, such as diffusion and flow, is present in the sample.
 
This function is used by [[imaging.m]] context in situations when spatial dynamics, such as diffusion and flow, is present in the sample.
  
 
==Notes==
 
==Notes==
−
 
 
Empty arrays are returned for inactive dimensions. The direct product order is Z(x)Y(x)X(x)Spin, this corresponds to a column-wise vectorization of a 3D array with dimensions ordered as [X Y Z].
 
Empty arrays are returned for inactive dimensions. The direct product order is Z(x)Y(x)X(x)Spin, this corresponds to a column-wise vectorization of a 3D array with dimensions ordered as [X Y Z].
  
 
==See also==
 
==See also==
−
 
+
[[imaging.m]], [[fdmat.m]], [[v2fplanck.m]], [[fourdif.m]], [[corrfun.m]], [[fdhess.m]], [[fdkup.m]], [[fdlap.m]], [[fdvec.m]], [[fdweights.m]], [[fpl2phan.m]], [[fpl2rho.m]], [[g2fplanck.m]], [[interpmat.m]], [[mri_2d_plot.m]], [[ngridpts.m]], [[oscillator.m]], [[overwound.m]], [[phan2fpl.m]], [[phantoms.m]], [[qxspen_kernel.m]], [[spden.m]], [[Imaging_module]], [[Kernel_utilities]]
−
[[imaging.m]], [[fdmat.m]], [[v2fplanck.m]], [[fourdif.m]]
 
−
 
 
  
 
''Version 1.10, authors: [[Ahmed Allami]], [[Ilya Kuprov]]''
 
''Version 1.10, authors: [[Ahmed Allami]], [[Ilya Kuprov]]''
−
 
−
==Description==
 
−
 
−
The function returns finite difference or Fourier differentiation matrices for first derivatives, correctly normalised to account for physical sample dimensions.
 
−
 
−
==Returns==
 
−
 
−
Fx, Fy, Fz        - derivative matrices, SI units
 

Latest revision as of 19:37, 6 June 2026

Basic hydrodynamics infrastructure provider that returns first derivative operators with respect to the sample coordinates using periodic boundary conditions; it returns finite-difference or Fourier differentiation matrices correctly normalised for the physical sample dimensions.

Syntax

    [Fx,Fy,Fz]=hydrodynamics(parameters)

Parameters

  parameters.dims    - dimensions of the sample (meters),
                       one, two, or three-element row
                       vector

  parameters.npts    - number of points in each dimension
                       of the sample, one, two, or three-
                       element row vector

  parameters.deriv   - {'fourier'} requests Fourier diffe-
                       rentiation matrices; {'period',n}
                       requests n-point central finite-
                       difference matrices with periodic
                       boundary conditions

Returns

  Fx, Fy, Fz         - derivative matrices, SI units

Examples

This function is used by imaging.m context in situations when spatial dynamics, such as diffusion and flow, is present in the sample.

Notes

Empty arrays are returned for inactive dimensions. The direct product order is Z(x)Y(x)X(x)Spin, this corresponds to a column-wise vectorization of a 3D array with dimensions ordered as [X Y Z].

See also

imaging.m, fdmat.m, v2fplanck.m, fourdif.m, corrfun.m, fdhess.m, fdkup.m, fdlap.m, fdvec.m, fdweights.m, fpl2phan.m, fpl2rho.m, g2fplanck.m, interpmat.m, mri_2d_plot.m, ngridpts.m, oscillator.m, overwound.m, phan2fpl.m, phantoms.m, qxspen_kernel.m, spden.m, Imaging_module, Kernel_utilities

Version 1.10, authors: Ahmed Allami, Ilya Kuprov