diff --git a/Project.toml b/Project.toml index 717d8b366..6bdfc03c7 100644 --- a/Project.toml +++ b/Project.toml @@ -13,7 +13,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" IfElse = "0.1" ModelingToolkit = "8" OffsetArrays = "1" -Symbolics = "0.1, 1, 2, 3, 4" +Symbolics = "4.9" julia = "1.6" [extras] diff --git a/src/Blocks/continuous.jl b/src/Blocks/continuous.jl index 96bee5f69..7cb858f7e 100644 --- a/src/Blocks/continuous.jl +++ b/src/Blocks/continuous.jl @@ -111,7 +111,7 @@ Critical damping corresponds to `d=1`, which yields the fastest step response wi # Parameters: - `k`: Gain -- `w`: Angular frequency +- `w`: [`rad/s`] Angular frequency - `d`: Damping - `x_start`: Initial value of state (output) - `xd_start`: Initial value of derivative of state (output) @@ -438,7 +438,7 @@ function StateSpace(; A, B, C, D = nothing, x_start = zeros(size(A, 1)), name) end @named input = RealInput(nin = nu) @named output = RealOutput(nout = ny) - @variables x[1:nx](t) = x_start + @variables x(t)[1:nx] = x_start # pars = @parameters A=A B=B C=C D=D # This is buggy eqs = [ # FIXME: if array equations work [Differential(t)(x[i]) ~ sum(A[i, k] * x[k] for k in 1:nx) + diff --git a/src/Blocks/utils.jl b/src/Blocks/utils.jl index 97b676125..5fd6c32f3 100644 --- a/src/Blocks/utils.jl +++ b/src/Blocks/utils.jl @@ -2,7 +2,7 @@ if nin == 1 @variables u(t)=u_start [input = true] else - @variables u[1:nin](t)=u_start [input = true] + @variables u(t)[1:nin]=u_start [input = true] u = collect(u) end ODESystem(Equation[], t, [u...], []; name = name) @@ -24,7 +24,7 @@ Connector with one input signal of type Real. if nout == 1 @variables u(t)=u_start [output = true] else - @variables u[1:nout](t)=u_start [output = true] + @variables u(t)[1:nout]=u_start [output = true] u = collect(u) end ODESystem(Equation[], t, [u...], []; name = name) @@ -45,7 +45,7 @@ Connector with one output signal of type Real. """ SISO(;name, u_start=0.0, y_start=0.0) -Single Input Single Output continuous control block. +Single input single output (SISO) continuous system block. # Parameters: - `u_start`: Initial value for the input @@ -66,7 +66,7 @@ end """ MIMO(;name, nin=1, nout=1, u_start=zeros(nin), y_start=zeros(nout)) -Base class for a multiple Input multiple Output continuous control block. +Base class for a multiple input multiple output (MIMO) continuous system block. # Parameters: - `nin`: Input dimension @@ -78,8 +78,8 @@ function MIMO(; name, nin = 1, nout = 1, u_start = zeros(nin), y_start = zeros(n @named input = RealInput(nin = nin, u_start = u_start) @named output = RealOutput(nout = nout, u_start = y_start) @variables begin - u[1:nin](t) = u_start - y[1:nout](t) = y_start + u(t)[1:nin] = u_start + y(t)[1:nout] = y_start end eqs = [ [u[i] ~ input.u[i] for i in 1:nin]...,