> 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/control-and-measurements/analysis/mean.md).

# Mean

## Description

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

The **Mean** block, located in the **OPAL-RT SPS Software/Sensors and Measurements** library, computes the mean value of the input signal.

The mean value is computed over a running average window of one cycle of the specified fundamental frequency:

$$
\text{Mean}(f(t))
=================

\frac{1}{T}
\int\_{t-T}^{t}
f(t), dt
\\\[8pt]

f(t) : \text{input signal},\quad T = 1/\text{fundamental frequency}
\\\[8pt]
$$

As this block uses a running average window, one cycle of simulation must complete before the output gives the correct value. For the first cycle of simulation, the output is held constant to the specified initial input value.

## Characteristics

<table data-header-hidden><thead><tr><th width="250.31109619140625"></th><th></th></tr></thead><tbody><tr><td>Sample Time</td><td>Specified in the <strong>Sample Time</strong> parameter Continuous if <strong>Sample Time</strong> = 0</td></tr><tr><td>Scalar Expansion</td><td>Yes, of the parameters</td></tr><tr><td>Dimensionalized</td><td>Yes</td></tr></tbody></table>

## Ports

### Input

<table data-header-hidden><thead><tr><th width="249.9111328125"></th><th></th></tr></thead><tbody><tr><td><strong>Port_1</strong> — Input signal<br>Simulink<sup>®</sup> signal</td><td>The input signal for which the block computes the mean value, specified as a Simulink signal.</td></tr></tbody></table>

### Output

<table data-header-hidden><thead><tr><th width="250.1778564453125"></th><th></th></tr></thead><tbody><tr><td><strong>X</strong> — Mean value of input signal<br>Simulink signal</td><td>The mean value of the input signal, returned as a Simulink signal.</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="249.5555419921875"></th><th></th></tr></thead><tbody><tr><td><strong>Fundamental frequency (Hz)</strong> — Fundamental frequency<br>60 (default) | positive scalar</td><td>Specify the fundamental frequency, in hertz. This value determines the period (1/<em>F</em>) of the running average window.</td></tr><tr><td><strong>Initial input (DC component)</strong> — Input value for first simulation cycle<br>0 (default) | scalar</td><td>Specify the input value for the first cycle of simulation.</td></tr><tr><td><strong>Sample time</strong> — Sample time of block<br>0 (default) | nonnegative scalar</td><td>Specify the sample time of the block, in seconds. Set to 0 to implement a continuous block.</td></tr></tbody></table>

## Examples

**Determine Mean Value of DC Signal with 12th Harmonic Ripple**

The power\_Mean model uses the Mean block to determine the mean value of a DC signal containing a 12th harmonic ripple.

The model sample time is parameterized by the Ts variable set to a default value of 50e-6 s. Set Ts to 0 in the command window to simulate the model in continuous mode.


---

# 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/control-and-measurements/analysis/mean.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.
