Math Parser (muParser) Functions

muParser Functions

muParser is a wonderful program.
It is what allows Mason to process text equations. More information can
be found on sourceforge. Also see the muParser license.

Run-time variables

Name

Explanation

frequency

Changes as the simulation runs, this is the simulation frequency

Built-in variables

For convenience, some constants are built into the library. Please note that the underscore must be used as shown in the table.

Name

Explanation

_e

e (2.71828...)

_pi

pi (3.1415...)

_j

sqrt(-1)

_c

speed of light in a vacuum

_eps0

permittivity of a vacuum

_mu0

permeability of a vacuum

Built-in constants (v 4.4.9)

For convenience, some unit constants are built into the library. Please note that the underscore must be used as shown in the table. These are used for making conversions in calculations: "width = 10 * _mil * length"

Name

Explanation

_mil, _mils

2.54e-5

_in

0.0254

_ft

0.3028

_mi

1609.34

_m

1

_cm

1e-2

_mm, _mH, _mF

1e-3

_um, _uF, _uH

1e-6

_nm, _nF, _nH

1e-9

_pm, _pF, _pH

1e-12

_deg

_pi / 180

_rad

180 / _pi

Built-in functions

The following table gives an
overview of the functions supported by the default implementation. It
lists the function names, the number of arguments and a brief
description.

Built-in binary operators

The following table lists the default binary operators supported by the parser.

Operator

Meaning

Priority

=

assignment*

-1

<=

less or equal

2

>=

greater or equal

2

!=

not equal

2

==

equality

2

>

greater than

2

<

less than

2

+

addition

3

-

subtraction

3

*

multiplication

4

/

division

4

^

raise x to the power of y

5

*The assignment operator is special since it changes one of its arguments and can only be applied to variables.MOR Code (Method of Relaxation- 2D Finite Difference)

The MOR code is accessed through muParser calls. Several "dummy" functions are called to set up the problem- dummy in the sense that they do not return any useful value, the only set up the geometry.

MORSetStrip(X, Y, Width, Thickness, Value):

Set up the a line of voltage "Value" whose left most point is at coordinates (X, Y), goes Width to the right, and is Thickness tall. The impedance and the permittivity will be calculated for the line associated with the first call to MORSetStrip.

A value of 1 is consistent with a "positive" side of a coupled line.

A value of -1 is consistent with a "negative' side of a coupled line.

A value of 0 is consistent with a ground line. Balanced structures like CPS should use +/-1; unbalanced structures like CPW should use 0/1.

Use Thickness = 0 for infinitely thin PEC.
The current loop is 2 cells from the first strip... try to keep gaps between lines at least four cells.

MORSetStrip1(X, Y, Width, Thickness): [deprecated for MORSetStrip]

Set up the "positive" line whose left most point is at coordinates (X, Y), goes Width to the right, and is Thickness tall.

Use Thickness = 0 for infinitely thin PEC. The impedance and the permittivity will be calculated for the line associated with this call.

MORSetStrip2(X, Y, Width, Thickness): [deprecated for MORSetStrip]

Set up the "negative" (-1) line whose left most point is at coordinates (X, Y), goes Width to the right, and is Thickness tall.

Use Thickness = 0 for infinitely thin PEC.

MORSetStrip3(X, Y, Width, Thickness): [deprecated for MORSetStrip]

Optional "negative" (-1) line whose left most point is at coordinates (X, Y), goes Width to the right, and is Thickness tall.

Use Thickness = 0 for infinitely thin PEC.

MORSetStrip2 MUST be called before MORSetStrip3

MORSetDielectric(EpsR, DYmin, DYMax):

Set up a dielectric slab of EpsR relative permittivity, from DYmin to DYMax.

MORSetBounds(XMax, YMax)

Set the boundary conditions, bottom left of grid is (0,0), upper right of grid is (XMax, YMax).

MORImpedance(dummy_variable)

Run the MOR code, returns a complex number whose real part is the even impedance, the imaginary is the odd.

MORPermittivity(dummy_variable)

Run the MOR code, returns a complex number whose real part is the even mode EpsR, the imaginary is the odd.