generate_amplifier
Generate an op-amp amplifier schematic (.CIR) for Micro-Cap with desired gain and type. Supports inverting and non-inverting configurations.
Instructions
Draw a .CIR op-amp amplifier with a near-ideal op-amp.
inverting gives gain -Rf/Rin; non-inverting gives 1 + Rf/Rg.
The feedback resistor is sized from gain and rin. Produces a drawn
schematic; feed it to simulate_schematic or hand the .CIR to the user.
Args:
gain: magnitude of the closed-loop gain (> 0; non-inverting needs >= 1).
kind: inverting or non-inverting.
rin: input resistor (inverting) or gain resistor to ground
(non-inverting); sets the feedback resistor from the gain.
source: source VALUE, Micro-Cap syntax ("DC=0 AC=1" for AC).
analysis: AC, Transient, or DC.
output_node: label for the output node.
Returns the .CIR text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rin | No | 1K | |
| gain | Yes | ||
| kind | No | inverting | |
| source | No | DC=0 AC=1 | |
| analysis | No | AC | |
| output_node | No | OUT |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||