Sheet language quick reference
Every kind of line a CivilKit Calcs sheet takes, its inputs, and the functions, constants, operators and units of the engine, on one page that prints well. Use Print and choose Save as PDF to keep a copy. The full account is in the user guide.
Lines of a sheet
| Line | You write | You get |
|---|---|---|
| Heading | # Beam check | A heading, level 1 to 6 with more #. |
| Prose | Plain text, **bold**, *italic*, lists and tables. | Markdown. A line that reads as a calculation but is not one can start with a backslash. |
| Formula in text | The moment is $M = wL^2/8$. | A formula typeset in the text. |
| Quantity | L: 6 m | span | A name with a value and a unit; the text after | is a note. |
| Calculation | M: w * L^2 / 8 -> kN*m | The working shown with the values put in, converted to kN·m. |
| Several on a line | a: 1; b: 2 | note for b | Two quantities; the note belongs to the last. |
| Your own function | f(x, y): sqrt(x^2 + y^2) | Used as f(3, 4) in later lines and in plots. |
| A unit of your own | #unit bag = 25 kg | Then 3 bag, or -> bag. |
| Vector and matrix | v: [1, 2, 3] | Commas across, semicolons between rows. v.2 and A.(1, 2) pick an element. |
| Condition | if u <= 1: "OK" else: "Fails" | A block with a body uses an indented body after if, else, for, while or repeat. |
| Loop | for i in 1..5: | for x in v, for i in 0..10 step 2, while, repeat n, break and continue also work. |
| Solve | x0: solve f(x) = 4 for x in 0..5 | Root finding on a range. |
| Integral and slope | A: integral of f(x) for x in 0..3 | Numerical integral and derivative. |
| Plot | plot sin(x) as "sine", cos(x) for x in 0..6 | Curves on one plot; as "name" adds a legend entry. |
| Page break | <div style="page-break-after:always"></div> | Starts a new page in print, PDF and Word. |
| Raw engine line | >> #deg | A line passed to the Calcpad engine as written. |
Inputs (a question mark makes the value a form field)
| Line | You write | You get |
|---|---|---|
| Number | L: ? 6 m | span | A box with its unit; the value is the default. |
| Slider | w: ? 12 kN/m [2 .. 30 step 0.5] | load | A box with a slider between the bounds. |
| Drop-down | E: ? [Steel = 200 GPa, *Timber = 11 GPa] | The name takes the value of the chosen option; * marks the default. |
| Radio buttons | k: ? (Low = 1, High = 2) | The same with round brackets. |
| Checkbox | ribs: ? on | on is 1 and off is 0. |
Constants and operators
| Constant | Symbol |
|---|---|
| Pi - ratio of circumference to diameter | π |
| Pi - ratio of circumference to diameter (spelled out) | pi |
| Euler's number - base of natural logarithm | e |
| Golden ratio | φ = 1.618033988749894 |
| Euler-Mascheroni constant | γ = 0.5772156649015328 |
| Standard gravitational acceleration | g = 9.80665m/s^2 |
| Gravitational constant | G = 6.67430*10^-11*(m^3/(kg*s^2)) |
| Earth mass | M_E = 5.9722*10^24*kg |
| Solar mass | M_S = 1.98847*10^30*kg |
| Speed of light in vacuum | c = 299792458m/s |
| Planck constant | h = 6.62607015*10^-34*J/Hz |
| Vacuum permeability | μ_0 = 1.25663706212*10^-6*N/A^2 |
| Vacuum permittivity | ε_0 = 8.8541878128*10^-12*F/m |
| Coulomb constant | k_e = 8.9875517923*10^9*N*m^2/C^2 |
| Elementary charge | e = 1.602176634*10^-19*C |
| Electron mass | m_e = 9.1093837015*10^-31*kg |
| Proton mass | m_p = 1.67262192369*10^-27*kg |
| Neutron mass | m_n = 1.67492749804*10^-27*kg |
| Avogadro constant | N_A = 6.02214076*10^23*mol^-1 |
| Stefan-Boltzmann constant | σ = 5.670374419*10^-8*W*m^-2*K^-4 |
| Boltzmann constant | k_B = 1.380649*10^-23*J/K |
| Molar gas constant | R = 8.31446261815324*(J/(mol*K)) |
| Faraday constant | F = 96485.33212331C/mol |
| Unit weight of concrete | γ_c = 25kN/m^3 |
| Unit weight of steel | γ_s = 78.5kN/m^3 |
| Unit weight of aluminium | γ_a = 27kN/m^3 |
| Unit weight of glass | γ_g = 25kN/m^3 |
| Unit weight of water | γ_w = 10kN/m^3 |
| Operator | Symbol |
|---|---|
| Factorial | ! |
| Exponent (power) | ^ |
| Division | / |
| Division bar (inline) / slash (pro mode) | ÷ |
| Integer division | \ |
| Modulo (remainder) | ⦼ |
| Multiplication | * |
| Subtraction / Negation | - |
| Addition | + |
| Equal to | ≡ |
| Not equal to | ≠ |
| Less than | < |
| Greater than | > |
| Less than or equal | ≤ |
| Greater than or equal | ≥ |
| Logical AND | ∧ |
| Logical OR | ∨ |
| Logical XOR | ⊕ |
| Phasor angle operator A∠φ | ∠ |
| Assignment | = |
| Outer scope assignment | ← |
In a sheet: + - * / ^ %, < > <= >= == !=, and or, and the forms ≤ ≥ ≠ ∧ ∨ × · ÷. ² and ³ after a name or unit mean ^2 and ^3.
Functions
Arguments are separated by commas in a sheet (the engine's semicolon also works inside brackets). A function written with a unit-bearing argument returns its result with the right unit.
Functions of numbers
Trigonometric
sin(x) cos(x) tan(x) csc(x) sec(x) cot(x)
Inverse Trigonometric
asin(x) acos(x) atan(x) atan2(x; y) acsc(x) asec(x) acot(x)
Hyperbolic
sinh(x) cosh(x) tanh(x) csch(x) sech(x) coth(x)
Inverse Hyperbolic
asinh(x) acosh(x) atanh(x) acsch(x) asech(x) acoth(x)
Logarithmic, Exponential and Roots
log(x) ln(x) log_2(x) exp(x) sqr(x) sqrt(x) cbrt(x) root(x; n)
Rounding
round(x) floor(x) ceiling(x) trunc(x)
Integer
mod(x; y) gcd(values; …) lcm(values; …) fact(n)
Complex
re(z) im(z) abs(z) phase(z) conj(z)
Aggregate and Interpolation
min(v₁; v₂; ...) min(v) min(M) max(v₁; v₂; ...) max(v) max(M) sum(v₁; v₂; ...) sum(v) sum(M) sumsq(v₁; v₂; ...) sumsq(v) sumsq(M) srss(v₁; v₂; ...) srss(v) srss(M) average(v₁; v₂; ...) average(v) average(M) product(v₁; v₂; ...) product(v) product(M) mean(v₁; v₂; ...) mean(v) mean(M) median(v₁; v₂; ...) stdev(v₁; v₂; ...) stdevp(v₁; v₂; ...) var(v₁; v₂; ...) varp(v₁; v₂; ...) take(n; values) take(n; v) take(n; m) line(x; data) line(x; xData; yData) line(x; m) spline(x; data) spline(x; xData; yData) spline(x; m)
Conditional and Logical
if(cond; value-if-true; value-if-false) switch(c₁; v₁; c₂; v₂; …; def) not(x) and(values; …) or(values; …) xor(values; …)
Other
sign(x) random(x) getunits(x) setunits(x; u) clrunits(x) hp(x) ishp(x) timer(x) mandelbrot(x; y)
Vector functions
Creational
vector(n) vector_hp(n) range(x1; xn; s) range_hp(x1; xn; s) linspace(a; b; n)
Structural
len(v) size(v) resize(v; n) fill(v; x) join(items) slice(v; i1; i2) first(v; n) last(v; n) extract(v; i)
Data
sort(v) rsort(v) order(v) revorder(v) reverse(v) count(v; x; i) search(v; x; i) find(v; x; i) find_eq(v; x; i) find_ne(v; x; i) find_lt(v; x; i) find_le(v; x; i) find_gt(v; x; i) find_ge(v; x; i) lookup(a; b; x) lookup_eq(a; b; x) lookup_ne(a; b; x) lookup_lt(a; b; x) lookup_le(a; b; x) lookup_gt(a; b; x) lookup_ge(a; b; x) polyfit(x; y; n) interp(x; xs; ys) linterp(x; xs; ys)
Math
norm(v) norm_1(v) norm_2(v) norm_e(v) norm_p(v; p) norm_i(v) unit(v) cumsum(v) convolve(a; b) dot(a; b) cross(a; b)
Matrix functions
Creational
matrix(m; n) identity(n) diagonal(n; d) column(m; c) utriang(n) ltriang(n) symmetric(n) matrix_hp(m; n) identity_hp(n) diagonal_hp(n; d) column_hp(m; c) utriang_hp(n) ltriang_hp(n) symmetric_hp(n) vec2diag(v) vec2row(v) vec2col(v) join_cols(columns; …) join_rows(rows; …) augment(matrices; …) stack(matrices; …)
Structural
n_rows(M) n_cols(M) mresize(M; m; n) mfill(M; x) fill_row(M; i; x) fill_col(M; j; x) copy(A; B; i; j) add(A; B; i; j) row(M; i) col(M; j) extract_rows(M; i) extract_cols(M; j) diag2vec(M) submatrix(M; i1; i2; j1; j2)
Data
sort_cols(M; i) rsort_cols(M; i) sort_rows(M; j) rsort_rows(M; j) order_cols(M; i) revorder_cols(M; i) order_rows(M; j) revorder_rows(M; j) mcount(M; x) msearch(M; x; i; j) mfind(M; x) mfind_eq(M; x) mfind_ne(M; x) mfind_lt(M; x) mfind_le(M; x) mfind_gt(M; x) mfind_ge(M; x) hlookup(M; x; i1; i2) hlookup_eq(M; x; i1; i2) hlookup_ne(M; x; i1; i2) hlookup_lt(M; x; i1; i2) hlookup_le(M; x; i1; i2) hlookup_gt(M; x; i1; i2) hlookup_ge(M; x; i1; i2) vlookup(M; x; j1; j2) vlookup_eq(M; x; j1; j2) vlookup_ne(M; x; j1; j2) vlookup_lt(M; x; j1; j2) vlookup_le(M; x; j1; j2) vlookup_gt(M; x; j1; j2) vlookup_ge(M; x; j1; j2)
Math
hprod(A; B) fprod(A; B) kprod(A; B) mnorm(M) mnorm_1(M) mnorm_2(M) mnorm_e(M) mnorm_i(M) cond(M) cond_1(M) cond_2(M) cond_e(M) cond_i(M) det(M) rank(M) trace(M) transp(M) adj(M) cofactor(M) polyroots(v) eigenvals(M; ne) eigenvecs(M; ne) eigen(M; ne) ceigenvals(M) ceigenvecs(M) cholesky(M) lu(M) qr(M) svd(M) inverse(M) lsolve(A; b) clsolve(A; b) slsolve(A; b) msolve(A; B) cmsolve(A; B) smsolve(A; B) fft(M) ift(M) take(x; y; M) line(x; y; M) spline(x; y; M)
Units
Write a unit after a number (300 MPa, 9.81 m/s², 5 kN*m). The engine combines and checks them, so a unit error is a mistake caught. Prefixes (k, M, G, m, µ, n and the rest of the SI set) apply to the metric units. Convert a result with -> unit, show a ratio as a percentage with -> %, and show a result in SI base units with -> base. Point at a unit for its meaning.
Dimensionless
% ‰ ‱ pcm ppm ppb ppt ppq
Angles
° ′ ″ deg rad grad rev
Metric: Mass
g dag hg kg t kt Mt Gt dg cg mg μg ng pg Da u
Metric: Length
m km dm cm mm μm nm pm AU ly
Metric: Area
a daa ha
Metric: Volume
L daL hL dL cL mL μL nL pL
Time
s ms μs ns ps min h d w y
Frequency
Hz kHz MHz GHz THz mHz μHz nHz pHz rpm
Speed
kmh
Temperature
°C Δ°C K
Metric: Force
N daN hN kN MN GN TN gf kgf tf dyn
Metric: Moment
Nm kNm
Metric: Pressure
Pa daPa hPa kPa MPa GPa TPa dPa cPa mPa μPa nPa pPa bar mbar μbar atm at Torr mmHg
Metric: Viscosity
P cP St cSt
Metric: Energy
J kJ MJ GJ TJ mJ μJ nJ pJ Wh kWh MWh GWh TWh mWh μWh nWh pWh VAh kVAh MVAh GVAh VARh kVARh MVARh GVARh eV keV MeV GeV TeV PeV EeV cal kcal erg
Metric: Power
W kW MW GW TW mW μW nW pW VA kVA MVA GVA TVA mVA μVA nVA pVA VAR kVAR MVAR GVAR TVAR mVAR μVAR nVAR pVAR
Electrical: Current
A kA MA GA TA mA μA nA pA
Electrical: Charge
C kC MC GC TC mC μC nC pC Ah mAh
Electrical: Potential
V kV MV GV TV mV μV nV pV
Electrical: Capacitance
F kF MF GF TF mF μF nF pF
Electrical: Resistance
Ω kΩ MΩ GΩ TΩ mΩ μΩ nΩ pΩ
Electrical: Conductance
S kS MS GS TS mS μS nS pS ℧ k℧ M℧ G℧ T℧ m℧ μ℧ n℧ p℧
Electrical: Magnetic Flux
Wb kWb MWb GWb TWb mWb μWb nWb pWb
Electrical: Magnetic Flux Density
T kT MT GT TT mT μT nT pT
Electrical: Inductance
H kH MH GH TH mH μH nH pH
Luminous
cd lm lx
Radioactivity
Bq kBq MBq GBq TBq mBq μBq nBq pBq Ci Rd
Dose: Absorbed
Gy kGy MGy GGy TGy mGy μGy nGy pGy
Dose: Equivalent
Sv kSv MSv GSv TSv mSv μSv nSv pSv
Catalytic Activity
kat
Amount of Substance
mol
Imperial: Mass
gr dr oz lb lbm lb_m kipm kip_m klb st qr cwt cwt_US cwt_UK ton ton_US ton_UK slug
Imperial: Length
th in ft yd ch fur mi ftm ftm_UK ftm_US cable cable_UK cable_US nmi li rod pole perch lea
Imperial: Speed
mph knot
Imperial: Temperature
°F Δ°F °R
Imperial: Area
rood ac
Imperial: Volume
fl_dr_UK fl_dr_US fl_oz fl_oz_UK fl_oz_US gi gi_UK gi_US pt pt_UK pt_US pt_dry qt qt_UK qt_US qt_dry gal gal_UK gal_US gal_dry bbl bbl_UK bbl_US bbl_dry pk_UK pk_US bu_UK bu_US
Imperial: Force
ozf oz_f lbf lb_f kip kipf kip_f tonf tonf_US tonf_UK pdl
Imperial: Pressure
osi osf psi psf ksi ksf tsi tsf inHg
Imperial: Energy
BTU therm therm_US therm_UK quad
Imperial: Power
hp hp_E hp_S hp_M ks
More
- The user guide, with a chapter for each of these.
- Calculators and guides: ready-made templates that open as forms.
- Source on GitHub (MIT licence).