bugGNU Octave - Bugs: bug #40973, control package: lsim fails to run

 
 

bug #40973: control package: lsim fails to run

Submitter:  None
Submitted:  Thu 19 Dec 2013 06:49:44 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Saul Mtakula Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 29 Jan 2014 05:50:37 PM UTC, comment #5: 

Yes, I think so.

Lukas Reichlin <paramaniac>
Wed 29 Jan 2014 05:47:48 PM UTC, comment #4: 

Can we close this bug report as "Invalid"?

Andreas Weber <andy1978>
Group Member
Fri 20 Dec 2013 04:45:13 PM UTC, comment #3: 

Thanks for the clarification. I should have read the documentation better. A statement to say time vector should have length(t) rows should help clarify  matters further.

Anonymous
Fri 20 Dec 2013 07:03:30 AM UTC, comment #2: 

Try


lsim (T1, U.', t.')


For MIMO systems, U requires as many columns as there are inputs and as many rows as there are time steps. Does lsim's help string need some clarifications?

HTH
Lukas

Lukas Reichlin <paramaniac>
Fri 20 Dec 2013 02:20:17 AM UTC, comment #1: 

One more for the control package maintainer, adding CC.

Mike Miller <mtmiller>
Group Member
Thu 19 Dec 2013 06:49:44 PM UTC, original submission:  

Code below refers; the lsim function reports the following error.



error: lsim: input vector u must have 151 rows
error: called from:
error:   C:\Software\Octave-3.6.4\share\octave\packages\control-2.4.2\lsim.m at line 245, column 5
error:   C:\Software\Octave-3.6.4\share\octave\packages\control-2.4.2\lsim.m at line 126, column 14
error:   C:\Software\Octave-3.6.4\mfiles\skoge_p96.m at line 73, column 1




clear()
pkg load control


g11num=[1];
g12num=[1];
g21num=[2 1];
g22num=[2];

gden=[0.2 1.2 1];


Gnum={g11num g12num; g21num g22num};
Gden={gden gden; gden gden};
 
G=tf(Gnum,Gden);


Gss=ss(G);
Gss=prescale(Gss);
A=1.e-4;
M1=1.5;
M2=1.5;
wb1=0.25;
wb2=25;



wp1num=[1/M1 wb1];
wp1den=[1 wb1*A];
wp1=tf(wp1num,wp1den);

wp2num=[1/M2 wb2];
wp2den=[1 wb2*A];
wp2=tf(wp2num,wp2den);

Wp1=blkdiag(wp1,wp1);
Wp2=blkdiag(wp1,wp2);
Wu=eye(2,2);
Wt=[]



[K1,mu]=mixsyn(Gss,Wp1,Wu,Wt);
L1=series(Gss,K1);
L1=minreal(L1);
T1=feedback(L1,eye(2,2));
S1=inv(eye(size(Gss))+L1);
S1=minreal(S1);
S1=tf(S1);
T1=minreal(T1);


[K2,mu]=mixsyn(Gss,Wp2,Wu,Wt);

L2=series(Gss,K2);
S2=inv(eye(size(Gss))+L2);
S2=sminreal(S2);
S2=tf(S2);
L2=minreal(L2);
T2=feedback(L2,eye(2,2));

T2=minreal(T2);
figure(1)
sigma(S1,S2);
figure(2)
step(T1,T2)

t=0:.1:15;
u=ones(size(t));
U=[u;u];
figure(3)
lsim(T1,U,t)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by paramaniac (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by mtmiller
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-29 andy1978 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2013-12-20 mtmiller Summarylsim (control package) fails to run control package: lsim fails to run
        Carbon-Copy- Added paramaniac

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code