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