1
- @connector function RealInput (; name, nin = 1 , u_start = nin > 1 ? zeros (nin) : 0.0 )
2
- if nin == 1
1
+ @connector function RealInput (; name, nin = 1 , isarray = false , u_start = isarray ? zeros (nin) : 0.0 )
2
+ if nin == 1 && ! isarray
3
3
@variables u (t)= u_start [
4
4
input = true ,
5
5
description = " Inner variable in RealInput $name "
@@ -21,13 +21,14 @@ Connector with one input signal of type Real.
21
21
# Parameters:
22
22
- `nin=1`: Number of inputs
23
23
- `u_start=0`: Initial value for `u`
24
+ - `isarray=false`: This is only applicable for `nin=1`. Boolean flag to use a scalar or a one element symbolic vector
24
25
25
26
# States:
26
27
- `u`: Value of the connector; if nin=1 this is a scalar
27
28
""" RealInput
28
29
29
- @connector function RealOutput (; name, nout = 1 , u_start = nout > 1 ? zeros (nout) : 0.0 )
30
- if nout == 1
30
+ @connector function RealOutput (; name, nout = 1 , isarray = true , u_start = isarray ? zeros (nout) : 0.0 )
31
+ if nout == 1 && ! isarray
31
32
@variables u (t)= u_start [
32
33
output = true ,
33
34
description = " Inner variable in RealOutput $name "
@@ -49,6 +50,7 @@ Connector with one output signal of type Real.
49
50
# Parameters:
50
51
- `nout=1`: Number of outputs
51
52
- `u_start=0`: Initial value for `u`
53
+ - `isarray=false`: This is only applicable for `nout=1`. Boolean flag to use a scalar or a one element symbolic vector
52
54
53
55
# States:
54
56
- `u`: Value of the connector; if nout=1 this is a scalar
0 commit comments