Skip to content

Commit 1c7eb69

Browse files
authored
Merge pull request #229 from SciML/fb/init_siso
initialize all relevant variables for SISO
2 parents e901f57 + 9e9ce08 commit 1c7eb69

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Blocks/nonlinear.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Limit the range of a signal.
1818
"""
1919
@component function Limiter(; name, y_max, y_min = y_max > 0 ? -y_max : -Inf)
2020
@symcheck y_max y_min || throw(ArgumentError("`y_min` must be smaller than `y_max`"))
21-
@named siso = SISO()
21+
m = (y_max + y_min) / 2
22+
@named siso = SISO(u_start = m, y_start = m) # Default signals to center of saturation to minimize risk of saturation while linearizing etc.
2223
@unpack u, y = siso
2324
pars = @parameters y_max=y_max [description = "Maximum allowed output of Limiter $name"] y_min=y_min [
2425
description = "Minimum allowed output of Limiter $name",

src/Blocks/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Single input single output (SISO) continuous system block.
7474
y(t) = y_start, [description = "Output of SISO system"]
7575
end
7676
@components begin
77-
input = RealInput(u_start = 0.0)
78-
output = RealOutput(u_start = 0.0)
77+
input = RealInput(u_start = u_start)
78+
output = RealOutput(u_start = y_start)
7979
end
8080
@equations begin
8181
u ~ input.u

0 commit comments

Comments
 (0)