Skip to content

Commit a8bb688

Browse files
fixes Symbolics deprecation (#99)
1 parent 472098d commit a8bb688

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1313
IfElse = "0.1"
1414
ModelingToolkit = "8"
1515
OffsetArrays = "1"
16-
Symbolics = "0.1, 1, 2, 3, 4"
16+
Symbolics = "4.9"
1717
julia = "1.6"
1818

1919
[extras]

src/Blocks/continuous.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Critical damping corresponds to `d=1`, which yields the fastest step response wi
111111
112112
# Parameters:
113113
- `k`: Gain
114-
- `w`: Angular frequency
114+
- `w`: [`rad/s`] Angular frequency
115115
- `d`: Damping
116116
- `x_start`: Initial value of state (output)
117117
- `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)
438438
end
439439
@named input = RealInput(nin = nu)
440440
@named output = RealOutput(nout = ny)
441-
@variables x[1:nx](t) = x_start
441+
@variables x(t)[1:nx] = x_start
442442
# pars = @parameters A=A B=B C=C D=D # This is buggy
443443
eqs = [ # FIXME: if array equations work
444444
[Differential(t)(x[i]) ~ sum(A[i, k] * x[k] for k in 1:nx) +

src/Blocks/utils.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if nin == 1
33
@variables u(t)=u_start [input = true]
44
else
5-
@variables u[1:nin](t)=u_start [input = true]
5+
@variables u(t)[1:nin]=u_start [input = true]
66
u = collect(u)
77
end
88
ODESystem(Equation[], t, [u...], []; name = name)
@@ -24,7 +24,7 @@ Connector with one input signal of type Real.
2424
if nout == 1
2525
@variables u(t)=u_start [output = true]
2626
else
27-
@variables u[1:nout](t)=u_start [output = true]
27+
@variables u(t)[1:nout]=u_start [output = true]
2828
u = collect(u)
2929
end
3030
ODESystem(Equation[], t, [u...], []; name = name)
@@ -45,7 +45,7 @@ Connector with one output signal of type Real.
4545
"""
4646
SISO(;name, u_start=0.0, y_start=0.0)
4747
48-
Single Input Single Output continuous control block.
48+
Single input single output (SISO) continuous system block.
4949
5050
# Parameters:
5151
- `u_start`: Initial value for the input
@@ -66,7 +66,7 @@ end
6666
"""
6767
MIMO(;name, nin=1, nout=1, u_start=zeros(nin), y_start=zeros(nout))
6868
69-
Base class for a multiple Input multiple Output continuous control block.
69+
Base class for a multiple input multiple output (MIMO) continuous system block.
7070
7171
# Parameters:
7272
- `nin`: Input dimension
@@ -78,8 +78,8 @@ function MIMO(; name, nin = 1, nout = 1, u_start = zeros(nin), y_start = zeros(n
7878
@named input = RealInput(nin = nin, u_start = u_start)
7979
@named output = RealOutput(nout = nout, u_start = y_start)
8080
@variables begin
81-
u[1:nin](t) = u_start
82-
y[1:nout](t) = y_start
81+
u(t)[1:nin] = u_start
82+
y(t)[1:nout] = y_start
8383
end
8484
eqs = [
8585
[u[i] ~ input.u[i] for i in 1:nin]...,

0 commit comments

Comments
 (0)