> 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/example-models/simulation-and-analysis/interfacing-simscape-models-with-sps.md).

# Interfacing Simscape Models with SPS

This example shows the interface between Simscape™ and SPS to design a breaker model.

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

## Description

There are two similar circuits shown in parallel. The top circuit model illustrates tripping of a circuit breaker protecting a 240 V residential distribution circuit. The Circuit Breaker model is built with SPS blocks. The circuit below is identical in all respects, but for a Simscape model of the Circuit Breaker.

The top circuit illustrates tripping of a circuit breaker in a 240 V residential distribution circuit. Initially, the 240 V circuit feeds a 10 kW load. Then, at t=0.05 s, a second load (10 kW, 5 kvar) is switched on, causing current to exceed the trip setting (100 A). Current is interrupted at its first zero-crossing after the trip current has been exceeded. Finally, Load 1 is reconnected by resetting the circuit breaker at t= 0.2 s.

The bottom circuit is using the Simscape Interface Element block sps\_lib to connect a Simscape circuit breaker model to the SPS circuit. The Simscape breaker block is a modified version of the breaker model found in ssc\_circuitbreaker model.

## Simulation

On running the model we can observe that the two different implementations of the circuit breaker device produce the same circuit breaker current and voltage.

### Conclusion

Using the Simscape Interface blocks of sps\_lib, it is possible to create any custom block not provided with SPS, in Simscape, and then interface it seamlessly with a SPS circuit.

## Command

Example model name: power\_SSCmodeling

{% code lineNumbers="true" %}

```matlab
open('power_SSCmodeling')
```

{% endcode %}


---

# 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/example-models/simulation-and-analysis/interfacing-simscape-models-with-sps.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.
