text:
\documentclass{article}

\usepackage{blindtext}
\usepackage{multicol}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan,
}
\usepackage{geometry}
\geometry{
	a4paper,
	noheadfoot=true,
	left=1.0in,
	right=1.0in,
	top=1.0in,
	bottom=1.0in
}

% url package
\usepackage{hyperref}
\usepackage{subcaption}

% Titling and Author
\title{Latex Tikz Examples, Relative Position on Page and Alignment}
\author{\href{https://fanwangecon.github.io/}{Fan Wang}\thanks{https://fanwangecon.github.io, repository: \href{https://fanwangecon.github.io/Tex4Econ/}{Tex4Econ}}}
\date{\today}

\begin{document}

\maketitle

\section{Relative Positioning}

\subsection{First line}
Using the code below, we draw from $x=0$ and $y=0$, to $x=1$ and $y=2$, the second point:
\begin{verbatim}
\draw (0,0) --(1,2);
\end{verbatim}
\bigskip
\begin{tikzpicture}
\draw (0,0) --(1,2);
\end{tikzpicture}

\subsection{Center Align Half Width Lines}
For lines below, we draw several partial page lines and align to page center:
\begin{verbatim}
\begin{center}
\begin{tikzpicture}
\draw (0,2) -- (0.25*\textwidth,2);
\draw (0,1) -- (0.5*\textwidth,1);
\draw (0,0) -- (0.75*\textwidth,0);
\end{tikzpicture}
\end{center}
\end{verbatim}
\bigskip
\begin{center}
\begin{tikzpicture}
\draw (0,2) -- (0.25*\textwidth,2);
\draw (0,1) -- (0.5*\textwidth,1);
\draw (0,0) -- (0.75*\textwidth,0);
\end{tikzpicture}
\end{center}

\subsection{Big line that fills page within margin}
Tikz coordinates are in cm. On A4 page, we have $21.0$ cm width by $29.7$ cm height. Each inch is $2.54$ cm. So with $1.0$ cm border on the left and on the right, we have $21-2.54\cdot2=15.92$, $15.92$ cm.
For lines below, we draw several full and partial page width lines:
\begin{verbatim}
\begin{center}
\begin{tikzpicture}
\draw (0,6) -- (7,6);
\draw (0,5) -- (15.92,5);
\draw (0,4) -- (0.45*\textwidth,4);
\draw (0,3) -- (0.5*\textwidth,3);
\draw (0,2) -- (0.9*\textwidth,2);
\draw (0,1) -- (\textwidth,1);
\end{tikzpicture}
\end{center}
\end{verbatim}
Note that we center the lines. Centering does not disrupt the coordinates, but just places entire tikz in the middle of page considering all plotted lines
\bigskip
\begin{center}
\begin{tikzpicture}
\draw (0,6) -- (7,6);
\draw (0,5) -- (15.92,5);
\draw (0,4) -- (0.45*\textwidth,4);
\draw (0,3) -- (0.5*\textwidth,3);
\draw (0,2) -- (0.9*\textwidth,2);
\draw (0,1) -- (\textwidth,1);
\end{tikzpicture}
\end{center}

\bigskip
For additional, information, see \href{https://tex.stackexchange.com/questions/58292/a-line-of-length-textwidth-in-tikz}{A line of length textwidth in TikZ}

\subsection{Box in the Middle of Page}
Now draw half width relative position box in the middle of pageFor lines below, we draw several full and partial page width lines:
\begin{verbatim}
\begin{center}
\begin{tikzpicture}
\draw (0,0) --
(0,0.5*\textwidth) --
(0.5*\textwidth, 0.5*\textwidth) --
(0.5*\textwidth, 0) -- (0, 0);
\end{tikzpicture}
\end{center}
\end{verbatim}
Note that the box is centered.
\bigskip
\begin{center}
\begin{tikzpicture}
\draw (0,0) -- (0,0.5*\textwidth) -- (0.5*\textwidth, 0.5*\textwidth) -- (0.5*\textwidth, 0) -- (0, 0);
\end{tikzpicture}
\end{center}

\subsection{Four Boxes Same Page in Larger Box}
There are four plots that I would like to draw together, four panels of tikz. We are defining height and width by textwidth, in this case textwidth is the width of each subfigure.

\begin{itemize}
    \item tikz page panels subplots
    \item latex subfigure
\end{itemize}

\begin{verbatim}
\def\fhratio{0.50}
\def\fwratio{1.0}
\begin{subfigure}[b]{0.49\textwidth}
    \begin{center}
    \begin{tikzpicture}
    \draw (0,0) --
        (0,\fhratio*\textwidth) --
        (\fwratio*\textwidth, \fhratio*\textwidth) --
        (\fwratio*\textwidth, 0) -- (0, 0);
    \draw
        (0.3*\fwratio*\textwidth,0.3*\fhratio*\textwidth) --
        (0.7*\fwratio*\textwidth,0.7*\fhratio*\textwidth);
    \end{tikzpicture}
    \end{center}
    \caption{Panel A}
    \label{fig:panela}
\end{subfigure}
\end{figure}
\end{verbatim}
Repeat this four timnes in a figure:
\def\fhratio{0.50}
\def\fwratio{1.0}
\begin{figure}[h]
    \centering
    \begin{subfigure}[b]{0.49\textwidth}
        \begin{center}
        \begin{tikzpicture}
        \draw (0,0) -- (0,\fhratio*\textwidth) -- (\fwratio*\textwidth, \fhratio*\textwidth) -- (\fwratio*\textwidth, 0) -- (0, 0);
        \draw (0.3*\fwratio*\textwidth,0.3*\fhratio*\textwidth) --(0.7*\fwratio*\textwidth,0.7*\fhratio*\textwidth);
        \end{tikzpicture}
        \end{center}
        \caption{Panel A}
        \label{fig:panela}
    \end{subfigure}
    \hfill
    \begin{subfigure}[b]{0.49\textwidth}
        \begin{center}
        \begin{tikzpicture}
        \draw (0,0) -- (0,\fhratio*\textwidth) -- (\fwratio*\textwidth, \fhratio*\textwidth) -- (\fwratio*\textwidth, 0) -- (0, 0);
        \draw (0.3*\fwratio*\textwidth,0.3*\fhratio*\textwidth) --(0.7*\fwratio*\textwidth,0.7*\fhratio*\textwidth);
        \end{tikzpicture}
        \end{center}
        \caption{Panel B}
        \label{fig:panelb}
    \end{subfigure}
    \bigskip
    \\
    \begin{subfigure}[b]{0.49\textwidth}
        \begin{center}
        \begin{tikzpicture}
        \draw (0,0) -- (0,\fhratio*\textwidth) -- (\fwratio*\textwidth, \fhratio*\textwidth) -- (\fwratio*\textwidth, 0) -- (0, 0);
        \draw (0.3*\fwratio*\textwidth,0.3*\fhratio*\textwidth) --(0.7*\fwratio*\textwidth,0.7*\fhratio*\textwidth);
        \end{tikzpicture}
        \end{center}
        \caption{Panel C}
        \label{fig:panelc}
    \end{subfigure}
    \hfill
    \begin{subfigure}[b]{0.49\textwidth}
        \begin{center}
        \begin{tikzpicture}
        \draw (0,0) -- (0,\fhratio*\textwidth) -- (\fwratio*\textwidth, \fhratio*\textwidth) -- (\fwratio*\textwidth, 0) -- (0, 0);
        \draw (0.3*\fwratio*\textwidth,0.3*\fhratio*\textwidth) --(0.7*\fwratio*\textwidth,0.7*\fhratio*\textwidth);
        \end{tikzpicture}
        \end{center}
        \caption{Panel D}
        \label{fig:paneld}
    \end{subfigure}
    \caption{Figure with Four Subfigures Each Containing Tikz Figure}\label{fig:tikztogether}
\end{figure}

\end{document}


text:
\subsection{Output}

\paragraph{print\_level:}\label{sec:print_level} Output verbosity level. $\;$ \\
 Sets the default verbosity level for console
output. The larger this value the more detailed
is the output. The valid range for this integer option is
$0 \le {\tt print\_level } \le 12$
and its default value is $5$.

\paragraph{print\_user\_options:}\label{sec:print_user_options} Print all options set by the user. $\;$ \\
 If selected, the algorithm will print the list of
all options set by the user including their
values and whether they have been used.  In some
cases this information might be incorrect, due to
the internal program flow.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: don't print options
   \item yes: print options
\end{itemize}

\paragraph{print\_options\_documentation:}\label{sec:print_options_documentation} Switch to print all algorithmic options. $\;$ \\
 If selected, the algorithm will print the list of
all available algorithmic options with some
documentation before solving the optimization
problem.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: don't print list
   \item yes: print list
\end{itemize}

\paragraph{output\_file:}\label{sec:output_file} File name of desired output file (leave unset for no file output). $\;$ \\
 NOTE: This option only works when read from the
ipopt.opt options file! An output file with this
name will be written (leave unset for no file
output).  The verbosity level is by default set
to "print\_level", but can be overridden with
"file\_print\_level".  The file name is changed
to use only small letters.
The default value for this string option is "".
\\
Possible values:
\begin{itemize}
   \item *: Any acceptable standard file name
\end{itemize}

\paragraph{file\_print\_level:}\label{sec:file_print_level} Verbosity level for output file. $\;$ \\
 NOTE: This option only works when read from the
ipopt.opt options file! Determines the verbosity
level for the file specified by "output\_file".
By default it is the same as "print\_level". The valid range for this integer option is
$0 \le {\tt file\_print\_level } \le 12$
and its default value is $5$.

\paragraph{option\_file\_name:}\label{sec:option_file_name} File name of options file (to overwrite default). $\;$ \\
 By default, the name of the Ipopt options file is
"ipopt.opt" - or something else if specified in
the IpoptApplication::Initialize call. If this
option is set by SetStringValue BEFORE the
options file is read, it specifies the name of
the options file.  It does not make any sense to
specify this option within the options file.
The default value for this string option is "".
\\
Possible values:
\begin{itemize}
   \item *: Any acceptable standard file name
\end{itemize}

\paragraph{print\_info\_string:}\label{sec:print_info_string} Enables printing of additional info string at end of iteration output. $\;$ \\
 This string contains some insider information
about the current iteration.  For details, look
for "Diagnostic Tags" in the Ipopt documentation.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: don't print string
   \item yes: print string at end of each iteration output
\end{itemize}

\paragraph{inf\_pr\_output:}\label{sec:inf_pr_output} Determines what value is printed in the "inf\_pr" output column. $\;$ \\
 Ipopt works with a reformulation of the original
problem, where slacks are introduced and the
problem might have been scaled.  The choice
"internal" prints out the constraint violation of
this formulation. With "original" the true
constraint violation in the original NLP is
printed.
The default value for this string option is "original".
\\
Possible values:
\begin{itemize}
   \item internal: max-norm of violation of internal equality
constraints
   \item original: maximal constraint violation in original NLP
\end{itemize}

\subsection{Termination}

\paragraph{tol:}\label{sec:tol} Desired convergence tolerance (relative). $\;$ \\
 Determines the convergence tolerance for the
algorithm.  The algorithm terminates
successfully, if the (scaled) NLP error becomes
smaller than this value, and if the (absolute)
criteria according to "dual\_inf\_tol",
"primal\_inf\_tol", and "compl\_inf\_tol" are
met.  (This is epsilon\_tol in Eqn. (6) in
implementation paper).  See also
"acceptable\_tol" as a second termination
criterion.  Note, some other algorithmic features
also use this quantity to determine thresholds
etc. The valid range for this real option is
$0 <  {\tt tol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-08}$.

\paragraph{max\_iter:}\label{sec:max_iter} Maximum number of iterations. $\;$ \\
 The algorithm terminates with an error message if
the number of iterations exceeded this number. The valid range for this integer option is
$0 \le {\tt max\_iter } <  {\tt +inf}$
and its default value is $3000$.

\paragraph{max\_cpu\_time:}\label{sec:max_cpu_time} Maximum number of CPU seconds. $\;$ \\
 A limit on CPU seconds that Ipopt can use to
solve one problem.  If during the convergence
check this limit is exceeded, Ipopt will
terminate with a corresponding error message. The valid range for this real option is
$0 <  {\tt max\_cpu\_time } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+06}$.

\paragraph{dual\_inf\_tol:}\label{sec:dual_inf_tol} Desired threshold for the dual infeasibility. $\;$ \\
 Absolute tolerance on the dual infeasibility.
Successful termination requires that the max-norm
of the (unscaled) dual infeasibility is less than
this threshold. The valid range for this real option is
$0 <  {\tt dual\_inf\_tol } <  {\tt +inf}$
and its default value is $1$.

\paragraph{constr\_viol\_tol:}\label{sec:constr_viol_tol} Desired threshold for the constraint violation. $\;$ \\
 Absolute tolerance on the constraint violation.
Successful termination requires that the max-norm
of the (unscaled) constraint violation is less
than this threshold. The valid range for this real option is
$0 <  {\tt constr\_viol\_tol } <  {\tt +inf}$
and its default value is $0.0001$.

\paragraph{compl\_inf\_tol:}\label{sec:compl_inf_tol} Desired threshold for the complementarity conditions. $\;$ \\
 Absolute tolerance on the complementarity.
Successful termination requires that the max-norm
of the (unscaled) complementarity is less than
this threshold. The valid range for this real option is
$0 <  {\tt compl\_inf\_tol } <  {\tt +inf}$
and its default value is $0.0001$.

\paragraph{acceptable\_tol:}\label{sec:acceptable_tol} "Acceptable" convergence tolerance (relative). $\;$ \\
 Determines which (scaled) overall optimality
error is considered to be "acceptable." There are
two levels of termination criteria.  If the usual
"desired" tolerances (see tol, dual\_inf\_tol
etc) are satisfied at an iteration, the algorithm
immediately terminates with a success message.
On the other hand, if the algorithm encounters
"acceptable\_iter" many iterations in a row that
are considered "acceptable", it will terminate
before the desired convergence tolerance is met.
This is useful in cases where the algorithm might
not be able to achieve the "desired" level of
accuracy. The valid range for this real option is
$0 <  {\tt acceptable\_tol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-06}$.

\paragraph{acceptable\_iter:}\label{sec:acceptable_iter} Number of "acceptable" iterates before triggering termination. $\;$ \\
 If the algorithm encounters this many successive
"acceptable" iterates (see "acceptable\_tol"), it
terminates, assuming that the problem has been
solved to best possible accuracy given round-off.
 If it is set to zero, this heuristic is disabled. The valid range for this integer option is
$0 \le {\tt acceptable\_iter } <  {\tt +inf}$
and its default value is $15$.

\paragraph{acceptable\_constr\_viol\_tol:}\label{sec:acceptable_constr_viol_tol} "Acceptance" threshold for the constraint violation. $\;$ \\
 Absolute tolerance on the constraint violation.
"Acceptable" termination requires that the
max-norm of the (unscaled) constraint violation
is less than this threshold; see also
acceptable\_tol. The valid range for this real option is
$0 <  {\tt acceptable\_constr\_viol\_tol } <  {\tt +inf}$
and its default value is $0.01$.

\paragraph{acceptable\_dual\_inf\_tol:}\label{sec:acceptable_dual_inf_tol} "Acceptance" threshold for the dual infeasibility. $\;$ \\
 Absolute tolerance on the dual infeasibility.
"Acceptable" termination requires that the
(max-norm of the unscaled) dual infeasibility is
less than this threshold; see also
acceptable\_tol. The valid range for this real option is
$0 <  {\tt acceptable\_dual\_inf\_tol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+10}$.

\paragraph{acceptable\_compl\_inf\_tol:}\label{sec:acceptable_compl_inf_tol} "Acceptance" threshold for the complementarity conditions. $\;$ \\
 Absolute tolerance on the complementarity.
"Acceptable" termination requires that the
max-norm of the (unscaled) complementarity is
less than this threshold; see also
acceptable\_tol. The valid range for this real option is
$0 <  {\tt acceptable\_compl\_inf\_tol } <  {\tt +inf}$
and its default value is $0.01$.

\paragraph{acceptable\_obj\_change\_tol:}\label{sec:acceptable_obj_change_tol} "Acceptance" stopping criterion based on objective function change. $\;$ \\
 If the relative change of the objective function
(scaled by Max(1,|f(x)|)) is less than this
value, this part of the acceptable tolerance
termination is satisfied; see also
acceptable\_tol.  This is useful for the
quasi-Newton option, which has trouble to bring
down the dual infeasibility. The valid range for this real option is
$0 \le {\tt acceptable\_obj\_change\_tol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+20}$.

\paragraph{diverging\_iterates\_tol:}\label{sec:diverging_iterates_tol} Threshold for maximal value of primal iterates. $\;$ \\
 If any component of the primal iterates exceeded
this value (in absolute terms), the optimization
is aborted with the exit message that the
iterates seem to be diverging. The valid range for this real option is
$0 <  {\tt diverging\_iterates\_tol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+20}$.

\subsection{NLP Scaling}

\paragraph{obj\_scaling\_factor:}\label{sec:obj_scaling_factor} Scaling factor for the objective function. $\;$ \\
 This option sets a scaling factor for the
objective function. The scaling is seen
internally by Ipopt but the unscaled objective is
reported in the console output. If additional
scaling parameters are computed (e.g.
user-scaling or gradient-based), both factors are
multiplied. If this value is chosen to be
negative, Ipopt will maximize the objective
function instead of minimizing it. The valid range for this real option is
${\tt -inf} <  {\tt obj\_scaling\_factor } <  {\tt +inf}$
and its default value is $1$.

\paragraph{nlp\_scaling\_method:}\label{sec:nlp_scaling_method} Select the technique used for scaling the NLP. $\;$ \\
 Selects the technique used for scaling the
problem internally before it is solved. For
user-scaling, the parameters come from the NLP.
If you are using AMPL, they can be specified
through suffixes ("scaling\_factor")
The default value for this string option is "gradient-based".
\\
Possible values:
\begin{itemize}
   \item none: no problem scaling will be performed
   \item user-scaling: scaling parameters will come from the user
   \item gradient-based: scale the problem so the maximum gradient at
the starting point is scaling\_max\_gradient
   \item equilibration-based: scale the problem so that first derivatives are
of order 1 at random points (only available
with MC19)
\end{itemize}

\paragraph{nlp\_scaling\_max\_gradient:}\label{sec:nlp_scaling_max_gradient} Maximum gradient after NLP scaling. $\;$ \\
 This is the gradient scaling cut-off. If the
maximum gradient is above this value, then
gradient based scaling will be performed. Scaling
parameters are calculated to scale the maximum
gradient back to this value. (This is g\_max in
Section 3.8 of the implementation paper.) Note:
This option is only used if
"nlp\_scaling\_method" is chosen as
"gradient-based". The valid range for this real option is
$0 <  {\tt nlp\_scaling\_max\_gradient } <  {\tt +inf}$
and its default value is $100$.

\paragraph{nlp\_scaling\_min\_value:}\label{sec:nlp_scaling_min_value} Minimum value of gradient-based scaling values. $\;$ \\
 This is the lower bound for the scaling factors
computed by gradient-based scaling method.  If
some derivatives of some functions are huge, the
scaling factors will otherwise become very small,
and the (unscaled) final constraint violation,
for example, might then be significant.  Note:
This option is only used if
"nlp\_scaling\_method" is chosen as
"gradient-based". The valid range for this real option is
$0 \le {\tt nlp\_scaling\_min\_value } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-08}$.

\subsection{NLP}

\paragraph{bound\_relax\_factor:}\label{sec:bound_relax_factor} Factor for initial relaxation of the bounds. $\;$ \\
 Before start of the optimization, the bounds
given by the user are relaxed.  This option sets
the factor for this relaxation.  If it is set to
zero, then then bounds relaxation is disabled.
(See Eqn.(35) in implementation paper.) The valid range for this real option is
$0 \le {\tt bound\_relax\_factor } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-08}$.

