Compute a reference, an AC projection and an interpolation

Compute on canonical Datasets with declared columns, row ranges and units.

Prepare the Datasets for Numeric

Numeric has three profiles in the inspector, RC, AC and Interpolate. Each profile has its own result view in the right-hand panel. Choose the Dataset before using Discover. The selectors show the actual IDs of the variables. The index of the first row starts from zero and the count is explicit. Discovering the fields lets you check names, units and ranges. To load the CSV files of the guide, follow the import procedure.

RC and analytical reference

FieldInitial setting and use
Source DatasetCanonical Dataset of the observations. Use Discover rows / variables to review the columns and the number of available rows.
Expressionvstep*(-expm1(-t/(R*C))) is the capacitor voltage for an ideal step and an initially discharged capacitor. expm1 evaluates exp(x)−1 accurately near zero.
First row (0-based), Row count (explicit)Initially 0 and 1. For the RC CSV use 0 and 13. Check that all the requested rows exist.
Output unitV for the voltage reference. It must agree with the expression and with Observed Y for the comparison.
Publish X, t variable, Observed YPublish X is the abscissa of the generated Dataset. t variable is the variable t of the computation. Observed Y is the measured column to compare. Assign v0001 (s) to the first two and v0002 (V) to the measurement of the exercise.
R value / R unit1000 Ohm at start-up. Resistance of the reference, independent of any schematic.
C value / C unit1e−6 F at start-up. R × C gives the time constant, 1 ms in the CSV.
Step value / Step unit1 V at start-up. Amplitude of the ideal step.
Relative floor1e−12 at start-up. The comparison uses the threshold to exclude measurements too close to zero from the relative statistics. Also check the number of admitted observations and the absolute metrics.

Evaluate reference stores the computed output in memory and opens the report in Numeric result. Compare observed uses the stored reference and the observed column. Check the RMS of the residuals, the absolute maximum and the observations admitted to the relative comparison. In the exercise there are 13 observations, 12 admitted for the relative error and an RMSE of 0.000695553 V. Publish reference Dataset explicitly creates an X/value Dataset with units, formula and parameters. The SDK scalar check exp(0) button checks a scalar call of the module, while the computing actions and publishing use the RC profile.

Comparison of the RC reference with 13 synthetic observations and the residual metrics.
Comparison of the RC reference with 13 synthetic observations and the residual metrics.

Statistics and Reset

In the three profiles Statistic chooses the summary to compute on the stored result. Statistics applies the choice and shows the outcome in the relevant view. statistics reports count, mean, extremes, sum and other available statistics. array_reduce.rms gives the root mean square. array_reduce.minimum and array_reduce.maximum give the single extremes. These operations describe the computed vector. For the residuals use Compare observed. The Reset next to a field restores that field to its initial value. Check the selections after the reset and repeat Evaluate if you need to update the result.

Magnitude and phase from real and imaginary columns

In Numeric → AC choose AC source Dataset with two compatible columns that describe the same complex signal. Discover AC variables finds the usable columns. Choose the frequency (Hz) as Frequency X, then Real Variable and Imaginary Variable. In the test CSV use, in order, v0001, v0002 and v0003. First row (0-based) starts from 0 and Row count (explicit) from 1. Set the count to 11 for the CSV.

In Projection choose magnitude for the magnitude √(re²+im²) in the units of the signal, phase_rad for the phase in radians or phase_deg for degrees. Press Evaluate projection and read AC result. Statistics computes the chosen summary and Publish projection creates a Dataset of frequency and projection. In the exercise the phase goes from about −3.60° to −89.09°. At about 159.15 Hz the magnitude is about 0.7071 and the phase −45°.

Statistics of the phase in degrees computed on 11 canonical rows.
Statistics of the phase in degrees computed on 11 canonical rows.

Interpolate on a second grid

In Numeric → Interpolate choose Source Dataset for the curve and Query Dataset for the abscissas to evaluate. Use Discover both grids and assign Source X, Source Y and Query X to the declared columns. The abscissas must have compatible units. Use distinct source points in increasing order. Set Source first row, Source rows (explicit), Query first row and Query rows (explicit). The initial values are 0 and 2 for the source, 0 and 1 for the requested points.

Method linear joins the points with segments and requires at least two points. pchip uses a shape-preserving piecewise cubic interpolation, with at least three points. Extrapolation offers error. An abscissa out of range makes the evaluation rejected. Press Evaluate interpolation and check Interp result. Statistics uses the chosen summary, Publish interpolation creates a Dataset of requested abscissa and interpolated value. In the exercise the PCHIP interpolation produces 12 rows and the minimum is about 0.3781 V.

Publishing the PCHIP interpolation with the source and grid Datasets reported in the result.
Publishing the PCHIP interpolation with the source and grid Datasets reported in the result.