Disabling block with physical components

Is there a way to enable or disable blocks containing physical components?

Hi Ernesto_Incerti,

There are a couple of different options:

  • Disable (comment out) components
    PLECS allows you to temporarily disable one or more components in your circuit without deleting them. Please see the documentation for details:

    Components — PLECS 5.0 Documentation

  • Use Configurable Subsystems
    Another option is to use Configurable Subsystems, which allow you to switch between different circuit implementations while keeping the same external interface.

    For example, you could:

    • Compare different input filter configurations.
    • Bypass the filter entirely by directly connecting the input and output terminals.
    • Switch between different component implementations.

    An example of this approach can be found here:

    Influence of Input Filter on Controller Stability

If you are trying to accomplish something different and neither of these approaches addresses your use case, let us know. A minimal PLECS model demonstrating what you are trying to do would be very helpful in understanding the problem.

My aim is to switch from a subcycle average model to a switched model while the simulation is running

A convenient way to do this is to use a Configurable Subsystem.

Run the simulation first with the sub-cycle average model. Once the simulation has reached the desired operating point, store the system state. Then switch the configurable subsystem to the switched model and restart the simulation from the stored system state.

The complete workflow is described in this forum post:

I’ve also attached a small boost converter example. Run the simulation script via Simulation > Simulation Scripts…. The script demonstrates exactly this workflow: it runs the average model, stores the system state, switches to the switched model, and continues the simulation from the stored state.
boost_converter_configuration_change.plecs (15.4 KB)