|
From: Ryan K. <rk...@si...> - 2013-06-06 18:47:22
|
I would like to submit some minor patches over the course of the summer to
help me completely get rid of my old controls module and switch over to
python-control for everything. My most immediate need is for a __call__
method. This method might not make any sense for a state-space system, but
for certain aspects of my modeling work, I need to evaluate transfer
functions at certain numerical values of s.
I would propose something like this:
def __call__(self, s):
"""Evaluate a transfer function at s."""
N_poly = poly1d(squeeze(self.num))
D_poly = poly1d(squeeze(self.den))
return N_poly(s)/D_poly(s)
It could also include a check that self is SISO and possibly throw an
exception if it is not (pretty sure that poly1d will throw one if we pass
in a vector of coefficients that isn't 1d).
Would this be welcome? Is there anything I should tweak?
Thanks,
Ryan
--
Ryan Krauss, Ph.D.
Associate Professor
Mechanical Engineering
Southern Illinois University Edwardsville
|