help-octave
[Top][All Lists]

Re: test this in matlab for my please

 From: Doug Stewart Subject: Re: test this in matlab for my please Date: Wed, 16 Mar 2016 15:07:26 -0400

On Wed, Mar 16, 2016 at 2:06 PM, Nicholas Jankowski wrote:
On Wed, Mar 16, 2016 at 1:36 PM, Doug Stewart wrote:

On Tue, Mar 15, 2016 at 8:25 PM, Doug Stewart wrote:

On Tue, Mar 15, 2016 at 2:08 PM, Przemek Klosowski wrote:
On 03/15/2016 12:07 PM, Doug Stewart wrote:
One more test  the 2 values printed should be close to 1 but they are
ans =  10.430
ans =  0.31421
in octave.

clear
s=tf('s')
sys=(1/s)
sys=sys*1/(s+1)
[y t x]=impulse(sys,5);
y(length(y))
sys2=ss(sys);
[ y2 t2 x2]=impulse(sys2,5);
y2(length(y2))

With latest Octave on Fedora 23 I get 2 values close to 1:

GNU Octave, version 4.0.0
...
Octave was configured for "x86_64-redhat-linux-gnu".
...
Package     | Version | Installation directory
--------------+---------+-----------------------
control  |   2.8.3 | /usr/share/octave/packages/control-2.8.3
...

octave:21> clear
octave:22> s=tf('s')

Transfer function 's' from input 'u1' to output ...

y1:  s

Continuous-time model.
octave:23> sys=(1/s)

Transfer function 'sys' from input 'u1' to output ...

1
y1:  -
s

Continuous-time model.
octave:24> sys=sys*1/(s+1)

Transfer function 'sys' from input 'u1' to output ...

1
y1:  -------
s^2 + s

Continuous-time model.
octave:25> [y t x]=impulse(sys,5);
octave:26> y(length(y))
ans =  0.99326
octave:27> sys2=ss(sys);
octave:28> [ y2 t2 x2]=impulse(sys2,5);
octave:29> y2(length(y2))
ans =  0.99326

_______________________________________________
Help-octave mailing list
https://lists.gnu.org/mailman/listinfo/help-octave

But you have control.2.8.3
The error is in control.3.0.0
But thanks for the report

--
DAS

1 more test :-)

clear
s=tf('s')
sys=(1/s)
sys1=sys*1/(s+1)
[y t x]=impulse(sys,5);
y(1)
[y t x]=step(sys,5);
y(2)

[y t x]=impulse(sys1,5);
y(1)
[y t x]=step(sys1,5);
y(2)

[y t x]=impulse(1/(s+1),5);
y(1)
[y t x]=step(1/(s+1),5);
y(2)

I get
ans =  1.0000
ans =  0.0050000
ans =  0.048374
ans =  0.0048374
ans =  0.95163
ans =  0.095163

ans =     1
ans =    0.0500
ans =     0
ans =    0.0012
ans =     1
ans =    0.0488

Przemek  what does octave 3.8 give?

--
DAS reply via email to