# Measure transient delays, peaks and scalar results

Add named .MEASURE TRAN statements to a buffered transient run. Read their values and units from the normal diagnostic output, and handle missing events as failed measurements.

## Compatibility

2.9.0 release target; bounded Windows RC CLI evidence

Published guidance with release-applicability limits. Confirm package applicability before following this guide.

[Download RC measurements (ZIP)](/_functions/kbExample?name=rc-measurements.zip)

Includes: rc_measurements.cir, README.txt.

## Create a complete measured circuit

Save the following as rc_measurements.cir in a new writable folder and use the intended licensed JoSIM®-Pro runtime. The example uses fixed-step VOLTAGE/BDF and buffered output; streaming measurements and other analysis types have different supported boundaries.

The waveform export starts at 40 ps and uses a 2 ps cadence. Measurements use accepted solver samples from the complete run, including the earlier threshold event.

```text
* RC response: 50 ohm, 0.2 pF, 10 ps time constant
.PARAM DRIVE=1m
V1 IN 0 PWL(0 0 10p 0 20p DRIVE 100p DRIVE)
R1 IN OUT 50
C1 OUT 0 0.2p
.OPTION ANALYSIS=VOLTAGE INTEGRATION=BDF
.TRAN 0.25p 100p 40p 2p
.PRINT V(IN) V(OUT) I(R1)
.MEASURE TRAN half WHEN V(OUT)=0.5m RISE=1
.MEASURE TRAN delay TRIG V(IN) VAL=0.5m RISE=1 TARG V(OUT) VAL=0.5m RISE=1
.MEASURE TRAN average AVG V(OUT) FROM=40p TO=80p
.MEASURE TRAN rms RMS V(OUT) FROM=40p TO=80p
.MEASURE TRAN minimum MIN V(OUT) FROM=40p TO=80p
.MEASURE TRAN peak MAX V(OUT) FROM=40p TO=80p
.MEASURE TRAN swing PP V(OUT) FROM=40p TO=80p
.MEASURE TRAN sample FIND V(OUT) AT=50p
.MEASURE TRAN integral INTEG V(OUT) FROM=40p TO=80p
.END
```

## Run and read scalar output

1. Use ordinary diagnostic verbosity and inspect job success. Quiet mode suppresses scalar diagnostic reports.
2. Read the named .MEASURE lines in the diagnostic output. The waveform CSV remains a time/trace table; measurement scalars are not extra waveform columns.
3. Keep each reported unit. WHEN and TRIG/TARG return seconds; V(OUT) statistics return volts; its integral returns V*s. A general expression may have no inferred unit label.

```text
josim-pro-cli -o rc_measurements.csv rc_measurements.cir
```

## Choose the measurement form

AVG is a time-weighted average over the selected interval. RMS uses the time average of the squared piecewise-linear waveform. MIN, MAX and PP include interpolated window endpoints; PP is maximum minus minimum. INTEG integrates the waveform in time, and FIND interpolates at AT.

WHEN selects a threshold crossing time. RISE, FALL or CROSS counts begin at one after TD and within the selected window; LAST selects the last qualifying event. A value equal to the threshold at the initial sample alone is not a crossing.

TRIG/TARG returns target time minus trigger time. Event counts and delays are independent, so an earlier selected target can give a negative result. Choose the intended crossings explicitly.

Names are unique ignoring case. Use a valid identifier, finite settings and a covered interval with FROM < TO inside the transient. Top-level measurements apply to transient jobs; job-local definitions add to them, so duplicate effective names are errors.

## Check the worked result

The checked half-voltage crossing is approximately 22.34785 ps and its delay from the input half-voltage crossing is 7.34785 ps. The 50 ps sample is approximately 0.968540 mV, the 40–80 ps average 0.979011 mV and the peak 0.998435 mV.

All nine forms were compared with the independent ideal RC response. Event-time allowance was 0.05 ps; voltage-statistic allowance was 2 microvolts and integral allowance was 8e-17 V*s. These are declared example checks, not universal numerical tolerances.

Changing only print start/cadence from 40p/2p to 0/10p left all nine scalar values exactly equal in the check. The exported waveforms have different sampling, while the measurements still use the same complete accepted run.

## Recover from a missing event or duplicate name

The output never reaches 2 mV in this example. Changing the half threshold to V(OUT)=2m caused a failed job and no new final CSV. Restoring 0.5m recovered all measurement values and the expected CSV. Keep failure outputs separate from earlier successful files.

Adding a second measurement named HALF after half was rejected because names are case-insensitive. Give every effective measurement a distinct name.

For a real missing event, inspect stimulus amplitude, sign, selected signal, time window and crossing count. Correct the intended measurement or extend the justified simulation; do not replace a failed result with zero. A missing event, uncovered interval or non-finite result fails the measurement set.

## Sources and verification details

Recorded inputs/builds only. Complete walkthrough and final-package acceptance remain separate.

- VAL-014: JoSIM-Pro 2.9.0 installed Windows review CLI. Complete linear RC circuit, included parameterised cell, include recovery, fixed-step refinement, nine scalar forms and measurement failure/recovery Handwritten RC examples and their declared analytic criteria only. No Josephson-device, adaptive/noisy, GUI, other-platform or final-release qualification. CLI loaded-library path was not observed.


- josim-pro:docs/manual_source/sections/syntax.tex: All transient measurement forms, interval/event semantics, units and failure contract
- josim-pro:docs/manual_source/sections/usage.tex: CLI input/output and versioned execution contract
- validation:josim-authoring-windows-20261103: VAL-014: exact RC examples, independent reference checks and recovery

- The documented RC files match the checked input content. All new outputs were written to fresh paths.
- Final distributed 2.9 package, other platforms and GUI workflows remain pending. Example-specific analytic allowances are not universal solver tolerances.

## Related guides

- [Write and run a complete JoSIM circuit netlist](/knowledge-base/josim-netlist-basics)
- [Choose and refine simulation and output time steps](/knowledge-base/josim-transient-timestep)
- [Run JoSIM®-Pro from the command line and save numerical output](/knowledge-base/josim-cli-output)
- [Export waveform figures or numerical CSV/TSV data](/knowledge-base/josim-export-results)