\paragraph{honor\_original\_bounds:}\label{sec:honor_original_bounds} Indicates whether final points should be projected into original bounds. $\;$ \\
 Ipopt might relax the bounds during the
optimization (see, e.g., option
"bound\_relax\_factor").  This option determines
whether the final point should be projected back
into the user-provide original bounds after the
optimization.
The default value for this string option is "yes".
\\
Possible values:
\begin{itemize}
   \item no: Leave final point unchanged
   \item yes: Project final point back into original bounds
\end{itemize}

\paragraph{check\_derivatives\_for\_naninf:}\label{sec:check_derivatives_for_naninf} Indicates whether it is desired to check for Nan/Inf in derivative matrices $\;$ \\
 Activating this option will cause an error if an
invalid number is detected in the constraint
Jacobians or the Lagrangian Hessian.  If this is
not activated, the test is skipped, and the
algorithm might proceed with invalid numbers and
fail.  If test is activated and an invalid number
is detected, the matrix is written to output with
print\_level corresponding to J\_MORE\_DETAILED;
so beware of large output!
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: Don't check (faster).
   \item yes: Check Jacobians and Hessian for Nan and Inf.
\end{itemize}

\paragraph{nlp\_lower\_bound\_inf:}\label{sec:nlp_lower_bound_inf} any bound less or equal this value will be considered -inf (i.e. not lower bounded). $\;$ \\
 The valid range for this real option is
${\tt -inf} <  {\tt nlp\_lower\_bound\_inf } <  {\tt +inf}$
and its default value is $-1 \cdot 10^{+19}$.

\paragraph{nlp\_upper\_bound\_inf:}\label{sec:nlp_upper_bound_inf} any bound greater or this value will be considered +inf (i.e. not upper bounded). $\;$ \\
 The valid range for this real option is
${\tt -inf} <  {\tt nlp\_upper\_bound\_inf } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+19}$.

\paragraph{fixed\_variable\_treatment:}\label{sec:fixed_variable_treatment} Determines how fixed variables should be handled. $\;$ \\
 The main difference between those options is that
the starting point in the "make\_constraint" case
still has the fixed variables at their given
values, whereas in the case "make\_parameter" the
functions are always evaluated with the fixed
values for those variables.  Also, for
"relax\_bounds", the fixing bound constraints are
relaxed (according to" bound\_relax\_factor").
For both "make\_constraints" and "relax\_bounds",
bound multipliers are computed for the fixed
variables.
The default value for this string option is "make\_parameter".
\\
Possible values:
\begin{itemize}
   \item make\_parameter: Remove fixed variable from optimization
variables
   \item make\_constraint: Add equality constraints fixing variables
   \item relax\_bounds: Relax fixing bound constraints
\end{itemize}

\paragraph{jac\_c\_constant:}\label{sec:jac_c_constant} Indicates whether all equality constraints are linear $\;$ \\
 Activating this option will cause Ipopt to ask
for the Jacobian of the equality constraints only
once from the NLP and reuse this information
later.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: Don't assume that all equality constraints are
linear
   \item yes: Assume that equality constraints Jacobian are
constant
\end{itemize}

\paragraph{jac\_d\_constant:}\label{sec:jac_d_constant} Indicates whether all inequality constraints are linear $\;$ \\
 Activating this option will cause Ipopt to ask
for the Jacobian of the inequality constraints
only once from the NLP and reuse this information
later.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: Don't assume that all inequality constraints
are linear
   \item yes: Assume that equality constraints Jacobian are
constant
\end{itemize}

\paragraph{hessian\_constant:}\label{sec:hessian_constant} Indicates whether the problem is a quadratic problem $\;$ \\
 Activating this option will cause Ipopt to ask
for the Hessian of the Lagrangian function only
once from the NLP and reuse this information
later.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: Assume that Hessian changes
   \item yes: Assume that Hessian is constant
\end{itemize}

\subsection{Initialization}

\paragraph{bound\_frac:}\label{sec:bound_frac} Desired minimum relative distance from the initial point to bound. $\;$ \\
 Determines how much the initial point might have
to be modified in order to be sufficiently inside
the bounds (together with "bound\_push").  (This
is kappa\_2 in Section 3.6 of implementation
paper.) The valid range for this real option is
$0 <  {\tt bound\_frac } \le 0.5$
and its default value is $0.01$.

\paragraph{bound\_push:}\label{sec:bound_push} Desired minimum absolute distance from the initial point to bound. $\;$ \\
 Determines how much the initial point might have
to be modified in order to be sufficiently inside
the bounds (together with "bound\_frac").  (This
is kappa\_1 in Section 3.6 of implementation
paper.) The valid range for this real option is
$0 <  {\tt bound\_push } <  {\tt +inf}$
and its default value is $0.01$.

\paragraph{slack\_bound\_frac:}\label{sec:slack_bound_frac} Desired minimum relative distance from the initial slack to bound. $\;$ \\
 Determines how much the initial slack variables
might have to be modified in order to be
sufficiently inside the inequality bounds
(together with "slack\_bound\_push").  (This is
kappa\_2 in Section 3.6 of implementation paper.) The valid range for this real option is
$0 <  {\tt slack\_bound\_frac } \le 0.5$
and its default value is $0.01$.

\paragraph{slack\_bound\_push:}\label{sec:slack_bound_push} Desired minimum absolute distance from the initial slack to bound. $\;$ \\
 Determines how much the initial slack variables
might have to be modified in order to be
sufficiently inside the inequality bounds
(together with "slack\_bound\_frac").  (This is
kappa\_1 in Section 3.6 of implementation paper.) The valid range for this real option is
$0 <  {\tt slack\_bound\_push } <  {\tt +inf}$
and its default value is $0.01$.

\paragraph{bound\_mult\_init\_val:}\label{sec:bound_mult_init_val} Initial value for the bound multipliers. $\;$ \\
 All dual variables corresponding to bound
constraints are initialized to this value. The valid range for this real option is
$0 <  {\tt bound\_mult\_init\_val } <  {\tt +inf}$
and its default value is $1$.

\paragraph{constr\_mult\_init\_max:}\label{sec:constr_mult_init_max} Maximum allowed least-square guess of constraint multipliers. $\;$ \\
 Determines how large the initial least-square
guesses of the constraint multipliers are allowed
to be (in max-norm). If the guess is larger than
this value, it is discarded and all constraint
multipliers are set to zero.  This options is
also used when initializing the restoration
phase. By default,
"resto.constr\_mult\_init\_max" (the one used in
RestoIterateInitializer) is set to zero. The valid range for this real option is
$0 \le {\tt constr\_mult\_init\_max } <  {\tt +inf}$
and its default value is $1000$.

\paragraph{bound\_mult\_init\_method:}\label{sec:bound_mult_init_method} Initialization method for bound multipliers $\;$ \\
 This option defines how the iterates for the
bound multipliers are initialized.  If "constant"
is chosen, then all bound multipliers are
initialized to the value of
"bound\_mult\_init\_val".  If "mu-based" is
chosen, the each value is initialized to the the
value of "mu\_init" divided by the corresponding
slack variable.  This latter option might be
useful if the starting point is close to the
optimal solution.
The default value for this string option is "constant".
\\
Possible values:
\begin{itemize}
   \item constant: set all bound multipliers to the value of
bound\_mult\_init\_val
   \item mu-based: initialize to mu\_init/x\_slack
\end{itemize}

\subsection{Barrier Parameter}

\paragraph{mehrotra\_algorithm:}\label{sec:mehrotra_algorithm} Indicates if we want to do Mehrotra's algorithm. $\;$ \\
 If set to yes, Ipopt runs as Mehrotra's
predictor-corrector algorithm. This works usually
very well for LPs and convex QPs.  This
automatically disables the line search, and
chooses the (unglobalized) adaptive mu strategy
with the "probing" oracle, and uses
"corrector\_type=affine" without any safeguards;
you should not set any of those options
explicitly in addition.  Also, unless otherwise
specified, the values of "bound\_push",
"bound\_frac", and "bound\_mult\_init\_val" are
set more aggressive, and sets
"alpha\_for\_y=bound\_mult".
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: Do the usual Ipopt algorithm.
   \item yes: Do Mehrotra's predictor-corrector algorithm.
\end{itemize}

\paragraph{mu\_strategy:}\label{sec:mu_strategy} Update strategy for barrier parameter. $\;$ \\
 Determines which barrier parameter update
strategy is to be used.
The default value for this string option is "monotone".
\\
Possible values:
\begin{itemize}
   \item monotone: use the monotone (Fiacco-McCormick) strategy
   \item adaptive: use the adaptive update strategy
\end{itemize}

\paragraph{mu\_oracle:}\label{sec:mu_oracle} Oracle for a new barrier parameter in the adaptive strategy. $\;$ \\
 Determines how a new barrier parameter is
computed in each "free-mode" iteration of the
adaptive barrier parameter strategy. (Only
considered if "adaptive" is selected for option
"mu\_strategy").
The default value for this string option is "quality-function".
\\
Possible values:
\begin{itemize}
   \item probing: Mehrotra's probing heuristic
   \item loqo: LOQO's centrality rule
   \item quality-function: minimize a quality function
\end{itemize}

\paragraph{quality\_function\_max\_section\_steps:}\label{sec:quality_function_max_section_steps} Maximum number of search steps during direct search procedure determining the optimal centering parameter. $\;$ \\
 The golden section search is performed for the
quality function based mu oracle. (Only used if
option "mu\_oracle" is set to "quality-function".) The valid range for this integer option is
$0 \le {\tt quality\_function\_max\_section\_steps } <  {\tt +inf}$
and its default value is $8$.

\paragraph{fixed\_mu\_oracle:}\label{sec:fixed_mu_oracle} Oracle for the barrier parameter when switching to fixed mode. $\;$ \\
 Determines how the first value of the barrier
parameter should be computed when switching to
the "monotone mode" in the adaptive strategy.
(Only considered if "adaptive" is selected for
option "mu\_strategy".)
The default value for this string option is "average\_compl".
\\
Possible values:
\begin{itemize}
   \item probing: Mehrotra's probing heuristic
   \item loqo: LOQO's centrality rule
   \item quality-function: minimize a quality function
   \item average\_compl: base on current average complementarity
\end{itemize}

\paragraph{adaptive\_mu\_globalization:}\label{sec:adaptive_mu_globalization} Globalization strategy for the adaptive mu selection mode. $\;$ \\
 To achieve global convergence of the adaptive
version, the algorithm has to switch to the
monotone mode (Fiacco-McCormick approach) when
convergence does not seem to appear.  This option
sets the criterion used to decide when to do this
switch. (Only used if option "mu\_strategy" is
chosen as "adaptive".)
The default value for this string option is "obj-constr-filter".
\\
Possible values:
\begin{itemize}
   \item kkt-error: nonmonotone decrease of kkt-error
   \item obj-constr-filter: 2-dim filter for objective and constraint
violation
   \item never-monotone-mode: disables globalization
\end{itemize}

\paragraph{mu\_init:}\label{sec:mu_init} Initial value for the barrier parameter. $\;$ \\
 This option determines the initial value for the
barrier parameter (mu).  It is only relevant in
the monotone, Fiacco-McCormick version of the
algorithm. (i.e., if "mu\_strategy" is chosen as
"monotone") The valid range for this real option is
$0 <  {\tt mu\_init } <  {\tt +inf}$
and its default value is $0.1$.

\paragraph{mu\_max\_fact:}\label{sec:mu_max_fact} Factor for initialization of maximum value for barrier parameter. $\;$ \\
 This option determines the upper bound on the
barrier parameter.  This upper bound is computed
as the average complementarity at the initial
point times the value of this option. (Only used
if option "mu\_strategy" is chosen as "adaptive".) The valid range for this real option is
$0 <  {\tt mu\_max\_fact } <  {\tt +inf}$
and its default value is $1000$.

\paragraph{mu\_max:}\label{sec:mu_max} Maximum value for barrier parameter. $\;$ \\
 This option specifies an upper bound on the
barrier parameter in the adaptive mu selection
mode.  If this option is set, it overwrites the
effect of mu\_max\_fact. (Only used if option
"mu\_strategy" is chosen as "adaptive".) The valid range for this real option is
$0 <  {\tt mu\_max } <  {\tt +inf}$
and its default value is $100000$.

\paragraph{mu\_min:}\label{sec:mu_min} Minimum value for barrier parameter. $\;$ \\
 This option specifies the lower bound on the
barrier parameter in the adaptive mu selection
mode. By default, it is set to the minimum of
1e-11 and
min("tol","compl\_inf\_tol")/("barrier\_tol\_fact-
or"+1), which should be a reasonable value. (Only
used if option "mu\_strategy" is chosen as
"adaptive".) The valid range for this real option is
$0 <  {\tt mu\_min } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-11}$.

\paragraph{mu\_target:}\label{sec:mu_target} Desired value of complementarity. $\;$ \\
 Usually, the barrier parameter is driven to zero
and the termination test for complementarity is
measured with respect to zero complementarity.
However, in some cases it might be desired to
have Ipopt solve barrier problem for strictly
positive value of the barrier parameter.  In this
case, the value of "mu\_target" specifies the
final value of the barrier parameter, and the
termination tests are then defined with respect
to the barrier problem for this value of the
barrier parameter. The valid range for this real option is
$0 \le {\tt mu\_target } <  {\tt +inf}$
and its default value is $0$.

\paragraph{barrier\_tol\_factor:}\label{sec:barrier_tol_factor} Factor for mu in barrier stop test. $\;$ \\
 The convergence tolerance for each barrier
problem in the monotone mode is the value of the
barrier parameter times "barrier\_tol\_factor".
This option is also used in the adaptive mu
strategy during the monotone mode. (This is
kappa\_epsilon in implementation paper). The valid range for this real option is
$0 <  {\tt barrier\_tol\_factor } <  {\tt +inf}$
and its default value is $10$.

\paragraph{mu\_linear\_decrease\_factor:}\label{sec:mu_linear_decrease_factor} Determines linear decrease rate of barrier parameter. $\;$ \\
 For the Fiacco-McCormick update procedure the new
barrier parameter mu is obtained by taking the
minimum of mu*"mu\_linear\_decrease\_factor" and
mu\^"superlinear\_decrease\_power".  (This is
kappa\_mu in implementation paper.) This option
is also used in the adaptive mu strategy during
the monotone mode. The valid range for this real option is
$0 <  {\tt mu\_linear\_decrease\_factor } <  1$
and its default value is $0.2$.

\paragraph{mu\_superlinear\_decrease\_power:}\label{sec:mu_superlinear_decrease_power} Determines superlinear decrease rate of barrier parameter. $\;$ \\
 For the Fiacco-McCormick update procedure the new
barrier parameter mu is obtained by taking the
minimum of mu*"mu\_linear\_decrease\_factor" and
mu\^"superlinear\_decrease\_power".  (This is
theta\_mu in implementation paper.) This option
is also used in the adaptive mu strategy during
the monotone mode. The valid range for this real option is
$1 <  {\tt mu\_superlinear\_decrease\_power } <  2$
and its default value is $1.5$.

\subsection{Multiplier Updates}

\paragraph{alpha\_for\_y:}\label{sec:alpha_for_y} Method to determine the step size for constraint multipliers. $\;$ \\
 This option determines how the step size
(alpha\_y) will be calculated when updating the
constraint multipliers.
The default value for this string option is "primal".
\\
Possible values:
\begin{itemize}
   \item primal: use primal step size
   \item bound-mult: use step size for the bound multipliers (good
for LPs)
   \item min: use the min of primal and bound multipliers
   \item max: use the max of primal and bound multipliers
   \item full: take a full step of size one
   \item min-dual-infeas: choose step size minimizing new dual
infeasibility
   \item safer-min-dual-infeas: like "min\_dual\_infeas", but safeguarded by
"min" and "max"
   \item primal-and-full: use the primal step size, and full step if
delta\_x <= alpha\_for\_y\_tol
   \item dual-and-full: use the dual step size, and full step if
delta\_x <= alpha\_for\_y\_tol
   \item acceptor: Call LSAcceptor to get step size for y
\end{itemize}

\paragraph{alpha\_for\_y\_tol:}\label{sec:alpha_for_y_tol} Tolerance for switching to full equality multiplier steps. $\;$ \\
 This is only relevant if "alpha\_for\_y" is
chosen "primal-and-full" or "dual-and-full".  The
step size for the equality constraint multipliers
is taken to be one if the max-norm of the primal
step is less than this tolerance. The valid range for this real option is
$0 \le {\tt alpha\_for\_y\_tol } <  {\tt +inf}$
and its default value is $10$.

\paragraph{recalc\_y:}\label{sec:recalc_y} Tells the algorithm to recalculate the equality and inequality multipliers as least square estimates. $\;$ \\
 This asks the algorithm to recompute the
multipliers, whenever the current infeasibility
is less than recalc\_y\_feas\_tol. Choosing yes
might be helpful in the quasi-Newton option.
However, each recalculation requires an extra
factorization of the linear system.  If a limited
memory quasi-Newton option is chosen, this is
used by default.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: use the Newton step to update the multipliers
   \item yes: use least-square multiplier estimates
\end{itemize}

\paragraph{recalc\_y\_feas\_tol:}\label{sec:recalc_y_feas_tol} Feasibility threshold for recomputation of multipliers. $\;$ \\
 If recalc\_y is chosen and the current
infeasibility is less than this value, then the
multipliers are recomputed. The valid range for this real option is
$0 <  {\tt recalc\_y\_feas\_tol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-06}$.

\subsection{Line Search}

\paragraph{max\_soc:}\label{sec:max_soc} Maximum number of second order correction trial steps at each iteration. $\;$ \\
 Choosing 0 disables the second order corrections.
(This is p\^{max} of Step A-5.9 of Algorithm A in
the implementation paper.) The valid range for this integer option is
$0 \le {\tt max\_soc } <  {\tt +inf}$
and its default value is $4$.

\paragraph{watchdog\_shortened\_iter\_trigger:}\label{sec:watchdog_shortened_iter_trigger} Number of shortened iterations that trigger the watchdog. $\;$ \\
 If the number of successive iterations in which
the backtracking line search did not accept the
first trial point exceeds this number, the
watchdog procedure is activated.  Choosing "0"
here disables the watchdog procedure. The valid range for this integer option is
$0 \le {\tt watchdog\_shortened\_iter\_trigger } <  {\tt +inf}$
and its default value is $10$.

\paragraph{watchdog\_trial\_iter\_max:}\label{sec:watchdog_trial_iter_max} Maximum number of watchdog iterations. $\;$ \\
 This option determines the number of trial
iterations allowed before the watchdog procedure
is aborted and the algorithm returns to the
stored point. The valid range for this integer option is
$1 \le {\tt watchdog\_trial\_iter\_max } <  {\tt +inf}$
and its default value is $3$.

\paragraph{accept\_every\_trial\_step:}\label{sec:accept_every_trial_step} Always accept the first trial step. $\;$ \\
 Setting this option to "yes" essentially disables
the line search and makes the algorithm take
aggressive steps, without global convergence
guarantees.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: don't arbitrarily accept the full step
   \item yes: always accept the full step
\end{itemize}

\paragraph{corrector\_type:}\label{sec:corrector_type} The type of corrector steps that should be taken (unsupported!). $\;$ \\
 If "mu\_strategy" is "adaptive", this option
determines what kind of corrector steps should be
tried.
The default value for this string option is "none".
\\
Possible values:
\begin{itemize}
   \item none: no corrector
   \item affine: corrector step towards mu=0
   \item primal-dual: corrector step towards current mu
\end{itemize}

\subsection{Warm Start}

\paragraph{warm\_start\_init\_point:}\label{sec:warm_start_init_point} Warm-start for initial point $\;$ \\
 Indicates whether this optimization should use a
warm start initialization, where values of primal
and dual variables are given (e.g., from a
previous optimization of a related problem.)
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: do not use the warm start initialization
   \item yes: use the warm start initialization
\end{itemize}

\paragraph{warm\_start\_bound\_push:}\label{sec:warm_start_bound_push} same as bound\_push for the regular initializer. $\;$ \\
 The valid range for this real option is
$0 <  {\tt warm\_start\_bound\_push } <  {\tt +inf}$
and its default value is $0.001$.

\paragraph{warm\_start\_bound\_frac:}\label{sec:warm_start_bound_frac} same as bound\_frac for the regular initializer. $\;$ \\
 The valid range for this real option is
$0 <  {\tt warm\_start\_bound\_frac } \le 0.5$
and its default value is $0.001$.

\paragraph{warm\_start\_slack\_bound\_frac:}\label{sec:warm_start_slack_bound_frac} same as slack\_bound\_frac for the regular initializer. $\;$ \\
 The valid range for this real option is
$0 <  {\tt warm\_start\_slack\_bound\_frac } \le 0.5$
and its default value is $0.001$.

\paragraph{warm\_start\_slack\_bound\_push:}\label{sec:warm_start_slack_bound_push} same as slack\_bound\_push for the regular initializer. $\;$ \\
 The valid range for this real option is
$0 <  {\tt warm\_start\_slack\_bound\_push } <  {\tt +inf}$
and its default value is $0.001$.

\paragraph{warm\_start\_mult\_bound\_push:}\label{sec:warm_start_mult_bound_push} same as mult\_bound\_push for the regular initializer. $\;$ \\
 The valid range for this real option is
$0 <  {\tt warm\_start\_mult\_bound\_push } <  {\tt +inf}$
and its default value is $0.001$.

\paragraph{warm\_start\_mult\_init\_max:}\label{sec:warm_start_mult_init_max} Maximum initial value for the equality multipliers. $\;$ \\
 The valid range for this real option is
${\tt -inf} <  {\tt warm\_start\_mult\_init\_max } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+06}$.

\subsection{Restoration Phase}

\paragraph{expect\_infeasible\_problem:}\label{sec:expect_infeasible_problem} Enable heuristics to quickly detect an infeasible problem. $\;$ \\
 This options is meant to activate heuristics that
may speed up the infeasibility determination if
you expect that there is a good chance for the
problem to be infeasible.  In the filter line
search procedure, the restoration phase is called
more quickly than usually, and more reduction in
the constraint violation is enforced before the
restoration phase is left. If the problem is
square, this option is enabled automatically.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: the problem probably be feasible
   \item yes: the problem has a good chance to be infeasible
\end{itemize}

\paragraph{expect\_infeasible\_problem\_ctol:}\label{sec:expect_infeasible_problem_ctol} Threshold for disabling "expect\_infeasible\_problem" option. $\;$ \\
 If the constraint violation becomes smaller than
this threshold, the "expect\_infeasible\_problem"
heuristics in the filter line search are
disabled. If the problem is square, this options
is set to 0. The valid range for this real option is
$0 \le {\tt expect\_infeasible\_problem\_ctol } <  {\tt +inf}$
and its default value is $0.001$.

\paragraph{expect\_infeasible\_problem\_ytol:}\label{sec:expect_infeasible_problem_ytol} Multiplier threshold for activating "expect\_infeasible\_problem" option. $\;$ \\
 If the max norm of the constraint multipliers
becomes larger than this value and
"expect\_infeasible\_problem" is chosen, then the
restoration phase is entered. The valid range for this real option is
$0 <  {\tt expect\_infeasible\_problem\_ytol } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+08}$.

\paragraph{start\_with\_resto:}\label{sec:start_with_resto} Tells algorithm to switch to restoration phase in first iteration. $\;$ \\
 Setting this option to "yes" forces the algorithm
to switch to the feasibility restoration phase in
the first iteration. If the initial point is
feasible, the algorithm will abort with a failure.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: don't force start in restoration phase
   \item yes: force start in restoration phase
\end{itemize}

\paragraph{soft\_resto\_pderror\_reduction\_factor:}\label{sec:soft_resto_pderror_reduction_factor} Required reduction in primal-dual error in the soft restoration phase. $\;$ \\
 The soft restoration phase attempts to reduce the
primal-dual error with regular steps. If the
damped primal-dual step (damped only to satisfy
the fraction-to-the-boundary rule) is not
decreasing the primal-dual error by at least this
factor, then the regular restoration phase is
called. Choosing "0" here disables the soft
restoration phase. The valid range for this real option is
$0 \le {\tt soft\_resto\_pderror\_reduction\_factor } <  {\tt +inf}$
and its default value is $0.9999$.

\paragraph{required\_infeasibility\_reduction:}\label{sec:required_infeasibility_reduction} Required reduction of infeasibility before leaving restoration phase. $\;$ \\
 The restoration phase algorithm is performed,
until a point is found that is acceptable to the
filter and the infeasibility has been reduced by
at least the fraction given by this option. The valid range for this real option is
$0 \le {\tt required\_infeasibility\_reduction } <  1$
and its default value is $0.9$.

\paragraph{bound\_mult\_reset\_threshold:}\label{sec:bound_mult_reset_threshold} Threshold for resetting bound multipliers after the restoration phase. $\;$ \\
 After returning from the restoration phase, the
bound multipliers are updated with a Newton step
for complementarity.  Here, the change in the
primal variables during the entire restoration
phase is taken to be the corresponding primal
Newton step. However, if after the update the
largest bound multiplier exceeds the threshold
specified by this option, the multipliers are all
reset to 1. The valid range for this real option is
$0 \le {\tt bound\_mult\_reset\_threshold } <  {\tt +inf}$
and its default value is $1000$.

\paragraph{constr\_mult\_reset\_threshold:}\label{sec:constr_mult_reset_threshold} Threshold for resetting equality and inequality multipliers after restoration phase. $\;$ \\
 After returning from the restoration phase, the
constraint multipliers are recomputed by a least
square estimate.  This option triggers when those
least-square estimates should be ignored. The valid range for this real option is
$0 \le {\tt constr\_mult\_reset\_threshold } <  {\tt +inf}$
and its default value is $0$.

\paragraph{evaluate\_orig\_obj\_at\_resto\_trial:}\label{sec:evaluate_orig_obj_at_resto_trial} Determines if the original objective function should be evaluated at restoration phase trial points. $\;$ \\
 Setting this option to "yes" makes the
restoration phase algorithm evaluate the
objective function of the original problem at
every trial point encountered during the
restoration phase, even if this value is not
required.  In this way, it is guaranteed that the
original objective function can be evaluated
without error at all accepted iterates; otherwise
the algorithm might fail at a point where the
restoration phase accepts an iterate that is good
for the restoration phase problem, but not the
original problem.  On the other hand, if the
evaluation of the original objective is
expensive, this might be costly.
The default value for this string option is "yes".
\\
Possible values:
\begin{itemize}
   \item no: skip evaluation
   \item yes: evaluate at every trial point
\end{itemize}

\subsection{Linear Solver}

\paragraph{linear\_solver:}\label{sec:linear_solver} Linear solver used for step computations. $\;$ \\
 Determines which linear algebra package is to be
used for the solution of the augmented linear
system (for obtaining the search directions).
Note, the code must have been compiled with the
linear solver you want to choose. Depending on
your Ipopt installation, not all options are
available.
The default value for this string option is "ma27".
\\
Possible values:
\begin{itemize}
   \item ma27: use the Harwell routine MA27
   \item ma57: use the Harwell routine MA57
   \item ma77: use the Harwell routine HSL\_MA77
   \item ma86: use the Harwell routine HSL\_MA86
   \item pardiso: use the Pardiso package
   \item wsmp: use WSMP package
   \item mumps: use MUMPS package
   \item custom: use custom linear solver
\end{itemize}

\paragraph{linear\_system\_scaling:}\label{sec:linear_system_scaling} Method for scaling the linear system. $\;$ \\
 Determines the method used to compute symmetric
scaling factors for the augmented system (see
also the "linear\_scaling\_on\_demand" option).
This scaling is independent of the NLP problem
scaling.  By default, MC19 is only used if MA27
or MA57 are selected as linear solvers. This
value is only available if Ipopt has been
compiled with MC19.
The default value for this string option is "mc19".
\\
Possible values:
\begin{itemize}
   \item none: no scaling will be performed
   \item mc19: use the Harwell routine MC19
   \item slack-based: use the slack values
\end{itemize}

\paragraph{linear\_scaling\_on\_demand:}\label{sec:linear_scaling_on_demand} Flag indicating that linear scaling is only done if it seems required. $\;$ \\
 This option is only important if a linear scaling
method (e.g., mc19) is used.  If you choose "no",
then the scaling factors are computed for every
linear system from the start.  This can be quite
expensive. Choosing "yes" means that the
algorithm will start the scaling method only when
the solutions to the linear system seem not good,
and then use it until the end.
The default value for this string option is "yes".
\\
Possible values:
\begin{itemize}
   \item no: Always scale the linear system.
   \item yes: Start using linear system scaling if solutions
seem not good.
\end{itemize}

\paragraph{max\_refinement\_steps:}\label{sec:max_refinement_steps} Maximum number of iterative refinement steps per linear system solve. $\;$ \\
 Iterative refinement (on the full unsymmetric
system) is performed for each right hand side.
This option determines the maximum number of
iterative refinement steps. The valid range for this integer option is
$0 \le {\tt max\_refinement\_steps } <  {\tt +inf}$
and its default value is $10$.

\paragraph{min\_refinement\_steps:}\label{sec:min_refinement_steps} Minimum number of iterative refinement steps per linear system solve. $\;$ \\
 Iterative refinement (on the full unsymmetric
system) is performed for each right hand side.
This option determines the minimum number of
iterative refinements (i.e. at least
"min\_refinement\_steps" iterative refinement
steps are enforced per right hand side.) The valid range for this integer option is
$0 \le {\tt min\_refinement\_steps } <  {\tt +inf}$
and its default value is $1$.

\subsection{Hessian Perturbation}

\paragraph{max\_hessian\_perturbation:}\label{sec:max_hessian_perturbation} Maximum value of regularization parameter for handling negative curvature. $\;$ \\
 In order to guarantee that the search directions
are indeed proper descent directions, Ipopt
requires that the inertia of the (augmented)
linear system for the step computation has the
correct number of negative and positive
eigenvalues. The idea is that this guides the
algorithm away from maximizers and makes Ipopt
more likely converge to first order optimal
points that are minimizers. If the inertia is not
correct, a multiple of the identity matrix is
added to the Hessian of the Lagrangian in the
augmented system. This parameter gives the
maximum value of the regularization parameter. If
a regularization of that size is not enough, the
algorithm skips this iteration and goes to the
restoration phase. (This is delta\_w\^max in the
implementation paper.) The valid range for this real option is
$0 <  {\tt max\_hessian\_perturbation } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+20}$.

\paragraph{min\_hessian\_perturbation:}\label{sec:min_hessian_perturbation} Smallest perturbation of the Hessian block. $\;$ \\
 The size of the perturbation of the Hessian block
is never selected smaller than this value, unless
no perturbation is necessary. (This is
delta\_w\^min in implementation paper.) The valid range for this real option is
$0 \le {\tt min\_hessian\_perturbation } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-20}$.

\paragraph{first\_hessian\_perturbation:}\label{sec:first_hessian_perturbation} Size of first x-s perturbation tried. $\;$ \\
 The first value tried for the x-s perturbation in
the inertia correction scheme.(This is delta\_0
in the implementation paper.) The valid range for this real option is
$0 <  {\tt first\_hessian\_perturbation } <  {\tt +inf}$
and its default value is $0.0001$.

\paragraph{perturb\_inc\_fact\_first:}\label{sec:perturb_inc_fact_first} Increase factor for x-s perturbation for very first perturbation. $\;$ \\
 The factor by which the perturbation is increased
when a trial value was not sufficient - this
value is used for the computation of the very
first perturbation and allows a different value
for for the first perturbation than that used for
the remaining perturbations. (This is
bar\_kappa\_w\^+ in the implementation paper.) The valid range for this real option is
$1 <  {\tt perturb\_inc\_fact\_first } <  {\tt +inf}$
and its default value is $100$.

\paragraph{perturb\_inc\_fact:}\label{sec:perturb_inc_fact} Increase factor for x-s perturbation. $\;$ \\
 The factor by which the perturbation is increased
when a trial value was not sufficient - this
value is used for the computation of all
perturbations except for the first. (This is
kappa\_w\^+ in the implementation paper.) The valid range for this real option is
$1 <  {\tt perturb\_inc\_fact } <  {\tt +inf}$
and its default value is $8$.

\paragraph{perturb\_dec\_fact:}\label{sec:perturb_dec_fact} Decrease factor for x-s perturbation. $\;$ \\
 The factor by which the perturbation is decreased
when a trial value is deduced from the size of
the most recent successful perturbation. (This is
kappa\_w\^- in the implementation paper.) The valid range for this real option is
$0 <  {\tt perturb\_dec\_fact } <  1$
and its default value is $0.333333$.

\paragraph{jacobian\_regularization\_value:}\label{sec:jacobian_regularization_value} Size of the regularization for rank-deficient constraint Jacobians. $\;$ \\
 (This is bar delta\_c in the implementation
paper.) The valid range for this real option is
$0 \le {\tt jacobian\_regularization\_value } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-08}$.

\subsection{Quasi-Newton}

\paragraph{hessian\_approximation:}\label{sec:hessian_approximation} Indicates what Hessian information is to be used. $\;$ \\
 This determines which kind of information for the
Hessian of the Lagrangian function is used by the
algorithm.
The default value for this string option is "exact".
\\
Possible values:
\begin{itemize}
   \item exact: Use second derivatives provided by the NLP.
   \item limited-memory: Perform a limited-memory quasi-Newton
approximation
\end{itemize}

\paragraph{limited\_memory\_update\_type:}\label{sec:limited_memory_update_type} Quasi-Newton update formula for the limited memory approximation. $\;$ \\
 Determines which update formula is to be used for
the limited-memory quasi-Newton approximation.
The default value for this string option is "bfgs".
\\
Possible values:
\begin{itemize}
   \item bfgs: BFGS update (with skipping)
   \item sr1: SR1 (not working well)
\end{itemize}

\paragraph{limited\_memory\_max\_history:}\label{sec:limited_memory_max_history} Maximum size of the history for the limited quasi-Newton Hessian approximation. $\;$ \\
 This option determines the number of most recent
iterations that are taken into account for the
limited-memory quasi-Newton approximation. The valid range for this integer option is
$0 \le {\tt limited\_memory\_max\_history } <  {\tt +inf}$
and its default value is $6$.

\paragraph{limited\_memory\_max\_skipping:}\label{sec:limited_memory_max_skipping} Threshold for successive iterations where update is skipped. $\;$ \\
 If the update is skipped more than this number of
successive iterations, we quasi-Newton
approximation is reset. The valid range for this integer option is
$1 \le {\tt limited\_memory\_max\_skipping } <  {\tt +inf}$
and its default value is $2$.

\paragraph{limited\_memory\_initialization:}\label{sec:limited_memory_initialization} Initialization strategy for the limited memory quasi-Newton approximation. $\;$ \\
 Determines how the diagonal Matrix B\_0 as the
first term in the limited memory approximation
should be computed.
The default value for this string option is "scalar1".
\\
Possible values:
\begin{itemize}
   \item scalar1: sigma = s\^Ty/s\^Ts
   \item scalar2: sigma = y\^Ty/s\^Ty
   \item scalar3: arithmetic average of scalar1 and scalar2
   \item scalar4: geometric average of scalar1 and scalar2
   \item constant: sigma = limited\_memory\_init\_val
\end{itemize}

\paragraph{limited\_memory\_init\_val:}\label{sec:limited_memory_init_val} Value for B0 in low-rank update. $\;$ \\
 The starting matrix in the low rank update, B0,
is chosen to be this multiple of the identity in
the first iteration (when no updates have been
performed yet), and is constantly chosen as this
value, if "limited\_memory\_initialization" is
"constant". The valid range for this real option is
$0 <  {\tt limited\_memory\_init\_val } <  {\tt +inf}$
and its default value is $1$.

\paragraph{limited\_memory\_init\_val\_max:}\label{sec:limited_memory_init_val_max} Upper bound on value for B0 in low-rank update. $\;$ \\
 The starting matrix in the low rank update, B0,
is chosen to be this multiple of the identity in
the first iteration (when no updates have been
performed yet), and is constantly chosen as this
value, if "limited\_memory\_initialization" is
"constant". The valid range for this real option is
$0 <  {\tt limited\_memory\_init\_val\_max } <  {\tt +inf}$
and its default value is $1 \cdot 10^{+08}$.

\paragraph{limited\_memory\_init\_val\_min:}\label{sec:limited_memory_init_val_min} Lower bound on value for B0 in low-rank update. $\;$ \\
 The starting matrix in the low rank update, B0,
is chosen to be this multiple of the identity in
the first iteration (when no updates have been
performed yet), and is constantly chosen as this
value, if "limited\_memory\_initialization" is
"constant". The valid range for this real option is
$0 <  {\tt limited\_memory\_init\_val\_min } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-08}$.

\paragraph{limited\_memory\_special\_for\_resto:}\label{sec:limited_memory_special_for_resto} Determines if the quasi-Newton updates should be special during the restoration phase. $\;$ \\
 Until Nov 2010, Ipopt used a special update
during the restoration phase, but it turned out
that this does not work well.  The new default
uses the regular update procedure and it improves
results.  If for some reason you want to get back
to the original update, set this option to "yes".
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: use the same update as in regular iterations
   \item yes: use the a special update during restoration
phase
\end{itemize}

\subsection{Derivative Test}

\paragraph{derivative\_test:}\label{sec:derivative_test} Enable derivative checker $\;$ \\
 If this option is enabled, a (slow!) derivative
test will be performed before the optimization.
The test is performed at the user provided
starting point and marks derivative values that
seem suspicious
The default value for this string option is "none".
\\
Possible values:
\begin{itemize}
   \item none: do not perform derivative test
   \item first-order: perform test of first derivatives at starting
point
   \item second-order: perform test of first and second derivatives at
starting point
   \item only-second-order: perform test of second derivatives at starting
point
\end{itemize}

\paragraph{derivative\_test\_perturbation:}\label{sec:derivative_test_perturbation} Size of the finite difference perturbation in derivative test. $\;$ \\
 This determines the relative perturbation of the
variable entries. The valid range for this real option is
$0 <  {\tt derivative\_test\_perturbation } <  {\tt +inf}$
and its default value is $1 \cdot 10^{-08}$.

\paragraph{derivative\_test\_tol:}\label{sec:derivative_test_tol} Threshold for indicating wrong derivative. $\;$ \\
 If the relative deviation of the estimated
derivative from the given one is larger than this
value, the corresponding derivative is marked as
wrong. The valid range for this real option is
$0 <  {\tt derivative\_test\_tol } <  {\tt +inf}$
and its default value is $0.0001$.

\paragraph{derivative\_test\_print\_all:}\label{sec:derivative_test_print_all} Indicates whether information for all estimated derivatives should be printed. $\;$ \\
 Determines verbosity of derivative checker.
The default value for this string option is "no".
\\
Possible values:
\begin{itemize}
   \item no: Print only suspect derivatives
   \item yes: Print all derivatives
\end{itemize}

\paragraph{derivative\_test\_first\_index:}\label{sec:derivative_test_first_index} Index of first quantity to be checked by derivative checker $\;$ \\
 If this is set to -2, then all derivatives are
checked.  Otherwise, for the first derivative
test it specifies the first variable for which
the test is done (counting starts at 0).  For
second derivatives, it specifies the first
constraint for which the test is done; counting
of constraint indices starts at 0, and -1 refers
to the objective function Hessian. The valid range for this integer option is
$-2 \le {\tt derivative\_test\_first\_index } <  {\tt +inf}$
and its default value is $-2$.

