<?xml version="1.0" encoding="ISO-8859-1"?><refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="plq_build"><info><pubdate>04-Apr-2006</pubdate></info><refnamediv><refname>plq_build</refname><refpurpose>Piecewise linear quadratic (plq), build a zeroth- or first-order function approximation</refpurpose></refnamediv>
  
   
  
   
  
   
  
   
  
   

  
   <refsynopsisdiv><title>Calling Sequence</title><synopsis>plqf = plq_build(x,f,df)
plqf = plq_build(x,f,df [,needEval] [,exclude] [,method] [,extrapolate])</synopsis></refsynopsisdiv>

  
   <refsection><title>Parameters</title>
	  
      <variablelist>
		  
         <varlistentry>
			  
            <term>x</term>
			  
            <listitem>
				  
               <para>column vector. A grid of points on which the function is sampled.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>f</term>
			  
            <listitem>
				  
               <para>function. The function to build a PLQ representation of.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>df</term>
			  
            <listitem>
				  
               <para>function, optional.  The derivative of f.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>needEval</term>
			  
            <listitem>
				  
               <para>boolean, optional. False, or not entered implies that function does not need to be evaluated and the function is vectorized, otherwise evaluate point by point.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>exclude</term>
			  
            <listitem>
				  
               <para>boolean, optional.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>method</term>
			  
            <listitem>
				  
               <para>boolean, optional.  The method 'plq' or not entered implies a normal plq approximation. The method 'soqs' uses a Shape-Preserving Osculatory Spline approximation (see McAllister and Roulier, ACM TOMS, Sep. 1981). If no derivatives are provided, forward differentiation is used for 'plq' and shape-preserving calculation is used for 'soqs'.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>extrapolate</term>
			  
            <listitem>
				  
               <para>string, optional.  'constant' (default) or 'bounded' to extend outside of domain by constant of %inf.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
	  
      </variablelist>
  
   </refsection>

  
   <refsection><title>Description</title>
     
         <para>
	    Builds a plq approximation of a function when given a function and optionally the function's derivative.  If df is given, a first-order model is built, otherwise a zeroth-order model is built.
    </para>
 	
   </refsection>

  
   <refsection><title>Examples</title><programlisting role="example"><![CDATA[
//Example 1
x=linspace(0,4)';
plqf = plq_build(x,exp,exp);
y=plq_eval(plqf,x);

//Example 2
function y=f(x),i1=find(x<0);i2=find(x==0);i3=find(x>0);y(i1)=%inf*ones(i1);y(i2)=0;y(i3)=x(i3).*log(x(i3))-x(i3);endfunction
function y=df(x),i1=find(x<=0);i2=find(x>0);y(i1)=%inf*ones(i1);y(i2)=log(x(i2));endfunction
x=linspace(0,20,3)';
plqf = plq_build(x,f,df);
y = plq_eval(plqf,x);
  ]]></programlisting></refsection>


   <refsection><title>See Also</title><simplelist type="inline">
    
      <member>
         <link linkend="plq_function">plq_function</link>
      </member>

   </simplelist></refsection>

  
   <refsection><title>Authors</title><para>
	  
      <literal>Yves Lucet</literal>, University of British Columbia, BC, Canada
  </para></refsection>

</refentry>
