@@ -52,7 +52,7 @@ A smaller `T` leads to a more ideal approximation of the derivative.
5252 - `output`
5353"""
5454@component function Derivative (; name, k = 1 , T, x_start = 0.0 )
55- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
55+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
5656 @named siso = SISO ()
5757 @unpack u, y = siso
5858 sts = @variables x (t)= x_start [description = " State of Derivative $name " ]
@@ -98,7 +98,7 @@ sT + 1 - k
9898See also [`SecondOrder`](@ref)
9999"""
100100@component function FirstOrder (; name, k = 1 , T, x_start = 0.0 , lowpass = true )
101- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
101+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
102102 @named siso = SISO ()
103103 @unpack u, y = siso
104104 sts = @variables x (t)= x_start [description = " State of FirstOrder filter $name " ]
@@ -171,7 +171,7 @@ Textbook version of a PI-controller without actuator saturation and anti-windup
171171See also [`LimPI`](@ref)
172172"""
173173@component function PI (; name, k = 1 , T, x_start = 0.0 )
174- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
174+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
175175 @named err_input = RealInput () # control error
176176 @named ctr_output = RealOutput () # control signal
177177 @named gainPI = Gain (k)
@@ -282,9 +282,10 @@ Text-book version of a PI-controller with actuator saturation and anti-windup me
282282 - `ctr_output`
283283"""
284284@component function LimPI (; name, k = 1 , T, u_max, u_min = - u_max, Ta, x_start = 0.0 )
285- Ta > 0 || throw (ArgumentError (" Time constant `Ta` has to be strictly positive" ))
286- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
287- u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
285+ @symcheck Ta > 0 ||
286+ throw (ArgumentError (" Time constant `Ta` has to be strictly positive" ))
287+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
288+ @symcheck u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
288289 @named err_input = RealInput () # control error
289290 @named ctr_output = RealOutput () # control signal
290291 @named gainPI = Gain (k)
@@ -367,8 +368,9 @@ where the transfer function for the derivative includes additional filtering, se
367368 (Ti ≥ 0 || throw (ArgumentError (" Ti out of bounds, got $(Ti) but expected Ti ≥ 0" )))
368369 ! isequal (Td, false ) &&
369370 (Td ≥ 0 || throw (ArgumentError (" Td out of bounds, got $(Td) but expected Td ≥ 0" )))
370- u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
371- Nd > 0 || throw (ArgumentError (" Nd out of bounds, got $(Nd) but expected Nd > 0" ))
371+ @symcheck u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
372+ @symcheck Nd > 0 ||
373+ throw (ArgumentError (" Nd out of bounds, got $(Nd) but expected Nd > 0" ))
372374
373375 @named reference = RealInput ()
374376 @named measurement = RealInput ()
0 commit comments