Skip to content

Commit 97b123e

Browse files
committed
conditional define
1 parent 0317dde commit 97b123e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ControlSystemsMTK"
22
uuid = "687d7614-c7e5-45fc-bfc3-9ee385575c88"
33
authors = ["Fredrik Bagge Carlson"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
ControlSystemIdentification = "3abffc1c-5106-53b7-b354-a47bfc086282"

src/ode_system.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,13 @@ function RobustAndOptimalControl.named_ss(
231231
)
232232
end
233233

234-
function ModelingToolkit.get_disturbance_system(dist::ModelingToolkit.DisturbanceModel{<:LTISystem})
235-
ControlSystemsBase.issiso(dist.model) || error("Disturbance model must be SISO")
236-
Blocks.StateSpace(ssdata(ss(dist.model))..., name=dist.name)
234+
if isdefined(ModelingToolkit, :get_disturbance_system)
235+
function ModelingToolkit.get_disturbance_system(dist::ModelingToolkit.DisturbanceModel{<:LTISystem})
236+
ControlSystemsBase.issiso(dist.model) || error("Disturbance model must be SISO")
237+
Blocks.StateSpace(ssdata(ss(dist.model))..., name=dist.name)
238+
end
237239
end
238240

239-
240241
"""
241242
build_quadratic_cost_matrix(matrices::NamedTuple, ssys::ODESystem, costs::Vector{Pair})
242243

0 commit comments

Comments
 (0)