Skip to content

Feature Request: Extended Electrical Components for Analog Circuit Simulation #435

@s-celles

Description

@s-celles

Summary

This proposal suggests adding a set of commonly-used electrical components to ModelingToolkitStandardLibrary.Electrical that would significantly enhance analog circuit simulation capabilities. These components complement the existing IdealOpAmp and basic passive components.

Motivation

The current Electrical library provides excellent basic components (Resistor, Capacitor, Inductor, IdealOpAmp, Diode, etc.), but lacks several components essential for:

  1. Realistic op-amp modeling: Finite gain, bandwidth limitations, slew rate, saturation
  2. SPICE-like controlled sources: VCVS, VCCS, CCVS, CCCS (E, G, H, F elements)
  3. Small-signal transistor analysis: Hybrid-π BJT and MOSFET models
  4. Educational use: Step-by-step progression from ideal to realistic models

These components are standard in tools like SPICE, Modelica (MSL), and are essential for:

  • Control systems design (op-amp stability analysis)
  • Analog IC design education
  • Mixed-signal simulation
  • Feedback system analysis

Proposed Components

1. Op-Amp Models (TwoPort-based, consistent with existing IdealOpAmp)

Component Description Parameters Use Case
OpAmpFiniteGain Operational Amplifier with finite gain A, Rin, Rout DC gain error analysis
OpAmpGBW Operational Amplifier with Gain-Bandwidth Product A0, GBW, Rin Frequency response, stability
OpAmpFull Operational Amplifier "full" model A0, GBW, Vsat, SR, Rin, Rout Complete behavioral model

2. Controlled Sources

Component Description Parameters SPICE Equivalent
VCVS Voltage Controlled Voltage Source G (voltage gain) E-element
VCCS Voltage Controlled Current Source Gm (transconductance) G-element
CCVS Current Controlled Voltage Source Rm (transimpedance) H-element
CCCS Current Controlled Current Source α (current gain) F-element

3. Two-Port Networks

Component Parameters Use Case
Gyrator R Inductor simulation in IC design
IdealTransformer n (turns ratio) Power electronics, isolation

4. Small-Signal Semiconductor Models (3-terminal)

Component Parameters Use Case
BJT_SmallSignal gm, , ro, , AC analysis, amplifier design
MOSFET_SmallSignal gm, rds, Cgs, Cgd AC analysis, amplifier design

5. Linearized Components

Component Parameters Use Case
LinearizedDiode Vd, Rd Small-signal analysis

Questions for Maintainers

Scope: Should all these components be in ModelingToolkitStandardLibrary.Electrical, or would a separate package (e.g., ModelingToolkitAnalogLib.jl) be preferred?

Edit:
Dyad ElectricalComponents https://github.com/DyadLang/ElectricalComponents

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions