Documentation map
This documentation is organized to mirror the engine pipeline and then dive into the full function library.
- Start with the engine overview and evaluation model.
- Learn syntax rules and preprocessing (implicit multiplication, degree symbol, polar notation).
- Understand display modes and formatting controls.
- Study the routing rules that decide numeric vs symbolic evaluation.
- Use the complete function catalog and constants lists.
- Review edge cases and limitations for reliable results.
Engine overview
GrayCalc uses a dual-engine approach:
- Numeric engine for fast numeric evaluation and matrix operations.
- Symbolic engine (running in-browser in a Web Worker) for algebra, calculus, transforms, and advanced solving.
The engine automatically routes each line to the appropriate engine based on the expression and current variable context. The symbolic engine is loaded on demand; the first symbolic evaluation may take a few seconds while it initializes.
Quick start
Open the app, start a new sheet, and paste this mini worksheet. Each line evaluates independently, and later lines can reference variables from earlier lines.
2 + 3 * 4
(2 + 3) * 4
2^8
a = 5
b = 12
c = sqrt(a^2 + b^2)
c
v = [10, 20, 30]
v[0]
solve(x^2 - 4, x)
- Edit
aorband watchcupdate automatically. - Try
v[2]to grab the last list element (indexing is 0-based in the UI).
2x and 3(y + 1), but wt is a single identifier—use w * t when you mean multiplication.Next: Evaluation model, Syntax, Engine routing, Function catalog.
Evaluation model
- Each line is evaluated independently but can reference variables from earlier lines.
- Variables are scoped by line number. A variable defined later does not affect earlier lines.
- Editing a line re-evaluates dependent lines automatically.
- Lines starting with
#are treated as comments and produce no output.
If you assign an expression with undefined symbols, GrayCalc stores it symbolically instead of erroring.
a = b + 2
c = a^2
Later, when b is defined, dependent lines re-evaluate automatically.
Syntax & preprocessing
Operators and precedence
- Exponentiation:
^(e.g.,2^8). - Multiplication and division:
*,/. - Addition and subtraction:
+,-. - Parentheses control order of operations.
- Assignment uses a single
=(e.g.,a = 5).
Implicit multiplication
GrayCalc inserts multiplication automatically in common cases:
2xis interpreted as2 * x.3(y + 1)is interpreted as3 * (y + 1).)xand)2insert multiplication after the closing parenthesis.
wt is one variable, not w * t. If you intend multiplication, use w * t.x2) are treated as a single variable name.Variable names
- Pattern:
[A-Za-z_][A-Za-z0-9_]*. - Greek letters are supported in variable names.
- Names are case-sensitive (
gandGare different constants).
Degree symbol
Degree notation is supported with °:
- In radian mode,
90°becomestoRadians(90). - In degree mode,
90°stays numeric because trig functions expect degrees.
sin(90°)
Polar angle notation
Polar complex numbers use the ∠ symbol:
10 ∠ 45°
This is converted to (10) * exp(i * (45°)), with automatic degree-to-radian conversion when angle mode is degrees.
Complex numbers
- Use
ias the imaginary unit:3 + 4i. - Polar display mode formats results as
r∠theta. - Rectangular display mode formats results as
a + bi.
Indexing (0-based)
Array and matrix indexing is 0-based in the UI:
v = [10, 20, 30]
v[0]
Matrix indexing uses [row, col]:
M = [[1, 2], [3, 4]]
M[0, 1]
Internally, indexes are shifted to match the 1-based indexing used by the numeric engine.
Modes & formatting
Angle mode
- Radians (
rad) is the default. - Degrees (
deg) changes trig functions to interpret inputs as degrees. - Inverse trig functions return values in the current angle mode.
Complex display mode
- Rectangular:
a + bi. - Polar:
r∠theta(theta in degrees when angle mode is degrees).
Number display mode
- Decimal: numeric output is formatted as decimals.
- Fraction: numeric output is formatted as rational fractions.
Calculation format and precision
- Format options:
auto(plain decimal, no scientific notation),fixed,exponential(scientific),engineering. - Decimal places range: 0-14.
Formatting uses the numeric engine formatter and respects the current mode.
Engine routing
The engine decides whether to evaluate a line in the numeric engine or symbolic engine using clear rules:
- Explicit symbolic commands always route to the symbolic engine (see list below).
- Undefined symbols route to the symbolic engine to preserve structure.
- Symbolic dependencies (variables defined symbolically earlier) route to the symbolic engine.
- Numeric-only expressions stay in the numeric engine for speed.
- If the numeric engine fails to evaluate a line, the engine falls back to the symbolic engine (when enabled).
These commands always route to the symbolic engine:
solve, nsolve, simplify, factor, expand, diff, derivative, integrate, integral, limit, series, laplace, laplace_transform, inverse_laplace, inverse_laplace_transform, invLaplace, fourier, fourier_transform, inverse_fourier, inverse_fourier_transform, ztrans, ztransform, inverse_ztrans, invZtransform, ode, dsolve, pfd, apart, linsolve, eigvals, eigvects, inverse, nullspace, erf.
^ for exponentiation. The engine converts ^ to ** for Python automatically.Symbolic engine details
Raw symbolic input
Prefix a line with symbolic: to send raw Python directly to the worker.
symbolic: sp.N(erf(1))
Default arguments
laplace(expr)expands tolaplace(expr, t, s).inverse_laplace(expr)expands toinverse_laplace(expr, s, t).diff(expr)defaults tox(ortiftappears).integrate(expr)defaults tox(ortiftappears).integrate(expr, v, a, b)rewrites tointegrate(expr, [v, a, b]).integral(expr, v, a, b)is an alias forintegrate(expr, [v, a, b]).derivative(expr, v, at)is an alias fordiff(expr, v).subs(v, at).nsolve(eq, var, [guess])defaults the initial guess to1when omitted.
Solving equations with equals sign
For solve and linsolve, lists of equations can use = and are rewritten to Eq(...) automatically:
solve([x + y = 2, x - y = 0], [x, y])
Symbol creation and substitutions
- Unknown identifiers are auto-defined as symbolic variables.
- Variables from earlier lines are substituted into symbolic results where applicable.
- Symbolic results display with
**converted to^. When storing into the numeric engine,Iis converted toi.
User-defined functions
GrayCalc supports lightweight Python-style function definitions.
Multi-line functions
def f(x):
y = x^2 + 1
return y
- Indentation is required for the body.
- Supported statements: assignments,
return, and condition headers (if/elif/else). - Control flow is limited (conditions are evaluated but do not run full branches).
Single-line functions
f(x) = x^2 + a
Single-line definitions are registered as functions with a single return expression.
Variables & dependencies
- Variables are tracked with line numbers to preserve notebook order.
- When a variable changes, all dependent lines are marked for re-evaluation.
- Deleting a line removes variables defined on that line from the active scope.
Unit-like identifiers
Inline units are not parsed. Identifiers like m, cm, and kg are treated as symbolic variables first.
Symbolic example
5 m + 200 cm
5 * m + 200 * cm until those symbols are defined.Explicit conversions
convert(60, "mi/h", "m/s")
convert; there is no to keyword unit parsing.convert("5 meters to feet") only supports simple unit names (letters and digits, no slashes).Constants
Math constants
pi= 3.141592653589793e= 2.718281828459045i= imaginary unittau= 2 * piphi= 1.618033988749895 (Golden ratio)eulerGamma= 0.5772156649015329sqrt2= 1.4142135623730951sqrt3= 1.7320508075688772sqrt5= 2.23606797749979
Physical constants
hbar= 1.0545718176461565e-34 (J*s)k_B= 1.380649e-23 (J/K)N_A= 6.02214076e23 (mol^-1)epsilon_0= 8.8541878128e-12 (F/m)mu_0= 1.25663706212e-6 (H/m)e_charge= 1.602176634e-19 (C)m_e= 9.1093837015e-31 (kg)m_p= 1.67262192369e-27 (kg)
Engineering constants
atm= 101325 (Pa)bar= 100000 (Pa)psi= 6894.757 (Pa)fahrenheit= 32celsius= 0kelvin= 273.15
Function catalog
This catalog lists the core numeric-engine functions surfaced by GrayCalc plus all custom helpers. The numeric engine exposes additional functions beyond this list. Functions marked "Symbolic engine" route to the symbolic engine.
Basic math & algebra
| Function | Description | Example | Engine |
|---|---|---|---|
sqrt(x) | Square root. | sqrt(9) | Numeric engine |
cbrt(x) | Cube root. | cbrt(8) | Numeric engine |
pow(x, y) | Power function. | pow(2, 3) | Numeric engine |
exp(x) | e raised to x. | exp(1) | Numeric engine |
log(x) | Natural logarithm. | log(e) | Numeric engine |
log10(x) | Base-10 logarithm. | log10(100) | Numeric engine |
log2(x) | Base-2 logarithm. | log2(8) | Numeric engine |
ln(x) | Natural log alias. | ln(e) | Numeric engine |
abs(x) | Absolute value. | abs(-5) | Numeric engine |
round(x) | Round to nearest integer. | round(3.7) | Numeric engine |
ceil(x) | Round up. | ceil(3.1) | Numeric engine |
floor(x) | Round down. | floor(3.9) | Numeric engine |
trunc(x) | Truncate decimal part. | trunc(3.9) | Helper |
factorial(n) | Factorial (via Gamma). | factorial(5) | Helper |
gammaFunc(z) | Gamma function. | gammaFunc(5) | Helper |
betaFunc(a, b) | Beta function. | betaFunc(2, 3) | Helper |
erf(x) | Error function. | erf(1) | Helper/Symbolic engine |
errorFunc(x) | Alias for erf. | errorFunc(1) | Helper |
besselJ(n, x) | Bessel J (n=0,1 supported). | besselJ(0, 1) | Helper |
gcd(a, b) | Greatest common divisor. | gcd(12, 8) | Numeric engine |
lcm(a, b) | Least common multiple. | lcm(12, 8) | Numeric engine |
collatz(n) | Collatz sequence. | collatz(5) | Helper |
Trigonometry (angle-mode aware)
| Function | Description | Example | Engine |
|---|---|---|---|
sin(x) | Sine. | sin(90°) | Helper |
cos(x) | Cosine. | cos(0) | Helper |
tan(x) | Tangent. | tan(45°) | Helper |
sec(x) | Secant. | sec(0) | Helper |
csc(x) | Cosecant. | csc(90°) | Helper |
cot(x) | Cotangent. | cot(45°) | Helper |
asin(x) | Arcsine. | asin(1) | Helper |
acos(x) | Arccosine. | acos(1) | Helper |
atan(x) | Arctangent. | atan(1) | Helper |
atan2(y, x) | Quadrant-aware arctangent. | atan2(1, 1) | Helper |
asec(x) | Arcsecant. | asec(2) | Helper |
acsc(x) | Arccosecant. | acsc(2) | Helper |
acot(x) | Arccotangent. | acot(1) | Helper |
sinh(x) | Hyperbolic sine. | sinh(0) | Helper |
cosh(x) | Hyperbolic cosine. | cosh(0) | Helper |
tanh(x) | Hyperbolic tangent. | tanh(0) | Helper |
asinh(x) | Inverse hyperbolic sine. | asinh(0) | Helper |
acosh(x) | Inverse hyperbolic cosine. | acosh(1) | Helper |
atanh(x) | Inverse hyperbolic tangent. | atanh(0) | Helper |
toRadians(x) | Degrees to radians. | toRadians(180) | Helper |
toDegrees(x) | Radians to degrees. | toDegrees(pi) | Helper |
deg2rad(x) | Alias for toRadians. | deg2rad(180) | Helper |
rad2deg(x) | Alias for toDegrees. | rad2deg(pi) | Helper |
Complex numbers
| Function | Description | Example | Engine |
|---|---|---|---|
complex(re, im) | Create complex number. | complex(3, 4) | Numeric engine |
re(z) | Real part. | re(3 + 4i) | Numeric engine |
im(z) | Imaginary part. | im(3 + 4i) | Numeric engine |
conj(z) | Complex conjugate. | conj(3 + 4i) | Numeric engine |
arg(z) | Argument (angle) in radians. | arg(3 + 4i) | Numeric engine |
Statistics
| Function | Description | Example | Engine |
|---|---|---|---|
mean(list) | Arithmetic mean. | mean([1, 2, 3]) | Numeric engine |
median(list) | Median value. | median([1, 2, 3, 4]) | Numeric engine |
mode(list) | Most frequent value(s). | mode([1, 2, 2, 3]) | Numeric engine |
stdev(list) | Standard deviation (alias for std). | stdev([1, 2, 3]) | Helper |
variance(list) | Variance. | variance([1, 2, 3]) | Helper |
stdevPop(list) | Population standard deviation. | stdevPop([1, 2, 3]) | Helper |
stdevSample(list) | Sample standard deviation. | stdevSample([1, 2, 3]) | Helper |
zscore(value, mean, stdev) | Standard score. | zscore(85, 80, 5) | Helper |
quartile(data, q) | Quartile (q=0.25, 0.5, 0.75). | quartile([1,2,3,4,5], 0.5) | Helper |
iqr(data) | Interquartile range. | iqr([1,2,3,4,5]) | Helper |
sum(list) | Sum of values. | sum([1, 2, 3]) | Numeric engine |
prod(list) | Product of values. | prod([1, 2, 3]) | Numeric engine |
min(list) | Minimum value. | min([1, 2, 3]) | Numeric engine |
max(list) | Maximum value. | max([1, 2, 3]) | Numeric engine |
Finance & business
| Function | Description | Example | Engine |
|---|---|---|---|
npv(rate, values) | Net present value. | npv(0.05, [-100, 50, 60]) | Helper |
irr(values, [guess]) | Internal rate of return. | irr([-100, 20, 30, 40, 50]) | Helper |
fv(pv, rate, nper, [pmt]) | Future value. | fv(1000, 0.05, 10, 0) | Helper |
pv(fv, rate, nper, [pmt]) | Present value. | pv(1628.89, 0.05, 10, 0) | Helper |
pmt(pv, rate, nper, [fv]) | Payment for annuity/loan. | pmt(1000, 0.05, 12, 0) | Helper |
roi(gain, cost) | Return on investment. | roi(1200, 1000) | Helper |
eff(nominalRate, periods) | Effective interest rate. | eff(0.12, 12) | Helper |
nom(effectiveRate, periods) | Nominal interest rate. | nom(0.1268, 12) | Helper |
breakeven(fixed, price, variable) | Break-even units. | breakeven(1000, 50, 30) | Helper |
eoq(demand, orderCost, holdingCost) | Economic order quantity. | eoq(1000, 50, 2) | Helper |
margin(revenue, cost) | Profit margin ratio. | margin(1000, 800) | Helper |
Engineering
| Function | Description | Example | Engine |
|---|---|---|---|
ohmsLaw(v, i, r) | Solve V=IR (use undefined for unknown). | ohmsLaw(undefined, 2, 5) | Helper |
impedance(r, x) | Total impedance magnitude. | impedance(3, 4) | Helper |
resonantFreq(l, c) | LC resonant frequency. | resonantFreq(0.001, 1e-6) | Helper |
decibel(ratio) | Amplitude ratio to dB. | decibel(2) | Helper |
wavelength(f, [speed]) | Wavelength from frequency. | wavelength(1e6) | Helper |
stress(force, area) | Stress. | stress(1000, 0.01) | Helper |
strain(deltaL, L) | Strain. | strain(0.01, 1) | Helper |
reynoldsNumber(rho, v, L, mu) | Reynolds number. | reynoldsNumber(1000, 1, 0.1, 0.001) | Helper |
torque(force, radius) | Torque. | torque(100, 0.5) | Helper |
pressure(force, area) | Pressure. | pressure(1000, 0.01) | Helper |
parallelResistance(r1, r2, ...) | Parallel resistance. | parallelResistance(100, 100) | Helper |
capacitiveReactance(f, C) | Capacitive reactance. | capacitiveReactance(60, 10e-6) | Helper |
inductiveReactance(f, L) | Inductive reactance. | inductiveReactance(60, 0.1) | Helper |
resonantFrequency(L, C) | LC resonant frequency. | resonantFrequency(0.1, 10e-6) | Helper |
timeConstant(R, C) | RC time constant. | timeConstant(1000, 10e-6) | Helper |
cutoffFrequency(R, C) | RC cutoff frequency. | cutoffFrequency(1000, 10e-6) | Helper |
qualityFactor(L, C, R) | Series Q factor. | qualityFactor(0.1, 10e-6, 10) | Helper |
hzToRad(hz) | Hz to rad/s. | hzToRad(60) | Helper |
radToHz(rad) | rad/s to Hz. | radToHz(377) | Helper |
dB(ratio) | Power ratio to dB. | dB(100) | Helper |
dBv(ratio) | Voltage ratio to dB. | dBv(100) | Helper |
fromDB(db) | dB to power ratio. | fromDB(20) | Helper |
fromDBv(db) | dB to voltage ratio. | fromDBv(40) | Helper |
Physics
| Function | Description | Example | Engine |
|---|---|---|---|
velocity(distance, time) | v = d / t. | velocity(100, 10) | Helper |
acceleration(dv, dt) | a = dv / dt. | acceleration(20, 2) | Helper |
force(mass, accel) | F = m * a. | force(10, 9.8) | Helper |
momentum(mass, velocity) | p = m * v. | momentum(5, 10) | Helper |
energy(mass, velocity) | Kinetic energy. | energy(10, 5) | Helper |
coulombsLaw(q1, q2, r) | Electrostatic force. | coulombsLaw(1e-6, 1e-6, 0.1) | Helper |
Chemistry & biology
| Function | Description | Example | Engine |
|---|---|---|---|
molarity(moles, liters) | Molarity. | molarity(0.5, 1.0) | Helper |
pH(hConcentration) | pH from H+ concentration. | pH(0.001) | Helper |
halfLife(initial, final, time) | Half-life from decay. | halfLife(100, 50, 10) | Helper |
growthRate(initial, final, time) | Exponential growth rate. | growthRate(100, 200, 10) | Helper |
Project management
| Function | Description | Example | Engine |
|---|---|---|---|
pert(o, m, p) | PERT estimate. | pert(2, 4, 8) | Helper |
cpi(earned, actual) | Cost performance index. | cpi(100, 110) | Helper |
spi(earned, planned) | Schedule performance index. | spi(100, 120) | Helper |
Computer science
| Function | Description | Example | Engine |
|---|---|---|---|
fibonacci(n) | nth Fibonacci number. | fibonacci(10) | Helper |
bin(n) | Binary string. | bin(10) | Helper |
hex(n) | Hex string. | hex(255) | Helper |
oct(n) | Octal string. | oct(64) | Helper |
fromBin(str) | Binary to decimal. | fromBin("1010") | Helper |
fromHex(str) | Hex to decimal. | fromHex("ff") | Helper |
Numerical methods
| Function | Description | Example | Engine |
|---|---|---|---|
newtonRaphson(f, df, x0) | Newton-Raphson root finding. | newtonRaphson("x^2-2", "2x", 1) | Helper |
bisection(f, a, b) | Bisection root finding. | bisection("x^2-2", 0, 2) | Helper |
simpson(f, a, b) | Simpson integration. | simpson("x^2", 0, 1) | Helper |
trapezoid(f, a, b) | Trapezoidal integration. | trapezoid("sin(x)", 0, pi) | Helper |
spline(xPts, yPts, x) | Cubic spline interpolation (linear fallback). | spline([0,1,2], [0,1,4], 1.5) | Helper |
Differential equations
| Function | Description | Example | Engine |
|---|---|---|---|
odeEuler(f, x0, y0, h, n) | Euler method ODE solver. | odeEuler("y", 0, 1, 0.1, 10) | Helper |
odeRK4(f, x0, y0, h, n) | Runge-Kutta 4th order. | odeRK4("-y", 0, 1, 0.1, 10) | Helper |
ode(eq, func) | Symbolic ODE solver. | ode(Derivative(f(x), x) - f(x), f(x)) | Symbolic engine |
dsolve(eq, func) | Symbolic ODE solver. | dsolve(Derivative(f(x), x) - f(x)) | Symbolic engine |
f as a symbolic function first: symbolic: f = Function('f').Transform theory
| Function | Description | Example | Engine |
|---|---|---|---|
laplace(expr, t, s) | Laplace transform. | laplace(sin(w*t), t, s) | Symbolic engine |
inverse_laplace(expr, s, t) | Inverse Laplace transform. | inverse_laplace(w/(s^2+w^2), s, t) | Symbolic engine |
fourier(expr, t, w) | Fourier transform. | fourier(exp(-a*t^2), t, w) | Symbolic engine |
inverse_fourier(expr, w, t) | Inverse Fourier transform. | inverse_fourier(exp(-w^2/4), w, t) | Symbolic engine |
ztrans(expr, n, z) | Z-transform. | ztrans(a^n, n, z) | Symbolic engine |
inverse_ztrans(expr, z, n) | Inverse Z-transform. | inverse_ztrans(z/(z-a), z, n) | Symbolic engine |
invLaplace(expr, s, t) | Alias of inverse_laplace. | invLaplace(w/(s^2+w^2), s, t) | Symbolic engine |
ztransform(expr, n, z) | Alias of ztrans. | ztransform(a^n, n, z) | Symbolic engine |
invZtransform(expr, z, n) | Alias of inverse_ztrans. | invZtransform(z/(z-a), z, n) | Symbolic engine |
fourier_transform(expr, t, w) | Alias of fourier. | fourier_transform(exp(-a*t^2), t, w) | Symbolic engine |
inverse_fourier_transform(expr, w, t) | Alias of inverse_fourier. | inverse_fourier_transform(exp(-w^2/4), w, t) | Symbolic engine |
fourier_transform and inverse_laplace_transform) route through the symbolic engine.Series & expansions
| Function | Description | Example | Engine |
|---|---|---|---|
taylor(f, x0, n) | Taylor series expansion (numeric). | taylor(f, 0, 5) | Helper |
fourierSeries(f, period, nTerms) | Fourier series coefficients (numeric). | fourierSeries('sin(t)', 2*pi, 5) | Helper |
taylor, pass a function reference (for example define f(x) = sin(x) first).Linear algebra
| Function | Description | Example | Engine |
|---|---|---|---|
det(matrix) | Determinant. | det([[1,2],[3,4]]) | Numeric engine |
inv(matrix) | Matrix inverse. | inv([[1,2],[3,4]]) | Numeric engine |
transpose(matrix) | Transpose. | transpose([[1,2],[3,4]]) | Numeric engine |
dot(a, b) | Dot product. | dot([1,2], [3,4]) | Numeric engine |
cross(a, b) | Cross product. | cross([1,0,0], [0,1,0]) | Numeric engine |
norm(v) | Vector norm. | norm([3,4]) | Numeric engine |
eigenvals(matrix) | Eigenvalues. | eigenvals([[1,2],[3,4]]) | Helper |
eigenvecs(matrix) | Eigenvectors. | eigenvecs([[1,2],[3,4]]) | Helper |
eye(n) | Identity matrix. | eye(3) | Helper |
zeros(m, n) | Zero matrix. | zeros(2, 3) | Numeric engine |
ones(m, n) | Ones matrix. | ones(2, 3) | Numeric engine |
matrix(...) | Matrix literal via nested arrays. | [[1,2],[3,4]] | Numeric engine |
Signal processing
| Function | Description | Example | Engine |
|---|---|---|---|
fft(data) | Fast Fourier transform. | fft([1, 0, 1, 0]) | Helper |
ifft(data) | Inverse FFT. | ifft([1, 0, 1, 0]) | Helper |
fftmag(data) | FFT magnitude spectrum. | fftmag([1, 0, 1, 0]) | Helper |
fftphase(data) | FFT phase spectrum (radians). | fftphase([1, 0, 1, 0]) | Helper |
hamming(n, N) | Hamming window value. | hamming(5, 10) | Helper |
hanning(n, N) | Hanning window value. | hanning(5, 10) | Helper |
blackman(n, N) | Blackman window value. | blackman(5, 10) | Helper |
convolve(a, b) | Signal convolution. | convolve([1,2,3], [0,1,0.5]) | Helper |
xcorr(a, b) | Cross-correlation. | xcorr([1,2,3], [1,2,3]) | Helper |
Control systems
| Function | Description | Example | Engine |
|---|---|---|---|
transferFunction(num, den, s) | Evaluate transfer function at real s. | transferFunction([1], [1,2,1], 1) | Helper |
bode(num, den, frequencies) | Bode plot data (experimental). | bode([1], [1,1], [0.1,1,10]) | Helper |
Plotting
| Function | Description | Example | Engine |
|---|---|---|---|
plot(expr[, var][, xMin, xMax][, ...]) | Interactive chart for a function or XY data. | plot(sin(x), x, -1, 1) | Helper |
Utility & combinatorics
| Function | Description | Example | Engine |
|---|---|---|---|
randint(min, max) | Random integer. | randint(1, 10) | Helper |
randnorm(mean, stdev) | Normal random. | randnorm(0, 1) | Helper |
random() | Uniform random in [0,1). | random() | Numeric engine |
nCr(n, r) | Combinations. | nCr(5, 2) | Helper |
nPr(n, r) | Permutations. | nPr(5, 2) | Helper |
dbd(date1, date2) | Days between dates (YYYYMMDD). | dbd(20230101, 20230201) | Helper |
polyRoots(coeffs) | Polynomial roots. | polyRoots([1, 0, -1]) | Helper |
toRect(polar) | Polar to rectangular. | toRect({r:1, phi:pi/4}) | Helper |
convert(val, from, to) | Explicit unit conversion (no inline units). | convert(5, "km", "m") | Helper |
unit(value, unitName) | Create a unit value (explicit strings). | unit(5, "kg") | Helper |
celsiusToFahrenheit(c) | Temperature conversion. | celsiusToFahrenheit(0) | Helper |
fahrenheitToCelsius(f) | Temperature conversion. | fahrenheitToCelsius(32) | Helper |
celsiusToKelvin(c) | Temperature conversion. | celsiusToKelvin(0) | Helper |
kelvinToCelsius(k) | Temperature conversion. | kelvinToCelsius(273.15) | Helper |
Symbolic algebra
| Function | Description | Example | Engine |
|---|---|---|---|
solve(eq, var) | Symbolic solve. | solve(x^2 - 4, x) | Symbolic engine |
nsolve(eq, var, [guess]) | Numeric solve. | nsolve(cos(x) - x, x, 0.7) | Symbolic engine |
simplify(expr) | Simplify expression. | simplify((x^2 - 4)/(x - 2)) | Symbolic engine |
expand(expr) | Expand expression. | expand((x - 1)(x + 1)) | Symbolic engine |
factor(expr) | Factor expression. | factor(x^2 - 1) | Symbolic engine |
diff(expr, var[, order]) | Differentiate. | diff(x^2, x) | Symbolic engine |
derivative(expr, var, at) | Derivative at a point (alias). | derivative(x^3, x, 2) | Symbolic engine |
integrate(expr, var[, a, b]) | Integrate. | integrate(x^2, x, 0, 1) | Symbolic engine |
integral(expr, var, a, b) | Definite integral (alias). | integral(x^2, x, 0, 1) | Symbolic engine |
limit(expr, var, pt) | Limit. | limit(sin(x)/x, x, 0) | Symbolic engine |
series(expr, var, pt) | Series expansion. | series(sin(x), x, 0) | Symbolic engine |
linsolve(eq, vars) | Linear system solve. | linsolve([x + y = 2, x - y = 0], [x, y]) | Symbolic engine |
eigvals(matrix) | Eigenvalues (symbolic). | eigvals([[1,2],[3,4]]) | Symbolic engine |
eigvects(matrix) | Eigenvectors (symbolic). | eigvects([[1,2],[3,4]]) | Symbolic engine |
inverse(matrix) | Matrix inverse (symbolic). | inverse([[1,2],[3,4]]) | Symbolic engine |
nullspace(matrix) | Nullspace. | nullspace([[1,2],[3,4]]) | Symbolic engine |
pfd(expr) | Partial fraction decomposition. | pfd(1/(x^2 - 1)) | Symbolic engine |
apart(expr) | Partial fraction (symbolic apart). | apart(1/(x^2 - 1)) | Symbolic engine |
Edge cases & limitations
- Inline comments are not supported. Comments must start the line.
- Multi-letter identifiers are treated as one variable. Use explicit
*when you want multiplication. - Python-style function bodies support assignments and returns; full control flow (loops, multi-branch if) is not implemented.
- Symbolic commands can be expensive for large expressions; the symbolic engine may take a moment to initialize.
bodeuses complex evaluation internally but the current transfer-function implementation is numeric-only, so results may beNaN. Use the symbolic engine for complex frequency responses.- Alias spellings such as
integral,derivative,invLaplace,ztransform, andinvZtransformare normalized to their symbolic equivalents before evaluation.