@@ -140,16 +140,32 @@ function pade(τ::Real, N::Int)
140140 return tf (_linscale (Q, - τ), _linscale (Q, τ)) # return Q(-τs)/Q(τs)
141141end
142142
143+ # Pade approximation with different degree in numerator and denominator
144+ """
145+ pade(τ::Real, N_num::Int, N_den::Int)
146+
147+ Compute the Padé approximation of a time-delay of length `τ` with `N_num` and `N_den` degrees in the numerator and denominator, respectively.
148+ """
149+ function pade (τ:: Real , m:: Int , n:: Int )
150+ p = [(- 1 )^ i * binomial (m, i) * factorial (m+ n- i) / factorial (m+ n)
151+ for i in 0 : m] |> Polynomials. Polynomial
152+
153+ q = [binomial (n, i) * factorial (m+ n- i) / factorial (m+ n)
154+ for i in 0 : n] |> Polynomials. Polynomial
155+
156+ return tf (_linscale (p, τ), _linscale (q, τ))
157+ end
158+
143159
144160"""
145161 pade(G::DelayLtiSystem, N)
146162
147163Approximate all time-delays in `G` by Padé approximations of degree `N`.
148164"""
149- function pade (G:: DelayLtiSystem , N)
165+ function pade (G:: DelayLtiSystem , N, args ... )
150166 ny, nu = size (G)
151167 nTau = length (G. Tau)
152- X = append (ss (pade (τ,N)) for τ in G. Tau) # Perhaps append should be renamed blockdiag
168+ X = append (ss (pade (τ,N,args ... )) for τ in G. Tau) # Perhaps append should be renamed blockdiag
153169 return lft (G. P. P, X)
154170end
155171
0 commit comments