Skip to content

Commit 96a92f8

Browse files
committed
only adjust phase for rational systems
1 parent 836c11c commit 96a92f8

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

lib/ControlSystemsBase/src/plotting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ end
329329
end
330330
plotphase || continue
331331

332-
if adjust_phase_start == true
332+
if adjust_phase_start == true && isrational(sbal)
333333
intexcess = integrator_excess(sbal)
334334
if intexcess != 0
335335
# Snap phase so that it starts at -90*intexcess

lib/ControlSystemsBase/src/types/Lti.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
abstract type LTISystem{TE<:TimeEvolution} <: AbstractSystem end
2+
isrational(sys::LTISystem) = false
23
+(sys1::LTISystem, sys2::LTISystem) = +(promote(sys1, sys2)...)
34
-(sys1::LTISystem, sys2::LTISystem) = -(promote(sys1, sys2)...)
45
function *(sys1::LTISystem, sys2::LTISystem)

lib/ControlSystemsBase/src/types/StateSpace.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ function isstable(sys::StateSpace{<:Discrete, <:ForwardDiff.Dual})
234234
all(abs.(ForwardDiff.value.(sys.A)) .< 1)
235235
end
236236

237+
isrational(::AbstractStateSpace) = true
237238

238239
#####################################################################
239240
## Math Operators ##

lib/ControlSystemsBase/src/types/TransferFunction.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ function isproper(G::TransferFunction)
9898
return all(isproper(f) for f in G.matrix)
9999
end
100100

101+
isrational(::TransferFunction) = true
102+
101103
#####################################################################
102104
## Math Operators ##
103105
#####################################################################

0 commit comments

Comments
 (0)