From: Richard M. <mu...@cd...> - 2012-11-11 02:54:31
|
Sorry for the cryptic commit message below. I've reconfigured the python-control 'post-commit' script so that it only sends e-mail to the list when there is a commit to trunk. This lets people do work in branches without having to send out lots of e-mail to the list every time they commit some of their branch code. The relevant (trunk) change below is that there is now a function issiso() to see if an LTI system is SISO. This will show up when I commit some additional changes to trunk, probably in a week or two. In the meantime, working on some trajectory generation code that I need for FBS... -richard On 10 Nov 2012, at 18:49 , mur...@us... wrote: > Revision: 241 > http://sourceforge.net/p/python-control/code/241 > Author: murrayrm > Date: 2012-11-11 02:49:33 +0000 (Sun, 11 Nov 2012) > Log Message: > ----------- > Fixed bugs in various calculations and orders of indices. > > Modified Paths: > -------------- > branches/rmm-trajgen/examples/doubleint.py > branches/rmm-trajgen/trajgen/flatsys.py > branches/rmm-trajgen/trajgen/poly.py > trunk/src/lti.py > > Modified: branches/rmm-trajgen/examples/doubleint.py > =================================================================== > --- branches/rmm-trajgen/examples/doubleint.py 2012-11-11 01:28:03 UTC (rev 240) > +++ branches/rmm-trajgen/examples/doubleint.py 2012-11-11 02:49:33 UTC (rev 241) > @@ -17,5 +17,6 @@ > > # Find a trajectory > xd, ud = tg.linear_point_to_point(sys1, x0, xf, 1) > +print(xd) > > # Plot the trajectory > > Modified: branches/rmm-trajgen/trajgen/flatsys.py > =================================================================== > --- branches/rmm-trajgen/trajgen/flatsys.py 2012-11-11 01:28:03 UTC (rev 240) > +++ branches/rmm-trajgen/trajgen/flatsys.py 2012-11-11 02:49:33 UTC (rev 241) > @@ -80,7 +80,7 @@ > # least squares solution for now. > # > #! TODO: need to allow cost and constraints... > - alpha = np.linalg.pinv(M) * np.vstack((zflag_T0, zflag_Tf)) > + alpha = np.dot(np.linalg.pinv(M), np.vstack((zflag_T0, zflag_Tf))) > > # > # Transform the trajectory from flat outputs to states and inputs > > Modified: branches/rmm-trajgen/trajgen/poly.py > =================================================================== > --- branches/rmm-trajgen/trajgen/poly.py 2012-11-11 01:28:03 UTC (rev 240) > +++ branches/rmm-trajgen/trajgen/poly.py 2012-11-11 02:49:33 UTC (rev 241) > @@ -14,4 +14,4 @@ > # Compute the kth derivative of the ith basis function at time t > def eval_deriv(self, i, k, t): > if (i < k): return 0; # higher derivative than power > - return sp.misc.factorial(k) * np.power(t, i-k) > + return sp.misc.factorial(i)/sp.misc.factorial(i-k) * np.power(t, i-k) > > Modified: trunk/src/lti.py > =================================================================== > --- trunk/src/lti.py 2012-11-11 01:28:03 UTC (rev 240) > +++ trunk/src/lti.py 2012-11-11 02:49:33 UTC (rev 241) > @@ -64,6 +64,16 @@ > self.outputs = outputs > self.dt = dt > > +# Test to see if a system is SISO > +def issiso(sys, strict=False): > + if isinstance(sys, (int, float, complex)) and not strict: > + return True > + elif not isinstance(sys, Lti): > + raise ValueError("Object is not an Lti system") > + > + # Done with the tricky stuff... > + return sys.inputs == 1 and sys.outputs == 1 > + > # Return the timebase (with conversion if unspecified) > def timebase(sys, strict=True): > """Return the timebase for an Lti system > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss |