Skip to content

Commit cee69ed

Browse files
author
Brad Carman
committed
added old MatrixGain definition for comparison
1 parent e56de20 commit cee69ed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/split_parameters.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ x_costs = [
137137
model.inertia2.phi => 1.
138138
]
139139
L = randn(1,4) # Post-multiply by `C` to get the correct input to the controller
140+
141+
# This old definition of MatrixGain will work because the parameter space does not include K (an Array term)
142+
# @component function MatrixGainAlt(K::AbstractArray; name)
143+
# nout, nin = size(K, 1), size(K, 2)
144+
# @named input = RealInput(; nin = nin)
145+
# @named output = RealOutput(; nout = nout)
146+
# eqs = [output.u[i] ~ sum(K[i, j] * input.u[j] for j in 1:nin) for i in 1:nout]
147+
# compose(ODESystem(eqs, t, [], []; name = name), [input, output])
148+
# end
149+
140150
@named state_feedback = MatrixGain(K=-L) # Build negative feedback into the feedback matrix
141151
@named add = Add(;k1=1., k2=1.) # To add the control signal and the disturbance
142152

0 commit comments

Comments
 (0)