Skip to content

Commit 8276b01

Browse files
fix: revert SISO to function syntax instead of mtkmodel syntax
1 parent 27246f0 commit 8276b01

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/Blocks/utils.jl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,24 @@ Single input single output (SISO) continuous system block.
6868
- `u_start`: Initial value for the input
6969
- `y_start`: Initial value for the output
7070
"""
71-
@mtkmodel SISO begin
72-
@parameters begin
73-
u_start = 0.0
74-
y_start = 0.0
71+
@component function SISO(; name, u_start = 0.0, y_start = 0.0)
72+
pars = @parameters begin
73+
u_start = u_start
74+
y_start = y_start
7575
end
76-
@variables begin
76+
vars = @variables begin
7777
u(t), [guess = u_start, description = "Input of SISO system"]
7878
y(t), [guess = y_start, description = "Output of SISO system"]
7979
end
80-
@components begin
81-
input = RealInput(u_start = u_start)
82-
output = RealOutput(u_start = y_start)
83-
end
84-
@equations begin
80+
81+
@named input = RealInput(u_start = u_start)
82+
@named output = RealOutput(u_start = y_start)
83+
84+
eqs = [
8585
u ~ input.u
8686
y ~ output.u
87-
end
87+
]
88+
return ODESystem(eqs, t, vars, pars; name = name, systems = [input, output])
8889
end
8990

9091
"""

0 commit comments

Comments
 (0)