> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/basics/power_customize.md).

# power\_customize

## Description

The **power\_customize** function lets you customize SPS 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 SPS 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 SPS block for customization.

## Syntax

You can call the function from the command line with:

{% code lineNumbers="true" %}

```matlab
 power_customize
```

{% endcode %}

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

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-5ab3dd36fa145573d2c31bbecf0ebe92c4eb01a1%2Fpower_customize_mask.png?alt=media" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="168.39996337890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Custom Library</strong></td><td>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 My Library.</td></tr><tr><td><strong>Replace the block in the model with the block from the library</strong></td><td>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.</td></tr><tr><td><strong>Unlock the internal model of the new library block</strong></td><td>SPS 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 <strong>Simulation type</strong> 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 <strong>Simulation type</strong> 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 <strong>Simulation type</strong> parameter of the Powergui block. This parameter is selected by default.</td></tr></tbody></table>

## Examples

The [24-hour Simulation of a Vehicle-to-Grid (V2G) System](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/example-models/renewables/24-hour-simulation-of-a-vehicle-to-grid-v2g-system.md) Preview (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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/basics/power_customize.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
