run_ac_analysis
Run an AC frequency sweep on a SPICE netlist to analyze frequency response. Results saved as .npz file containing frequency and complex traces.
Instructions
Run an AC frequency sweep on a SPICE netlist.
Injects a .ac dec <points_per_decade> <start_freq> <stop_freq> command
into a temporary copy of the netlist (does not modify the original).
Results are saved to a .npz file next to the netlist. Load with: data = np.load('netlist_ac.npz') freq = data['frequency_hz'] # traces are stored as complex values, e.g. data['v(out)']
For sweeping a component value or parameter across multiple AC runs in parallel, use run_sweep(analysis_cmd=".ac dec N fstart fstop") instead.
Args: netlist_path: Absolute path to the netlist file (.net, .sp, .cir, etc.) start_freq: Start frequency with optional SPICE suffix, e.g. "1", "1k", "100" stop_freq: Stop frequency, e.g. "1G", "100meg" points_per_decade: Points per decade (default 20)
Returns: JSON summary with data_file path, frequency range, and trace names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| netlist_path | Yes | ||
| start_freq | Yes | ||
| stop_freq | Yes | ||
| points_per_decade | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |