33#
44# Author: Sawyer Fuller
55# Date: 26 Aug 2010
6- #
6+ #
77# This file contains functions for implementing time delays (currently
88# only the pade() function).
99#
1616#
1717# 1. Redistributions of source code must retain the above copyright
1818# notice, this list of conditions and the following disclaimer.
19- #
19+ #
2020# 2. Redistributions in binary form must reproduce the above copyright
2121# notice, this list of conditions and the following disclaimer in the
2222# documentation and/or other materials provided with the distribution.
23- #
23+ #
2424# 3. Neither the name of the California Institute of Technology nor
2525# the names of its contributors may be used to endorse or promote
2626# products derived from this software without specific prior
2727# written permission.
28- #
28+ #
2929# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3030# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3131# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
3838# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
3939# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4040# SUCH DAMAGE.
41- #
41+ #
4242# $Id$
4343
4444# Python 3 compatability (needs to go here)
4545from __future__ import print_function
4646
4747def pade (T , n = 1 ):
48- """
48+ """
4949 Create a linear system that approximates a delay.
50-
50+
5151 Return the numerator and denominator coefficients of the Pade approximation.
52-
52+
5353 Parameters
5454 ----------
5555 T : number
5656 time delay
5757 n : integer
5858 order of approximation
59-
59+
6060 Returns
61- -------
61+ -------
6262 num, den : array
6363 Polynomial coefficients of the delay model, in descending powers of s.
64-
64+
6565 Notes
6666 -----
6767 Based on an algorithm in Golub and van Loan, "Matrix Computation" 3rd.
@@ -79,7 +79,7 @@ def pade(T, n=1):
7979 for k in range (1 , n + 1 ):
8080 c = T * c * (n - k + 1 )/ (2 * n - k + 1 )/ k
8181 num [n - k ] = c * (- 1 )** k
82- den [n - k ] = c
82+ den [n - k ] = c
8383 num = [coeff / den [0 ] for coeff in num ]
8484 den = [coeff / den [0 ] for coeff in den ]
85- return num , den
85+ return num , den
0 commit comments