Skip to content

Commit

Permalink
refactor: use RealI/O instead of RealI/OArray in more than one inputs…
Browse files Browse the repository at this point in the history
…/outputs
  • Loading branch information
sathvikbhagavan committed May 6, 2024
1 parent 3a8fb0a commit 4a80d7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Blocks/continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ linearized around the operating point `x₀, u₀`, we have `y0, u0 = h(x₀, u
else
size(D) == (ny, nu) || error("`D` has to be of dimension ($ny x $nu).")
end
@named input = RealInput(nin = nu)
@named output = RealOutput(nout = ny)
@named input = RealInputArray(nin = nu)
@named output = RealOutputArray(nout = ny)
@variables x(t)[1:nx]=x [
description = "State variables of StateSpace system $name"
]
Expand Down
6 changes: 3 additions & 3 deletions src/Blocks/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Output the product of a gain matrix with the input signal vector.
nin = size(K, 2)
end
@components begin
input = RealInput(; nin = nin)
output = RealOutput(; nout = nout)
input = RealInputArray(; nin = nin)
output = RealOutputArray(; nout = nout)
end
@equations begin
[output.u[i] ~ sum(K[i, j] * input.u[j] for j in 1:nin)
Expand All @@ -68,7 +68,7 @@ Input port dimension can be set with `input__nin`
"""
@mtkmodel Sum begin
@components begin
input = RealInput(; nin)
input = RealInputArray(; nin)
output = RealOutput()
end
@equations begin
Expand Down
4 changes: 2 additions & 2 deletions src/Blocks/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ Base class for a multiple input multiple output (MIMO) continuous system block.
"""
@component function MIMO(; name, nin = 1, nout = 1, u_start = zeros(nin),
y_start = zeros(nout))
@named input = RealInput(nin = nin, guess = u_start)
@named output = RealOutput(nout = nout, guess = y_start)
@named input = RealInputArray(nin = nin, guess = u_start)
@named output = RealOutputArray(nout = nout, guess = y_start)
@variables(u(t)[1:nin]=u_start, [description = "Input of MIMO system $name"],
y(t)[1:nout]=y_start, [description = "Output of MIMO system $name"],)
eqs = [
Expand Down

0 comments on commit 4a80d7d

Please sign in to comment.