\paragraph{point\_perturbation\_radius:}\label{sec:point_perturbation_radius} Maximal perturbation of an evaluation point. $\;$ \\
 If a random perturbation of a points is required,
this number indicates the maximal perturbation.
This is for example used when determining the
center point at which the finite difference
derivative test is executed. The valid range for this real option is
$0 \le {\tt point\_perturbation\_radius } <  {\tt +inf}$
and its default value is $10$.

\subsection{MA27 Linear Solver}

\paragraph{ma27\_pivtol:}\label{sec:ma27_pivtol} Pivot tolerance for the linear solver MA27. $\;$ \\
 A smaller number pivots for sparsity, a larger
number pivots for stability.  This option is only
available if Ipopt has been compiled with MA27. The valid range for this real option is
$0 <  {\tt ma27\_pivtol } <  1$
and its default value is $1 \cdot 10^{-08}$.

\paragraph{ma27\_pivtolmax:}\label{sec:ma27_pivtolmax} Maximum pivot tolerance for the linear solver MA27. $\;$ \\
 Ipopt may increase pivtol as high as pivtolmax to
get a more accurate solution to the linear
system.  This option is only available if Ipopt
has been compiled with MA27. The valid range for this real option is
$0 <  {\tt ma27\_pivtolmax } <  1$
and its default value is $0.0001$.

\paragraph{ma27\_liw\_init\_factor:}\label{sec:ma27_liw_init_factor} Integer workspace memory for MA27. $\;$ \\
 The initial integer workspace memory =
liw\_init\_factor * memory required by unfactored
system. Ipopt will increase the workspace size by
meminc\_factor if required.  This option is only
available if Ipopt has been compiled with MA27. The valid range for this real option is
$1 \le {\tt ma27\_liw\_init\_factor } <  {\tt +inf}$
and its default value is $5$.

\paragraph{ma27\_la\_init\_factor:}\label{sec:ma27_la_init_factor} Real workspace memory for MA27. $\;$ \\
 The initial real workspace memory =
la\_init\_factor * memory required by unfactored
system. Ipopt will increase the workspace size by
meminc\_factor if required.  This option is only
available if  Ipopt has been compiled with MA27. The valid range for this real option is
$1 \le {\tt ma27\_la\_init\_factor } <  {\tt +inf}$
and its default value is $5$.

\paragraph{ma27\_meminc\_factor:}\label{sec:ma27_meminc_factor} Increment factor for workspace size for MA27. $\;$ \\
 If the integer or real workspace is not large
enough, Ipopt will increase its size by this
factor.  This option is only available if Ipopt
has been compiled with MA27. The valid range for this real option is
$1 \le {\tt ma27\_meminc\_factor } <  {\tt +inf}$
and its default value is $10$.

\subsection{MA57 Linear Solver}

\paragraph{ma57\_pivtol:}\label{sec:ma57_pivtol} Pivot tolerance for the linear solver MA57. $\;$ \\
 A smaller number pivots for sparsity, a larger
number pivots for stability. This option is only
available if Ipopt has been compiled with MA57. The valid range for this real option is
$0 <  {\tt ma57\_pivtol } <  1$
and its default value is $1 \cdot 10^{-08}$.

\paragraph{ma57\_pivtolmax:}\label{sec:ma57_pivtolmax} Maximum pivot tolerance for the linear solver MA57. $\;$ \\
 Ipopt may increase pivtol as high as
ma57\_pivtolmax to get a more accurate solution
to the linear system.  This option is only
available if Ipopt has been compiled with MA57. The valid range for this real option is
$0 <  {\tt ma57\_pivtolmax } <  1$
and its default value is $0.0001$.

\paragraph{ma57\_pre\_alloc:}\label{sec:ma57_pre_alloc} Safety factor for work space memory allocation for the linear solver MA57. $\;$ \\
 If 1 is chosen, the suggested amount of work
space is used.  However, choosing a larger number
might avoid reallocation if the suggest values do
not suffice.  This option is only available if
Ipopt has been compiled with MA57. The valid range for this real option is
$1 \le {\tt ma57\_pre\_alloc } <  {\tt +inf}$
and its default value is $1.05$.

\paragraph{ma57\_pivot\_order:}\label{sec:ma57_pivot_order} Controls pivot order in MA57 $\;$ \\
 This is ICNTL(6) in MA57. The valid range for this integer option is
$0 \le {\tt ma57\_pivot\_order } \le 5$
and its default value is $5$.

\paragraph{ma57\_automatic\_scaling:}\label{sec:ma57_automatic_scaling} Controls MA57 automatic scaling $\;$ \\
 This option controls the internal scaling option
of MA57.This is ICNTL(15) in MA57.
The default value for this string option is "yes".
\\
Possible values:
\begin{itemize}
   \item no: Do not scale the linear system matrix
   \item yes: Scale the linear system matrix
\end{itemize}

\paragraph{ma57\_block\_size:}\label{sec:ma57_block_size} Controls block size used by Level 3 BLAS in MA57BD $\;$ \\
 This is ICNTL(11) in MA57. The valid range for this integer option is
$1 \le {\tt ma57\_block\_size } <  {\tt +inf}$
and its default value is $16$.

\paragraph{ma57\_node\_amalgamation:}\label{sec:ma57_node_amalgamation} Node amalgamation parameter $\;$ \\
 This is ICNTL(12) in MA57. The valid range for this integer option is
$1 \le {\tt ma57\_node\_amalgamation } <  {\tt +inf}$
and its default value is $16$.

\paragraph{ma57\_small\_pivot\_flag:}\label{sec:ma57_small_pivot_flag} If set to 1, then when small entries defined by CNTL(2) are detected they are removed and the corresponding pivots placed at the end of the factorization.  This can be particularly efficient if the matrix is highly rank deficient. $\;$ \\
 This is ICNTL(16) in MA57. The valid range for this integer option is
$0 \le {\tt ma57\_small\_pivot\_flag } \le 1$
and its default value is $0$.

\subsection{MUMPS Linear Solver}

\paragraph{mumps\_pivtol:}\label{sec:mumps_pivtol} Pivot tolerance for the linear solver MUMPS. $\;$ \\
 A smaller number pivots for sparsity, a larger
number pivots for stability.  This option is only
available if Ipopt has been compiled with MUMPS. The valid range for this real option is
$0 \le {\tt mumps\_pivtol } \le 1$
and its default value is $1 \cdot 10^{-06}$.

\paragraph{mumps\_pivtolmax:}\label{sec:mumps_pivtolmax} Maximum pivot tolerance for the linear solver MUMPS. $\;$ \\
 Ipopt may increase pivtol as high as pivtolmax to
get a more accurate solution to the linear
system.  This option is only available if Ipopt
has been compiled with MUMPS. The valid range for this real option is
$0 \le {\tt mumps\_pivtolmax } \le 1$
and its default value is $0.1$.

\paragraph{mumps\_mem\_percent:}\label{sec:mumps_mem_percent} Percentage increase in the estimated working space for MUMPS. $\;$ \\
 In MUMPS when significant extra fill-in is caused
by numerical pivoting, larger values of
mumps\_mem\_percent may help use the workspace
more efficiently.  On the other hand, if memory
requirement are too large at the very beginning
of the optimization, choosing a much smaller
value for this option, such as 5, might reduce
memory requirements. The valid range for this integer option is
$0 \le {\tt mumps\_mem\_percent } <  {\tt +inf}$
and its default value is $1000$.

\paragraph{mumps\_permuting\_scaling:}\label{sec:mumps_permuting_scaling} Controls permuting and scaling in MUMPS $\;$ \\
 This is ICNTL(6) in MUMPS. The valid range for this integer option is
$0 \le {\tt mumps\_permuting\_scaling } \le 7$
and its default value is $7$.

\paragraph{mumps\_pivot\_order:}\label{sec:mumps_pivot_order} Controls pivot order in MUMPS $\;$ \\
 This is ICNTL(7) in MUMPS. The valid range for this integer option is
$0 \le {\tt mumps\_pivot\_order } \le 7$
and its default value is $7$.

\paragraph{mumps\_scaling:}\label{sec:mumps_scaling} Controls scaling in MUMPS $\;$ \\
 This is ICNTL(8) in MUMPS. The valid range for this integer option is
$-2 \le {\tt mumps\_scaling } \le 77$
and its default value is $77$.

\subsection{Pardiso Linear Solver}

\paragraph{pardiso\_msglvl:}\label{sec:pardiso_msglvl} Pardiso message level $\;$ \\
 This determines the amount of analysis output
from the Pardiso solver. This is MSGLVL in the
Pardiso manual. The valid range for this integer option is
$0 \le {\tt pardiso\_msglvl } <  {\tt +inf}$
and its default value is $0$.

\paragraph{pardiso\_matching\_strategy:}\label{sec:pardiso_matching_strategy} Matching strategy to be used by Pardiso $\;$ \\
 This is IPAR(13) in Pardiso manual.  This option
is only available if Ipopt has been compiled with
Pardiso.
The default value for this string option is "complete+2x2".
\\
Possible values:
\begin{itemize}
   \item complete: Match complete (IPAR(13)=1)
   \item complete+2x2: Match complete+2x2 (IPAR(13)=2)
   \item constraints: Match constraints (IPAR(13)=3)
\end{itemize}

\paragraph{pardiso\_out\_of\_core\_power:}\label{sec:pardiso_out_of_core_power} Enables out-of-core variant of Pardiso $\;$ \\
 Setting this option to a positive integer k makes
Pardiso work in the out-of-core variant where the
factor is split in 2\^k subdomains.  This is
IPARM(50) in the Pardiso manual.  This option is
only available if Ipopt has been compiled with
Pardiso. The valid range for this integer option is
$0 \le {\tt pardiso\_out\_of\_core\_power } <  {\tt +inf}$
and its default value is $0$.

\subsection{WSMP Linear Solver}

\paragraph{wsmp\_num\_threads:}\label{sec:wsmp_num_threads} Number of threads to be used in WSMP $\;$ \\
 This determines on how many processors WSMP is
