[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions are not methods of mglData
class. However it provide additional functionality to handle data. So I put it in this chapter.
mglData
mglTransform (const mglDataA &
real, const mglDataA &
imag, const char *
type)HMDT
mgl_transform (HCDT
real, HCDT
imag, const char *
type)Does integral transformation of complex data real, imag on specified direction. The order of transformations is specified in string type: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: ‘f’ is forward Fourier transformation, ‘i’ is inverse Fourier transformation, ‘s’ is Sine transform, ‘c’ is Cosine transform, ‘h’ is Hankel transform, ‘n’ or ‘ ’ is no transformation.
mglData
mglTransformA const mglDataA &
ampl, const mglDataA &
phase, const char *
type)HMDT
mgl_transform_a HCDT
ampl, HCDT
phase, const char *
type)The same as previous but with specified amplitude ampl and phase phase of complex numbers.
void
mglFourier const mglDataA &
re, const mglDataA &
im, const char *
dir)void
mgl_data_fourier HCDT
re, HCDT
im, const char *
dir)Does Fourier transform of complex data re+i*im in directions dir. Result is placed back into re and im data arrays.
dn
['dir'='x']mglData
mglSTFA (const mglDataA &
real, const mglDataA &
imag, int
dn, char
dir='x'
)HMDT
mgl_data_stfa (HCDT
real, HCDT
imag, int
dn,char
dir)Short time Fourier transformation for real and imaginary parts. Output is amplitude of partial Fourier of length dn. For example if dir=‘x’, result will have size {int(nx/dn), dn, ny} and it will contain res[i,j,k]=|\sum_d^dn exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn.
dz=0.1 k0=100
]mglData
mglPDE (HMGL
gr, const char *
ham, const mglDataA &
ini_re, const mglDataA &
ini_im, mreal
dz=0.1
, mreal
k0=100
, const char *
opt=""
)HMDT
mgl_pde_solve (HMGL
gr, const char *
ham, HCDT
ini_re, HCDT
ini_im, mreal
dz, mreal
k0, const char *
opt)Solves equation du/dz = i*k0*ham(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters ini_re, ini_im specify real and imaginary part of initial field distribution. Parameters Min, Max set the bounding box for the solution. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter dz set the step along evolutionary coordinate z. At this moment, simplified form of function ham is supported – all “mixed” terms (like ‘x*p’->x*d/dx) are excluded. For example, in 2D case this function is effectively ham = f(p,z) + g(x,z,u). However commutable combinations (like ‘x*q’->x*d/dy) are allowed. Here variable ‘u’ is used for field amplitude |u|. This allow one solve nonlinear problems – for example, for nonlinear Shrodinger equation you may set ham="p^2 + q^2 - u^2"
. You may specify imaginary part for wave absorption, like ham = "p^2 + i*x*(x>0)"
, but only if dependence on variable ‘i’ is linear (i.e. ham = hre+i*him). See section PDE solving hints, for sample code and picture.
x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]
mglData
mglRay (const char *
ham, mglPoint
r0, mglPoint
p0, mreal
dt=0.1
, mreal
tmax=10
)HMDT
mgl_ray_trace (const char *
ham, mreal
x0, mreal
y0, mreal
z0, mreal
px, mreal
py, mreal
pz, mreal
dt, mreal
tmax)Solves GO ray equation like dr/dt = d ham/dp, dp/dt = -d ham/dr. This is Hamiltonian equations for particle trajectory in 3D case. Here ham is Hamiltonian which may depend on coordinates ‘x’, ‘y’, ‘z’, momentums ‘p’=px, ‘q’=py, ‘v’=pz and time ‘t’: ham = H(x,y,z,p,q,v,t). The starting point (at t=0
) is defined by variables r0, p0. Parameters dt and tmax specify the integration step and maximal time for ray tracing. Result is array of {x,y,z,p,q,v,t} with dimensions {7 * int(tmax/dt+1) }.
r=1 k0=100
xx yy]mglData
mglQO2d (const char *
ham, const mglDataA &
ini_re, const mglDataA &
ini_im, const mglDataA &
ray, mreal
r=1
, mreal
k0=100
, mglData *
xx=0
, mglData *
yy=0
)mglData
mglQO2d (const char *
ham, const mglDataA &
ini_re, const mglDataA &
ini_im, const mglDataA &
ray, mglData &
xx, mglData &
yy, mreal
r=1
, mreal
k0=100
)HMDT
mgl_qo2d_solve (const char *
ham, HCDT
ini_re, HCDT
ini_im, HCDT
ray, mreal
r, mreal
k0, HMDT
xx, HMDT
yy)Solves equation du/dt = i*k0*ham(p,q,x,y,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators (see mglPDE()
for details). Parameters ini_re, ini_im specify real and imaginary part of initial field distribution. Parameters ray set the reference ray, i.e. the ray around which the accompanied coordinate system will be maked. You may use, for example, the array created by mglRay()
function. Note, that the reference ray must be smooth enough to make accompanied coodrinates unambiguity. Otherwise errors in the solution may appear. If xx and yy are non-zero then Cartesian coordinates for each point will be written into them. See also mglPDE()
. See section PDE solving hints, for sample code and picture.
mglData
mglJacobian (const mglDataA &
x, const mglDataA &
y)mglData
mglJacobian (const mglDataA &
x, const mglDataA &
y, const mglDataA &
z)HMDT
mgl_jacobian_2d (HCDT
x, HCDT
y)HMDT
mgl_jacobian_3d (HCDT
x, HCDT
y, HCDT
z)Computes the Jacobian for transformation {i,j,k} to {x,y,z} where initial coordinates {i,j,k} are data indexes normalized in range [0,1]. The Jacobian is determined by formula det||dr_\alpha/d\xi_\beta|| where r={x,y,z} and \xi={i,j,k}. All dimensions must be the same for all data arrays. Data must be 3D if all 3 arrays {x,y,z} are specified or 2D if only 2 arrays {x,y} are specified.
mglData
mglTriangulation (const mglDataA &
x, const mglDataA &
y)HMDT
mgl_triangulation_2d (HCDT
x, HCDT
y)Computes triangulation for arbitrary placed points with coordinates {x,y} (i.e. finds triangles which connect points). MathGL use s-hull code for triangulation. The sizes of 1st dimension must be equal for all arrays x.nx=y.nx
. Resulting array can be used in triplot or tricont functions for visualization of reconstructed surface.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Build Daemon user on December 22, 2013 using texi2html 1.82.