> 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/library-blocks-reference/control-miscellaneous/filter-2nd-order.md).

# Filter, 2nd order

## Description

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-59817ac436ea4e976fcf1c15d804c8a095a743b8%2Fimage%20(657).png?alt=media" alt="" width="233"><figcaption></figcaption></figure>

The **Filter 2nd-order** block, located in the **Control Miscellaneous** library, is a second-order low-pass filter that implements the transfer function :

<p align="center"><span class="math">H(s) = \frac{ω_n^2 }{s^2 + 2·ξ·ω_n·s + ω_n^2}</span></p>

where ω is the natural frequency and ξ the damping ratio.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-69f6d4894b4bc5056407bf6629b38d1de159fc92%2Fimage%20(659).png?alt=media" alt="" width="563"><figcaption><p>Internal circuit of the block</p></figcaption></figure>

{% hint style="info" %}
The Filter, 2nd-order component is designed for DC input signals. With AC input signals, the output presents a temporary offset that is corrected after several time steps.
{% endhint %}

The following example model implements the first and second order filter with 60 Hz sinusoidal signal applied to the second-order low-pass filter with a 60 Hz natural frequency and a damping ratio of 0.707.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-f16fc520525467f49d5a480d548d8c902374d133%2Fimage%20(660).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-9237fe9b065ad7944ecb4c7c8b35f673dc00091a%2Fimage%20(661).png?alt=media" alt="" width="563"><figcaption><p>Simulation results in ScopeView</p></figcaption></figure>

## Mask parameters

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-769e4d5465538f369a8573eaff5f7ec55dc6ca88%2Fimage%20(658).png?alt=media" alt="" width="450"><figcaption></figcaption></figure>

<table><thead><tr><th width="220.39996337890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Use this field to add information about the component.</td></tr><tr><td><strong>Filter natural frequency</strong></td><td>Second-order natural low-pass filter frequency (Hz),<br>FreqFilter_fn = [0, 1e12] .</td></tr><tr><td><strong>Filter damping ratio</strong></td><td>Second-order low-pass filter damping rate. The damping ratio FreqFilter_zeta is typically a value between 0 and 1.</td></tr><tr><td><strong>Initial input (DC component)</strong></td><td>Initial value of the DC component magnitude of the output signal for the first simulation cycle, InitialOutput = [0, 1e12].<br>Cannot be modified during the simulation.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="221.20001220703125">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>u</strong></td><td>Input signal</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="220.4000244140625">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>y</strong></td><td>Filtered output signal</td></tr></tbody></table>


---

# 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/library-blocks-reference/control-miscellaneous/filter-2nd-order.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.
