Subsections


Sawtooth generator

\epsfig{file=SAWTOOTH_f.eps,width=90.00pt}

Library

Sources

Description

This block is a sawtooth wave generator: output is $ (t-t_i)$ from $ t_i$ to $ t_{i+1}$ where $ t_i$ and $ t_{i+1}$ denote the times of two successive input events.

Default properties

Interfacing function

scilab/macros/scicos_blocks/sources/SAWTOOTH_f.sci

Computational function (type 0)


      subroutine sawtth(flag,nevprt,t,xd,x,nx,z,nz,tvec,ntvec,
     &     rpar,nrpar,ipar,nipar,u,nu,y,ny)
c     Copyright INRIA

c     Scicos block simulator
c
      double precision t,xd(*),x(*),z(*),tvec(*),rpar(*),u(*),y(*)
      integer flag,nevprt,nx,nz,ntvec,nrpar,ipar(*)
      integer nipar,nu,ny

c
c
      if (flag.eq.1.and.nevprt.eq.0) then
         y(1)=t-z(1)
      elseif (flag.eq.1.and.nevprt.eq.1) then
         y(1)=0.0d0
      elseif (flag.eq.2.and.nevprt.eq.1) then
         z(1)=t
      elseif (flag.eq.4) then
         z(1)=0.0d0
      endif
      return
      end


Ramine Nikoukhah 2004-06-22