# MaxwellFunctions

A - B - C - D - E - F - G - H - I - K - L - M - N - O - P - Q - R - S - T - U - V - W - X

#### MaxwellFunctions

Section Time-Dependent
Type block

This block specifies the shape of a "spatial-dependent function", such as the envelope needed when using the MaxwellFunctions block. Each line in the block specifies one function. The first element of each line will be a string that defines the name of the function. The second element specifies which type of function we are using; in the following we provide an example for each of the possible types:

Options:

• mxf_const_wave:
%MaxwellFunctions
"function-name" | mxf_const_wave | kx | ky | kz | x0 | y0 | z0
%

The function is constant plane wave $f(x,y,z) = a0 * \cos( kx*(x-x0) + ky*(y-y0) + kz*(z-z0) )$

• mxf_const_phase:
%MaxwellFunctions
"function-name" | mxf_const_phase | kx | ky | kz | x0 | y0 | z0
%

The function is a constant phase of $f(x,y,z) = a0 * (kx * x0 + ky * y0 + kz * z0)$

• mxf_gaussian_wave:
%MaxwellFunctions
"function-name" | mxf_gaussian_wave | kx | ky | kz | x0 | y0 | z0 | width
%

The function is a Gaussian, $f(x,y,z) = a0 * \exp( -( kx*(x-x0) + ky*(y-y0) + kz*(z-z0) )^2 / (2 width^2) )$

• mxf_cosinoidal_wave:
%MaxwellFunctions
"function-name" | mxf_cosinoidal_wave | kx | ky | kz | x0 | y0 | z0 | width
%

$f(x,y,z) = \cos( \frac{\pi}{2} \frac{kx*(x-x0)+ky*(y-y0)+kz*(z-z0)-2 width}{width} + \pi )$

If $| kxx + kyy + kz*z - x0 | > \xi_0$, then $f(x,y,z) = 0$.

• mxf_logistic_wave:
%MaxwellFunctions
"function-name" | mxf_logistic_wave | kx | ky | kz | x0 | y0 | z0 | growth | width
%

The function is a logistic function, $f(x,y,z) = a0 * 1/(1+\exp(growth*(kx*(x-x0)+ky*(y-y0)+kz*(kz*(z-z0))+width/2))) * 1/(1+\exp(-growth*(kx*(x-x0)+ky*(y-y0)+kz*(kz*(z-z0))-width/2)))$

• mxf_trapezoidal_wave:
%MaxwellFunctions
"function-name" | mxf_trapezoidal_wave | kx | ky | kz | x0 | y0 | z0 | growth | width
%

The function is a logistic function,
$f(x,y,z) = a0 * ( ( 1-growth*(k*(r-r0)-width/2)*\Theta(k*(r-r0)-width/2))*\Theta(-(k*(r-r0)+width/2+1/growth))$
$\qquad \qquad \qquad + (-1+growth*(k*(r-r0)+width/2)*\Theta(k*(r-r0)+width/2))*\Theta(-(k*(r-r0)-width/2+1/growth)) )$

• mxf_from_expr:
%MaxwellFunctions
"function-name" | mxf_from_expr | "expression"
%

The temporal shape of the field is given as an expression (e.g., cos(2.0x-3y+4*z). The letter x, y, z means spatial coordinates, obviously. The expression is used to construct the function f that defines the field.

Source information