Skip to content
RelativeTemperatureSensor.md

RelativeTemperatureSensor

Relative temperature sensor

Usage

RelativeTemperatureSensor()

Connectors

  • node_a - (Node)

  • node_b - (Node)

  • T_rel - This connector represents a real signal as an output from a component (RealOutput)

Behavior

T_rel(t)=node_b.T(t)+node_a.T(t)0=node_a.Q(t)0=node_b.Q(t)

Source

dyad
# Relative temperature sensor
component RelativeTemperatureSensor
  node_a = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_a", "x1": -100, "y1": 400, "x2": 100, "y2": 600}}
    }
  }]
  node_b = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_b", "x1": 900, "y1": 400, "x2": 1100, "y2": 600}}
    }
  }]
  # Relative temperature as output signal
  T_rel = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 400, "y1": 900, "x2": 600, "y2": 1100}}}}]
relations
  T_rel = node_a.T-node_b.T
  0 = node_a.Q
  0 = node_b.Q
end
Flattened Source
dyad
# Relative temperature sensor
component RelativeTemperatureSensor
  node_a = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_a", "x1": -100, "y1": 400, "x2": 100, "y2": 600}}
    }
  }]
  node_b = Node() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "node_b", "x1": 900, "y1": 400, "x2": 1100, "y2": 600}}
    }
  }]
  # Relative temperature as output signal
  T_rel = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 400, "y1": 900, "x2": 600, "y2": 1100}}}}]
relations
  T_rel = node_a.T-node_b.T
  0 = node_a.Q
  0 = node_b.Q
metadata {}
end


Test Cases

This is setup code, that must be run before each test case.

julia
using ThermalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(ThermalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/ThermalComponents/uOuoD/test/snapshots"
  • Examples

  • Experiments

  • Analyses