Spice Measure
spice_measureDerive steady-state, rise/fall time, overshoot, settling time, 3 dB bandwidth, or interpolated values from a simulation CSV to analyze circuit response without running ngspice.
Instructions
Derive a number from a simulation table (the result.csv of spice_simulate, or any CSV whose first column is the x axis): steady_state value, rise_time or fall_time (10 % to 90 %), overshoot (percent), settling_time (within a tolerance band), bandwidth_3db (low-pass -3.0103 dB frequency from an ac table), bandpass_3db (peak, lower and upper -3.0103 dB corners and bandwidth) or value_at (interpolated). Units follow the column (volt, ampere, decibel for .db, degree for .phase_deg). The formulas are in the result. Needs no ngspice.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"csv_file": "<csv_file>",
"measurement": "<measurement>"
},
"name": "spice_measure"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | value_at only: the x position with unit, e.g. '1 ms' for a time table, '1 kHz' for frequency, '2 V' for a DC sweep | |
| column | No | Column name, e.g. 'v(out)' (ac tables: 'v(out)' means v(out).mag; use 'v(out).db' or '.phase_deg' to say otherwise). May be empty when the table has one data column. | |
| csv_file | Yes | Path to the table, e.g. the result.csv artifact of spice_simulate (header row, first column = time, frequency or sweep) | |
| tolerance | No | settling_time only: half-width of the band as a share of the step, 0 < tol < 1 (default 0.02 = 2 %) | |
| measurement | Yes | One of: steady_state, rise_time, fall_time, overshoot, settling_time, bandwidth_3db, bandpass_3db, value_at | |
| final_fraction | No | Share of the x span at the end that defines the steady-state value, 0 < f <= 0.5 (default 0.1) |