RES xdat adat
¶RES xdat ydat adat
¶RES xdat ydat zdat adat
¶mglGraph
: mglData
Hist (const mglDataA &
x, const mglDataA &
a, const char *
opt=""
)
¶mglGraph
: mglData
Hist (const mglDataA &
x, const mglDataA &
y, const mglDataA &
a, const char *
opt=""
)
¶mglGraph
: mglData
Hist (const mglDataA &
x, const mglDataA &
y, const mglDataA &
z, const mglDataA &
a, const char *
opt=""
)
¶HMDT
mgl_hist_x (HMGL
gr, HCDT
x, HCDT
a, const char *
opt)
¶HMDT
mgl_hist_xy (HMGL
gr, HCDT
x, HCDT
y, HCDT
a, const char *
opt)
¶HMDT
mgl_hist_xyz (HMGL
gr, HCDT
x, HCDT
y, HCDT
z, HCDT
a, const char *
opt)
¶These functions make distribution (histogram) of data. They do not draw the obtained data themselves. These functions can be useful if user have data defined for random points (for example, after PIC simulation) and he want to produce a plot which require regular data (defined on grid(s)). The range for grids is always selected as axis range. Arrays x, y, z define the positions (coordinates) of random points. Array a define the data value. Number of points in output array res is defined by option value
(default is mglFitPnts=100).
dat 'eq'
¶dat 'eq' vdat
¶dat 'eq' vdat wdat
¶mglGraph
: void
Fill (mglData &
u, const char *
eq, const char *
opt=""
)
¶mglGraph
: void
Fill (mglData &
u, const char *
eq, const mglDataA &
v, const char *
opt=""
)
¶mglGraph
: void
Fill (mglData &
u, const char *
eq, const mglDataA &
v, const mglDataA &
w, const char *
opt=""
)
¶void
mgl_data_fill_eq (HMGL
gr, HMDT
u, const char *
eq, HCDT
v, HCDT
w, const char *
opt)
¶Fills the value of array ‘u’ according to the formula in string eq. Formula is an arbitrary expression depending on variables ‘x’, ‘y’, ‘z’, ‘u’, ‘v’, ‘w’. Coordinates ‘x’, ‘y’, ‘z’ are supposed to be normalized in axis range. Variable ‘u’ is the original value of the array. Variables ‘v’ and ‘w’ are values of arrays v, w which can be NULL
(i.e. can be omitted).
dat xdat ydat zdat
¶mglGraph
: void
DataGrid (mglData &
u, const mglDataA &
x, const mglDataA &
y, const mglDataA &
z, const char *
opt=""
)
¶void
mgl_data_grid (HMGL
gr, HMDT
u, HCDT
x, HCDT
y, HCDT
z, const char *
opt)
¶Fills the value of array ‘u’ according to the linear interpolation of triangulated surface, found for arbitrary placed points ‘x’, ‘y’, ‘z’. Interpolation is done at points equidistantly distributed in axis range. NAN value is used for grid points placed outside of triangulated surface. See Making regular data, for sample code and picture.
dat xdat vdat [sl=-1]
¶dat xdat ydat vdat [sl=-1]
¶dat xdat ydat zdat vdat
¶mglData
: void
Refill (mglDataA &
dat, const mglDataA &
x, const mglDataA &
v, long
sl=-1
, const char *
opt=""
)
¶mglData
: void
Refill (mglDataA &
dat, const mglDataA &
x, const mglDataA &
y, const mglDataA &
v, long
sl=-1
, const char *
opt=""
)
¶mglData
: void
Refill (mglDataA &
dat, const mglDataA &
x, const mglDataA &
y, const mglDataA &
z, const mglDataA &
v, const char *
opt=""
)
¶void
mgl_data_refill_gr (HMGL
gr, HMDT
a, HCDT
x, HCDT
y, HCDT
z, HCDT
v, long
sl, const char *
opt)
¶Fills by interpolated values of array v at the point {x, y, z}={X[i], Y[j], Z[k]
} (or {x, y, z}={X[i,j,k], Y[i,j,k], Z[i,j,k]
} if x, y, z are not 1d arrays), where X,Y,Z
are equidistantly distributed in axis range and have the same sizes as array dat. If parameter sl is 0 or positive then changes will be applied only for slice sl.
RES 'ham' ini_re ini_im [dz=0.1 k0=100
]
¶mglGraph
: mglData
PDE (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. Coordinates ‘x’, ‘y’, ‘z’ are supposed to be normalized in axis range. 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 PDE solving hints, for sample code and picture.