| name | rlc-circuit-drawing-generator |
| description | Generates RLC circuit diagrams from text descriptions using Schemdraw. Use this skill when the user wants to create circuit drawings for educational purposes, particularly for AC/DC circuits with resistors, capacitors, inductors, and power sources. |
RLC Circuit Drawing Generator
This skill generates professional circuit diagrams from natural language descriptions using Python's Schemdraw library.
When to Use This Skill
- User asks to draw or create a circuit diagram
- User describes a circuit with resistors, capacitors, inductors, or power sources
- User needs an educational circuit illustration
- User wants to visualize an RLC circuit topology
Workflow
- Parse the circuit description - Identify components, values, and topology
- Determine layout - Series, parallel, or mixed arrangement
- Generate Schemdraw code - Create Python script using library conventions
- Render to image - Execute script to produce SVG output
Input Format
Users can describe circuits in natural language:
- "Draw a series RLC circuit with R=100ฮฉ, L=10mH, C=1ฮผF powered by 12V DC"
- "Create an RC low-pass filter with a 10kฮฉ resistor and 100nF capacitor"
- "Show a parallel LC circuit with L=1mH and C=100pF"
Layout Convention
Preferred layout: Vertical component arrangement on the right side.
โโโโโโโโโโโโโโโโโโโโโ
โ โ
(+) [Rโ]
(SRC) โ
(-) [Lโ]
โ โ
โโโโโโโโโโโโโโโโโโ[Cโ]
(GND) โ
โ
- Power source: Vertical on left side, positive terminal on top
- Components: Arranged vertically on the right side using
.down()
- Ground: Reference point on the return path (bottom)
- Labels: Include component designators and values (Rโ 10kฮฉ) - use default positioning
Schemdraw Code Generation
Use the bundled references for syntax:
references/schemdraw-guide.md - Component elements and methods
references/circuit-patterns.md - Common topology templates
Basic Structure (Vertical Layout - Preferred)
Important: The ground must be connected to the source negative terminal to form a complete circuit.
Labeling: Use .label('text') without specifying loc - Schemdraw's default positioning handles placement intelligently based on element orientation.
import schemdraw
import schemdraw.elements as elm
with schemdraw.Drawing() as d:
d.config(unit=3, fontsize=12)
source = d.add(elm.SourceV().up().label('Vโ\n12V'))
d += elm.Line().right().length(5).at(source.end)
d += elm.Resistor().down().label('Rโ 100ฮฉ')
d += elm.Inductor().down().label('Lโ 10mH')
d += elm.Capacitor().down().label('Cโ 1ฮผF')
d += elm.Line().left().length(3)
d += elm.Ground()
d += elm.Line().left().tox(source.start)
d += elm.Line().up().toy(source.start)
d.save('circuit.svg')
Rendering
After generating the Schemdraw code, save it to a .py file and render:
python scripts/render_circuit.py circuit_code.py output.svg
Or run the generated Python directly if Schemdraw is installed.
Components Reference
| Component | Element | Typical Values |
|---|
| DC Source | elm.SourceV() | 1V - 24V |
| AC Source | elm.SourceSin() | 120V, 60Hz |
| Battery | elm.Battery() | 1.5V, 9V, 12V |
| Resistor | elm.Resistor() | ฮฉ, kฮฉ, Mฮฉ |
| Capacitor | elm.Capacitor() | pF, nF, ฮผF |
| Inductor | elm.Inductor() | ฮผH, mH, H |
| Ground | elm.Ground() | - |
Output
- Default format: SVG (scalable, web-friendly)
- Alternatives: PNG, PDF (specify in render command)
- Location: Same directory as the Schemdraw script, or user-specified path
Example Files
See assets/examples/ for working templates:
simple-resistive.py - Basic resistor circuit
rc-series.py - RC series circuit
rl-series.py - RL series circuit
rlc-series.py - Full RLC series circuit
rlc-parallel.py - Parallel RLC circuit