1- @connector function RealInput (; name, nin = 1 , u_start = nin > 1 ? zeros (nin) : 0.0 )
1+ @connector function RealInput (;
2+ name, nin = 1 , u_start = nothing , guess = nin > 1 ? zeros (nin) : 0.0 )
23 nin > 1 && @warn " For inputs greater than one, use `RealInputArray`."
4+ if u_start != = nothing
5+ Base. depwarn (
6+ " The keyword argument `u_start` is deprecated. Use `guess` instead." , :u_start )
7+ guess = u_start
8+ end
39 if nin == 1
410 @variables u (t) [
511 input = true ,
1117 description = " Inner variable in RealInput $name "
1218 ]
1319 end
14- ODESystem (Equation[], t, [u], []; name = name, guesses = [u => u_start ])
20+ ODESystem (Equation[], t, [u], []; name = name, guesses = [u => guess ])
1521end
1622@doc """
17- RealInput(;name, u_start )
23+ RealInput(;name, guess )
1824
1925Connector with one input signal of type Real.
2026
2127# Parameters:
22- - `u_start =0`: Guess value for `u`.
28+ - `guess =0`: Guess value for `u`.
2329
2430# States:
2531- `u`: Value of the connector which is a scalar.
2632""" RealInput
2733
28- @connector function RealInputArray (; name, nin, u_start = zeros (nin))
34+ @connector function RealInputArray (; name, nin, u_start = nothing , guess = zeros (nin))
35+ if u_start != = nothing
36+ Base. depwarn (
37+ " The keyword argument `u_start` is deprecated. Use `guess` instead." , :u_start )
38+ guess = u_start
39+ end
2940 @variables u (t)[1 : nin] [
3041 input = true ,
3142 description = " Inner variable in RealInputArray $name "
3243 ]
33- ODESystem (Equation[], t, [u], []; name = name, guesses = [u => u_start ])
44+ ODESystem (Equation[], t, [u], []; name = name, guesses = [u => guess ])
3445end
3546@doc """
36- RealInputArray(;name, nin, u_start )
47+ RealInputArray(;name, nin, guess )
3748
3849Connector with an array of input signals of type Real.
3950
4051# Parameters:
4152- `nin`: Number of inputs.
42- - `u_start =zeros(nin)`: Guess value for `u`.
53+ - `guess =zeros(nin)`: Guess value for `u`.
4354
4455# States:
4556- `u`: Value of the connector which is an array.
4657""" RealInputArray
4758
48- @connector function RealOutput (; name, nout = 1 , u_start = nout > 1 ? zeros (nout) : 0.0 )
59+ @connector function RealOutput (;
60+ name, nout = 1 , u_start = nothing , guess = nout > 1 ? zeros (nout) : 0.0 )
4961 nout > 1 && @warn " For outputs greater than one, use `RealOutputArray`."
62+ if u_start != = nothing
63+ Base. depwarn (
64+ " The keyword argument `u_start` is deprecated. Use `guess` instead." , :u_start )
65+ guess = u_start
66+ end
5067 if nout == 1
5168 @variables u (t) [
5269 output = true ,
@@ -58,35 +75,40 @@ Connector with an array of input signals of type Real.
5875 description = " Inner variable in RealOutput $name "
5976 ]
6077 end
61- ODESystem (Equation[], t, [u], []; name = name, guesses = [u => u_start ])
78+ ODESystem (Equation[], t, [u], []; name = name, guesses = [u => guess ])
6279end
6380@doc """
64- RealOutput(;name, u_start )
81+ RealOutput(;name, guess )
6582
6683Connector with one output signal of type Real.
6784
6885# Parameters:
69- - `u_start =0`: Guess value for `u`.
86+ - `guess =0`: Guess value for `u`.
7087
7188# States:
7289- `u`: Value of the connector which is a scalar.
7390""" RealOutput
7491
75- @connector function RealOutputArray (; name, nout, u_start = zeros (nout))
92+ @connector function RealOutputArray (; name, nout, u_start = nothing , guess = zeros (nout))
93+ if u_start != = nothing
94+ Base. depwarn (
95+ " The keyword argument `u_start` is deprecated. Use `guess` instead." , :u_start )
96+ guess = u_start
97+ end
7698 @variables u (t)[1 : nout] [
7799 output = true ,
78100 description = " Inner variable in RealOutputArray $name "
79101 ]
80- ODESystem (Equation[], t, [u], []; name = name, guesses = [u => u_start ])
102+ ODESystem (Equation[], t, [u], []; name = name, guesses = [u => guess ])
81103end
82104@doc """
83- RealOutputArray(;name, nout, u_start )
105+ RealOutputArray(;name, nout, guess )
84106
85107Connector with an array of output signals of type Real.
86108
87109# Parameters:
88110- `nout`: Number of outputs.
89- - `u_start =zeros(nout)`: Guess value for `u`.
111+ - `guess =zeros(nout)`: Guess value for `u`.
90112
91113# States:
92114- `u`: Value of the connector which is an array.
@@ -112,8 +134,8 @@ Single input single output (SISO) continuous system block.
112134 y (t) = y_start, [description = " Output of SISO system" ]
113135 end
114136 @components begin
115- input = RealInput (u_start = u_start)
116- output = RealOutput (u_start = y_start)
137+ input = RealInput (guess = u_start)
138+ output = RealOutput (guess = y_start)
117139 end
118140 @equations begin
119141 u ~ input. u
@@ -135,8 +157,8 @@ Base class for a multiple input multiple output (MIMO) continuous system block.
135157"""
136158@component function MIMO (; name, nin = 1 , nout = 1 , u_start = zeros (nin),
137159 y_start = zeros (nout))
138- @named input = RealInput (nin = nin, u_start = u_start)
139- @named output = RealOutput (nout = nout, u_start = y_start)
160+ @named input = RealInput (nin = nin, guess = u_start)
161+ @named output = RealOutput (nout = nout, guess = y_start)
140162 @variables (u (t)[1 : nin]= u_start, [description = " Input of MIMO system $name " ],
141163 y (t)[1 : nout]= y_start, [description = " Output of MIMO system $name " ],)
142164 eqs = [
0 commit comments