Cos Cos Icon

Mathematical.Cos

Cos

Computes the cosine of the input signal.

Description

Extends BlockComponents.SISO and computes the cosine function of the input signal u. Produces a real-valued output y = cos(u).

Variables

  • u: Input signal (in radians)
  • y: Output signal (cosine of input)

Examples

  • u = 0 → y = 1.0
  • u = π/2 → y = 0.0
  • u = π → y = -1.0
  • u = 2π → y = 1.0

This component extends from BlockComponents.SISO

Usage

PrimitiveComponents.Mathematical.Cos()

Connectors

  • u - This connector represents a real signal as an input to a component (RealInput)
  • y - This connector represents a real signal as an output from a component (RealOutput)

Behavior

\[ \begin{align} y\left( t \right) &= \cos\left( u\left( t \right) \right) \end{align} \]

Source

"""
    Cos

Computes the cosine of the input signal.

# Description
Extends BlockComponents.SISO and computes the cosine function of the input signal u.
Produces a real-valued output y = cos(u).

# Variables
- `u`: Input signal (in radians)
- `y`: Output signal (cosine of input)

# Examples
- u = 0      → y = 1.0
- u = π/2    → y = 0.0
- u = π      → y = -1.0
- u = 2π     → y = 1.0
"""
component Cos
  extends BlockComponents.SISO
relations
  y = cos(u)
metadata {
  "Dyad": {"labels": [{"label": "$(instance)", "x": 500, "y": 1100}]},
  "icons": {"default": "dyad://BlockComponents/Cos.svg"}
}
end
Flattened Source
"""
    Cos

Computes the cosine of the input signal.

# Description
Extends BlockComponents.SISO and computes the cosine function of the input signal u.
Produces a real-valued output y = cos(u).

# Variables
- `u`: Input signal (in radians)
- `y`: Output signal (cosine of input)

# Examples
- u = 0      → y = 1.0
- u = π/2    → y = 0.0
- u = π      → y = -1.0
- u = 2π     → y = 1.0
"""
component Cos
  "Input signal port"
  u = RealInput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0},
        "diagram": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      }
    }
  }
  "Output signal port"
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
        "diagram": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      }
    }
  }
relations
  y = cos(u)
metadata {
  "Dyad": {"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}]},
  "icons": {"default": "dyad://BlockComponents/Cos.svg"}
}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses