IfLiftBug IfLiftBug Icon

Examples.IfLiftBug

This component shows some bugs in MTK's IfLifting pass. Run this with IfLifting=true and =false as a parameter to TransientAnalysis.

Usage

DiscreteComponents.Examples.IfLiftBug(freq=1.0)

Parameters:

NameDescriptionUnitsDefault value
freq1

Variables

NameDescriptionUnits
x

Behavior

Behavior of this component cannot be rendered because it includes path variables.

Source

"""
This component shows some bugs in MTK's IfLifting pass.
Run this with `IfLifting=true` and `=false` as a parameter
to TransientAnalysis.
"""
example component IfLiftBug
  parameter freq::Real = 1.0
  variable x::Real
relations
  initial x = 0.0
  der(x) = ifelse(sin(2 * pi * freq * time) > 0, 2, 0)
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
"""
This component shows some bugs in MTK's IfLifting pass.
Run this with `IfLifting=true` and `=false` as a parameter
to TransientAnalysis.
"""
example component IfLiftBug
  parameter freq::Real = 1.0
  variable x::Real
relations
  initial x = 0.0
  der(x) = ifelse(sin(2 * pi * freq * time) > 0, 2, 0)
metadata {"Dyad": {"doc": {"behavior": false}}}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses