Skip to content

Commit 3091433

Browse files
albheimbaggepinnen
andauthored
Fix Simulator blocking non-zero D (#398)
* Remove assertion in Simulator blocking non-zero D * Update src/simulators.jl Co-authored-by: Fredrik Bagge Carlson <baggepinnen@gmail.com> * Update y in Simulator type Co-authored-by: Fredrik Bagge Carlson <baggepinnen@gmail.com>
1 parent 32bc1be commit 3091433

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/simulators.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ plot(t, s.y(sol, t)[:], lab="Open loop step response")
3838
"""
3939
function Simulator(P::AbstractStateSpace, u::F = (x,t) -> 0) where F
4040
@assert iscontinuous(P) "Simulator only supports continuous-time system. See function `lsim` for simulation of discrete-time systems."
41-
@assert all(P.D .== 0) "Can not simulate systems with direct term D != 0"
4241
f = (dx,x,p,t) -> dx .= P.A*x .+ P.B*u(x,t)
43-
y(x,t) = P.C*x #.+ P.D*u(x,t)
44-
y(sol::ODESolution,t) = P.C*sol(t)
42+
y(x,t) = P.C*x .+ P.D*u(x,t)
43+
y(sol::ODESolution,t) = P.C*sol(t) .+ P.D*u(sol(t),t)
4544
Simulator(P, f, y)
4645
end
4746

0 commit comments

Comments
 (0)