Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use RealI/OArray instead of RealI/O in more than one inputs/ouputs #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading