PartialYear partial model

Requirements.Examples.Elementary.ViolationStatistics.PartialYear  ยท source

Icon of PartialYear

A year of a room temperature against a comfort band, hourly output

Extends Modelica.Icons.Example

The plant of the year-long examples: a synthetic room temperature over a year (t = 0 is 1 January, 0:00), 22.5 °C + 3 K daily (peak at 15:00) + 2.5 K seasonal (peak in mid-July), optionally with a 10-minute ripple, through a first-order lag of 60 s for the room air, against within 20 °C and 26 °C, tolerance 1 K. It is too warm on summer afternoons and too cold on winter nights. The output interval is one hour, as is usual for an annual building simulation.

The lag is what a real room has, and it matters here: it gives the solver a state to control its error on. Without it the temperature is a plain expression, the solver takes steps of up to an hour, and a 10-minute ripple's dip across a band edge, or below the least margin so far, falls between two steps and is missed — by every event-based check, the check block's own included. ViolationStatistics sees what the solver resolves, no more.

Copyright © 2026 Model Based Innovation LLC. All rights reserved.

Parameters

NameTypeDescription
ripple parameterRealAmplitude of a 10-minute oscillation, as of a controller

Components and variables

NameTypeDescription
loadModelica.Blocks.Sources.RealExpressionTemperature the room is driven to, in degC: daily swing of 3 K peaking at 15:00, seasonal swing of 2.5 K peaking in mid-July
TModelica.Blocks.Continuous.FirstOrderRoom temperature in degC: the room air follows with a time constant of 60 s
alwaysRequirements.Sources.BooleanConstantCondition, always true
comfortRequirements.ChecksInFixedWindow.DuringThe room temperature shall stay within 20 degC and 26 degC, tolerance 1 K