Functions Overview
This document summarizes functions supported by microMathmatics Plus
1 Constants
Set a value
Get value
$$a = 10.0$$ |
$$b = 60.0$$ |
Build-in constants
2 Operators
Addition ("+")
$$d := 10 + 70$$ |
$$d = 80.0$$ |
$$c := 1 + i$$ |
$$c = 1.0+1.0i$$ |
Subtraction ("-")
$$d := 10 - 70$$ |
$$d = -60.0$$ |
$$c := 1 - i$$ |
$$c = 1.0-1.0i$$ |
Multiplication ("*")
$$d := 10 \cdot 70$$ |
$$d = 700.0$$ |
$$c := i \cdot i$$ |
$$c = -1.0$$ |
Division ("/" or "รท")
$$d := a / b$$ |
or |
$$d := \frac{a}{b}$$ |
$$c := i / 2$$ |
$$c = 0.0+0.5i$$ |
Parenthesis
$$ \left( e\right) = 2.71828$$ |
Complex operators:
$$\left( a + b \right) \cdot \left( a - b \right) - \left( a \cdot a - b \cdot b\right) = 0.0$$ |
3 Common functions
Raise to power ("^")
$${100}^{0} = 1.0$$ |
$${2}^{2} = 4.0$$ |
The square root of the argument ("#" or
"sqrt")
$$\sqrt{25} = 5.0$$ |
$$\sqrt{-1} = 0.0+1.0i$$ |
$$sqrt \left( 10\right) = 3.16228$$ |
The n-th root of the argument ("$")
$$\sqrt[\leftroot{-3}\uproot{3}3]{125} = 5.0$$ |
The product of all positive integers less
than or equal to the argument ("!")
The absolute value of the real or complex
argument ("|" or "abs")
$$ \left| 10 \right| = 10.0$$ |
$$ \left| -10 \right| = 10.0$$ |
$$abs \left( i\right) = 1.0$$ |
The complex conjugate of the complex argument
("~")
$$\overline{\left( 3 + 5i \right)} = 3.0-5.0i$$ |
$$\overline{\left( 1 - 2i \right)} = 1.0+2.0i$$ |
The real and imaginary parts of the complex
argument
$$\Re\left( 3 + 5i \right) = 3.0$$ |
$$\Im\left( 3 + 5i \right) = 5.0$$ |
4 Trigonometric functions
Sine, cosine, tangent
$$sin \left( {\pi} / 2\right) = 1.0$$ |
$$cos \left( {\pi}\right) = -1.0$$ |
$$tan \left( 0\right) = 0.0$$ |
Cosecant, secant, cotangent
$$csc \left( {\pi} / 2\right) = 1.0$$ |
$$sec \left( -{\pi}\right) = -1.0$$ |
$$cot \left( {\pi} / 4\right) = 1.0$$ |
Inverse sine, cosine, tangent
$$asin \left( 1\right) = 1.5708$$ |
$$acos \left( -1\right) = 3.14159$$ |
$$atan \left( 0\right) = 0.0$$ |
Inverse cosecant, secant, cotangent
$$acsc \left( 1\right) = 1.5708$$ |
$$asec \left( -1\right) = 3.14159$$ |
$$acot \left( 1\right) = 0.785398$$ |
The arc tangent of y/x within the range
[-pi..pi]
$$atan2 \left( 1,\, 5\right) = 0.197396$$ |
5 Hyperbolic functions and logarithms
The raising 'e' to the power of the argument
$$exp \left( 3\right) = 20.0855$$ |
The natural logarithm of the argument
$$ln \left( {e}^{5}\right) = 5.0$$ |
Logarithm of number to the specified base
$$log \left( 256,\, 2\right) = 8.0$$ |
The base 10 logarithm of the argument
$$log10 \left( {10}^{5}\right) = 5.0$$ |
Hyperbolic sine, cosine, tangent
$$sinh \left( 0\right) = 0.0$$ |
$$cosh \left( 0\right) = 1.0$$ |
$$tanh \left( 0\right) = 0.0$$ |
Hyperbolic cosecant, secant, cotangent
$$csch \left( 1\right) = 0.850918$$ |
$$sech \left( 0\right) = 1.0$$ |
$$coth \left( 1\right) = 1.31304$$ |
6 Functions for real numbers
The most positive (closest to positive
infinity) of the two arguments
$$max \left( 1,\, 2\right) = 2.0$$ |
$$max \left( 2,\, 1\right) = 2.0$$ |
The most negative (closest to negative
infinity) of the two arguments
$$min \left( 1,\, 2\right) = 1.0$$ |
$$min \left( 2,\, 1\right) = 1.0$$ |
The remainder on dividing the first argument
by the second
$$mod \left( 11,\, 2\right) = 1.0$$ |
$$mod \left( e,\, 2\right) = 0.718282$$ |
Calculates percentage (for example, 5% of 20)
$$perc \left( 20,\, 5\right) = 1.0$$ |
The pseudo-random value between zero and the
argument
$$random \left( 1\right) = 0.686012$$ |
$$random \left( 10\right) = 0.123869$$ |
The most negative (closest to negative
infinity) integer value greater than or
equal to the argument
$$ceil \left( 1\right) = 1.0$$ |
$$ceil \left( 1.25\right) = 2.0$$ |
$$ceil \left( 1.75\right) = 2.0$$ |
$$ceil \left( 2\right) = 2.0$$ |
The most positive (closest to positive
infinity) integer value less than or equal
to the argument
$$floor \left( 1\right) = 1.0$$ |
$$floor \left( 1.25\right) = 1.0$$ |
$$floor \left( 1.75\right) = 1.0$$ |
$$floor \left( 2\right) = 2.0$$ |
Rounds the real number x to n places
$$round \left( {\pi},\, 2\right) = 3.14$$ |
Returns the integer part of a real number by
removing the fractional part
$$trunc \left( {\pi}\right) = 3.0$$ |
Compute the signum of a number: -1 for
negative numbers, +1 for positive numbers
and 0 otherwise:
$$sign \left( -5\right) = -1.0$$ |
$$sign \left( 0\right) = 0.0$$ |
$$sign \left( e\right) = 1.0$$ |
7 Processing of the sequence
Summation |
$$\displaystyle\sum_{k=1}^{10} k = 55.0$$ |
Product |
$$\displaystyle\prod_{k=1}^{10} k = 3628800.0$$ |
8 Derivative of the function
$$f1(x) := \frac{d}{dx} sin \left( x\right) $$ |
$$f1 \left( 0\right) = 1.0$$ |
$$f2(x) := \frac{d}{dx} \frac{d}{dx} sin \left( x\right) $$ |
$$f2 \left( 0\right) = 0.0$$ |
9 The definite integral of a function
$$\displaystyle\int_{1}^{e}\frac{1}{0.5 \cdot x}\, dx = 2.0$$ |
$$G({\varphi},{\rho}) := \frac{3 \cdot cos \left( {\varphi}\right) - 2 \cdot sin \left( {\varphi}\right) }{{\rho}}$$ |
$$\displaystyle\int_{-{\pi} / 2}^{0}\displaystyle\int_{2}^{3}{\rho} \cdot G \left( {\varphi},\, {\rho}\right) \, d{\rho}\, d{\varphi} = 5.0$$ |
10 Root finding
A root of an one-dimensional equation f(x)=0
using Ridders Method:
$$f(x) := \frac{d}{dx} \left( {sin \left( x\right) }^{2} + {e}^{sin \left( x\right) }\right) $$ |
$$r := solve \left( f \left( y\right) ,\, y,\, -5,\, 5\right) $$ |
$$r = 4.71239$$ |
$$f \left( r\right) = -2.54529E-9$$ |
11 IF-function and logical operators
Select a term to be used depending on
comparison result for two expressions
$$true := 1$$ |
$$false := 0$$ |
$$if \left( 1 = 2,\, true,\, false\right) = 0.0$$ |
$$if \left( 1 \neq 2,\, true,\, false\right) = 1.0$$ |
$$if \left( 1 > 2,\, true,\, false\right) = 0.0$$ |
$$if \left( 1 \ge 2,\, true,\, false\right) = 0.0$$ |
$$if \left( 1 < 2,\, true,\, false\right) = 1.0$$ |
$$if \left( 1 \le 2,\, true,\, false\right) = 1.0$$ |
$$if \left( \left( 1 = 2 \right) or \left( 1 \neq 2 \right),\, true,\, false\right) = 1.0$$ |
$$if \left( \left( 1 = 2 \right) and \left( 1 \neq 2 \right),\, true,\, false\right) = 0.0$$ |
12 Function plots
The first x-value: |
$$x1 := -10$$ |
The last x-value: |
$$x2 := 10$$ |
The sampling step: |
$$dx := 0.1$$ |
X-values, interval (":")
$$x := \left[ x1,\, x1 + dx \,..\, x2 \right]$$ |
Y-values, a function of X
$$f(x) := {e}^{-x / 10} \cdot \displaystyle\sum_{n=0}^{20} \frac{{ \left( -1\right) }^{n}}{\left( 2 \cdot n \right)! } \cdot {x}^{2 \cdot n}$$ |
A plot with automatically calculated
boundaries:
A plot with manually defined boundaries:
13 Arrays
Define index range
$$N := 100$$ |
$$n := \left[ 1,\, 2 \,..\, N \right]$$ |
Define 1-D array (enter "[")
$$z_{n} := x1 + \frac{x2 - x1}{N - 1} \cdot \left( n - 1\right) $$ |
$$G_{n} := f \left( z_{n} \right) $$ |
Show elements of 1-D array
$$z_{n} = \begin{bmatrix}-10.0\\-9.79798\\-9.59596\\-9.39394\\-9.19192\\-8.9899\\\dots\\10.0\\\end{bmatrix}$$ |
$$G_{n} = \begin{bmatrix}-2.28083\\-2.48055\\-2.57248\\-2.55721\\-2.43959\\-2.22841\\\dots\\-0.308677\\\end{bmatrix}$$ |
Assign value by index
Show values of single elements of array
$$z_{5} = -10.0$$ |
$$G_{5} = -2.43959$$ |
Define 2-D array
$$M := 200$$ |
$$m := \left[ 1,\, 2 \,..\, M \right]$$ |
$$G2_{n,\, m} := round \left( sin \left( 2 \cdot pi \cdot \frac{n + m}{N + M}\right) ,\, 3\right) $$ |
$$G2_{n,\, m} = \begin{bmatrix}0.042&0.063&0.084&0.105&0.125&0.146&\dots&-0.876\\0.063&0.084&0.105&0.125&0.146&0.167&\dots&-0.886\\0.084&0.105&0.125&0.146&0.167&0.187&\dots&-0.896\\0.105&0.125&0.146&0.167&0.187&0.208&\dots&-0.905\\0.125&0.146&0.167&0.187&0.208&0.228&\dots&-0.914\\0.146&0.167&0.187&0.208&0.228&0.249&\dots&-0.922\\\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots\\0.855&0.844&0.833&0.821&0.809&0.797&\dots&0.0\\\end{bmatrix}$$ |
Define an array as vector or matrix, use
object properties to change the array size:
$$E := \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\\\end{bmatrix}$$ |
$$E = \begin{bmatrix}1.0&0.0&0.0\\0.0&1.0&0.0\\0.0&0.0&1.0\\\end{bmatrix}$$ |
14 Signal processing
Read a matrix fom an ASCII CSV file:
$$F := read \left( asset:/examples/three\_component\_signal.dat\right) $$ |
Get count of rows and columns:
$$rows \left( F\right) = 2000.0$$ |
$$cols \left( F\right) = 4.0$$ |
Extract and expand the second column to have
a length equal power of 2:
$$N := 2048$$ |
$$k := \left[ 0,\, 1 \,..\, N - 1 \right]$$ |
$$D_{k} := if \left( k < rows \left( F\right) ,\, F_{k,\, 1} ,\, 0\right) $$ |
Calculate the fast Fourier transform (when
the given array has the length equal to
power of 2) or a continuous (slow) Fourier
transform for other array length:
$$FT := fft \left( D\right) $$ |
Calculate the fast inverse Fourier transform
(when the given array has the length equal
to power of 2) or a continuous inverse
Fourier transform for other array length:
$$F := ifft \left( FT\right) $$ |
15 Output format
Using result property dialog, it is possible
to change the format of the result field:
15.1 Radix
Use a radix for integer results, for example
use binary, octal or hexadecimal bases:
$$M = 11111110$$ |
$$M = 376$$ |
$$M = fe$$ |
15.1 Fraction
Show a fraction for the floating results:
As a "raw" number: |
$$F = 4.02222$$ |
As a fraction: |
$$F = 4\ 1/45$$ |