> For the complete documentation index, see [llms.txt](https://docs.tricloudnexus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tricloudnexus.io/management-portal/designer/assets/tags/collect/configuration/equation.md).

# Equation

Use the **Equation** connector to create a new *Tag* computed from other Tags. You define a symbolic expression and map each symbol to an existing Tag. The result is calculated at the edge and can then be processed/stored like any other Tag output.

Equations apply to read tags but support both **On Change** and **Periodic** modes:

* **On Change**: Equation is computed every time any of the inputs change.
* **Periodic**: Equation is computed in fixed intervals.

{% hint style="info" %}
If an **On Change** equation forms a feedback loop—referencing its own output directly or via other equations. The runtime detects the cycle and **rate-limits evaluation to** once per second to prevent runaway updates.
{% endhint %}

***

## Equation Editor

Use the **Formula calculator editor** to build equation Tags without hand-typing the full `expression#assignments` string. The UI validates syntax, lets you map symbols to Tags, and previews the computed result using test values.

<figure><img src="/files/2sJk6CkPIyX8kfopD7YJ" alt=""><figcaption><p>When the Data Connection is set to Equation,<br>it is possible to click the blue button to open the Equation Editor.</p></figcaption></figure>

Clicking the blue button with the f(x) symbol opens the Equation Editor. The editor looks like this:

<figure><img src="/files/2GlmeivFcexwm3EVkxrt" alt=""><figcaption><p>Equation Editor UI</p></figcaption></figure>

* **Variables table**\
  Contains a Tag reference for every symbol in the expression.\
  \
  Symbol : The symbol name\
  Tag reference : Name of the Tag that maps to the symbol\
  Test Value : Temporary value assigned to the symbol, to test the expression.\
  \
  \&#xNAN;**+ Add** — declare a new symbol.

  **✎** — edit the existing symbol declaration..

  **🗑** — remove the symbol declaration.
* **Symbolic expressions**\
  A single-line input for the expression (e.g., `a+b+9`).\
  Any symbol used here, must be declared in the **Variables** table.\
  The expression is continuously validated, and the validation result is shown below the expression.
* **Result**\
  Displays the evaluated value using the test inputs. This can be used to validate that the expression is correct, especially when defining more complex equations.

### How to configure an Equation Tag

1. **Declare symbols**\
   Click **+ Add** for each symbol you’ll use (e.g., `a`, `b`). Map each to an existing Tag in **Tag Reference**.
2. **Enter the expression**\
   Type your formula in **Symbolic expressions** (e.g., `a+b+9`, `min(a;b)^c`, `if(a;1;2)*if(b;4;5)`).
3. **Verify**\
   Provide **Test Values** to check the logic; confirm you see **Valid Expression** and an expected **Result**.
4. **Save**\
   The platform stores the configuration in the required format, e.g.:\
   `a+b#a=Area3.Asset3.Tag3;b=Area1.Asset1.NewTag`

### Syntax

An equation has two parts separated by `#`:

```
<symbolic expression>#<symbol assignments>
```

* **Symbolic expression** — The math/logic to evaluate, e.g.:
  * `a+b`
  * `round(a)`
  * `sin(b)`
  * `a*b^c`
* **Symbol assignments** — Map every symbol used in the expression to a Tag name:

  ```
  a=Asset1.PumpSpeed;b=Asset2.FlowRate;c=Asset3.Exponent
  ```

**Examples**

```
a+b#a=asset1.tag1;b=asset2.tag2
min(a;b)^c#a=asset1.tag1;asset1.b=tag2;asset1.c=tag3
2*pi*radius#radius=asset1.tag1
```

{% hint style="warning" %}
**Null/invalid inputs** propagate an invalid result for that evaluation.
{% endhint %}

***

### Constants

The symbols below denote **built-in constants** and may not be redefined or used as custom symbols:

* `pi` = 3.14159… → Example: `2*pi*radius#radius=asset1.R`
* `e` = 2.71828… → Example: `e^a#a=asset1.Exponent`
