POLES
The poles of a linear time-invariant system are the roots of the denominator polynomial of its transfer function.
If the denominator is written as
a_n s^n + a_{n-1} s^{n-1} + \cdots + a_1 s + a_0 = 0
then the poles are the complex values of s that satisfy this equation. Pole locations determine whether the system is stable, oscillatory, slow, or fast. This wrapper returns the real and imaginary parts of the poles as a 2-row array.
Excel Usage
=POLES(sysdata)
sysdata(list[list], required): System data (numerator, denominator rows).
Returns (list[list]): A 2-row array: [Real, Imaginary].
Example 1: System poles
Inputs:
| sysdata |
|---|
| 1 |
| 1 |
Excel formula:
=POLES({1;1,2,1})
Expected output:
| Result | |
|---|---|
| -1 | -1 |
| 0 | 0 |
Python Code
Show Code
import control as ct
import numpy as np
def poles(sysdata):
"""
Compute the poles of a linear system.
See: https://python-control.readthedocs.io/en/latest/generated/control.poles.html
This example function is provided as-is without any representation of accuracy.
Args:
sysdata (list[list]): System data (numerator, denominator rows).
Returns:
list[list]: A 2-row array: [Real, Imaginary].
"""
try:
def flatten(x):
if x is None: return None
if not isinstance(x, list): return [float(x)]
res = []
for row in x:
if isinstance(row, list):
for v in row:
if v is not None and str(v).strip() != "":
res.append(float(v))
elif row is not None and str(row).strip() != "":
res.append(float(row))
return res if res else None
if not sysdata or len(sysdata) < 2:
return "Error: sysdata must contain numerator and denominator rows"
num = flatten(sysdata[0])
den = flatten(sysdata[1])
if not num or not den:
return "Error: Invalid numerator or denominator arrays"
sys = ct.tf(num, den)
p = ct.poles(sys)
if len(p) == 0:
return [[""], [""]]
return [
[float(value) for value in np.real(p)],
[float(value) for value in np.imag(p)],
]
except Exception as e:
return f"Error: {str(e)}"Online Calculator
System data (numerator, denominator rows).