Octave operation reference
Generated from the current declarations. Do not edit this file by hand.
Types, limits and defaults below describe resolved values. Runtime expressions must produce these types. Unknown options are rejected; defaults apply only when omitted. Constructor options must be constant after document composition.
Index#
derivative, fft, integral, linearFit, movingMean, readCSV, resample, samples, scale, sequence, wave
derivative#
Estimates dy/dx at every sample with Octave's gradient using the x coordinates, so nonuniform spacing is handled. Interior values are the secant slope between the two neighbours, (y[i+1] - y[i-1]) / (x[i+1] - x[i-1]); the first and last values use the one-sided slope to the adjacent sample. The output keeps x and has units of y per x.
Common mistakes and assumptions:
- Requires strictly increasing x.
- Differentiation amplifies noise; smooth with movingMean or fit with linearFit first for measured data.
Native binding: derivative. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
Options: none.
fft#
Computes the one-sided amplitude spectrum of uniformly sampled real y with Octave's fft: x becomes frequency in cycles per x unit (0 to the Nyquist frequency, n/2 + 1 values) and y the amplitude, scaled so that a sinusoid of amplitude A centred on a frequency bin shows a peak of A. Choose it to identify dominant frequencies in a signal. No window or detrending is applied.
Common mistakes and assumptions:
- Requires 4-8192 samples in a power of two and uniform x spacing; use resample first for irregular data. x becomes frequency; amplitudes double interior bins but not DC or Nyquist.
- Frequencies that fall between bins leak into neighbouring bins with a lower peak; choose the record length to contain whole cycles where possible.
- Phase is discarded; only magnitudes are published.
Native binding: fft. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
Options: none.
integral#
Accumulates the trapezoidal integral of y over x (Octave cumtrapz) and adds a constant initial value, so output y[i] is initial plus the area from the first x to x[i]. Choose it for running totals such as displacement from velocity or energy from power. The output keeps x and has units of y times x.
Common mistakes and assumptions:
- Requires strictly increasing x; the first output equals initial and units are y-unit times x-unit.
- The trapezoidal rule is exact only for piecewise-linear data; coarse sampling of curved signals under- or over-estimates the area.
Native binding: integral. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
initial |
Value of the running integral at the first x, added to every output value; for example the starting position when integrating velocity. Units are y units times x units. | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
0 |
linearFit#
Fits the least-squares straight line y = slope * x + intercept to the input (Octave polyfit, degree 1) and outputs the fitted y at each original x. Slope, intercept and residual sum of squares are recorded in the run's native.json evidence, not in the published CSV or statistics.json. Choose it to summarise a linear trend or calibration; use the R adaptor's regression for uncertainty estimates.
Common mistakes and assumptions:
- Requires varying x. Slope, intercept and residual sum of squares are retained in native metadata.
- No standard errors, R squared or outlier handling are produced; inspect the residuals separately if fit quality matters.
Native binding: linearFit. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
Options: none.
movingMean#
Smooths y with a centred moving average over an odd number of neighbouring samples (Octave movmean with Endpoints shrink), keeping x. Choose it to reduce noise before differentiation or plotting; a wider window smooths more but flattens peaks and blurs steps.
Common mistakes and assumptions:
- The window counts samples, not x distance, so irregular spacing gives an uneven smoothing length.
- The window shrinks at endpoints and must not exceed the number of samples.
Native binding: movingMean. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
window |
Number of samples averaged for each output, centred on that sample: (window - 1) / 2 on each side. Larger windows remove more noise but also reduce peaks and widen edges; 1 leaves the data unchanged. Near the ends the window is truncated to the samples that exist. | {"type":"integer","minimum":1,"maximum":1001} |
5 |
readCSV#
Reads two named numeric columns from an existing CSV file as the x and y of a table. Schemaxis validates and copies the file into the run, so the analysis and its verification use the captured bytes. Choose it for measurements exported from instruments, spreadsheets or other Schemaxis runs (for example a Calc or Cantera CSV); use samples for a few literal values.
Common mistakes and assumptions:
- Every cell in the file must be a finite number below a header row; missing values, text or dates fail with INVALID_TABLE, even in columns you do not select.
- The file is limited to 8 MiB and 10000 data rows. Units are not read from the file; keep track of them yourself.
Native binding: readCSV. Output kind: ["table"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
file |
Absolute path of a UTF-8 CSV file with one header row of distinct column names and only finite numeric cells below it (2-10000 rows, at most 8 MiB). The file is validated, copied into the run and checked for changes during the copy; the analysis reads the copy. | {"type":"string","minLength":1,"maxLength":4096} |
required |
xColumn |
Header name of the column used as x, matched exactly (case-sensitive) against the first row of the file. | {"type":"string","minLength":1} |
"x" |
yColumn |
Header name of the column used as y, matched exactly (case-sensitive) against the first row of the file. It may be the same column as x. | {"type":"string","minLength":1} |
"y" |
resample#
Linearly interpolates the input table (Octave interp1, method linear) onto count evenly spaced x values from its first to its last x. Choose it to turn irregular measurements into a uniform grid, for example before fft, or to change the number of samples.
Common mistakes and assumptions:
- Requires strictly increasing x. Interpolation changes the sampling and does not preserve extrema between samples.
- Resampling to fewer points discards detail without low-pass filtering; apply movingMean first if the data are noisy.
Native binding: resample. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
count |
Number of evenly spaced output points between the input's first and last x, both included; the new spacing is (last x - first x) / (count - 1). More points do not add information beyond straight lines between the original samples. | {"type":"integer","minimum":2,"maximum":10000} |
101 |
samples#
Creates a table directly from literal x and y vectors typed into the document, with no file involved. Choose it for small measured data sets, test cases with known answers, or calibration points; use readCSV for data already in a file and sequence or wave for generated data. The table passes unchanged to later nodes; any ordering requirement comes from the operation that consumes it.
Common mistakes and assumptions:
- x and y must have the same length (2-10000 values), otherwise planning fails with INVALID_TABLE.
- derivative, integral, resample and fft need strictly increasing x; sort the pairs before entering them.
Native binding: samples. Output kind: ["table"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
x |
The independent variable of each sample (for example time or position), in the order the pairs should appear. Order matters: derivative, integral, resample and fft need it strictly increasing, and fft also evenly spaced. | {"type":"array","items":{"type":"number","minimum":-1e+100,"maximum":1e+100},"minItems":2,"maxItems":10000} |
required |
y |
The dependent values, one per x at the same position. Must have exactly as many values as x. | {"type":"array","items":{"type":"number","minimum":-1e+100,"maximum":1e+100},"minItems":2,"maxItems":10000} |
required |
scale#
Applies a linear transformation y' = factor * y + offset to the input table and leaves x unchanged. Choose it to apply a calibration, change sign, or convert units when you know the conversion factor and offset (for example degrees Celsius to kelvin with factor 1 and offset 273.15).
Common mistakes and assumptions:
- No implicit unit conversion; select factor and offset for the intended physical convention.
- Only y is transformed; to rescale x, there is no operation in this adaptor.
Native binding: scale. Output kind: ["table"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | table |
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
factor |
Multiplier applied to every y value before the offset is added; a negative factor inverts the data and 0 gives a constant equal to the offset. | {"type":"number","minimum":-1000000.0,"maximum":1000000.0} |
1 |
offset |
Constant added to every y value after multiplication by factor, in the output y units. | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
0 |
sequence#
Generates count evenly spaced values from start to stop inclusive with Octave's linspace and uses them as both x and y, giving the identity line y = x. Choose it as a synthetic or calibration input, for example followed by scale to build a known linear relationship; choose wave for an oscillating signal.
Common mistakes and assumptions:
- Both endpoints are included, so the spacing is (stop - start) / (count - 1), not (stop - start) / count.
- A stop below start gives decreasing x, which derivative, integral, resample and fft reject.
Native binding: sequence. Output kind: ["table"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
start |
First value of the sequence, included exactly as the first x (and y). | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
0 |
stop |
Last value of the sequence, included exactly as the final x (and y). A value below start produces a decreasing sequence. | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
1 |
count |
Number of points, including both endpoints. More points give a finer spacing, (stop - start) / (count - 1). | {"type":"integer","minimum":2,"maximum":10000} |
101 |
wave#
Generates a sampled sinusoid y = offset + amplitude * sin(2 pi frequency x + phase) (or cos) at x = start, start + step, ... for count samples. Choose it for synthetic test signals, for example to check an fft, movingMean or derivative chain against a known answer. Frequency is in cycles per x unit and phase in radians.
Common mistakes and assumptions:
- Keep frequency below 1 / (2 step) cycles per x unit; faster signals are undersampled and alias to a lower apparent frequency.
- For an fft, choose count as a power of two from 4 to 8192.
Native binding: wave. Output kind: ["table"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
start |
x value of the first sample. Shifting start moves the sampling window along x; because phase is applied to 2 pi frequency x, it also changes the signal value at the first sample. | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
0 |
step |
Spacing between successive x values; the samples run from start to start + step * (count - 1). Smaller steps resolve faster oscillations: the highest representable frequency is 1 / (2 step) cycles per x unit. | {"type":"number","minimum":1e-12,"maximum":1000000000000.0} |
0.01 |
count |
Number of samples generated. Together with step it sets the length covered, step * (count - 1). | {"type":"integer","minimum":2,"maximum":10000} |
101 |
shape |
Whether the signal is a sine or a cosine. With phase 0, at x = 0 a sine is at the offset and rising while a cosine is at its peak (offset + amplitude); the two differ only by a quarter-cycle phase shift of pi/2. | {"type":"enum","values":["sine","cosine"]} |
"sine" |
amplitude |
Peak deviation of the signal from its offset, in y units; the signal ranges from offset - amplitude to offset + amplitude. A negative value inverts the wave. | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
1 |
frequency |
Number of complete cycles per unit of x (for example hertz when x is in seconds). Higher frequency means more oscillations over the same x range; 0 gives a constant signal. | {"type":"number","minimum":0,"maximum":1000000000000.0} |
1 |
phase |
Phase angle added inside the sine or cosine, in radians; a positive phase shifts the wave towards smaller x by phase / (2 pi frequency). | {"type":"number","minimum":-100000,"maximum":100000} |
0 |
offset |
Constant added to every sample, shifting the whole wave up or down in y units; it becomes the mean of a whole number of cycles and the DC (frequency 0) value of an fft. | {"type":"number","minimum":-1e+100,"maximum":1e+100} |
0 |