Hi,
I’m trying to build a multi-input multi-output control system using ModelingToolkit and the ModelingToolkitStandardLibrary. I’ve come to the Integrator block and I can’t figure out how to configure it for a vector input.
For a minimum example (size 2, although later on I’ll be using larger size), you can see the code below:
using ModelingToolkit, DifferentialEquations, Plots
using ModelingToolkit: t_nounits as t, D_nounits as D
using ModelingToolkitStandardLibrary.Blocks: MatrixGain, Add, StateSpace, Integrator
using LinearAlgebra
@named int = Integrator(k=1.0I(2),x = [0.0, 0.0])
@named p = StateSpace(A = -1.0I(2), B=1.0I(2), C=1.0I(2), D = zeros(2,2))
@named Kfb = MatrixGain(K=zeros(2,4))
@named add1 = Add()
connections = [
[Kfb.input.u[i] ~ p.x[i] for i in 1:2]
[Kfb.input.u[i+2] ~ int.y[i] for i in 1:2]
[p.u[i] ~ Kfb.output.u[i] for i in 1:2]
[int.u[i] ~ 1-p.y[i] for i in 1:2]
]
But i get an error: ERROR: TypeError: in keyword argument x, expected Union{Nothing, Real}, got a value of type Vector{Float64}
Can somebody help me out?
Thank you!