Main Content

power_customize

Prepare a Simscape Electrical Specialized Power Systems block for customization

Syntax

power_customize

Description

power_customize lets you customize Simscape™ Electrical™ Specialized Power Systems blocks to:

  • Model behaviors that are not provided in the library blocks

  • Build more advanced models

  • Develop simplified models

  • Provide additional user interfaces to existing blocks

Simscape Electrical Specialized Power Systems blocks you customize cannot have broken or inactive library links. In other words, you cannot disable or break the library link of a block and start customizing the block directly in your model. If you want to modify a block, you make a copy of the block in a custom library, break the block link to the product library, and start doing your modifications in the custom library. The function power_customize automates these steps and helps you to prepare a Simscape Electrical Specialized Power Systems block for customization.

You can call the function from the command line with power_customize, or you can click Customize SPS blocks in the Tools tab of the Powergui block to open the dialog box.

In the typical workflow, you open the power_customize dialog box, select the block you want to customize in a model, specify the name of a custom library to save the block in, and apply your changes. Then you customize the block in your library. The dialog box also has the option to replace the block in your model with a library link to the new custom block.

Dialog Box

Custom Library

Specify the name of a custom library to save the selected block to. If the specified library does not exist, power_customize creates it. The block is copied to the library and the name appended with the text (custom) when you apply the changes. The library opens, and you can then customize the block in your library.

The default value is MyLibrary.

Replace the block in the model with the block from the library

Replace the selected block in your model with a copy of the block (i.e., a library link) from the specified library. When you apply your changes, the function replaces the block in your model with the library link to the new custom block. When power_customize creates the library block and the link in the model, it appends the block name with the text (custom). If this parameter is cleared, the function does not replace the block in your model. In this situation, if you apply changes several times, the function creates several instances of the selected block in the specified library. You can customize these libraries with different changes.

This parameter is selected by default.

Unlock the internal model of the new library block

Simscape Electrical Specialized Power Systems blocks use internal functions that control the mask behavior and the internal Simulink® model. For example, the function replaces the internal Simulink model of a Synchronous Machine block with a discrete model when the Simulation type parameter of the Powergui block is set to Discrete or to a phasor model when set to Phasor.

Select this parameter to enable customizing of the internal Simulink model of the selected block. The internal model of the block is then no longer controlled by the Powergui Simulation type parameter.

If you do not plan to customize the internal Simulink model but instead plan to rework other parts of the block, you can clear this parameter. The internal model of the block remains under control of the Simulation type parameter of the Powergui block.

This parameter is selected by default.

Examples

The power_V2G example model, which shows a 24-hour simulation of a vehicle-to-grid system, contains a customized Asynchronous Machine block (under the Load subsystem). The electrical internal model (a phasor model) was optimized to provide faster simulation in phasor mode. This custom block and the V2Glib custom library were prepared for customization using power_customize.

Version History

Introduced in R2015a