- Notifications
You must be signed in to change notification settings - Fork441
Description
The following snippet
importcontrolasctrlG=ctrl.tf(1, [1,1])t,y=ctrl.step_response(G)
executed under Python 3.5.4 withSciPy 1.0, NumPy 1.13.3 and python-control 0.7 andSlyCot NOT installed fails to run.
After investigation it turns out that the problem arrises in the filestatesp.py
, function_convertToStateSpace
line 641: python-control tries to solve the problem using SlyCot. Since SlyCot is not found, it falls back to theImportError
handling in which the SciPy'slti
is called:
lti_sys=lti(squeeze(sys.num),squeeze(sys.den))returnStateSpace(lti_sys.A,lti_sys.B,lti_sys.C,lti_sys.D,sys.dt)
In SciyPy versions PRIOR to 1.0 the lti_sys object had the attributes A, B, C, D. However, in SciPy 1.0 these attributes have been removed. Hence, the code fails to execute.
Possible workaround would be (runs using SciPy 0.19 and 1.0):
fromscipy.signalimporttf2ssA,B,C,D=tf2ss(squeeze(sys.num),squeeze(sys.den))returnStateSpace(A,B,C,D,sys.dt)
What do you think? Since many Windows user do not have Slycot available by default it would be nice to get this fixed.
Jan