running on.  This option is only available if
Ipopt has been compiled with WSMP. The valid range for this integer option is
${\tt -inf} <  {\tt wsmp\_num\_threads } <  {\tt +inf}$
and its default value is $1$.

\paragraph{wsmp\_ordering\_option:}\label{sec:wsmp_ordering_option} Determines how ordering is done in WSMP (IPARM(16) $\;$ \\
 This corresponds to the value of WSSMP's
IPARM(16).  This option is only available if
Ipopt has been compiled with WSMP. The valid range for this integer option is
$-2 \le {\tt wsmp\_ordering\_option } \le 3$
and its default value is $1$.

\paragraph{wsmp\_pivtol:}\label{sec:wsmp_pivtol} Pivot tolerance for the linear solver WSMP. $\;$ \\
 A smaller number pivots for sparsity, a larger
number pivots for stability.  This option is only
available if Ipopt has been compiled with WSMP. The valid range for this real option is
$0 <  {\tt wsmp\_pivtol } <  1$
and its default value is $0.0001$.

\paragraph{wsmp\_pivtolmax:}\label{sec:wsmp_pivtolmax} Maximum pivot tolerance for the linear solver WSMP. $\;$ \\
 Ipopt may increase pivtol as high as pivtolmax to
get a more accurate solution to the linear
system.  This option is only available if Ipopt
has been compiled with WSMP. The valid range for this real option is
$0 <  {\tt wsmp\_pivtolmax } <  1$
and its default value is $0.1$.

\paragraph{wsmp\_scaling:}\label{sec:wsmp_scaling} Determines how the matrix is scaled by WSMP. $\;$ \\
 This corresponds to the value of WSSMP's
IPARM(10). This option is only available if Ipopt
has been compiled with WSMP. The valid range for this integer option is
$0 \le {\tt wsmp\_scaling } \le 3$
and its default value is $0$.

\paragraph{wsmp\_singularity\_threshold:}\label{sec:wsmp_singularity_threshold} WSMP's singularity threshold. $\;$ \\
 WSMP's DPARM(10) parameter.  The smaller this
value the less likely a matrix is declared
singular.  This option is only available if Ipopt
has been compiled with WSMP. The valid range for this real option is
$0 <  {\tt wsmp\_singularity\_threshold } <  1$
and its default value is $1 \cdot 10^{-18}$.

ext: tex

max_issues_repo_name: cpatrick/calatk

max_forks_repo_name: cpatrick/calatk


text:
\documentclass{article}

\usepackage{fancyhdr}
\usepackage[T1]{fontenc}
\newcommand{\changefont}[3]{\fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}

\usepackage{listings}
\usepackage{color}
\usepackage{hyperref}
\usepackage{graphicx}
\graphicspath{{}}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{orange}{rgb}{0.7,0.7,0}
\definecolor{lightgray}{rgb}{0.92,0.92,0.92}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=none,
  language=Python,
  aboveskip=3mm,
  belowskip=3mm,
  showstringspaces=false,
  columns=flexible,
  basicstyle={\small\ttfamily},
  numbers=none,
  backgroundcolor=\color{lightgray},
  numberstyle=\color{orange},
  keywordstyle=\color{mauve},
  commentstyle=\color{gray},
  stringstyle=\color{dkgreen},
  breaklines=true,
  breakatwhitespace=true,
  tabsize=3
}

% change title and date every week
\title{BPP Exercise 1 - print("Hello World!")}
\author{A. Hain, M. Nipshagen}
\date{09.04.2018, 8:00}

\makeatletter
\let\thetitle\@title
\let\theauthor\@author
\let\thedate\@date
\makeatother

% header and foot
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\thetitle}
\fancyhead[C]{}
\fancyhead[R]{\theauthor}
\renewcommand{\headrulewidth}{0.4pt}
\fancyfoot[L]{Due: \thedate}
\fancyfoot[R]{\thepage}
\renewcommand{\footrulewidth}{0.4pt}

\begin{document}

The deadline for this exercise sheet is \textbf{Monday, \thedate.}

% ----- PREAMBLE -----
\section*{Some words before we start...}
Welcome to the first exercise! Please submit your solutions to your group's folder
on Stud.IP by the deadline each week. So in case you have not joined a group yet,
please do so now. Though we strongly recommend that every group member solves all
exercises, please upload only one solution per group. We prefer if
you put all your files into a .zip archive and upload this to your folder but
uploading them separately is also fine.\\
So without further ado - let's start!

% ------ INSTALLATION INSTRUCTIONS -----
\section{Installing Python}
First, of course, you need to install Python. We recommend that you use Miniconda
which is a package management system and makes managing a Python installation easy.

\begin{itemize}
\item Download Miniconda from: \href{conda.io/miniconda.html}{conda.io/miniconda.html}
\item Install and add it to your path (refer to the documentation for that or, if you are having trouble,
come to the walk in session)
\item Then run the following commands in your terminal/command line:
\begin{lstlisting}
conda install pip numpy matplotlib scipy
conda install pandas jupyter scikit-learn scikit-image
\end{lstlisting}
\item You can of course also download Python from the official website and use pip
\end{itemize}

% ----- TASK 1 -----
\section{Hello you!}
To take first steps, we will for now work in the \textit{Python Shell}. To open
it, open your terminal/command line, type in "python" and press return.
It should give you an output similar to this: \\
\changefont{cmtt}{m}{n}\\
Python 3.6.3 |Anaconda, Inc. (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] on win32\\
Type "help", "copyright", "credits" or "license" for more information.\\
{>}>{>}\\
\changefont{cmr}{m}{n}\\
If this is similar to what you're seeing, then you're good to go. (Otherwise, please
check again if Python was installed correctly).\\
Now type the following and hit return:
\begin{lstlisting}
print("Hello World!")
\end{lstlisting}
This will give you the following output:\\
\changefont{cmtt}{m}{n}\\
Hello World!\\
\changefont{cmr}{m}{n}\\
Now modify the statement to create the following outputs:
\changefont{cmtt}{m}{n}
\begin{enumerate}
\item Hi, my name is [your name]!
\item What's up?
\item \textit{Bonus:}\\So what's "Python"?
\item \textit{Bonus:}\\Hello\\World
\end{enumerate}
\changefont{cmr}{m}{n}
To solve the two bonus tasks, you might have to do some googling. It's good to get
used to it right away because programmers have to google. A lot. Therefore, there
will probably be more exercises where we let you ask the internet for help.\\
When you're finished, please write all your statements that succesfully printed
the given sentences into a file and save it using the name \textit{hello.py}. Simply open a new file in your favourite editor for this.
Do not use Word or similar programmes, as they add a lot more than just your commands to the file.\\
Feel free to play around with more statements.\\
To exit the Python shell, use the following command:
\begin{lstlisting}
exit()
\end{lstlisting}
\textit{Solution (hello.py):}
\begin{lstlisting}
# from the original print("Hello World!") just change what's inside the brackets
print("Hi, my name is [your name]!")
print("What's up?")

# Bonus
print("So what's \"Python\"?") # use \ to cancel the meaning of "
print("Hello\nWorld") # \n will add a line break
\end{lstlisting}

% ----- TASK 2 -----
\section{Fun with Turtles}
% More shameless copying
In the late 20th century it became very popular to teach programming with a
turtle. Those turtles were little robots that could move around - check one
out \href{https://youtu.be/8wU6NdjTVTA}{here}
\footnote{Check \href{https://en.wikipedia.org/wiki/Turtle_(robot)}{this} for more info.
The concept is still popular today, although turtles are not enough anymore
(\href{https://studio.code.org/s/frozen/stage/1/puzzle/17}{https://studio.code.org/s/frozen/stage/1/puzzle/17})
}
Did you notice that it drew on the sheet of paper? No? Watch again then.\\
Since we can not afford to buy a turtle for everyone, Python allows us to draw
with a virtual turtle. Open your Python interpreter again, as you did in the
previous exercise.\\
\textit{Note for Windows users:} Please use this command instead this time:
\begin{lstlisting}
python -i
\end{lstlisting}
To use the turtle, you first have to tell Python that we need it:
\begin{lstlisting}
import turtle
\end{lstlisting}
To show our turtle, use:
\begin{lstlisting}
turtle.shape('turtle')
\end{lstlisting}
You should see a window like this:\\\\
\includegraphics[scale=0.6]{Ex_1_Turtle}\\
Now you can let your turtle move around and draw with the following commands:
\begin{lstlisting}
turtle.forward(100)
turtle.right(90)
turtle.backward(100)
turtle.left(90)
\end{lstlisting}
\textit{Another note for Windows users:} You might notice the turtle window is
sometimes unresponsive in the background. Don't worry - as soon as you're entering
a new command, it will show up in the foreground again.\\\\
If you want to reset what your turtle drew, you can use:
\begin{lstlisting}
turtle.reset()
\end{lstlisting}
In Germany little kids learn to draw the \textit{Haus vom Nikolaus} (St. Nicholas' house)
in one stroke. It looks like this:\\
\begin{center}
\includegraphics[scale=1]{Ex_1_Nicholas}
\end{center}
Can you give your turtle commands to draw something like this?\\
Store your successful commands in a file names \textit{nicholas.py} for your submission.\\\\
\textit{Solution (nicholas.py):}
\begin{lstlisting}
import turtle

turtle.shape('turtle')

# left edge
turtle.left(90)
turtle.forward(100)

# roof
turtle.right(45)
turtle.forward(70.71)
turtle.right(90)
turtle.forward(70.71)
turtle.right(135)
turtle.forward(100)

# cross and right edge
turtle.left(135)
turtle.forward(141.42)
turtle.right(45) # !
turtle.backward(100)
turtle.right(45)
turtle.forward(141.42)

# bottom edge
turtle.left(135)
turtle.forward(100)

# keep the window open (not needed for the homework)
turtle.done()
\end{lstlisting}

\end{document}

max_stars_repo_name: lfrommelt/monty

max_issues_repo_name: lfrommelt/monty

max_forks_repo_name: lfrommelt/monty