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:
| Name | Description | Units | Default value |
|---|---|---|---|
freq | – | 1 |
Variables
| Name | Description | Units |
|---|---|---|
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}}}
endTest Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses