%$Id: dc.tex,v 25.95 2006/08/26 01:26:53 al Exp $ -*- LaTeX -*-
% man commands dc .
% 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 DC} command}
\index{dc command}
\index{transfer characteristics}
\index{nonlinear transfer analysis}
%------------------------------------------------------------------------
\subsection{Syntax}
\begin{verse}
{\tt dc} {\it start stop stepsize} \{{\it options} ...\}\\
{\tt dc} {\it label start stop stepsize} \{{\it options} ...\}
\end{verse}
%------------------------------------------------------------------------
\subsection{Purpose}

Performs a nonlinear DC steady state analysis, and sweeps the signal input,
or a component value.
%------------------------------------------------------------------------
\subsection{Comments}

The nodes to look at must have been previously selected by the {\tt print} or
{\tt plot} command.

If there are numeric arguments, without a part label, they represent a ramp
from the {\tt generator} function.  They are the start value, stop value
and step size, in order.  They are saved between commands, so no arguments
will repeat the previous sweep.

A single parameter represents a single input voltage.  Two parameters
instruct the computer to analyze for those two points only.

In some cases, you will get one more step outside the specified range of
inputs due to internal rounding errors.  The last input may be beyond the end
point.

This command also sets up a movable operating point for subsequent {\tt AC}
analysis, which can be helpful in distortion analysis.

The program will sweep any simple component, including resistors,
capacitors, and controlled sources.  SPICE sweeps only fixed sources (types
{\tt V} and {\tt I}).

This command will sweep up to 4 components, nested.
%------------------------------------------------------------------------
\subsection{Options}

\begin{description}

\item[{\tt *} {\it multiplier}]
Log sweep.  Multiply the input by {\it multiplier} to get the next
step.  Do not pass zero volts!!

\item[{\tt >} {\it file}]
Send results of analysis to {\it file}.

\item[{\tt >>} {\it file}]
Append results to {\it file}.

%%%\item[{\tt ACMAx}] Use worst case max values, per last
%%%{\tt AC} analysis.

%%%\item[{\tt ACMIn}] Use worst case min values, per last
%%%{\tt AC} analysis.

\item[{\tt by} {\it stepsize}]
Linear sweep.  Add {\it stepsize} to get the next step.

\item[{\tt continue}]
Use the last step of a {\tt OP}, {\tt DC} or {\tt Transient} analysis
as the first guess.

%%%\item[{\tt DCMAx}] Use worst case max values, per last
%%%{\tt DC} or {\tt OP} analysis.

%%%\item[{\tt DCMIn}] Use worst case min values, per last
%%%{\tt DC} or {\tt OP} analysis.

\item[{\tt decade} {\it steps}]
Log sweep.  Use {\it steps} steps per decade.

\item[{\tt dtemp} {\it degrees}]
Temperature offset, degrees C.  Add this number to the temperature
from the {\tt options} command.

%%%\item[{\tt LAg}] Use worst case values, for lagging phase,
%%% per {\tt AC} analysis.

%%%\item[{\tt LEad}] Use worst case values, for leading	
%%% phase, per {\tt AC} analysis.

\item[{\tt loop}]
Repeat the sweep, backwards.

%%%\item[{\tt MAx}] Use worst case max values, per same type
bb%%%({\tt OP} or {\tt DC}) analysis.  (Same as {\tt DCMAx},
%%% here.)

%%%\item[{\tt MIn}] Use worst case min values, per same type
%%%({\tt OP} or {\tt DC}) analysis.  (Same as {\tt DCMIn},
%%% here.)

%%%\item[{\tt MCarlo} {\it trials}] Monte-Carlo analysis.
%%% Simulate {\it trials} circuits; compile statistics.  Hide
%%% individual trials.

\item[{\tt noplot}]
Suppress plotting.

\item[{\tt plot}]
Graphic output, when plotting is normally off.

\item[{\tt quiet}]
Suppress console output.

%%%\item[{\tt Random} {\it trials}] Simulate {\it trials}
%%% circuits using random values.

\item[{\tt reverse}]
Sweep in the opposite direction.

%%%\item[{\tt TAble}] Tabular output. Override default plot.

\item[{\tt temperature} {\it degrees}]
Temperature, degrees C.

\item[{\tt times} {\it multiplier}]
Log sweep.  Multiply the input by {\it multiplier} to get the next
step.  Do not pass zero volts!!

\item[{\tt trace} {\it n}]
Show extended information during solution.
Must be followed by one of the following:
\begin{description}
\item[{\tt off}] No extended trace information (default, override .opt)
\item[{\tt warnings}] Show extended warnings
%%%\item[{\tt alltime}] Show all accepted internal time steps.
%%%\item[{\tt rejected}] Show all internal time steps including rejected steps.
\item[{\tt iterations}] Show every iteration.
\item[{\tt verbose}] Show extended diagnostics.
\end{description}

%%%\item[{\tt WOrstcase} {\it probe}] Worst case analysis, at
%%%{\it probe}.

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

\begin{description}

\item[{\tt dc 1}] Do a single point DC signal simulation, with {`1 volt'}
input.

\item[{\tt dc -10 15 1}] Sweep the circuit input from -10 to +15 in steps of
1.  (usually volts.)  Do a DC transfer simulation at each step.

\item[{\tt dc}] With no parameters, it uses the same ones as the last time.
In this case, from -10 to 15 in 1\ volt steps.

\item[{\tt dc 20 0 -2}] You can sweep downward, by asking for a negative
increment.  Sometimes, this will result in better convergence, or even
different results!  (For example, in the case of a bi-stable circuit.)

\item[{\tt dc}] Since the last time used the {\tt input} option, go back one
more to find what the sweep parameters were.  In this case, downward from 20
to 0 in steps of 2.  (Because we did it 2 commands ago.)

\item[{\tt dc -2 2 .1 loop}] After the sweep, do it again in the opposite
direction.  In this case, the sweep is -2 to +2 in steps of .1.  After it
gets to +2, it will go back, and sweep from +2 to -2 in steps of -.1.  The
plot will be superimposed on the up sweep.  This way, you can see hysteresis
in the circuit.

\item[{\tt dc temperature 75}] Simulate at 75 degrees, this time.  Since we
didn't specify new sweep parameters, do the same as last time.  (Without the
loop.)

%%%\item[{\tt dc 1 worstcase v r12}] A worst case analysis
%%% for voltage across the resistor {\tt R12}, with input of 1.

\end{description}
%------------------------------------------------------------------------
%------------------------------------------------------------------------
