> 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/hypersim/model-and-simulation/import-models-from-external-software-or-code/import-from-simulink-hyperlink.md).

# Import from Simulink (Hyperlink)

## Overview

The **Simulink Import** tool (via **Hyperlink**) is a HYPERSIM feature that allows users to **import and integrate Simulink models** into HYPERSIM through code generation. This mechanism enables Simulink models, such as control algorithms or electrical subsystems, to be compiled into C/C++ code and imported as native HYPERSIM components. Simulink Import is designed to **support both offline and real‑time simulation** workflows, making it possible to reuse existing Simulink developments within large‑scale power system simulations executed in HYPERSIM.

## Typical workflow

Importing a Simulink model into HYPERSIM generally follows these steps:

1. Configure MATLAB to enable Hyperlink code generation.
2. Generate C/C++ code from the Simulink model using Simulink Coder or Embedded Coder.
3. Import the generated model into HYPERSIM using the **Simulink Import** tool.
4. Configure execution parameters, such as execution time, to optimize task mapping and real‑time performance.

Each step is documented in detail in the corresponding sections of this guide.

## Key capabilities

Using Simulink Import, users can:

* Import compiled Simulink models as HYPERSIM components
* Instantiate multiple copies of the same Simulink model
* Use tunable parameters to modify model behavior without regenerating code
* Protect model intellectual property through compilation
* Integrate Simulink‑based controls into complex HYPERSIM simulations

Advanced features such as multi‑rate models, multiple time‑step code generation, and integration of scopes and S‑functions are also supported, subject to specific constraints.

## When to use Simulink Import

Simulink Import is particularly well suited for:

* Reusing existing Simulink control models in HYPERSIM
* Coupling detailed control logic with large power system models
* Running Simulink‑based models in real‑time simulation environments
* Improving performance and scalability compared to co‑simulation approaches


---

# 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/hypersim/model-and-simulation/import-models-from-external-software-or-code/import-from-simulink-hyperlink.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.
