[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116233":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":13,"starSnapshotCount":13,"syncStatus":12,"lastSyncTime":27,"discoverSource":28},116233,"circuit-drawer-for-ee","ahainur\u002Fcircuit-drawer-for-ee","ahainur","Paper-ready circuit and control diagrams, with ngspice, Simulink and PLECS export.",null,"Python",74,2,0,6,15,22,62.43,"MIT License",false,"main",true,[],"2026-11-23 06:28:39","2026-11-23 08:35:13","# Circuit Drawer for EE\n\n[简体中文](README.zh-CN.md) | English\n\nCircuit Drawer is a circuit and control-diagram editor for power electronics. Draw by hand, edit a template, or ask the AI Agent to start from a blank canvas, configure parameters, run ngspice and inspect waveforms and operating modes. Editable JSON drawings produce paper-ready CircuiTikZ figures, and linked power circuits and control diagrams can be exported as complete closed-loop simulation models.\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002FCircuitDrawer-Setup-2.2.0.exe\">\u003Cimg alt=\"Download Windows installer — Offline setup v2.2.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownload%20Windows%20Installer-v2.2.0-7CB342?style=for-the-badge&amp;labelColor=151515\">\u003C\u002Fa>\n  \u003Cbr>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002Fcircuit_drawer_for_ee-2.2.0-py3-none-any.whl\">\u003Cimg alt=\"Download for macOS Apple Silicon — Python wheel v2.2.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownload%20for%20Mac%20%28Apple%20Silicon%29-v2.2.0-168BFF?style=for-the-badge&amp;labelColor=151515\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002Fcircuit_drawer_for_ee-2.2.0-py3-none-any.whl\">\u003Cimg alt=\"Download for macOS Intel — Python wheel v2.2.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownload%20for%20Mac%20%28Intel%29-v2.2.0-269C91?style=for-the-badge&amp;labelColor=151515\">\u003C\u002Fa>\n  \u003Cbr>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002FCircuitDrawer-Setup-2.2.0.exe\">\u003Cimg alt=\"Download for Windows — Offline installer v2.2.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownload%20for%20Windows-v2.2.0-36ADEF?style=for-the-badge&amp;labelColor=151515\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002Fcircuit_drawer_for_ee-2.2.0-py3-none-any.whl\">\u003Cimg alt=\"Download for Linux — Python wheel v2.2.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownload%20for%20Linux-v2.2.0-E95420?style=for-the-badge&amp;labelColor=151515\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nThe Windows button downloads the offline installer. The macOS and Linux buttons download the universal Python package (`.whl`, Python 3.10+). macOS and Linux currently have preview support. See the installation steps below.\n\n[Release notes](https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Ftag\u002Fv2.2.0) \u002F [Trial bundle with examples](https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002Fcircuit-drawer-trial-2.2.0.zip) \u002F [Offline manuals — 简体 \u002F 繁體 \u002F English](https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002Fcircuit-drawer-manuals-2.2.0.zip) \u002F [Source code](https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases\u002Fdownload\u002Fv2.2.0\u002Fcircuit-drawer-public-source-2.2.0.zip)\n\n[Start from a blank canvas](#quick-start) · [Link a controller and export a closed loop](#link-a-controller-and-export-a-complete-closed-loop-model) · [Agent and MCP guide](docs\u002FAGENT_MCP.md)\n\n![Full-bridge LLC converter, IEEE single column](docs\u002Fimages\u002Fmanual\u002Fexample-llc-fullbridge.png)\n\n## Highlights\n\n1、**Agent workflow and prompt library.** Describe a task on a blank canvas or an existing drawing, supply parameters, review circuit, controller and simulation-parameter candidates, then adopt them to continue with ngspice, measurements, mode identification and figure export. Follow-up requests, stop\u002Fresume and undoable adoption are supported. Search the DC\u002FDC, inverter and grid, rectifier and PFC, or motor-control categories, and save personal prompts. New examples cover Boost, single-phase full bridge, three-phase grid-connected dq control, Boost APFC and PMSM FOC. [Agent guide](docs\u002FAGENT_MCP.md#四内置-agent-的使用)\n\n2、**One table, many outputs.** A single JSON file holds the parts, wires, netlist, operating modes, annotations, simulation parameters and waveform settings. From it you get PDF, SVG, PNG and TeX figures, ngspice decks with CSV results, a MATLAB build script for Simulink + Simscape, and a native PLECS Standalone model. Open-loop PSIM export provides a Python builder for the official PSIM 2026 API. [PSIM models and steps](docs\u002FPSIM_EXPORT.md)\n\n3、**Paper-ready by default.** Figures fit IEEE single (8.79 cm) or double (17.99 cm) columns with 8 pt Times text. Symbol sizes stay fixed while the spacing between parts is scaled, so you insert the PDF at 100 % and the text matches your captions.\n\n4、**Editable drawings with validation.** Manual, template and AI-generated drawings share the coordinate-table format and remain editable after adoption. Explicitly expanding a module can make room for its contents. The checker reports slanted wires, overlapping symbols and labels, unmarked crossings, dangling wires and differences between the drawing and its netlist.\n\n5、**Web editor.** Move parts, wires and modules as one selection, rotate ordinary parts and wires in either direction, merge overlapping wires and keep wire hops at their crossings. Box selection, context menus, undo\u002Fredo, arrow-key nudging and drawing scaling are available.\n\n6、**Modules.** Define a converter cell once, drag it from the library into the canvas, and connect its ports with ordinary wires. Instances can be folded into boxes with IEC symbols. Simulation uses the full circuit, and native exports can represent folded modules as subsystems.\n\n7、**Operating modes and waveforms.** Highlight conducting paths and export mode sheets. Fixed-frequency internal PWM cases support mode identification from ngspice waveforms. Results show sampling windows, output means, ripple and cycle checks. Simulated or measured waveforms can also be arranged alongside t0, t1, ... and the matching mode figures.\n\n7a、**Figure studio and personal icons.** Drag symbols, text and callout arrows on the paper preview, or select an object and send it to the figure Agent. Edit a system symbol’s border and fill. Under **System symbols → Images and personal icons**, choose the drawing model for line icons or a dedicated image model for equipment illustrations. Compose algorithm flowcharts, circuits and annotated waveforms on one sheet.\n\n8、**Control diagrams and complete closed loops.** A separate editor supports PI, FOC and MPC diagrams, loop analysis (margins, Bode plots, Type I\u002FII\u002FIII compensators) and fixed- or floating-point C code generation. AI diagrams are laid out from their connections. Routing and layout adjustments can be previewed and adopted as one undoable edit. Link a saved power circuit, feedback signals and PWM, VCO or single-group SPS bindings to run supported ngspice loops or export Simulink and PLECS models.\n\n9、**AI interfaces and MCP.** The AI menu generates new drawings and edits existing ones. Agent tasks combine drawing, simulation and export. Built-in AI uses your API key with an Anthropic-compatible or OpenAI-compatible service. External MCP clients can use the optional Python MCP interface for candidate editing, validation, rendering, simulation and loop analysis. [MCP setup](docs\u002FAGENT_MCP.md)\n\n## Gallery\n\n| Operating modes of a DAB converter | Waveforms matched to modes |\n| --- | --- |\n| ![DAB mode sheet](docs\u002Fimages\u002Fmanual\u002Fexample-dab-modes.png) | ![Boost waveforms with mode figures](docs\u002Fimages\u002Fmanual\u002Fexample-waveform-modes.png) |\n\n| Folded modules wired by port name | Control block diagram (FOC) |\n| --- | --- |\n| ![Two DAB modules folded into boxes](docs\u002Fimages\u002Fmanual\u002Fexample-modules-folded.png) | ![PMSM field-oriented control diagram](docs\u002Fimages\u002Fmanual\u002Fexample-control-foc.png) |\n\nThe 2.2 circuit editor shows a Boost converter with its task mode in the Agent prompt library.\n\n![Boost circuit and the example simulation option in the Agent prompt library](docs\u002Fimages\u002Fmanual\u002Fen\u002Feditor-agent-2.png)\n\n## Installation\n\n### 64-bit Windows 10 and 11\n\n1、Download `CircuitDrawer-Setup-2.2.0.exe` and run it. Select the installer language and follow the wizard. Installation is per user. [Release downloads](https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\u002Freleases)\n\n2、Choose an installation path containing ASCII characters. Spaces are supported. Drawing files, export folders and Windows user names can contain Chinese characters.\n\n3、Open **Circuit Drawer** from the desktop or Start menu. The installer includes Python, TinyTeX with Chinese fonts, Poppler, ngspice and the Anthropic SDK. Drawing, previews, exports and ngspice simulation work offline. The AI assistant uses your configured online service.\n\n4、The installer is unsigned, so Windows may show **Unknown publisher** or **Windows protected your PC**. After checking the download source and SHA256, select **More info → Run anyway** if that option is available. In PowerShell, compare the following result with the installer's entry in the release's `SHA256SUMS.txt`.\n\n```powershell\nGet-FileHash .\\CircuitDrawer-Setup-2.2.0.exe -Algorithm SHA256\n```\n\n5、Save your drawings and close the launcher and running Circuit Drawer command-line tasks before upgrading or uninstalling. Run a newer installer to upgrade. To uninstall, open Windows **Settings → Apps → Circuit Drawer → Uninstall**. User drawings and settings are retained. Save drawings in your own document folders.\n\n### Python installation for developers, macOS and Linux\n\nCircuit Drawer needs Python 3.10 or newer. The core package has no third-party Python dependencies.\n\nDownload the wheel from the release page, then open a terminal in its download folder.\n\nOn Windows:\n\n```powershell\npython -m pip install circuit_drawer_for_ee-2.2.0-py3-none-any.whl\n```\n\nOn macOS or Linux, install it in a virtual environment:\n\n```bash\npython3 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\npython -m pip install circuit_drawer_for_ee-2.2.0-py3-none-any.whl\n```\n\nKeep this environment active when running the commands below. On Debian or Ubuntu, install `python3-venv` if the `venv` module is missing.\n\nOr install straight from the repository:\n\n```bash\npython -m pip install \"git+https:\u002F\u002Fgithub.com\u002Fahainur\u002Fcircuit-drawer-for-ee\"\n```\n\nDrawing entry points include `circuit-drawer` for circuits, `circuit-drawer-control` for control diagrams and `circuit-drawer-launcher` for the launcher window. If your shell cannot find them, use `python -m circuit_drawer`, `python -m circuit_drawer.control` and `python -m circuit_drawer.launcher`. External MCP clients use `circuit-drawer-mcp` with the optional MCP dependencies installed. [MCP setup](docs\u002FAGENT_MCP.md#一安装与启动)\n\nThe example files used throughout the documentation live in the [`examples\u002F`](examples\u002F) folder of this repository. They are not part of the wheel; download the source archive from the release page or clone the repository to get them.\n\nThe Python installation can use the following optional components. The Windows installer already includes LaTeX, Poppler, Chinese fonts, ngspice and the Anthropic SDK.\n\n| Component | Needed for |\n| --- | --- |\n| LaTeX (MiKTeX or TeX Live) with `circuitikz` | PDF output and the editor's true preview |\n| Poppler `pdftocairo` | SVG and PNG output |\n| `CJKutf8` LaTeX package | Chinese text in figures |\n| ngspice | Running simulations and getting CSV results |\n| MATLAB, Simulink and Simscape | Running the builder and generated `.slx`. C Function controllers require a compatible C compiler. PMSM and Clarke\u002FPark blocks also require Simscape Electrical |\n| PLECS Standalone | Opening the exported `.plecs` model |\n| PSIM 2026 and its official Python API | Building and running the exported open-loop PSIM model; [supported models and steps](docs\u002FPSIM_EXPORT.md) |\n| Python package `anthropic` | The AI assistant with an Anthropic-compatible interface (`python -m pip install \"anthropic>=2.3\"`) |\n\nDrawing, editing, checking, exporting TeX and exporting simulation models need none of these. See the [user manual](docs\u002FUSER_MANUAL.en.md#2-installation-and-startup) for step-by-step instructions on each platform.\n\n## Quick start\n\n### Start from a blank canvas\n\n1、Open **Circuit Drawer** and configure the provider, model and API key in the launcher's **API 与仿真设置…** dialog. Choose **新建电路… → 空白电路** and save the drawing in your project folder.\n\n2、Open **Agent → Prompt library**, choose **Blank canvas** and search for **Boost**. Choose **Drawing only** to keep unspecified component values symbolic, or **Example simulation** to match the circuit connections to an example operating point. Click **Fill requirement (editable)**, edit the task, then click **Start**.\n\n3、For a simulation, adopt the circuit drawing first. The next review shows current values, proposed values and assumptions. Confirm the operating point to run ngspice. **View results** shows output voltage, inductor current and PWM. Save the drawing to keep its parameters. Run files are in `agent-output` beside the drawing. [Agent instructions](docs\u002FAGENT_MCP.md#四内置-agent-的使用)\n\n4、To try a second load, open **Simulation → SPICE simulation…**. Search for `RL` on the left and change its resistance from 30 Ω to `12`. Search for `S1` and change the switching frequency from 50 kHz to `40k`. Check the operating point and channels at the top, select a new output folder, then run or rerun to compare the waveforms. You can also start directly with the [editable Boost circuit](examples\u002Fspice\u002Fboost.json).\n\n### Repair a candidate drawing\n\n1. The candidate card identifies the parts and pins to check. Choose **Edit candidate manually**, add the missing wire, then **Save and check again** to compare and adopt the draft.\n2. Compare single and double column, or **Try a single-column label layout**. Wide winding spacing appears as print advice. Dashed outlines locate the labels being checked. Amber outlines mark tight spacing or overlapping text. You can adopt, preview and export the drawing as it stands, or drag just the label. Explore both widths using the supplied PFC and LLC drawing. [Open the example](examples\u002Fagent_review\u002Fpfc_llc.json)\n\n### Link a controller and export a complete closed-loop model\n\n1、Save the power circuit, for example as `power.json`. Return to the launcher and choose **新建控制框图… → 空白控制框图**. Save the control drawing as `controller.json` in the same folder.\n\n2、In the control editor's Agent, specify the power file, feedback signal, control target and modulation. Confirm numerical parameters and adopt the candidate. The request below provides a starting point.\n\n> Link power.json in the same folder and draw a complete output-voltage feedback loop with reference, error, PI, modulator, power stage and voltage feedback. Use the saved circuit to identify parameters and switch bindings that need confirmation. After adoption, export a continuous-control Simulink model containing both the power stage and controller.\n\n3、The control JSON stores the power-file reference, feedback measurements and switch bindings. The program resolves the controller from the actual connections and reads the saved power circuit. **Export once from the control editor's Agent to produce the integrated closed-loop model.** Save power-circuit changes before exporting again.\n\n4、Use the generated files as described below. Native model building or solving takes place in the corresponding application.\n\n| Export target | Files and next step |\n| --- | --- |\n| Simulink | A `build_*.m` script, mapping manifest and instructions. In MATLAB, change to the export folder and run the builder to generate and open the `.slx`, then click Run |\n| PLECS | A `.plecs` model and supporting files. Open and run the model in PLECS Standalone |\n| PDF \u002F SVG \u002F PNG \u002F TeX | Figure files for a paper or report. The control editor's toolbar **Export…** action provides these formats |\n\nThe circuit editor's **Simulation → Export to Simulink… \u002F Export to PLECS…** commands export the model and control bindings configured in that circuit. [Controller linking and export](docs\u002FAGENT_MCP.md#四内置-agent-的使用)\n\n### Command-line examples\n\n\u003Cdetails>\n\u003Csummary>Expand template drawing, ngspice and native-model export commands\u003C\u002Fsummary>\n\n```bash\n# 1. List the built-in templates and their options\ncircuit-drawer list\n\n# 2. Draw a template: PDF, SVG, PNG and TeX in figs\u002F\ncircuit-drawer draw llc_fullbridge -o figs -f pdf,svg,png,tex\n\n# 3. Start from the Buck template and edit it in the browser (http:\u002F\u002F127.0.0.1:8765)\ncircuit-drawer edit my_buck.json -t buck\n\n# 4. One figure per operating mode, plus an overview sheet\ncircuit-drawer modes buck -o figs -f pdf,png\n\n# 5. Add example simulation parameters and run ngspice\ncircuit-drawer spice-init my_buck.json --preset buck -o my_buck_sim.json\ncircuit-drawer spice my_buck_sim.json -o out\u002Fspice --run\n\n# 6. Export the same circuit to PLECS Standalone and to Simulink\ncircuit-drawer plecs my_buck_sim.json -o out\u002Fplecs\ncircuit-drawer simulink my_buck_sim.json -o out\u002Fsimulink\n```\n\n\u003C\u002Fdetails>\n\nIn the editor, drag parts and wires, watch the status bar for problems, then use **File → Export circuit figure…** to write the figure. Export is only possible when the checker passes. Both editors offer **简体中文 \u002F 繁體中文 \u002F English** in the top-right language selector. Switching is immediate and preserves unsaved edits; the browser remembers the choice for that address and port.\n\n## What you can do\n\n| Task | Where |\n| --- | --- |\n| Generate from a blank canvas, review candidates, simulate, measure and export | **Agent** in either editor's toolbar |\n| Fill common requirements or save personal prompts | **Agent → Prompt library** |\n| Draw a common topology (Buck, Boost, LLC, DAB, flyback, CLLC, NPC, Vienna, Z-source, ...) | `circuit-drawer draw \u003Ctemplate>` |\n| Move parts, change labels, colours and symbol sizes | Web editor |\n| Group selection, context menus, undo\u002Fredo, arrow-key nudging | Web editor |\n| Background regions, stacked panels, block arrows, curved and wavy arrows, control blocks | Web editor, **Insert** menu |\n| Step and pulse marks next to sources | Web editor, part properties |\n| Reusable modules, folding, module library | Web editor, **Modules (subsystems)** group of the parts library |\n| Operating-mode figures and fixed-PWM mode identification | Toolbar **Identify modes**, **Modes** tab or Agent, also `circuit-drawer modes` |\n| Place a legend, schematic, equipment symbol or personal image on a waveform (development version) | **Figure studio → Waveform publication → Insert**. Drag to position it, set the plot tint and grids, or turn off **Show border** under **Appearance**. Hover over **?** for help with a setting. [Three-load Boost example](examples\u002Fwaveforms\u002Fboost_paper_insets.json) |\n| Waveforms bound to modes | **Modes and waveforms → Waveforms and modes…**, or `circuit-drawer waveforms` |\n| ngspice simulation | **Simulation → SPICE simulation…**, or `circuit-drawer spice` |\n| Conducted EMI engineering estimates and filter comparison | **Experimental → Conducted EMI estimate…**; start with the `buck_emi` template |\n| Simulink and PLECS models, closed-loop controllers, folded modules as subsystems | **Simulation → Export to Simulink… \u002F Export to PLECS…**, or `circuit-drawer simulink` \u002F `circuit-drawer plecs` |\n| Open-loop PSIM models | **Simulation → Export to PSIM…**, or `circuit-drawer psim`; run the generated Python builder with the official PSIM API |\n| Control diagrams, loop analysis, C code | Launcher **新建控制框图…**, or `circuit-drawer-control` |\n| Link a complete controller to a power circuit and export the closed loop | Control editor **Agent**, with power and controller JSON files in the same project folder |\n| Adjust control-diagram routing and layout | **Reroute wires \u002F Rearrange layout** in the control editor, preview and adopt |\n| Call drawing tools from an external AI client | Optional Python MCP interface `circuit-drawer-mcp` |\n| New topology from a description, or a one-sentence change | **AI** menu, or `circuit-drawer new` \u002F `circuit-drawer tweak` |\n| Save a checked table as your own template | `circuit-drawer save-template` |\n\nDrawing validation checks connections, geometry and text placement. Simulation and result tools check numerical configuration, solver results and sampling windows. Device ratings, losses, efficiency and ZVS require suitable device models and engineering verification.\n\nAutomatic mode identification applies to fixed-frequency internal PWM. The internal mode check and the results page's cycle check can differ because of sampling. Dynamic PWM dead time uses a carrier-threshold approximation, and SPS uses one two-bridge group. See the release notes and manual for the supported conditions. [Supported conditions](RELEASE_NOTES.md#当前适用范围)\n\n## Documentation\n\n1、[Agent workflow and MCP interface](docs\u002FAGENT_MCP.md)\n\n2、[User manual (English)](docs\u002FUSER_MANUAL.en.md)\n\n3、[使用说明书（中文）](docs\u002FUSER_MANUAL.zh-CN.md)\n\n4、[繁體中文使用說明書](docs\u002FUSER_MANUAL.zh-TW.md)\n\n5、[Change log](CHANGELOG.md)\n\n6、[Examples](examples\u002F)\n\n## Contributors\n\n1. [@YouthWell](https:\u002F\u002Fgithub.com\u002FYouthWell) reported the disabled **Adopt** button and shared Boost PFC + LLC screenshots that helped identify overly strict label checks.\n\n## License\n\nCircuit Drawer for EE is released under the [MIT License](LICENSE).\n","这是一款面向电力电子领域的电路与控制框图绘制工具，支持手绘、模板编辑和AI辅助建模。核心功能包括参数化电路设计、ngspice仿真集成、波形与工作模式分析，以及导出可直接用于学术论文的CircuiTikZ矢量图；同时支持将关联的功率电路与控制器联合导出为Simulink、PLECS和ngspice完整闭环仿真模型。适用于电力电子教学、科研绘图、论文图表制作及快速原型验证等场景。","2026-11-24 04:53:14","CREATED_QUERY"]