How can I switch between several implementations of a Simscape block in SimPowerSystems Simscape Components?

2 views (last 30 days)
I would like to know the recommended modelling workflow in order to switch between different implementations of a custom block in SimPowerSystems Simscape Components.
For example, I would like to implement a block that switches between delta and wye implementation of an electrical machine.
The user should be able to choose between one or the other implementation of the block.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Oct 2014
The recommended implementation depends if you need to switch during simulation or between different simulations.
  • For switching DURING simulation, you can do one of the following:
  • Use an if-else statement in your custom Simscape code in order to switch between implementations based on a variable's value
  • Implement two separate blocks with a "switch" block. In the shipped example model "pe_asm_starting", a switch block enables switching during delta and wye connection for an electrical machine.
  • For switching BETWEEN simulations, you can use a Variant Subsystem that enables the user to select one or the other implementation. This is illustrated in the example model pe_customer_sm_simplified.

More Answers (0)

Categories

Find more on Discrete Events and Mode Charts in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!