File: dsslti.f

package info (click to toggle)
scilab 2.2-4
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 31,472 kB
  • ctags: 21,963
  • sloc: fortran: 110,983; ansic: 89,717; makefile: 3,016; sh: 1,892; csh: 150; cpp: 101
file content (28 lines) | stat: -rw-r--r-- 785 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
      subroutine dsslti(t,x,nx,z,nz,u,nu,rpar,nrpar,ipar,nipar,nclock,
     &     out,nout,flag)
c     discrete state space linear system simulator
c     rpar(1:nx*nx)=A
c     rpar(nx*nx+1:nx*nx+nx*nu)=B
c     rpar(nx*nx+nx*nu+1:nx*nx+nx*nu+nx*ny)=C
c!
      double precision t,x(*),z(*),u(*),rpar(*),out(*)
      integer ipar(*),flag

      la=1
      lb=nz*nz+la
      lc=lb+nz*nu

      if(flag.eq.1) then
c    out=c*x
         ld=lc+nz*nout
         call dmmul(rpar(lc),nout,z,nz,out,nout,nout,nz,1)
         call dmmul1(rpar(ld),nout,u,nu,out,nout,nout,nu,1)
      elseif(flag.eq.2) then
c     x+=a*x+b*u
         call dcopy(nz,z,1,out,1)
         call dmmul(rpar(la),nz,out,nz,z,nz,nz,nz,1)
         call dmmul1(rpar(lb),nz,u,nu,z,nz,nz,nu,1)
      endif
      return
      end