What's New in Calcpad VM Pro 8.00

Changes compared to Calcpad VM 7.7.3

At a glance

Upgrading from 7.7.3

Some changes in 8.00 can affect existing worksheets. Check the following before you run older files:

ChangeVersion 7.7.3Version 8.00
Headings "Title '"Title: a single quote, then a double quote, at the start of the line. Text in double quotes is now a string, so an old-style heading is reported as an unclosed string.
Function names Built-in names were not case sensitive: Sin(x) and SIN(x) worked. All function names are case sensitive and all built-in functions are lower case. Sin(x) is undefined, unless you define it as a custom function.
mean Geometric mean Arithmetic mean (an alias of average). Use geomean for the geometric mean.
Plot settings Variables PlotWidth, PlotHeight, PlotSVG, PlotAdaptive, PlotPalette, PlotSmooth, PlotShadows, PlotLightDir and PlotStep Options Plot.Width, Plot.Height, Plot.Svg, Plot.Adaptive, Plot.Palette, Plot.Smooth, Plot.Shadows, Plot.LightDirection and Plot.MapStep. The old variables no longer affect plots.
Default plot size 400 × 250 px 500 × 300 px
Comments Text in single or double quotes Only single quotes start a comment. To include a single quote in a comment, type it twice: ''.

All examples that come with the program have been updated to the new syntax.

When you open an older file, headings in the form "Title and the old plot variables, e.g. PlotWidth, are automatically converted to '"Title and Plot.Width. The same applies to included files and to the command line interpreter.

Detailed reference

  1. Edition and license
  2. Strings
  3. Tables
  4. Data charts
  5. Plot options
  6. Special functions
  7. Statistical functions
  8. Financial functions
  9. CoolProp fluid properties
  10. Other new functions
  11. Number input and output
  12. Headings and comments
  13. Page header
  14. LaTeX export
  15. Editor and user interface
  16. Spell checking
  17. Command line interpreter

1. Edition and license

2. Strings

Calcpad can now work with text values. A string is enclosed in double quotes: "text". To include a double quote in a string, type it twice: "say ""hi""". A string can contain any characters, including |, : and ;, but it must end on the same line.

s = "Hello"
t = join(left(s; 1); "."; mid(s; 2; 4))
ucase(t) = "H.ELLO"

String results are displayed in quotes, except in #val mode. HTML inside a string is displayed as text and is not interpreted. Custom functions can accept and return strings.

String functions

FunctionDescription
str(x)Converts x to text, as it is displayed in the output, including the units
val(s)Converts the text s to a number with optional units, e.g. val("1.5 kN/m^2")
val(M)Converts the string elements of a vector or matrix to numbers
len(s)Number of characters
join(s₁; s₂; s₃…)Joins texts and values into a single text
join(M; colsep; rowsep)Joins the elements of a vector or matrix into a text
left(s; n), right(s; n), mid(s; i; n)Parts of the text
trim(s), ltrim(s), rtrim(s)Remove leading and/or trailing spaces
ucase(s), lcase(s), tcase(s), scase(s)Upper, lower, title and sentence case. They work with all Unicode letters.
instr(s; t; i)Position of t in s, starting from i (optional, 1 by default), or 0 if t is not found
replace(s; a; b)Replaces all occurrences of a with b
split(s; sep)Splits a text into a vector of strings
split(s; colsep; rowsep)Splits a text into a matrix of strings
table(M; nhrows; nhcols)Displays a matrix as a table (see Tables)

If an argument should be text but is not, it is converted with str first, e.g. left(12345; 3) = "123". Positions are counted from 1.

Operators

Strings in vectors and matrices

Input forms

You can enter a string in an input field: s = ?{"abc"}. A question mark inside a string does not create an input field.

3. Tables

table(M; nhrows; nhcols) displays the matrix M as a table, with nhrows header rows and nhcols header columns (1 and 0 by default). The cells can contain strings, numbers and values with units. The table appears in place of the equation. It is exported as a Word table, as a LaTeX table and as a Markdown table in the text output.

M = ["Section"; "Force, kN"; "Force, kN"; "η"|"Section"; "Fx"; "Fy"; "η"|"B1"; 12.5; 4.2; 0.62|"B2"; 18; 6.75; 0.88]
Table.Style = TableStyle.Rules
Table.MergeHeaders = 1
table(M; 2; 1)

Table options

OptionDescription
Table.StyleTableStyle.Bordered (default), Rules, Lines, Striped, Zebra, Boxed or Banner
Table.CellAlign, Table.HeadAlignAlign.Left, Align.Center or Align.Right. Use one value for all columns, or a vector with one value per column.
Table.MergeCells[i1; j1; i2; j2], or a matrix with one range per row
Table.MergeHeadersMerges adjacent header cells with equal text
Table.CellColor, Table.CellFill, Table.AltColor, Table.AltFill, Table.HeadColor, Table.HeadFillText and background colors of the cells, the alternate rows and the headers. Use a color name, e.g. Color.SteelBlue, or a hex code, e.g. "#4682B4".

