SCHEMAXIS · Declared work. Results you can check.Documentation ↗ · Contact
schemaxis/Agent’s Hands

Documentation / generated/ngspice-operations.md
Core 11629ae · View or edit Markdown on GitHub ↗

Ngspice 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#

acSweep, dcSweep, rcStep

acSweep#

Computes the small-signal phasor response of a linear RLC network to one grounded sinusoidal source at evenly spaced frequencies. results.csv gives, per probe, real and imaginary parts and magnitude in volts and phase in degrees, alongside circuit-summary.json and circuit.cir; every value is checked against an independent complex nodal solution. Choose it for filter cut-offs, resonance and gain versus frequency; inductors are only allowed in this analysis.

Common mistakes and assumptions:

  • start and stop are in hertz with linear (not logarithmic) spacing; use enough points to resolve narrow resonances.
  • Phase uses the exp(+jomegat) convention, so a lagging output has negative phase.
  • Loops made only of inductors, an inductor directly across the source, and singular or ill-conditioned networks at any sample frequency are rejected; there is no mutual coupling.

Native binding: ngspice ac lin. Output kind: ["table"].

Inputs: none.

Option Meaning Type / constraints Default
circuit The circuit, written inline: one ideal voltage source between ground (node "0") and the source node, 1 to 64 resistors, up to 64 capacitors, up to 64 uncoupled inductors (acSweep only) and the nodes to publish. At most 16 non-ground nodes; no netlist, device model or subcircuit can be imported. {"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":32,"default":"in"},"resistors":{"type":"array","minItems":1,"maxItems":64,"required":true,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"resistance":{"type":"number","minimum":0.001,"maximum":1000000000.0,"required":true}}}},"capacitors":{"type":"array","maxItems":64,"default":[],"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"capacitance":{"type":"number","minimum":1e-12,"maximum":1,"required":true}}}},"probes":{"type":"array","minItems":1,"maxItems":15,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":32},"default":["out"]},"inductors":{"type":"array","maxItems":64,"default":[],"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"inductance":{"type":"number","minimum":1e-09,"maximum":1000.0,"required":true}}}}}} required
start DC start is signed source volts (default 0); AC start is positive frequency Hz (default 1). stop must exceed start. rcStep always starts at zero seconds. {"type":"number","minimum":0.001,"maximum":1000000000.0} 1
stop DC stop is source volts (default 5), AC stop is positive Hz (default 10000), RC stop is seconds (default 0.005). RC duration must be 0.01–20 R*C time constants. {"type":"number","minimum":0.001,"maximum":1000000000.0} 10000
points Number of evenly spaced samples including endpoints: 2–512 for DC/RC, 3–512 for AC; default 101. Finite samples cannot prove a continuous response envelope. {"type":"integer","minimum":3,"maximum":512} 101
amplitude Source voltage for acSweep and rcStep, -1000 to 1000 V, and must be nonzero; dcSweep uses start and stop instead. In acSweep it is the phasor amplitude (gainMagnitude divides by its absolute value); in rcStep it is the height of the step. {"type":"number","minimum":-1000,"maximum":1000} 1

dcSweep#

Steps one ideal grounded voltage source through evenly spaced DC values and reports the steady node voltages of a resistor network (capacitors act as open circuits). Outputs are results.csv (source voltage, then one column per probe in volts), circuit-summary.json and the generated netlist circuit.cir; every native value is checked against an independent nodal solution. Choose it for dividers, bridges and other resistive networks; use acSweep for frequency response and rcStep for a charging curve.

Common mistakes and assumptions:

  • start and stop are source volts and stop must exceed start; points includes both endpoints.
  • Every node needs a path through resistors to ground or the source; a node reached only through capacitors is rejected as floating.
  • Only ideal resistors and capacitors; semiconductors, models, subcircuits and imported netlists are not accepted.

Native binding: ngspice dc. Output kind: ["table"].

Inputs: none.

Option Meaning Type / constraints Default
circuit The circuit, written inline: one ideal voltage source between ground (node "0") and the source node, 1 to 64 resistors, up to 64 capacitors, up to 64 uncoupled inductors (acSweep only) and the nodes to publish. At most 16 non-ground nodes; no netlist, device model or subcircuit can be imported. {"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":32,"default":"in"},"resistors":{"type":"array","minItems":1,"maxItems":64,"required":true,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"resistance":{"type":"number","minimum":0.001,"maximum":1000000000.0,"required":true}}}},"capacitors":{"type":"array","maxItems":64,"default":[],"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"capacitance":{"type":"number","minimum":1e-12,"maximum":1,"required":true}}}},"probes":{"type":"array","minItems":1,"maxItems":16,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":32},"default":["out"]}}} required
start DC start is signed source volts (default 0); AC start is positive frequency Hz (default 1). stop must exceed start. rcStep always starts at zero seconds. {"type":"number","minimum":-1000,"maximum":1000} 0
stop DC stop is source volts (default 5), AC stop is positive Hz (default 10000), RC stop is seconds (default 0.005). RC duration must be 0.01–20 R*C time constants. {"type":"number","minimum":-1000,"maximum":1000} 5
points Number of evenly spaced samples including endpoints: 2–512 for DC/RC, 3–512 for AC; default 101. Finite samples cannot prove a continuous response envelope. {"type":"integer","minimum":2,"maximum":512} 101

rcStep#

Simulates an initially uncharged series resistor feeding a grounded capacitor when a constant voltage is switched on at t = 0, and reports the source and capacitor node voltages at evenly spaced times. Native transient values are resampled and checked against V x (1 - exp(-t/RC)). Outputs match the other analyses (results.csv with time in seconds, summary and netlist). Choose it for RC charging and settling-time checks only.

Common mistakes and assumptions:

  • The circuit must be exactly source - resistor - response node - capacitor - ground; any other topology fails with UNSUPPORTED_CIRCUIT.
  • stop (seconds) must lie between 0.01 and 20 time constants R x C; the default 0.005 s suits only RC values near 0.25 to 500 ms.
  • The default probe is "out"; name the capacitor node "out" or list the actual node in probes.

Native binding: ngspice tran/linearize. Output kind: ["table"].

Inputs: none.

Option Meaning Type / constraints Default
circuit The circuit, written inline: one ideal voltage source between ground (node "0") and the source node, 1 to 64 resistors, up to 64 capacitors, up to 64 uncoupled inductors (acSweep only) and the nodes to publish. At most 16 non-ground nodes; no netlist, device model or subcircuit can be imported. {"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":32,"default":"in"},"resistors":{"type":"array","minItems":1,"maxItems":64,"required":true,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"resistance":{"type":"number","minimum":0.001,"maximum":1000000000.0,"required":true}}}},"capacitors":{"type":"array","maxItems":64,"default":[],"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32,"required":true},"a":{"type":"string","minLength":1,"maxLength":32,"required":true},"b":{"type":"string","minLength":1,"maxLength":32,"required":true},"capacitance":{"type":"number","minimum":1e-12,"maximum":1,"required":true}}}},"probes":{"type":"array","minItems":1,"maxItems":16,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":32},"default":["out"]}}} required
stop DC stop is source volts (default 5), AC stop is positive Hz (default 10000), RC stop is seconds (default 0.005). RC duration must be 0.01–20 R*C time constants. {"type":"number","minimum":1e-09,"maximum":1000000.0} 0.005
points Number of evenly spaced samples including endpoints: 2–512 for DC/RC, 3–512 for AC; default 101. Finite samples cannot prove a continuous response envelope. {"type":"integer","minimum":2,"maximum":512} 101
amplitude Source voltage for acSweep and rcStep, -1000 to 1000 V, and must be nonzero; dcSweep uses start and stop instead. In acSweep it is the phasor amplitude (gainMagnitude divides by its absolute value); in rcStep it is the height of the step. {"type":"number","minimum":-1000,"maximum":1000} 1