[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Speed of lsim
From: |
John W. Eaton |
Subject: |
Re: Speed of lsim |
Date: |
Tue, 29 Jul 2003 13:49:10 -0500 |
On 29-Jul-2003, Geraint Paul Bevan <address@hidden> wrote:
| I've run the same test a couple of times on the same machine with Octave
| versions 2.1.35 and 2.1.50. The newer version of Octave is much faster,
| which seems to agree with the previous results.
|
| Best advice is probably to upgrade to version 2.1.50.
Yes, that is probably good advice. Probably the difference for lsim
is the following change.
jwe
2002-11-12 John W. Eaton <address@hidden>
* control/base/lsim.m: Use approximate test for step size change.
Index: lsim.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/control/base/lsim.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- lsim.m 4 Nov 2002 22:03:05 -0000 1.4
+++ lsim.m 13 Nov 2002 00:45:23 -0000 1.5
@@ -73,10 +73,13 @@
t(2)-t(1);
u=u';
n = max(size(t));
+
for ii = 1:(n-1)
## check if step size changed
- if (t(ii+1) - t(ii) != Ts)
+ ## XXX FIXME XXX -- this is probably not the best test, but it is
+ ## better than a test for exact equality.
+ if (abs (t(ii+1) - t(ii) - Ts) > 10 * eps)
Ts = t(ii+1) - t(ii);
## [F,G] = c2d(a,b,Ts);
dsys = c2d(sys, Ts);
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------