> 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/rt-lab/example-models/ehs-example-models/sps-software-example-models/thermal-loss-feature.md).

# Thermal Loss Feature

## Description <a href="#description" id="description"></a>

The **Thermal loss feature** model illustrates the use of the thermal loss in the eHS solver. The user can see the different types of thermal loss based on the voltage, current, temperature and switching characteristics of the four inverter legs in real-time from the CPU.

## Requirements <a href="#requirements" id="requirements"></a>

To run your model properly, the following software must be installed:

* RT-LAB.
* RT-EVENTS.
* eFPGASIM.
* SPS Software.

The eHS solver requires an FPGA-based hardware board. This board will be configured with the attached binary file automatically when the model is loaded in the RT-LAB interface. This model uses a VC707 as its active carrier board (OP5607 / OP5700 simulators). Please refer to the product documentation for details on version compatibility.

## Simulation and results

### Setup and connections <a href="#setup-and-connections" id="setup-and-connections"></a>

This model must be run with the Hardware Synchronized option, with the XHP mode enabled. It does not require any external I/O hardware except the active control card.

Please note that following setup:

* The VC707 kit must be connected to the target PCIe bus and detected through the RT-LAB interface “Tools > Get I/O Infos” procedure.
* The Simulink simulation step time is set to 20 microseconds as the variable Ts in the RT-LAB model “InitFcn” and “PostLoadFcn” callbacks. To modify it, double-click on the “Model Initialization” block in the root of the RT-LAB model and modify accordingly the definition of the variable “Ts”.

### Run the model

To run the example, follow the procedure below:

1. If eFPGASIM is installed, add the example project to RT-LAB by selecting **File>>New>>RT-LAB Project>>eFPGASIM>>SimPowerSystems\_Workflow>>Thermal Loss**.
2. Compile the RT Model by clicking on **Build** in RT-LAB.
3. Verify that the VC707 board ID is set correctly in the OpCtrl block in the RT-LAB model SM\_eHS subsystem.
4. There is 4 types of losses; turn ON switching loss, turn OFF switching loss, direct conducting loss, and reverse conducting loss for MOSFET. The SPS Software (formerly SimPowerSystems) models have 4 inverter legs with a current source on the AC side, and a voltage source on the DC side. For each leg, only 1 type of losses will be assigned to the diode and to the switch.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-6f3a6181824539cb4833a7c7aa46f69bb57e2af6%2Fehs-model-sps-thermalloss-1.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Looking at the configuration, for each table you can see that most of the losses are multiplied by 0.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-cc2cda1976f40f82668ebb8683736ffe60715a8e%2Fehs-model-sps-thermalloss-2.png?alt=media" alt=""><figcaption></figcaption></figure>

6. When the model is compiled in Simulink, the configuration of the eHS solver will be generated according to the SPS Software (formerly SimPowerSystems) circuit characteristics. Elements will be put into matrices and stored into .mat files that will be transferred into the solver when the model is run from the RT-LAB interface.
7. To run a simulation including the eHS solver in real time, create a RT-LAB project and add the RT-LAB model of this example into the project. The SPS Software (formerly SimPowerSystems) model should not be added to the RT-LAB project, as it does not need to be transferred to the target computer for execution. Compile the model, then assign a target node to run it in real time, then load the model onto it.
8. Execute the real-time simulation, changing the Vdc, Iac, PWM frequency, and temperature will affect the losses. The following results have been obtained from the original model.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-3410e4a2a4262264c2c74d64c5b4f89ba9cca004%2Fehs-model-sps-thermalloss-3.png?alt=media" alt=""><figcaption></figcaption></figure>

9. In the result, the blue waveforms show the expected losses based on the current, voltage and temperature. The yellow waveforms show the result obtained, in real time, when adding switching information. Yellow waveforms should either be 0 or superimposed with the blue waveform.
10. Using the Foster network block heat transfer for the different components and table can be observed. In this example since only some losses are applied to each component, most components will remain at the ambient temperature.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-79b901ae24a57498b3267759b9c3f6fa6d33287e%2Fehs-model-sps-thermalloss-4.png?alt=media" alt=""><figcaption></figcaption></figure>

Temperature for each table can be observed using the selector.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-ebd8fef0ca30f103fbe5cc6ae374f8da8f84fdc1%2Fehs-model-sps-thermalloss-5.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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/rt-lab/example-models/ehs-example-models/sps-software-example-models/thermal-loss-feature.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.
