|
From: Murray, R. M. <mu...@cd...> - 2019-08-30 06:16:34
|
Which version of python-control and slycot? I just ran against the latest master and slycot 0.3.4 and it didn’t generate an error.
-richard
> On 29 Aug 2019, at 11:04 , Ryan Krauss <kra...@gv...> wrote:
>
> I am trying to do a super basic step response for a first order TF and am getting an error I have never seen before. The notebook is attached, but here is the code and the error message:
>
> %matplotlib inline
> import matplotlib.pyplot as plt
> import numpy as np
> import control
> from numpy import sin, cos, tan, pi
> from control import TransferFunction as TF
>
> p = 30
>
> G = control.TransferFunction(p,[1,p])
> G
>
> control.step_response(G)
>
> ---------------------------------------------------------------------------
> ValueError
> Traceback (most recent call last)
>
> <ipython-input-7-7235fbf92fdd> in <module>()
> ----> 1 control.step_response(G)
>
>
>
> /usr/local/lib/python3.6/site-packages/control/timeresp.py in step_response(sys, T, X0, input, output, transpose, return_x)
> 450 >>> T, yout = step_response(sys, T, X0)
> 451
> """
>
> --> 452 sys = _get_ss_simo(sys, input, output)
> 453 if T is None:
> 454 if isctime(sys):
>
>
>
> /usr/local/lib/python3.6/site-packages/control/timeresp.py in _get_ss_simo(sys, input, output)
> 378 If input is not specified, select first input and
> issue warning
>
> 379
> """
>
> --> 380 sys_ss = _convertToStateSpace(sys)
> 381 if sys_ss.issiso():
> 382 return
> sys_ss
>
>
> /usr/local/lib/python3.6/site-packages/control/statesp.py in _convertToStateSpace(sys, **kw)
> 895 # transfer function to state space conversion now should work!
> 896
> ssout = td04ad('C', sys.inputs, sys.outputs,
>
> --> 897
> denorder, den, num, tol=0)
>
> 898
>
>
> 899 states = ssout[0]
>
>
>
> /usr/local/lib/python3.6/site-packages/slycot/transform.py in td04ad(rowcol, m, p, index, dcoeff, ucoeff, tol, ldwork)
> 446 e = ValueError(error_text)
> 447 e.info = out[-1]
> --> 448 raise
> e
>
> 449 if out[-1] > 0:
> 450 error_text = "The leading coefficient of a denominator polynomial is nearly zero; calculations would overflow; no state-space representation was calculated. ABS(DCOEFF("+str(out[-1])+",1))="+str(abs(dcoeff(out[-1],1)))+" is too small."
>
>
>
> ValueError: The following argument had an illegal value: dcoeff
>
> --
> Dr. Ryan Krauss
> Associate Professor
> Product Design and Manufacturing Engineering
> Grand Valley State University
> <illegeal_dcoeff.ipynb>_______________________________________________
> python-control-discuss mailing list
> pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/python-control-discuss
|