RoadData
IconRoadData
Usage
RoadData(bump=0.2, freq=0.5, offset=0.4, loop=10)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
bump | – | 0.2 | |
freq | – | 0.5 | |
offset | – | 0.4 | |
loop | – | 10 |
Connectors
y
- This connector represents a real signal as an output from a component (RealOutput
)
Behavior
\[ \begin{align} y\left( t \right) &= ifelse\left( rem\left( t, \mathtt{loop} \right) < \mathtt{offset}, 0, ifelse\left( - \mathtt{offset} + rem\left( t, \mathtt{loop} \right) > \mathtt{freq}, 0, \mathtt{bump} \left( 1 - \cos\left( \frac{6.2832 \left( - \mathtt{offset} + t \right)}{\mathtt{freq}} \right) \right) \right) \right) \end{align} \]
Source
component RoadData
y = RealOutput() [{
"JuliaSim": {
"placement": {"icon": {"iconName": "output", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
}
}]
parameter bump::Real = 0.2
parameter freq::Real = 0.5
parameter offset::Real = 0.4
parameter loop::Real = 10
relations
y = if (time%loop)<offset then 0.0 else if (time%loop)-offset>freq then 0.0 else bump*(1-cos(2*π*(time-offset)/freq))
metadata {
"JuliaSim": {"icons": {"default": "jsml://JuliaSimExampleComponents/road_data.svg"}}
}
end
Flattened Source
component RoadData y = RealOutput() [{ "JuliaSim": { "placement": {"icon": {"iconName": "output", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}} } }] parameter bump::Real = 0.2 parameter freq::Real = 0.5 parameter offset::Real = 0.4 parameter loop::Real = 10 relations y = if (time%loop)freq then 0.0 else bump*(1-cos(2*π*(time-offset)/freq)) metadata { "JuliaSim": {"icons": {"default": "jsml://JuliaSimExampleComponents/road_data.svg"}} } end
Test Cases
Related
- Examples
- Experiments
- Analyses