Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace numpy.poly1d with numpy.polynomial.Polynomial #350

Open
DeBruinJohan opened this issue Jun 12, 2019 · 0 comments
Open

Replace numpy.poly1d with numpy.polynomial.Polynomial #350

DeBruinJohan opened this issue Jun 12, 2019 · 0 comments

Comments

@DeBruinJohan
Copy link
Contributor

Johan de Bruin has attempted to solve this in 2019. His code did not pass the test. It was found that it is possible to rewrite the tf function to work with Polynomial, however numerous other functions in the repo are dependant on the coefficients of numerator and denominator of the fransferfunction. These numerators and denominators are both of type Polynomial and therefore their coefficients are given in the reverse order of that what is expected from the user, namely in increasing order of powers instead of decreasing order, as poly1d gives it. The transfer function can be made to display in decreasing order and takes inputs in decreasing order, however is no obvious way to ensure that the call tf.numerator.coef() would return the values in decreasing order. A possible solution to this would be to replace all instances of tf.numerator.coef with tf.numerator.coef[::-1], however this will cause confusion to anyone who wants code further on it.

His code can be found on the "Polynomial" branch of https://github.com/DeBruinJohan/Skogestad-Python/tree/Polynomial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant