Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
control.margin() Floating point versus integer difference #462
Comments
|
This apparently has been fixed in the current master branch.
python-control 0.8.4 is around the corner (#451). |
When running the margin command on Version 0.8.3, the numerator data type impacts the returned results.
Minimum Working Example: The transfer functions appear identical as expected, but the margin results for the integer are wrong.
import control as ctrl
num = 50000 # Integer
num2 = 50000.
den = [1, 88., 3840., 25600.]
print(ctrl.margin(ctrl.tf(num,den)))
print(ctrl.margin(ctrl.tf(num2,den)))
Returned Results:
(6.2464, inf, 61.96773353931867, nan)
(6.2464, 101.32058351824355, 61.96773353931867, 13.393128802072123)
PS: Huge fan of this effort. I have been teaching a 4xx level course in Controls using Python for three years now and truly appreciate the efforts made (Control Library & Slycot)