csslti4.c

Go to the documentation of this file.
00001 #include "scicos_block.h"
00002 #include "machine.h"
00003 
00004 extern int C2F(dmmul)();
00005 extern int C2F(dmmul1)();
00006 
00007 void csslti4(scicos_block *block,int flag)
00008 {
00009   /*  Copyright INRIA
00010 
00011       Scicos block simulator
00012       continuous state space linear system simulator
00013       rpar(1:nx*nx)=A
00014       rpar(nx*nx+1:nx*nx+nx*nu)=B
00015       rpar(nx*nx+nx*nu+1:nx*nx+nx*nu+nx*ny)=C
00016       rpar(nx*nx+nx*nu+nx*ny+1:nx*nx+nx*nu+nx*ny+ny*nu)=D */
00017   
00018   int un=1,lb,lc,ld;
00019   int nx=block->nx;
00020   double* x=block->x;
00021   double* xd=block->xd;
00022   double* rpar=block->rpar;
00023   double* y=block->outptr[0];
00024   double* u=block->inptr[0];
00025   int* outsz=block->outsz;
00026   int* insz=block->insz;
00027   
00028   lb=nx*nx;
00029   lc=lb+nx*insz[0];
00030   
00031   if (flag ==1 || flag ==6){
00032     /* y=c*x+d*u     */
00033     ld=lc+nx*outsz[0];
00034     if (nx==0) {
00035       C2F(dmmul)(&rpar[ld],outsz,u,insz,y,outsz,outsz,insz,&un);
00036     }else{
00037       C2F(dmmul)(&rpar[lc],outsz,x,&nx,y,outsz,outsz,&nx,&un);
00038       C2F(dmmul1)(&rpar[ld],outsz,u,insz,y,outsz,outsz,insz,&un);
00039     }
00040   }
00041 
00042   else if (flag ==0){
00043     /* xd=a*x+b*u */
00044     C2F(dmmul)(&rpar[0],&nx,x,&nx,xd,&nx,&nx,&nx,&un);
00045     C2F(dmmul1)(&rpar[lb],&nx,u,insz,xd,&nx,&nx,insz,&un);
00046   }
00047 }
00048 
00049 
00050 

Generated on Sun Mar 4 15:03:59 2007 for Scilab [trunk] by  doxygen 1.5.1