You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(19) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(11) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
|
Feb
(113) |
Mar
(12) |
Apr
(27) |
May
(2) |
Jun
(16) |
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(3) |
Nov
(9) |
Dec
(2) |
2012 |
Jan
(5) |
Feb
(11) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(18) |
Nov
(18) |
Dec
|
2013 |
Jan
(4) |
Feb
(1) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(33) |
Jul
(2) |
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
|
Mar
(8) |
Apr
|
May
(3) |
Jun
(3) |
Jul
(9) |
Aug
(5) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
2020 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: Ryan K. <kra...@gv...> - 2021-09-27 17:56:58
|
I feel like the control.feedback help string only makes sense because most of us have seen the ascii art block diagram from Matlab's equivalent function. I created this using tikz (latex): https://drive.google.com/file/d/1DROc6SkJjx2kbKdKx3vhLSsgDnldjfUu/view?usp=sharing Is there any way to link something like that in the docstring? I am glad to tweak it and will likely keep a version on my google drive for the foreseeable future. Thanks, Ryan -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University |
From: Ryan K. <kra...@gv...> - 2021-09-07 01:32:50
|
Thanks for your thoughts. I will probably head in this direction of talking about different sine waves and compare their frequencies and fft plots and such. -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Mon, Sep 6, 2021 at 11:10 AM Clarence W. Rowley <cwr...@pr...> wrote: > Hi Ryan, > > This is something I've struggled with in my own teaching. I don't have a > great answer, but I'll tell you how I typically answer it. > > Students usually understand that, for a linear system, if the input is a > sinusoid at frequency w, then the output is a sinusoid at frequency w (and > the amplitude and phase are given by the transfer function G(iw)). > > It's true more generally that if the input is an exponential exp(st) then > the output is also an exponential G(s) exp(st), where G(s) is the transfer > function. This holds whether s is real or complex. So if s is real, you > just have an exponentially growing (or decaying) input, and the output is > also exponentially growing (or decaying) with a gain of G(s). And if s is > pure imaginary, then you are back to the case of sinusoids. > > Best regards, > Clancy > > ================== > > Clancy Rowley > > Professor, Mechanical and Aerospace Engineering > > Affiliated faculty, Program in Applied and Computational Math > > Princeton University > > On Sep 6, 2021, at 10:21 AM, Ryan Krauss <kra...@gv...> wrote: > > Not sure if this list is still active or if there is a good answer to > my question. I teach a junior level intro to dynamic systems course for > manufacturing engineers who don't take dynamics. There are some unique > challenges based on whether or not skipping dynamics indicates a lack of > conceptual understanding about more theoretical things. > > Every year I get questions like "what is s?" or "what is the frequency > domain?". They seem to want some kind of an analogy that is very concrete > (not abstract). I have tried various things. I think I can do a decent > job explaining the frequency domain from a fourier standpoint, but how do > you talk about the frequency domain when s has a real component (i.e. is > not purely imaginary like in Fourier analysis)? > > Any suggestions are welcome. > > Thanks, > Ryan > > -- > Dr. Ryan Krauss > Associate Professor > Product Design and Manufacturing Engineering > Grand Valley State University > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > |
From: Clarence W. R. <cwr...@pr...> - 2021-09-06 15:10:52
|
Hi Ryan, This is something I've struggled with in my own teaching. I don't have a great answer, but I'll tell you how I typically answer it. Students usually understand that, for a linear system, if the input is a sinusoid at frequency w, then the output is a sinusoid at frequency w (and the amplitude and phase are given by the transfer function G(iw)). It's true more generally that if the input is an exponential exp(st) then the output is also an exponential G(s) exp(st), where G(s) is the transfer function. This holds whether s is real or complex. So if s is real, you just have an exponentially growing (or decaying) input, and the output is also exponentially growing (or decaying) with a gain of G(s). And if s is pure imaginary, then you are back to the case of sinusoids. Best regards, Clancy ================== Clancy Rowley Professor, Mechanical and Aerospace Engineering Affiliated faculty, Program in Applied and Computational Math Princeton University On Sep 6, 2021, at 10:21 AM, Ryan Krauss <kra...@gv...<mailto:kra...@gv...>> wrote: Not sure if this list is still active or if there is a good answer to my question. I teach a junior level intro to dynamic systems course for manufacturing engineers who don't take dynamics. There are some unique challenges based on whether or not skipping dynamics indicates a lack of conceptual understanding about more theoretical things. Every year I get questions like "what is s?" or "what is the frequency domain?". They seem to want some kind of an analogy that is very concrete (not abstract). I have tried various things. I think I can do a decent job explaining the frequency domain from a fourier standpoint, but how do you talk about the frequency domain when s has a real component (i.e. is not purely imaginary like in Fourier analysis)? Any suggestions are welcome. Thanks, Ryan -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University _______________________________________________ python-control-discuss mailing list pyt...@li...<mailto:pyt...@li...> https://lists.sourceforge.net/lists/listinfo/python-control-discuss |
From: Ryan K. <kra...@gv...> - 2021-09-06 14:54:25
|
Not sure if this list is still active or if there is a good answer to my question. I teach a junior level intro to dynamic systems course for manufacturing engineers who don't take dynamics. There are some unique challenges based on whether or not skipping dynamics indicates a lack of conceptual understanding about more theoretical things. Every year I get questions like "what is s?" or "what is the frequency domain?". They seem to want some kind of an analogy that is very concrete (not abstract). I have tried various things. I think I can do a decent job explaining the frequency domain from a fourier standpoint, but how do you talk about the frequency domain when s has a real component (i.e. is not purely imaginary like in Fourier analysis)? Any suggestions are welcome. Thanks, Ryan -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University |
From: Murray, R. M. <mu...@cd...> - 2020-02-03 18:38:03
|
It would be nice to have the capability to specify a forbidden region and have that show up on the Nichols chart, but that doesn’t currently exist. If you (or someone else) would like to add it, that would be great. -richard > On 28 Jan 2020, at 10:57 , Patrick Dubus via python-control-discuss <pyt...@li...> wrote: > > Hello, > > I would like to know if you have foreseen to better identify the forbidden area into the black-Nichols chart as show into the attached file (bold line with closed loop gain at +2.3dB). > ALternatively, do you know how to proceed ? > > Thanks for your help and for this very interesting module. > > Patrick. > <abaque_blacknichols_margins.pdf>_______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss |
From: Patrick D. <pat...@la...> - 2020-01-28 18:57:57
|
Hello, I would like to know if you have foreseen to better identify the forbidden area into the black-Nichols chart as show into the attached file (bold line with closed loop gain at +2.3dB). ALternatively, do you know how to proceed ? Thanks for your help and for this very interesting module. Patrick. |
From: Ryan K. <kra...@gv...> - 2019-11-26 12:11:00
|
Looking closer at the traceback showed that the issue is that control.canonical_form returns a tuple rather than just the system. So, slicing the first thing out of the tuple solved my issue: sys = control.canonical_form(sys1,"observable")[0] -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Mon, Nov 25, 2019 at 3:29 PM Ryan Krauss <kra...@gv...> wrote: > I have a transfer function and I want to simulate its response to initial > conditions. Do to this correctly, I think I need to get to OCF so that I > understand the initial conditions of the states (if I thought about it, > maybe I could use C**-1 to find initial conditions for the states in any > form). control.canonical_form seems prefect: > > from control import TransferFunction as TF > > diff = TF([1,0],1) > wn = 1.1*2*pi > z = 0.03 > so_p = TF(wn,[1,2*z*wn,wn**2]) > p = 2*2*pi > pole = TF(p,[1,p]) > G = diff*so_p*pole > G > > sys1 = control.tf2ss(G) > sys = control.canonical_form(sys1,"observable") > > When I run that line, I see my desired C=[[1,0,0]] > > But when I try to run the initial_response method, I get an error: > > t, y_ol = control.initial_response(sys,t,X0=[100,0,0]) > > Failure to assume argument is matrix-like in _convertToStateSpace, result setting an array element with a sequence. > > ---------------------------------------------------------------------------TypeError Traceback (most recent call last)<ipython-input-13-9f800e97ff4d> in <module>()----> 1 t, y_ol = control.initial_response(sys,t,X0=[100,0,0],input=0,output=0) > /usr/local/lib/python3.6/site-packages/control/timeresp.py in initial_response(sys, T, X0, input, output, transpose, return_x) 619 >>> T, yout = initial_response(sys, T, X0) 620 """--> 621 sys = _get_ss_simo(sys, input, output) 622 623 # Create time and input vectors; checking is done in forced_response(...) > /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) 946 " _convertToStateSpace, result %s" % e) 947 --> 948 raise TypeError("Can't convert given type to StateSpace system.") 949 950 # TODO: add discrete time option > TypeError: Can't convert given type to StateSpace system. > > > It sounds like somehow control.initial_response doesn't recognize sys is > ss or that it is simo. > > Am I doing something wrong? How should I proceed? > > Thanks, > > Ryan > -- > Dr. Ryan Krauss > Associate Professor > Product Design and Manufacturing Engineering > Grand Valley State University > |
From: Ryan K. <kra...@gv...> - 2019-11-26 01:01:00
|
I have a transfer function and I want to simulate its response to initial conditions. Do to this correctly, I think I need to get to OCF so that I understand the initial conditions of the states (if I thought about it, maybe I could use C**-1 to find initial conditions for the states in any form). control.canonical_form seems prefect: from control import TransferFunction as TF diff = TF([1,0],1) wn = 1.1*2*pi z = 0.03 so_p = TF(wn,[1,2*z*wn,wn**2]) p = 2*2*pi pole = TF(p,[1,p]) G = diff*so_p*pole G sys1 = control.tf2ss(G) sys = control.canonical_form(sys1,"observable") When I run that line, I see my desired C=[[1,0,0]] But when I try to run the initial_response method, I get an error: t, y_ol = control.initial_response(sys,t,X0=[100,0,0]) Failure to assume argument is matrix-like in _convertToStateSpace, result setting an array element with a sequence. ---------------------------------------------------------------------------TypeError Traceback (most recent call last)<ipython-input-13-9f800e97ff4d> in <module>()----> 1 t, y_ol = control.initial_response(sys,t,X0=[100,0,0],input=0,output=0) /usr/local/lib/python3.6/site-packages/control/timeresp.py in initial_response(sys, T, X0, input, output, transpose, return_x) 619 >>> T, yout = initial_response(sys, T, X0) 620 """--> 621 sys = _get_ss_simo(sys, input, output) 622 623 # Create time and input vectors; checking is done in forced_response(...) /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) 946 " _convertToStateSpace, result %s" % e) 947 --> 948 raise TypeError("Can't convert given type to StateSpace system.") 949 950 # TODO: add discrete time option TypeError: Can't convert given type to StateSpace system. It sounds like somehow control.initial_response doesn't recognize sys is ss or that it is simo. Am I doing something wrong? How should I proceed? Thanks, Ryan -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University |
From: Ryan K. <kra...@gv...> - 2019-08-30 23:27:59
|
OK, my problem seems to be fixed. Documenting my fix here in case this helps someone in the future: - upgraded to Mac OSX 10.14, then again to 10.14.6 - I was doing this to install xcode, which I still have not been able to do because of disk space - manually downloaded the commandline tools for xcode and installed it - updated gcc via homebrew - this seems to have fixed an error from pip regarding gfortran - updated slycot via pip: Successfully installed slycot-0.3.5 Everything is now happy and I can evaluate the step response of an RC filter.... -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Fri, Aug 30, 2019 at 6:21 PM Ryan Krauss <kra...@gv...> wrote: > Good times. I have updated to 10.14.6. I have 39GB of free hard drive > space. But apparently this isn't enough to install xcode.............. > > -- > Dr. Ryan Krauss > Associate Professor > Product Design and Manufacturing Engineering > Grand Valley State University > > > On Fri, Aug 30, 2019 at 11:27 AM Ryan Krauss <kra...@gv...> wrote: > >> I guess I have to upgrade to OSX 10.14 to get xcode back...... >> >> This could take a minute..... >> >> -- >> Dr. Ryan Krauss >> Associate Professor >> Product Design and Manufacturing Engineering >> Grand Valley State University >> >> >> On Fri, Aug 30, 2019 at 11:26 AM Ryan Krauss <kra...@gv...> wrote: >> >>> I just ran a pip upgrade for the control module. I am running 0.8.2. >>> >>> I just tried upgrading slycot via pip. pip says I am currently running >>> 0.3.0. I tried to upgrade to 0.3.5 via pip, but I receive error messages >>> about gfortran and xcode. I am kind of surprised that I don't have them >>> both working. I will work on that. >>> >>> I am getting False for this variable: slycot.__SLYCOT_SETUP__ >>> >>> -- >>> Dr. Ryan Krauss >>> Associate Professor >>> Product Design and Manufacturing Engineering >>> Grand Valley State University >>> >>> >>> On Fri, Aug 30, 2019 at 2:16 AM Murray, Richard M. < >>> mu...@cd...> wrote: >>> >>>> 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 >>>> >>>> >>>> _______________________________________________ >>>> python-control-discuss mailing list >>>> pyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>>> >>> |
From: Ryan K. <kra...@gv...> - 2019-08-30 22:21:31
|
Good times. I have updated to 10.14.6. I have 39GB of free hard drive space. But apparently this isn't enough to install xcode.............. -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Fri, Aug 30, 2019 at 11:27 AM Ryan Krauss <kra...@gv...> wrote: > I guess I have to upgrade to OSX 10.14 to get xcode back...... > > This could take a minute..... > > -- > Dr. Ryan Krauss > Associate Professor > Product Design and Manufacturing Engineering > Grand Valley State University > > > On Fri, Aug 30, 2019 at 11:26 AM Ryan Krauss <kra...@gv...> wrote: > >> I just ran a pip upgrade for the control module. I am running 0.8.2. >> >> I just tried upgrading slycot via pip. pip says I am currently running >> 0.3.0. I tried to upgrade to 0.3.5 via pip, but I receive error messages >> about gfortran and xcode. I am kind of surprised that I don't have them >> both working. I will work on that. >> >> I am getting False for this variable: slycot.__SLYCOT_SETUP__ >> >> -- >> Dr. Ryan Krauss >> Associate Professor >> Product Design and Manufacturing Engineering >> Grand Valley State University >> >> >> On Fri, Aug 30, 2019 at 2:16 AM Murray, Richard M. < >> mu...@cd...> wrote: >> >>> 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 >>> >>> >>> _______________________________________________ >>> python-control-discuss mailing list >>> pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>> >> |
From: Ryan K. <kra...@gv...> - 2019-08-30 15:28:07
|
I guess I have to upgrade to OSX 10.14 to get xcode back...... This could take a minute..... -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Fri, Aug 30, 2019 at 11:26 AM Ryan Krauss <kra...@gv...> wrote: > I just ran a pip upgrade for the control module. I am running 0.8.2. > > I just tried upgrading slycot via pip. pip says I am currently running > 0.3.0. I tried to upgrade to 0.3.5 via pip, but I receive error messages > about gfortran and xcode. I am kind of surprised that I don't have them > both working. I will work on that. > > I am getting False for this variable: slycot.__SLYCOT_SETUP__ > > -- > Dr. Ryan Krauss > Associate Professor > Product Design and Manufacturing Engineering > Grand Valley State University > > > On Fri, Aug 30, 2019 at 2:16 AM Murray, Richard M. <mu...@cd...> > wrote: > >> 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 >> >> >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> > |
From: Ryan K. <kra...@gv...> - 2019-08-30 15:26:45
|
I just ran a pip upgrade for the control module. I am running 0.8.2. I just tried upgrading slycot via pip. pip says I am currently running 0.3.0. I tried to upgrade to 0.3.5 via pip, but I receive error messages about gfortran and xcode. I am kind of surprised that I don't have them both working. I will work on that. I am getting False for this variable: slycot.__SLYCOT_SETUP__ -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Fri, Aug 30, 2019 at 2:16 AM Murray, Richard M. <mu...@cd...> wrote: > 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 > > > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > |
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 |
From: Ryan K. <kra...@gv...> - 2019-08-30 01:28:36
|
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 |
From: Ryan K. <rya...@gm...> - 2018-06-28 11:11:04
|
Some guy is asking me questions about installing the control module based on trying to follow some controls related tutorial on my youtube channel. He says he is getting this message: Could not find a version that satisfies the requirement python-control <from versions: > He also says he is running windows 8.1 and anaconda. Any ideas why pip would fail to install python-control? Thanks, Ryan |
From: Ryan K. <rya...@gm...> - 2017-10-16 12:14:30
|
Sorry if this goes through twice. I accidentally sent it from my university account which is not part of the discussion group. I tried conda update conda conda install slycot and received a PackageNotFoundError Do I need to somehow enable a super recent version of Anaconda? The update supposedly put me at 4.3.27. On Wed, Oct 11, 2017 at 2:46 AM, Rene van Paassen <ren...@gm... > wrote: > Would it be an option to use anaconda? Then you can try the slycot I built > for anaconda just Monday (finally pulled this one off). > > The problem is deeper than just mingw; the later lapack versions > deprecated some functions; you need lapack (at least that is the only > option I have seen binary versions for Windows for), and an updated Slycot > to handle the incompatibilities > > Another option is Christoph Gohlke's python extension packages; that would > work for a regular Windows python http://www.lfd.uci.edu/ > ~gohlke/pythonlibs/ > > Without slycot you are mainly limited in state-space work, and I think it > would be annoying to work around that in a course. > > Success, > > René > > Op di 10 okt. 2017 om 18:06 schreef Ryan Krauss <rya...@gm...>: > >> I am not sure if this is still the official mailing list for >> python-control or not.... >> >> I am also resending this from what I think is my membership email for >> this list. >> >> I am getting ready to introduce state-space to an introductory (junior >> level) dynamic systms and control course. We really only need the basics >> (probably just step and forced response). Most of my students use windows >> and most of them are not great with computers. I just tried to do "pip >> install slycot" in a windows virtual machine and received an error message >> about the lack of fortran compiler. I can work on that, but I am pretty >> sure most of them can't handle MinGW. >> >> So, my main question is this: what will and what will not work without >> slycot for state-space simulations in python-control? >> >> Thanks, >> >> Ryan >> ------------------------------------------------------------ >> ------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______ >> _________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |
From: Ryan K. <kra...@gv...> - 2017-10-16 12:08:04
|
I tried conda update conda conda install slycot and received a PackageNotFoundError Do I need to somehow enable a super recent version of Anaconda? The update supposedly put me at 4.3.27. -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University On Wed, Oct 11, 2017 at 2:46 AM, Rene van Paassen <ren...@gm... > wrote: > Would it be an option to use anaconda? Then you can try the slycot I built > for anaconda just Monday (finally pulled this one off). > > The problem is deeper than just mingw; the later lapack versions > deprecated some functions; you need lapack (at least that is the only > option I have seen binary versions for Windows for), and an updated Slycot > to handle the incompatibilities > > Another option is Christoph Gohlke's python extension packages; that would > work for a regular Windows python http://www.lfd.uci.edu/ > ~gohlke/pythonlibs/ > > Without slycot you are mainly limited in state-space work, and I think it > would be annoying to work around that in a course. > > Success, > > René > > Op di 10 okt. 2017 om 18:06 schreef Ryan Krauss <rya...@gm...>: > >> I am not sure if this is still the official mailing list for >> python-control or not.... >> >> I am also resending this from what I think is my membership email for >> this list. >> >> I am getting ready to introduce state-space to an introductory (junior >> level) dynamic systms and control course. We really only need the basics >> (probably just step and forced response). Most of my students use windows >> and most of them are not great with computers. I just tried to do "pip >> install slycot" in a windows virtual machine and received an error message >> about the lack of fortran compiler. I can work on that, but I am pretty >> sure most of them can't handle MinGW. >> >> So, my main question is this: what will and what will not work without >> slycot for state-space simulations in python-control? >> >> Thanks, >> >> Ryan >> ------------------------------------------------------------ >> ------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______ >> _________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |
From: Rene v. P. <ren...@gm...> - 2017-10-11 06:46:29
|
Would it be an option to use anaconda? Then you can try the slycot I built for anaconda just Monday (finally pulled this one off). The problem is deeper than just mingw; the later lapack versions deprecated some functions; you need lapack (at least that is the only option I have seen binary versions for Windows for), and an updated Slycot to handle the incompatibilities Another option is Christoph Gohlke's python extension packages; that would work for a regular Windows python http://www.lfd.uci.edu/~gohlke/pythonlibs/ Without slycot you are mainly limited in state-space work, and I think it would be annoying to work around that in a course. Success, René Op di 10 okt. 2017 om 18:06 schreef Ryan Krauss <rya...@gm...>: > I am not sure if this is still the official mailing list for > python-control or not.... > > I am also resending this from what I think is my membership email for this > list. > > I am getting ready to introduce state-space to an introductory (junior > level) dynamic systms and control course. We really only need the basics > (probably just step and forced response). Most of my students use windows > and most of them are not great with computers. I just tried to do "pip > install slycot" in a windows virtual machine and received an error message > about the lack of fortran compiler. I can work on that, but I am pretty > sure most of them can't handle MinGW. > > So, my main question is this: what will and what will not work without > slycot for state-space simulations in python-control? > > Thanks, > > Ryan > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > |
From: Ryan K. <rya...@gm...> - 2017-10-10 14:54:27
|
I am not sure if this is still the official mailing list for python-control or not.... I am also resending this from what I think is my membership email for this list. I am getting ready to introduce state-space to an introductory (junior level) dynamic systms and control course. We really only need the basics (probably just step and forced response). Most of my students use windows and most of them are not great with computers. I just tried to do "pip install slycot" in a windows virtual machine and received an error message about the lack of fortran compiler. I can work on that, but I am pretty sure most of them can't handle MinGW. So, my main question is this: what will and what will not work without slycot for state-space simulations in python-control? Thanks, Ryan |
From: Ryan K. <kra...@gv...> - 2017-10-10 14:16:53
|
I am not sure if this is still the official mailing list for python-control or not.... I am getting ready to introduce state-space to an introductory (junior level) dynamic systms and control course. We really only need the basics (probably just step and forced response). Most of my students use windows and most of them are not great with computers. I just tried to do "pip install slycot" in a windows virtual machine and received an error message about the lack of fortran compiler. I can work on that, but I am pretty sure most of them can't handle MinGW. So, my main question is this: what will and what will not work without slycot for state-space simulations in python-control? Thanks, Ryan -- Dr. Ryan Krauss Associate Professor Product Design and Manufacturing Engineering Grand Valley State University |
From: Ryan K. <rk...@si...> - 2015-12-13 06:18:26
|
Thanks for the suggestion. -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Sat, Dec 5, 2015 at 12:47 PM, Richard Murray <mu...@cd...> wrote: > At one point in time we were doing the simulations in > control.forced_response differently, using the scipy.integrate.odeint() > function. A brief discussion is here: > > https://github.com/python-control/python-control/issues/48 > > plus look at the changes here > > > https://github.com/python-control/python-control/commit/d7d278ba6072fce1ef28402b7580ffa698424f76#diff-e216ba2d66c950242b1475a045e3cd33 > > So one other possibility, separate from you quick fix, would be to call > scipy.integrate.odeint(). > > > -richard > > On 4 Dec 15, at 13:21, Ryan Krauss <rk...@si...> wrote: > > Apparently I don't know which email list is subscribed. Sorry if this > comes through more than once. > > I am teaching a classical controls class for mechanical engineering > undergraduates. Up till now, I have tried to gloss over state-space. My > students need to do an initial condition simulation for a system that > includes actuator saturation. I have them do this by integrating for one > time step at a time using control.forced_response inside a for loop. We > are essentially doing a continuous time approximation of ZOH with the input > held constant for each time step. As the time step gets too large, sp. > linalg.expm has to use a higher order pade approximation and eventually > throws this error: > > ValueError Traceback (most recent call last) > > > /Users/rkrauss/git/python-control/zumo_PID_simulation_modified_ss.py in <module>() > > 103 t0 = dt*(i-1) > > 104 t1 = dt*i > > --> 105 > to, yo, xo = control.forced_response(G_int, [t0,t1], [v[i],v[i]], X0=X0) > > 106 X0 = xo[:,-1]#<-- save for next time through for loop > > 107 x[i] = squeeze(X0) > > > /Users/rkrauss/git/python-control/control/timeresp.pyc in forced_response(sys, > T, U, X0, transpose) > > 374 [np.zeros((n_inputs, n_states + 2 * > n_inputs))]]) > > 375 print('M=' + str(M)) > > --> 376 expM = sp.linalg.expm(M) > > 377 Ad = expM[:n_states, :n_states] > > 378 Bd1 = expM[:n_states, n_states+n_inputs:] > > > /usr/local/lib/python2.7/site-packages/scipy/linalg/matfuncs.pyc in expm(A, > q) > > 258 # Input checking and conversion is provided by > sparse.linalg.expm(). > > 259 import scipy.sparse.linalg > > --> 260 return scipy.sparse.linalg.expm(A) > > 261 > > 262 > > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in expm(A) > > 580 > > 581 """ > > --> 582 return _expm(A, use_exact_onenorm='auto') > > 583 > > 584 > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _expm(A, > use_exact_onenorm) > > 635 if structure == UPPER_TRIANGULAR: > > 636 # Invoke Code Fragment 2.1. > > --> 637 X = _fragment_2_1(X, h.A, s) > > 638 else: > > 639 # X = r_13(A)^(2^s) by repeated squaring. > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _fragment_2_1(X, > T, s) > > 753 exp_diag = np.exp(scale * diag_T) > > 754 for k in range(n): > > --> 755 X[k, k] = exp_diag[k] > > 756 > > 757 for i in range(s-1, -1, -1): > > > ValueError: setting an array element with a sequence. > > > This is probably ultimately a problem for the scipy people, but my > students' project is due in 6 days. Any suggestions to quickly get the > attached simulation code to work for 60Hz simulation, i.e. dt = 1.0/60? > > > Thanks, > > > Ryan > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > <kp_0_3_rotate_only_less_delay.csv><zumo_PID_simulation_modified_ss.py> > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple > OSs. > > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140_______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple > OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |
From: Richard M. <mu...@cd...> - 2015-12-05 18:47:18
|
At one point in time we were doing the simulations in control.forced_response differently, using the scipy.integrate.odeint() function. A brief discussion is here: https://github.com/python-control/python-control/issues/48 plus look at the changes here https://github.com/python-control/python-control/commit/d7d278ba6072fce1ef28402b7580ffa698424f76#diff-e216ba2d66c950242b1475a045e3cd33 So one other possibility, separate from you quick fix, would be to call scipy.integrate.odeint(). -richard > On 4 Dec 15, at 13:21, Ryan Krauss <rk...@si...> wrote: > > Apparently I don't know which email list is subscribed. Sorry if this comes through more than once. > > I am teaching a classical controls class for mechanical engineering undergraduates. Up till now, I have tried to gloss over state-space. My students need to do an initial condition simulation for a system that includes actuator saturation. I have them do this by integrating for one time step at a time using control.forced_response inside a for loop. We are essentially doing a continuous time approximation of ZOH with the input held constant for each time step. As the time step gets too large, sp.linalg.expm has to use a higher order pade approximation and eventually throws this error: > > ValueError Traceback (most recent call last) > > /Users/rkrauss/git/python-control/zumo_PID_simulation_modified_ss.py in <module>() > > 103 t0 = dt*(i-1) > > 104 t1 = dt*i > > --> 105 to, yo, xo = control.forced_response(G_int, [t0,t1], [v[i],v[i]], X0=X0) > > 106 X0 = xo[:,-1]#<-- save for next time through for loop > > 107 x[i] = squeeze(X0) > > > > /Users/rkrauss/git/python-control/control/timeresp.pyc in forced_response(sys, T, U, X0, transpose) > > 374 [np.zeros((n_inputs, n_states + 2 * n_inputs))]]) > > 375 print('M=' + str(M)) > > --> 376 expM = sp.linalg.expm(M) > > 377 Ad = expM[:n_states, :n_states] > > 378 Bd1 = expM[:n_states, n_states+n_inputs:] > > > > /usr/local/lib/python2.7/site-packages/scipy/linalg/matfuncs.pyc in expm(A, q) > > 258 # Input checking and conversion is provided by sparse.linalg.expm(). > > 259 import scipy.sparse.linalg > > --> 260 return scipy.sparse.linalg.expm(A) > > 261 > > 262 > > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in expm(A) > > 580 > > 581 """ > > --> 582 return _expm(A, use_exact_onenorm='auto') > > 583 > > 584 > > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _expm(A, use_exact_onenorm) > > 635 if structure == UPPER_TRIANGULAR: > > 636 # Invoke Code Fragment 2.1. > > --> 637 X = _fragment_2_1(X, h.A, s) > > 638 else: > > 639 # X = r_13(A)^(2^s) by repeated squaring. > > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _fragment_2_1(X, T, s) > > 753 exp_diag = np.exp(scale * diag_T) > > 754 for k in range(n): > > --> 755 X[k, k] = exp_diag[k] > > 756 > > 757 for i in range(s-1, -1, -1): > > > > ValueError: setting an array element with a sequence. > > > > This is probably ultimately a problem for the scipy people, but my students' project is due in 6 days. Any suggestions to quickly get the attached simulation code to work for 60Hz simulation, i.e. dt = 1.0/60? > > > > Thanks, > > > > Ryan > > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > <kp_0_3_rotate_only_less_delay.csv><zumo_PID_simulation_modified_ss.py>------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140_______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss |
From: Ryan K. <rk...@si...> - 2015-12-04 21:55:11
|
Apparently I don't know which email list is subscribed. Sorry if this comes through more than once. I am teaching a classical controls class for mechanical engineering undergraduates. Up till now, I have tried to gloss over state-space. My students need to do an initial condition simulation for a system that includes actuator saturation. I have them do this by integrating for one time step at a time using control.forced_response inside a for loop. We are essentially doing a continuous time approximation of ZOH with the input held constant for each time step. As the time step gets too large, sp. linalg.expm has to use a higher order pade approximation and eventually throws this error: ValueError Traceback (most recent call last) /Users/rkrauss/git/python-control/zumo_PID_simulation_modified_ss.py in <module>() 103 t0 = dt*(i-1) 104 t1 = dt*i --> 105 to, yo, xo = control.forced_response(G_int, [t0,t1], [v[i],v[i]], X0=X0) 106 X0 = xo[:,-1]#<-- save for next time through for loop 107 x[i] = squeeze(X0) /Users/rkrauss/git/python-control/control/timeresp.pyc in forced_response(sys, T, U, X0, transpose) 374 [np.zeros((n_inputs, n_states + 2 * n_inputs))]]) 375 print('M=' + str(M)) --> 376 expM = sp.linalg.expm(M) 377 Ad = expM[:n_states, :n_states] 378 Bd1 = expM[:n_states, n_states+n_inputs:] /usr/local/lib/python2.7/site-packages/scipy/linalg/matfuncs.pyc in expm(A, q) 258 # Input checking and conversion is provided by sparse.linalg.expm(). 259 import scipy.sparse.linalg --> 260 return scipy.sparse.linalg.expm(A) 261 262 /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in expm(A) 580 581 """ --> 582 return _expm(A, use_exact_onenorm='auto') 583 584 /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _expm(A, use_exact_onenorm) 635 if structure == UPPER_TRIANGULAR: 636 # Invoke Code Fragment 2.1. --> 637 X = _fragment_2_1(X, h.A, s) 638 else: 639 # X = r_13(A)^(2^s) by repeated squaring. /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _fragment_2_1(X, T, s) 753 exp_diag = np.exp(scale * diag_T) 754 for k in range(n): --> 755 X[k, k] = exp_diag[k] 756 757 for i in range(s-1, -1, -1): ValueError: setting an array element with a sequence. This is probably ultimately a problem for the scipy people, but my students' project is due in 6 days. Any suggestions to quickly get the attached simulation code to work for 60Hz simulation, i.e. dt = 1.0/60? Thanks, Ryan -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville |
From: Ryan K. <rk...@si...> - 2015-12-04 21:52:17
|
My hackish solution to the immediate problem is to integrate 3 times at dt/3 within the for loop: Ndt = 3#factor to divide dt by dt_sim = dt/Ndt for i in range(1,N): e[i] = r[i] - y[i-3]#<-- one step time delay on the measurement #v[i] = Gc*e[i]#<-- this is only doing P control esum += e[i] v[i] = Kp*e[i] + Ki*esum + Kd*(e[i]-e[i-1]) #PID control if include_sat: v[i] = mysat(v[i]) t0 = dt*(i-1) #integrate Ndt times to get to the next dt for q in range(Ndt): t1 = t0 + dt_sim to, yo, xo = control.forced_response(G_int, [t0,t1], [v[i],v[i]], X0=X0) X0 = xo[:,-1]#<-- save for next time through for loop t0 = t1#<-- for next pass x[i] = squeeze(X0) y[i] = yo[-1] This keep my students moving forward for now. -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Fri, Dec 4, 2015 at 3:21 PM, Ryan Krauss <rk...@si...> wrote: > Apparently I don't know which email list is subscribed. Sorry if this > comes through more than once. > > I am teaching a classical controls class for mechanical engineering > undergraduates. Up till now, I have tried to gloss over state-space. My > students need to do an initial condition simulation for a system that > includes actuator saturation. I have them do this by integrating for one > time step at a time using control.forced_response inside a for loop. We > are essentially doing a continuous time approximation of ZOH with the input > held constant for each time step. As the time step gets too large, sp. > linalg.expm has to use a higher order pade approximation and eventually > throws this error: > > ValueError Traceback (most recent call last) > > > /Users/rkrauss/git/python-control/zumo_PID_simulation_modified_ss.py in <module>() > > 103 t0 = dt*(i-1) > > 104 t1 = dt*i > > --> 105 > to, yo, xo = control.forced_response(G_int, [t0,t1], [v[i],v[i]], X0=X0) > > 106 X0 = xo[:,-1]#<-- save for next time through for loop > > 107 x[i] = squeeze(X0) > > > /Users/rkrauss/git/python-control/control/timeresp.pyc in forced_response(sys, > T, U, X0, transpose) > > 374 [np.zeros((n_inputs, n_states + 2 * > n_inputs))]]) > > 375 print('M=' + str(M)) > > --> 376 expM = sp.linalg.expm(M) > > 377 Ad = expM[:n_states, :n_states] > > 378 Bd1 = expM[:n_states, n_states+n_inputs:] > > > /usr/local/lib/python2.7/site-packages/scipy/linalg/matfuncs.pyc in expm(A, > q) > > 258 # Input checking and conversion is provided by > sparse.linalg.expm(). > > 259 import scipy.sparse.linalg > > --> 260 return scipy.sparse.linalg.expm(A) > > 261 > > 262 > > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in expm(A) > > 580 > > 581 """ > > --> 582 return _expm(A, use_exact_onenorm='auto') > > 583 > > 584 > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _expm(A, > use_exact_onenorm) > > 635 if structure == UPPER_TRIANGULAR: > > 636 # Invoke Code Fragment 2.1. > > --> 637 X = _fragment_2_1(X, h.A, s) > > 638 else: > > 639 # X = r_13(A)^(2^s) by repeated squaring. > > > /usr/local/lib/python2.7/site-packages/scipy/sparse/linalg/matfuncs.pyc in _fragment_2_1(X, > T, s) > > 753 exp_diag = np.exp(scale * diag_T) > > 754 for k in range(n): > > --> 755 X[k, k] = exp_diag[k] > > 756 > > 757 for i in range(s-1, -1, -1): > > > ValueError: setting an array element with a sequence. > > > This is probably ultimately a problem for the scipy people, but my > students' project is due in 6 days. Any suggestions to quickly get the > attached simulation code to work for 60Hz simulation, i.e. dt = 1.0/60? > > > Thanks, > > > Ryan > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > |
From: Richard M. <mu...@cd...> - 2014-09-30 05:46:02
|
Glad you have found it to be useful! Lots of contributions from many people (and hopefully more coming!). -richard On 29 Sep 2014, at 10:49 , Mitchell Clement <mdc...@en...> wrote: > Richard, > > I also wanted to thank you for how awesome this package is. It has been of great help to me recently. > > Mitchell > > On Fri, Sep 26, 2014 at 9:55 AM, Richard Murray <mu...@cd...> wrote: > Great. I've got a pull request that I hope to get to this weekend and then I'll probably do a new release on SourceForge (0.6e). > > -richard > > On 26 Sep 2014, at 9:54 , Mitchell Clement <mdc...@en...> wrote: > > > Richard, > > > > Thanks for your response. I was using version 0.6d from sourceForge, I found that this had been fixed on the latest GitHub version. > > > > Mitchell > > > > On Fri, Sep 26, 2014 at 9:49 AM, Richard Murray <mu...@cd...> wrote: > > Which version of python-control are you using? This has been fixed in the latest developer version (on github): > > > > https://github.com/python-control/python-control/issues/8 > > > > -richard > > > > On 26 Sep 2014, at 9:04 , Mitchell Clement <mdc...@en...> wrote: > > > > > All, > > > > > > Has anyone else noticed that the DARE solver in python control does not give the same solution for the discrete time algebraic riccati equation as MATLAB or Octave-control's DARE solver? Thanks. > > > > > > Mitchell Clement > > > ------------------------------------------------------------------------------ > > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > > > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________ > > > python-control-discuss mailing list > > > pyt...@li... > > > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > > > > > ------------------------------------------------------------------------------ > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk > > _______________________________________________ > > python-control-discuss mailing list > > pyt...@li... > > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > > > ------------------------------------------------------------------------------ > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________ > > python-control-discuss mailing list > > pyt...@li... > > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > ------------------------------------------------------------------------------ > Slashdot TV. Videos for Nerds. Stuff that Matters. > http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk_______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss |