%$Id: pulse.tex,v 25.95 2006/08/26 01:26:53 al Exp $ -*- LaTeX -*-
% 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., 51 Franklin Street, Fifth Floor, Boston, MA
% 02110-1301, 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}

For other components, it gives a time dependent value.

As an extension beyond Spice, you may specify the parameters as
name=value pairs in any order.
%------------------------------------------------------------------------
\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} 
%------------------------------------------------------------------------
%------------------------------------------------------------------------
