damper

Modules

damper_torch_system module

class DamperTorchSystem(a=1, nominalAirFlowRate=0.03402777777777778, **kwargs)[source]

Bases: System, Module

A damper system model implemented with PyTorch for gradient-based optimization.

This model represents a damper that controls air flow rate based on damper position, using an exponential equation for accurate flow control representation.

Parameters:
  • a (float) – Shape parameter for the air flow curve. Controls the non-linearity

  • behavior. (of the damper characteristic. Higher values result in more non-linear)

  • nominalAirFlowRate (float) – Nominal air flow rate [m³/s] at fully open position

Mathematical Formulation

The damper characteristic is calculated using an exponential equation:

\[\dot{m} = a \cdot e^{b \cdot u} + c\]
where:
  • \(\dot{m}\) is the air flow rate [m³/s]

  • \(a\) is the shape parameter

  • \(b\) is calculated to ensure \(\dot{m} = \dot{m}_{nom}\) at \(u = 1\)

  • \(c\) is calculated to ensure \(\dot{m} = 0\) at \(u = 0\)

  • \(u\) is the damper position (0-1)

  • \(\dot{m}_{nom}\) is the nominal air flow rate [m³/s]

The parameters \(b\) and \(c\) are calculated during initialization:

\[c = -a\]
\[b = \ln(\frac{\dot{m}_{nom} - c}{a})\]
where:
  • \(c = -a\) ensures zero flow at closed position

  • \(b\) is calculated to ensure nominal flow at fully open position

Notes

Damper Characteristics:
  • The exponential characteristic provides a more realistic representation of damper behavior compared to a linear relationship

  • The shape parameter ‘a’ controls the non-linearity of the flow curve

  • Higher values of ‘a’ result in more non-linear behavior

  • The model ensures zero flow at closed position and nominal flow at fully open position

Implementation Details:
  • The model uses PyTorch tensors for gradient-based optimization

  • Parameters ‘a’ and ‘nominalAirFlowRate’ are stored as non-trainable PyTorch parameters

  • Parameters ‘b’ and ‘c’ are calculated during initialization

  • The model assumes ideal damper behavior (no hysteresis or deadband)

do_step(secondTime, dateTime, step_size, stepIndex)[source]

Perform one step of the damper system simulation.

The damper characteristic is calculated using an exponential equation: m = a * exp(b * u) + c where: - m is the air flow rate - a is the shape parameter - b is calculated to ensure m=nominalAirFlowRate at u=1 - c is calculated to ensure m=0 at u=0 - u is the damper position (0-1)

Return type:

None

initialize(start_time, end_time, step_size, simulator)[source]

Initialize the damper system.

Return type:

None

property config

Get the configuration of the damper system.

property input: dict

Get the input ports of the damper system.

Returns:

Dictionary containing input ports:
  • ”damperPosition”: Damper position (0-1)

Return type:

dict

property output: dict

Get the output ports of the damper system.

Returns:

Dictionary containing output ports:
  • ”damperPosition”: Damper position (0-1)

  • ”airFlowRate”: Air flow rate [m³/s]

Return type:

dict

sp = [<twin4build.translator.translator.SignaturePattern object>, <twin4build.translator.translator.SignaturePattern object>]
get_signature_pattern()[source]

Creates and returns a SignaturePattern for the DamperSystem.

Returns:

A configured SignaturePattern object for the DamperSystem.

Return type:

SignaturePattern

get_signature_pattern_brick()[source]

Creates and returns a BRICK-only SignaturePattern for the DamperSystem.

Returns:

A configured BRICK-only SignaturePattern object for the DamperSystem.

Return type:

SignaturePattern