Skip to content

Commit

Permalink
fix: revert SISO to function syntax instead of mtkmodel syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
avinashresearch1 committed Apr 12, 2024
1 parent 27246f0 commit 8276b01
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/Blocks/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,24 @@ Single input single output (SISO) continuous system block.
- `u_start`: Initial value for the input
- `y_start`: Initial value for the output
"""
@mtkmodel SISO begin
@parameters begin
u_start = 0.0
y_start = 0.0
@component function SISO(; name, u_start = 0.0, y_start = 0.0)
pars = @parameters begin
u_start = u_start
y_start = y_start

Check warning on line 74 in src/Blocks/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/Blocks/utils.jl#L71-L74

Added lines #L71 - L74 were not covered by tests
end
@variables begin
vars = @variables begin
u(t), [guess = u_start, description = "Input of SISO system"]
y(t), [guess = y_start, description = "Output of SISO system"]

Check warning on line 78 in src/Blocks/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/Blocks/utils.jl#L76-L78

Added lines #L76 - L78 were not covered by tests
end
@components begin
input = RealInput(u_start = u_start)
output = RealOutput(u_start = y_start)
end
@equations begin

@named input = RealInput(u_start = u_start)
@named output = RealOutput(u_start = y_start)

Check warning on line 82 in src/Blocks/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/Blocks/utils.jl#L81-L82

Added lines #L81 - L82 were not covered by tests

eqs = [

Check warning on line 84 in src/Blocks/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/Blocks/utils.jl#L84

Added line #L84 was not covered by tests
u ~ input.u
y ~ output.u
end
]
return ODESystem(eqs, t, vars, pars; name = name, systems = [input, output])

Check warning on line 88 in src/Blocks/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/Blocks/utils.jl#L88

Added line #L88 was not covered by tests
end

"""
Expand Down

0 comments on commit 8276b01

Please sign in to comment.