Models, Subcircuits & Libraries
In this tutorial, we build a simple buck converter to explain model construction, subcircuits, and libraries.
Models vs subcircuits vs libraries (quick definitions)
- A model is a single reusable device you place in a schematic (for example: MOSFET, diode, capacitor...).
- A subcircuit encapsulates a selection of devices into a hierarchical block with interface pins, so your top-level schematic stays clean.
- A library is where models/subcircuits are organized for reuse:
- A Project Library is stored inside the current
.jsimbaproject file. - A Library File (
.jsimbalib) can be reused across projects.
Example of an LLC converter using subcircuits for the inner and outer loops.
Step 1 — Create a new project and design
- Create a new project.
- Rename the default design to Buck Demo (or similar).

Right-click a design to open its context menu.
Step 2 — Place models from the Model Library
- Open Model Library from the left sidebar.
- Use Search models… (or the library tree) to find parts.
- Double-click or drag-and-drop models into the schematic.
While placing, use your usual shortcuts/tools to rotate or flip components.

Model Library open while building the buck converter.
Step 3 — Faster access with the Unified Search Box
For quick library access, use the Unified Search Box:
- Press Ctrl/Cmd+P.
- Type
lto search libraries/models only. - Enter a model name and click it to add it to the circuit.
For the PWM, add a Square Wave (control source) model.

Using the Unified Search Box to quickly place a model from the library.
Step 4 — Wire and navigate the schematic
- To connect pins, drag from one pin to another.
- To create a connection from an existing wire, click the wire and use the “+” handle.
- Use the mouse wheel/trackpad to zoom; use middle-mouse (or Space + drag) to pan; press Space to fit the circuit on screen.
Step 5 — Edit parameters (expressions + units) and add circuit variables
- Select a device and edit values in the Property Grid.
- Parameters accept mathematical expressions and unit coefficients (for example:
33u,100k).
Example values for this tutorial:
Vin = 24L = 1mC = 100uRload = 5
Make the circuit parametric using Circuit Variables:
- Add a variable
fsw = 100k - Use
fswin the PWM frequency (and anywhere else it makes sense)

Defining Circuit Variables (example: fsw).
Variable file (optional)
At the top circuit level, you can also define additional circuit variables through a variable file.
Syntax:
- Comments start with
// - Variables use
variable_name = variable_expression - Expressions support SI multipliers (
p,n,u,m,k,M) and common math functions (for example:M = A * cos(X))
Step 6 — Use variables in simulation settings
Open the Transient analysis settings and set the end time using the variable, for example:
End time = 1000/fsw

Setting simulation parameters using an expression (example: 1000/fsw).
Step 7 — Create a subcircuit (encapsulate the power stage)
- Select the buck power stage components (for example: MOSFET, diode, inductor, capacitor).
- Use Subcircuit to encapsulate the selection.
SIMBA keeps the top-level wiring by creating interface pins for the new subcircuit.

Creating a subcircuit from the selected power-stage devices.
Step 8 — Open the subcircuit and manage pins
- Select the subcircuit block and choose Open.
- Use the navigation bar to understand where you are in the hierarchy.
Inside the subcircuit, the Pins library becomes available. Rename or move pins as needed; the symbol updates automatically.

Hierarchy navigation bar and Pins library inside the subcircuit.
Step 9 — Reuse subcircuits: shared definition vs “Make Unique”
If you copy/paste a subcircuit, the instances typically share the same definition (changes affect every copy).
For per-instance tuning, use Subcircuit Variables.

Example of Subcircuit Variables.
To make one instance independent:
- Select the subcircuit instance.
- In the Property Grid, click Make Unique.
Step 10 — Store reusable subcircuits in libraries
To reuse a subcircuit later, add it to a library:
- New Project Library: stored in the current
.jsimbaproject file - New Library File: saved as a
.jsimbalibfile for reuse across projects
You can also load external library files globally from Settings.

Saving a reusable subcircuit into a custom library.