An option stays in effect until you change it. Auto restores an option's default, and Table.Reset() resets all options.

4. Data charts

Data charts display values that are already stored in vectors and matrices. They do not evaluate expressions. The general format is:

$Line{y1 & y2 & … @ xl = labels}
CommandChart
$LineLines through the points
$FillFilled areas below the lines
$SmoothSmooth lines through the points
$BarHorizontal bars
$ColumnVertical columns
$ScatterPoints only
$Pie, $DonutPie or donut chart, one ring per series
$RadarRadar (spider) chart
$BubbleBubbles with different sizes: x|y|d, y|d or y
$ChartCombined chart. Each series can have its own type: $Chart{column: P & line: T @ xl = months}
months = ["Jan"; "Feb"; "Mar"; "Apr"; "May"; "Jun"]
T_1 = [2; 4; 9; 14; 19; 23]
T_2 = [-1; 1; 6; 12; 16; 20]
Plot.Legend = 1
Plot.Series1.Name = "2025"
Plot.Series2.Name = "2026"
$Line{T_1 & T_2 @ xl = months}

5. Plot options

Plot options are special variables whose names start with Plot.. They apply to function plots ($Plot, $Map) and to data charts. An option stays in effect for all the plots that follow. Auto restores an option's default, and Plot.Reset() resets all options. You can also read options in expressions, e.g. w = Plot.Width.

OptionDescription
Plot.Width, Plot.HeightSize of the plot area in pixels (500 × 300 by default)
Plot.Title, Plot.LabelX, Plot.LabelYPlot title and axis labels (strings)
Plot.LegendShows a legend with the series names
Plot.LogX, Plot.LogYLogarithmic axes
Plot.ReverseX, Plot.ReverseY, Plot.ReverseZReversed axes, or reversed values and colors in $Map
Plot.FlipAxesSwaps the axes: x becomes vertical
Plot.Limits, Plot.MinX… Plot.MaxZAxis limits, all at once or separately
Plot.Step, Plot.StepX, Plot.StepYSteps between the axis numbers, for both axes or separately
Plot.Grid, Plot.GridX, Plot.GridYGrid line spacing, for both axes or separately
Plot.FormatXAxis, Plot.FormatYAxisNumber format of the axis labels, as for the results, e.g. "F2" or "0.##_2"
Plot.Svg, Plot.AdaptiveVector (SVG) or raster (PNG) output, and adaptive plotting of functions
Plot.Series1… Plot.Series10 .Name, .Color, .Style, .ThicknessName, color (Color.Tomato or "#RRGGBB"), line style (Style.Solid, Dash, LongDash, Dot, DashDot, DashDotDot) and relative thickness of each series
Plot.Palette, Plot.Shadows, Plot.Smooth, Plot.LightDirection, Plot.MapStepSurface map settings. The palette can be set by name, e.g. Palette.Rainbow, and the light direction by Direction.NorthEast, etc.
Plot.Stack, Plot.Dots, Plot.DataTags, Plot.DropLinesData chart options (see above)

6. Special functions

All arguments must be unitless, except the amplitude φ of the elliptic integrals, which follows the current angle units. In complex mode, the special functions also accept complex arguments. The orders of Bessel functions must be real, and integer orders must be integers.

GroupFunctions
Gamma and betagamma, gammaln, digamma, polygamma, gammainc_ (lower), gammainc‾ (upper), beta, betainc
Error function and Fresnel integralserf, erfc, erfinv, erfcinv, dawsonf, fresnelc, fresnels
Exponential, logarithmic, sine and cosine integralsei, li, si, ci, shi, chi
Elliptic integralselliptick, elliptice, ellipticp, ellipticf, ellipticei, ellipticpi
Jacobi elliptic functionsjacobiam, jacobisn, jacobicn, jacobidn, jacobics, jacobicd, jacobidc, jacobisc, jacobisd, jacobids, jacobins, jacobinc, jacobind
Bessel functionsbesselj0, besselj1, bessely0, bessely1, besseljn, besselyn, besseljv, besselyv, besseljv′, besselyv′; spherical: besseljs, besselys, besseljs′, besselys′
Modified Bessel functionsbesseli0, besseli1, besselk0, besselk1, besselin, besselkn, besseliv, besselkv, besseliv′, besselkv′
Airy functionsai, bi, ai′, bi′
Zeta and Lambert Wzeta, eta, lambertw

7. Statistical functions

GroupFunctions
Descriptive statisticsmedian, quantile(…; p), stdev, variance, skew, kurt. They accept lists of values, vectors and matrices, as sum does. Sample formulas (n − 1) are used, as in Excel.
Two samples and rankscovar(a; b), correl(a; b), linreg(x; y) → [a; b], ranks(v), frequency(v; bins)
Combinatoricscombin(n; k), permut(n; k)
Probability distributions (pdf, cdf, inv)Normal: normpdf, normcdf, norminv; lognormal: logn…; Student's t: t…; χ²: chi2…; Gumbel: gumbel…; Weibull: wbl…; binomial: binopdf, binocdf; Poisson: poisspdf, poisscdf

The normal, Gumbel and Weibull distributions accept a variable and parameters with consistent units.

8. Financial functions

FunctionDescription
pv(rate; nper; pmt; [fv]; [type])Present value
fv(rate; nper; pmt; [pv]; [type])Future value
pmt(rate; nper; pv; [fv]; [type])Periodic payment
nper(rate; pmt; pv; [fv]; [type])Number of periods
rate(nper; pmt; pv; [fv]; [type]; [guess])Interest rate per period
ipmt, ppmt(rate; per; nper; pv; [fv]; [type])Interest and principal parts of a payment
npv(rate; x; y; z…), irr(x; y; z…), mirr(x; y; z…; fr; rr)Net present value, internal rate of return, modified IRR

The functions take their arguments in the same order as in Excel. Rates can be given in %, and amounts can have any consistent units, e.g. currency units. Cash paid out is negative.

9. CoolProp fluid properties

The new CP. functions return the thermophysical properties of more than 100 pure fluids, of mixtures, of incompressible fluids and solutions, and of humid air. The properties are calculated by the CoolProp library (CoolProp.dll, version 8.0.0), which is included with Calcpad.

FunctionDescription
CP.Props(Output; Name1; Prop1; Name2; Prop2; Fluid)Property of a fluid at the state given by two state variables
CP.Props1(Fluid; Output)Property that does not depend on the state, e.g. "Tcrit"
CP.HAProps(Output; Name1; Prop1; Name2; Prop2; Name3; Prop3)Property of humid air at the state given by three state variables
CP.Phase(Name1; Prop1; Name2; Prop2; Fluid)Phase at the given state, as text, e.g. "liquid"
CP.SaturationAncillary(Fluid; Output; Q; Input; Value)Saturation property from the ancillary equations, for liquid (Q = 0) or vapor (Q = 1)
CP.GetFluidParamString(Fluid; Param)Information about a fluid, e.g. "aliases", "CAS" or "ASHRAE34"
CP.GetGlobalParamString(Param)CoolProp information, e.g. "version" or "FluidsList"
CP.GetParamIndex(Name)Index of a CoolProp parameter
CP.GetParameterInformationString(Key; Info)Information about a parameter, for Info = "IO", "short", "long" or "units"
CP.SetReferenceStateD(Fluid; T; RhoMolar; h0; s0)Sets the reference state of a fluid by temperature, molar density, enthalpy and entropy
CP.SetReferenceStateS(Fluid; ReferenceState)Sets a predefined reference state: "IIR", "ASHRAE", "NBP", "DEF" or "RESET"
ρ = CP.Props("D"; "T"; 25°C; "P"; 1atm; "Water")
h = CP.Props("H"; "T"; 200°C; "P"; 10bar; "Water")|kJ/kg
T_dp = CP.HAProps("D"; "T"; 25°C; "P"; 1atm; "R"; 50%)|°C

10. Other new functions

11. Number input and output

Scientific notation

Numbers can be entered in floating point format: 3.4e+6 is the same as 3.4*10^6.

Other number systems

To enter a number in base 2 to 16, add an underscore and the base after the digits: 10001001_2, 777_8, 0FF_16. Fractions are supported: 101.01_2 = 5.25. The output shows the base as a subscript, followed by the decimal value.

To display a result in another base, add _n at the end of the format string or the target units:

CodeResult
137:_2100010012
255:_16FF16
5.25:0.00_2101.012
5:D8_2000001012
5500mm|m_2101.12 m

To use a base for the whole worksheet, write #format _16, or combine it with a format string: #format 0.00_2.

12. Headings and comments

Write the #Header keyword to put the report inside your own page header, for example a company title block with a logo. The header is an HTML template, Documents\Calcpad\Template\header.html. The report is placed in the first cell of the template's table body.

14. LaTeX export

15. Editor and user interface

16. Spell checking

Calcpad checks the spelling of comments and strings. Misspelled words are underlined with a red wavy line. A line is checked when you leave it, together with the syntax highlighting.

17. Command line interpreter