@@ -237,15 +237,15 @@ Generate ramp signal.
237237 - `output`
238238"""
239239@component function Ramp (; name,
240- height = 1 ,
241- duration = 1 ,
242- offset = 0 ,
243- start_time = 0 ,
240+ height = 1.0 ,
241+ duration = 1.0 ,
242+ offset = 0.0 ,
243+ start_time = 0.0 ,
244244 smooth = false )
245245 @named output = RealOutput ()
246246 pars = @parameters offset= offset start_time= start_time height= height duration= duration
247247 equation = if smooth == false
248- offset + ifelse (t < start_time, 0 ,
248+ offset + ifelse (t < start_time, zero (height) ,
249249 ifelse (t < (start_time + duration), (t - start_time) * height / duration,
250250 height))
251251 else
@@ -320,20 +320,20 @@ Generate step signal.
320320
321321 - `output`
322322"""
323- @component function Step (; name, height = 1 , offset = 0 , start_time = 0 , duration = Inf ,
323+ @component function Step (; name, height = 1.0 , offset = 0.0 , start_time = 0. 0 , duration = Inf ,
324324 smooth = 1e-5 )
325325 @named output = RealOutput ()
326326 duration_numeric = duration
327327 pars = @parameters offset= offset start_time= start_time height= height duration= duration
328328 equation = if smooth == false # use comparison in case smooth is a float
329- offset + ifelse ((start_time < t) & (t < start_time + duration), height, 0 )
329+ offset + ifelse ((start_time < t) & (t < start_time + duration), height, zero (height) )
330330 else
331331 smooth === true && (smooth = 1e-5 )
332332 if duration_numeric == Inf
333333 smooth_step (t, smooth, height, offset, start_time)
334334 else
335335 smooth_step (t, smooth, height, offset, start_time) -
336- smooth_step (t, smooth, height, 0 , start_time + duration)
336+ smooth_step (t, smooth, height, zero (start_time) , start_time + duration)
337337 end
338338 end
339339
@@ -366,17 +366,17 @@ Exponentially damped sine signal.
366366"""
367367@component function ExpSine (; name,
368368 frequency,
369- amplitude = 1 ,
369+ amplitude = 1.0 ,
370370 damping = 0.1 ,
371- phase = 0 ,
372- offset = 0 ,
373- start_time = 0 ,
371+ phase = 0.0 ,
372+ offset = 0.0 ,
373+ start_time = 0.0 ,
374374 smooth = false )
375375 @named output = RealOutput ()
376376 pars = @parameters offset= offset start_time= start_time amplitude= amplitude frequency= frequency phase= phase damping= damping
377377
378378 equation = if smooth == false
379- offset + ifelse (t < start_time, 0 ,
379+ offset + ifelse (t < start_time, zero (amplitude) ,
380380 amplitude * exp (- damping * (t - start_time)) *
381381 sin (2 * pi * frequency * (t - start_time) + phase))
382382 else
0 commit comments