%$Id: pulse.tex,v 21.13 2002/03/25 05:37:03 al Exp $
% man behavior pulse .
% Copyright (C) 2001 Albert Davis
% Author: Albert Davis <aldavis@ieee.org>
%
% This file is part of "Gnucap", the Gnu Circuit Analysis Package
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
% 02111-1307, USA.
%------------------------------------------------------------------------
\section{{\tt PULSE}: Pulsed time dependent value}
%------------------------------------------------------------------------
\subsection{Syntax}
\begin{verse}
{\tt PULSE} {\it args}\\
{\tt PULSE} {\it iv pv delay rise fall width period}
\end{verse}
%------------------------------------------------------------------------
\subsection{Purpose}

The component value is a pulsed function of time.
%------------------------------------------------------------------------
\subsection{Comments}

For voltage and current sources, this is the same as the Spice {\tt
PULSE} function, with some extensions.

The shape of a single pulse is described by the following algorithm:

\begin{verbatim}
if (time > _delay+_rise+_width+_fall){
  // past pulse
  ev = _iv;
}else if (time > _delay+_rise+_width){
  // falling
  interp=(time-(_delay+_rise+_width))/_fall;
  ev = _pv + interp * (_iv - _pv);
}else if (time > _delay+_rise){
  // pulsed value
  ev = _pv;
}else if (time > _delay){
  // rising
  interp = (time - _delay) / _rise;
  ev = _iv + interp * (_pv - _iv);
}else{
  // initial value
  ev = _iv;
}
\end{verbatim}
%------------------------------------------------------------------------
\subsection{Parameters}

\begin{description}

\item[{\tt IV} = {\it x}] Initial value.  (required)

\item[{\tt PV} = {\it x}] Pulsed value.  (required)

\item[{\tt DELAY} = {\it x}] Rise time delay, seconds.  (Default = 0.)

\item[{\tt RISE} = {\it x}] Rise time, seconds.  (Default = 0.)

\item[{\tt FALL} = {\it x}] Fall time, seconds.  (Default = 0.)

\item[{\tt WIDTH} = {\it x}] Pulse width, seconds.  (Default = 0.)

\item[{\tt PERIOD} = {\it x}] Repeat period, seconds.  (Default = infinity.)

\end{description}
%------------------------------------------------------------------------
%\subsection{Example} 
%------------------------------------------------------------------------
%------------------------------------------------------------------------
