Skip to content

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 .jsimba project file.
  • A Library File (.jsimbalib) can be reused across projects.

LLC

Example of an LLC converter using subcircuits for the inner and outer loops.

Step 1 — Create a new project and design

  1. Create a new project.
  2. Rename the default design to Buck Demo (or similar).

Right-Click

Right-click a design to open its context menu.

Step 2 — Place models from the Model Library

  1. Open Model Library from the left sidebar.
  2. Use Search models… (or the library tree) to find parts.
  3. Double-click or drag-and-drop models into the schematic.

While placing, use your usual shortcuts/tools to rotate or flip components.

Buck Converter

Model Library open while building the buck converter.


For quick library access, use the Unified Search Box:

  1. Press Ctrl/Cmd+P.
  2. Type l to search libraries/models only.
  3. Enter a model name and click it to add it to the circuit.

For the PWM, add a Square Wave (control source) model.

Unified Search Box

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

  1. Select a device and edit values in the Property Grid.
  2. Parameters accept mathematical expressions and unit coefficients (for example: 33u, 100k).

Example values for this tutorial:

  • Vin = 24
  • L = 1m
  • C = 100u
  • Rload = 5

Make the circuit parametric using Circuit Variables:

  • Add a variable fsw = 100k
  • Use fsw in the PWM frequency (and anywhere else it makes sense)

Circuit Variables

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

Transient settings

Setting simulation parameters using an expression (example: 1000/fsw).


Step 7 — Create a subcircuit (encapsulate the power stage)

  1. Select the buck power stage components (for example: MOSFET, diode, inductor, capacitor).
  2. Use Subcircuit to encapsulate the selection.

SIMBA keeps the top-level wiring by creating interface pins for the new subcircuit.

Create a subcircuit

Creating a subcircuit from the selected power-stage devices.


Step 8 — Open the subcircuit and manage pins

  1. Select the subcircuit block and choose Open.
  2. 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.

Subcircuit content

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.

Subcircuit variables

Example of Subcircuit Variables.

To make one instance independent:

  1. Select the subcircuit instance.
  2. 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 .jsimba project file
  • New Library File: saved as a .jsimbalib file for reuse across projects

You can also load external library files globally from Settings.

Custom library

Saving a reusable subcircuit into a custom library.