generate_schematic
Generate a Micro-Cap .CIR schematic from a parts list: a source driving series R/C/L passives with optional shunt branches. Returns circuit text for simulation.
Instructions
Draw a .CIR schematic: a voltage source driving parts in series to
ground, optionally with parallel branches from the output node to ground.
Unlike a netlist, this produces a drawn schematic you can open in
Micro-Cap. Feed the result to simulate_schematic to run it, or hand the
.CIR text to the user.
Bounded on purpose — a source, a series chain of two-terminal passives (R, C, L), and optional parallel shunt branches. That covers RC/RL/RLC, dividers, and resonant tanks. Every pin position is taken from Micro-Cap's own component library, so the drawn circuit is electrically what you asked for. For an op-amp gain stage use generate_amplifier; for a common-emitter BJT stage use generate_transistor_amplifier.
Args:
parts: ordered "KIND=VALUE" strings in series, KIND in R/C/L, e.g.
["R=1K", "C=159.155N"] for an RC low-pass. With shunt, the
whole chain feeds the output node.
source: the source's VALUE in Micro-Cap syntax — "DC=0 AC=1" for an
AC probe, or a PULSE ... line for transient.
analysis: AC, Transient, or DC.
output_node: label for the output node.
shunt: extra "KIND=VALUE" strings hung in parallel from the output
node to ground, e.g. ["L=1M", "C=1U"] on a series R for a tank.
Returns the .CIR text and the ordered part references.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | Yes | ||
| shunt | No | ||
| source | No | DC=0 AC=1 | |
| analysis | No | AC | |
| output_node | No | OUT |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||