Subsections


Interpolation

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

Library

Non_linear

Description

The output of this block is a function of the input obtained by linear interpolation. This block has a single scalar input and a single scalar output port. The $ X$ coord. and $ Y$ coord. give respectively the $ X$ coordinate and the $ Y$ coordinate of the data points to be interpolated. $ X$ coord must be strictly increasing.

Dialog Box

Set Interpolation block parameters
X coord. [0;1]
Y coord. [0;1]

Default properties

Interfacing function

scilab/macros/scicos_blocks/nonlinear/INTRPLBLK_f.sci

Computational function (type 0)


      subroutine intrpl(flag,nevprt,t,xd,x,nx,z,nz,tvec,ntvec,
     &     rpar,nrpar,ipar,nipar,u1,nu1,y1,ny1)
c     Copyright INRIA

c     Scicos block simulator
c     ipar(1) : the number of input
c
      double precision t,xd(*),x(*),z(*),tvec(*),rpar(*)
      double precision y1,u1
      integer flag,nevprt,nx,nz,ntvec,nrpar,ipar(*),i
      integer nipar
c
c    
      do 100 i=2,nrpar/2
         if (u1.le.rpar(i)) goto 200 
 100  continue
      i=nrpar/2
 200  continue
      y1=rpar(nrpar/2+i-1) + ((rpar(nrpar/2+i)-rpar(nrpar/2+i-1))/
     $     (rpar(i)-rpar(i-1)))*(u1-rpar(i-1))
      return
      end


Ramine Nikoukhah 2004-06-22