### - Qucs -
Quite Universal Circuit Simulator

# Short Description of mathematical Functions

The following operations and functions can be applied in Qucs equations.

`+x` | unary plus
`-x` | unary minus
`x+y` | addition
`x-y` | subtraction
`x*y` | multiplication
`x/y` | division
`x%y` | modulo (remainder of division)
`x^y` | power
`max(x)` | maximum value in vector
`min(x)` | minimum value in vector
`sum(x)` | sum of values in vector
`prod(x)` | product of values in vector
`avg(x)` | arithmetic average of values in vector
`real(x)` | real part of complex number
`imag(x)` | imaginary part of complex number
`abs(x)` | absolute value, magnitude of complex number
`mag(x)` | same as abs(x)
`norm(x)` | square of mag(x)
`conj(x)` | conjugate complex
`phase(x)` | phase in degree
`angle(x)` | phase in radians
`arg(x)` | same as angle(x)
`deg2rad(x)` | converts degrees to radians
`rad2deg(x)` | converts radians to degrees
`unwrap(rad[,tol])` | unwraps the angle (in radians) using the optional tolerance value (default is pi)
`dB(x)` | voltage decibel
`sqrt(x)` | square root
`exp(x)` | exponential function to basis e
`ln(x)` | natural logarithm
`log10(x)` | decimal logarithm
`log2(x)` | binary logarithm
`sin(x)` | sine
`cos(x)` | cosine
`tan(x)` | tangent
`sinh(x)` | sine hyperbolicus
`cosh(x)` | cosine hyperbolicus
`tanh(x)` | tangent hyperbolicus
`arcsin(x)` | arcus sine
`arccos(x)` | arcus cosine
`arctan(x)` | arcus tangent
`arccot(x)` | arcus cotangent
`arsinh(x)` | area sine hyperbolicus
`arcosh(x)` | area cosine hyperbolicus
`artanh(x)` | area tangent hyperbolicus
`arcoth(x)` | area cotangent hyperbolicus
`sec(x)` | secans
`cosec(x)` | cosecans
`cot(x)` | cotangent
`sech(x)` | secans hyperbolicus
`cosech(x)` | cosecans hyperbolicus
`coth(x)` | cotangent hyperbolicus
`ztor(x)` | converts impedance to reflexion coefficient (reference 50 ohms)
`rtoz(x)` | converts reflexion coefficient (reference 50 ohms) to impedance
`rtoswr(x)` | converts reflexion coefficient to (voltage) standing wave ratio (SWR or VSWR)
`diff(y,x)` | differentiates vector y with respect to x
`diff(y,x,n)` | differentiates vector y with respect to x n-times
`stoy(s)` | converts s-parameter matrix to y-parameter matrix
`stoz(s)` | converts s-parameter matrix to z-parameter matrix
`ytos(y)` | converts y-parameter matrix to s-parameter matrix
`ytoz(y)` | converts y-parameter matrix to z-parameter matrix
`ztos(z)` | converts z-parameter matrix to s-parameter matrix
`ztoy(z)` | converts z-parameter matrix to y-parameter matrix
`twoport(m,from,to)` | converts the given 2-port matrix from one representation into another, possible values for `"from"` and `"to"` are 'Y', 'Z', 'H', 'G', 'A', 'S' and 'T'.
`sign(x)` | computes the signum function
`sinc(x)` | returns sin(x)/x and one at x=0
`det(x)` | determinant of x
`transpose(x)` | transposed matrix of x (rows and columns exchanged)
`inverse(x)` | inverse matrix of x
`eye(n)` | n x n identity matrix
`adjoint(x)` | adjoint matrix of x (transposed and conjugate complex)
`Rollet(x)` | Rollet stability factor of matrix x (twoport S-parameter matrix)
`Mu(x)` | Mu stability factor of matrix x (twoport S-parameter matrix)
`Mu2(x)` | Mu' stability factor of matrix x (twoport S-parameter matrix)
`linspace(from,to,n)` | creates a vector with `n` linearly spaced elements between `from` and `to`, both inclusively
`logspace(from,to,n)` | creates a vector with `n` logarithmically spaced elements between `from` and `to`, both inclusively
`NoiseCircle(Sopt, Fmin,Rn,F[,Arcs])` | circles with constant noise figure(s) `F` (can be a constant or a vector), `Arcs` specifies the angles in degree created by e.g. `linspace(0,360,100)`, if `Arcs` is a number it specifies the number of equally spaced circle segments, if it is omitted this number defaults to a reasonable value
`StabCircleS(S[,Arcs])` | stability circle in the source plane
`StabCircleL(S[,Arcs])` | stability circle in the load plane
`GaCircle(S,Ga[,Arcs])` | circle(s) with constant available power gain `Ga` in the source plane
`GpCircle(S,Gp[,Arcs])` | circle(s) with constant operating power gain `Gp` in the load plane
`PlotVs(data,dep)` | returns a data item based upon `data` (vector or matrix vector) with dependency on the given `dep` vector, e.g. `PlotVs(Gain,frequency/1e9)`
`interpolate(f,x[,n])` | returns an interpolated data vector of the real function `f(x)`using `n` equidistant datapoints, the latter can be omitted and defaults to a reasonable value

Matrix nomenclature

`M` | the whole matrix M
`M[2,3]` | element being in 2nd row and 3rd column of matrix M
`M[:,3]` | vector consisting of 3rd column of matrix M

Constants

`j` | imaginary unit ("square root of -1")
`pi` | 4*atan(1) = 3.14159
`e` | Euler = 2.71828
`kB` | Boltzmann constant = 1.38065e-23

back to the top