Skip to content

Commit

Permalink
return empty input for OutputData
Browse files Browse the repository at this point in the history
this allows it to be used for nonlinear estimation with no inputs
  • Loading branch information
baggepinnen committed Nov 28, 2024
1 parent 4b86524 commit 8398659
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ iddata(res::ControlSystemsBase.SimResult) = iddata(res.y, res.u, res.t[2]-res.t[

output(d::AbstractIdData) = d.y
input(d::AbstractIdData) = d.u
input(d::OutputData) = fill(eltype(d.y)[], length(d)) # Return empty input array
LowLevelParticleFilters.state(d::AbstractIdData) = d.x
output(d::AbstractArray) = d
input(d::AbstractArray) = d
Expand Down
1 change: 1 addition & 0 deletions test/test_iddata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ using ControlSystemIdentification: Sec
@test d isa ControlSystemIdentification.OutputData
@test length(d) == T
@test output(d) == y
@test length(input(d)) == T
@test !hasinput(d)
@test ControlSystemIdentification.time2(y) == y
@test sampletime(d) == 1
Expand Down

0 comments on commit 8398659

Please sign in to comment.