\part{Calculation commands reference}\label{part:Rechenbefehle}

When using calculation commands in Warteschlangensimulator,
it is distinguished between \textbf{expressions} and \textbf{comparisons}.
Expressions are used to calculate a numerical values, which are e.g.\ used as periods of time.
Comparisons provide a yes/no decision (for example, whether a client should be directed
in a particular direction). Unlike expressions, comparisons always contain at least one comparison operator.

All commands presented below are each recognized in \textbf{any case}.
There is no distinction between different case types.

\chapter{Constants}

The following constants are available in all calculation commands:

\begin{itemize}

\item
\cmd{e}: Returns the basis of the exponential function $e^x$. It is
$e\approx 2.718281828459$.

\item
\cmd{pi}: Returns the value of the circle constant $\pi$. It is
$\pi\approx 3.1415926535898$.

\end{itemize}

\chapter{Variables}

When calculating values in the context of a concrete client, the variables
\begin{itemize}
\item
\cmd{w} for the \textbf{previous waiting time} of the client,
\item
\cmd{t} for the \textbf{previous transfer time} of the client ant
\item
\cmd{p} for the \textbf{previous operating time} of the client are always available.
\end{itemize}

If the calculation is done for getting a clients score, the variable \cmd{w} does not contain
the total waiting time of the current client but the waiting time of the current client at the
current station.

Furthermore, all variables that are defined by an assignment element are always available.
Before the first assignment of a value to a variable, it has the value 0.

\chapter{Basic arithmetic operations}

Supported instructions for the basic arithmetic operations:
\begin{itemize}
\item Addition: \cmd{$+$}
\item Subtraction: \cmd{$-$}
\item Multiplication: \cmd{$*$}
\item Division: \cmd{$/$}
\item Potentiate: \cmd{$\hat~$}
\end{itemize}

The rule \textbf{point before line calculation} is taken into account.
To enforce deviating evaluations, \textbf{brackets} can be set.

\chapter{Trailing instructions}

The following expressions can be written directly behind a number:

\begin{itemize}
\item
\cmd{\%}:
The numerical value left to this symbol is interpreted as a percent value,
for example $30\%=0.3$.

\item
\cmd{$^2$}:
Exponentiate number by 2.

\item
\cmd{$^3$}:
Exponentiate number by 3.

\item
\cmd{!}:
Calculate factorial of the number, for example\ $4!=1\cdot2\cdot3\cdot4=24$.

\item
\cmd{$^{\circ}$}:
Converts the value left to this symbol from grad to radian, for example $180^{\circ}=3.1415\ldots$.\\
(See also section \ref{sec:Winkelfunktionen} in which the supported
trigonometric functions are presented.)
\end{itemize}

\chapter{General functions}

\begin{itemize}

\item
\cmd{abs(x)}:
Absolute value, for example \cm{abs(-5)=5}.

\item
\cmd{ceil(x)}:
Round to next bigger integer number, for example \cm{ceil(2.1)=3}

\item
\cmd{exp(x)}:
Exponential function $e^x$.

\item
\cmd{factorial(x)}:
Factorial, for example $4!=1\cdot2\cdot3\cdot4=24$.

\item
\cmd{binom(n;k)}:
Binomial coefficient

\item
\cmd{floor(x)}:
Round to next smaller integer number, for example \cm{floor(2.9)=2}

\item
\cmd{frac(x)}:
Fraction part, for example \cm{frac(1.3)=0,3}

\item
\cmd{gamma(x)}:
Gamma funkcion, for example \cm{gamma(5)=4!=24}

\item
\cmd{int(x)}:
Integer part, for example \cm{int(2.9)=2}

\item
\cmd{log(x)}:
Logarithm to the base $e$.

\item
\cmd{log(x;b)}:
Logarithm to the base $b$.

\item
\cmd{ld(x)}:
Logarithm to the base $2$, for example \cm{ld(256)=8}.

\item
\cmd{lg(x)}:
Logarithm to the base $10$, for example \cm{lg(100)=2}.

\item
\cmd{ln(x)}:
Logarithm to the base $e$.

\item
\cmd{modulo(a;b)} oder \cmd{mod(a;b)}:
Division reminder when dividing a/b

\item
\cmd{pow(x;y)}:
Exponentiate $x^y$.

\item
\cmd{round(x)}:
Round, for example \cm{round(4.4)=4} and \cm{round(4.5)=5}.

\item
\cmd{sign(x)}:
Sign of a number, for example \cm{sign(3)=1} and \cm{sign(-3)=-1}.

\item
\cmd{sqrt(x)}:
Square root, for example \cm{sqrt{81}=9}.

\item
\cmd{sqr(x)}:
Square the number, for example \cm{sqr(4)=16}.

\end{itemize}

\section{Random numbers}

The following commands can be used to generate random numbers
that are \textbf{equally distributed} in a certain area.
Section \ref{sec:Wahrscheinlichkeitsverteilungen} introduces
additional functions for generating random numbers according
to certain distribution functions.

\begin{itemize}

\item
\cmd{random()}:
Random number between 0 (inclusive) and 1 (exclusive).

\item
\cmd{random(x)}:
Random number between 0 (inclusive) and x (exclusive).

\end{itemize}

\chapter{Trigonometric functions}\label{sec:Winkelfunktionen}

The trigonometric functions always refer to $2\pi$ as a full circle (radians).
If angles in degrees ($360^\circ$ for the full circle) are to be specified
in the elementary trigonometric functions,
these have to be converted to radians using the angle functions, for example
\cm{sin($90^\circ$)=1}.

\section{Elementary trigonometric functions}

\begin{itemize}

\item
\cmd{sin(x)}:
Sine

\item
\cmd{cos(x)}:
Cosine

\item
\cmd{tan(x)}:
Tangent

\item
\cmd{cot(x)}:
Cotangent

\end{itemize}

\section{Hyperbolic trigonometric functions}

\begin{itemize}

\item
\cmd{sinh(x)}:
Sine hyperbolicus

\item
\cmd{cosh(x)}:
Cosine hyperbolicus

\item
\cmd{tanh(x)}:
Tangent hyperbolicus

\item
\cmd{coth(x)}:
Cotangent hyperbolicus

\end{itemize}

\section{Inverse of the elementary trigonometric functions}

\begin{itemize}

\item
\cmd{arcsin(x)}:
Arcus sine

\item
\cmd{arccos(x)}:
Arcus cosine

\item
\cmd{arctan(x)}:
Arcus tangent

\item
\cmd{arccot(x)}:
Arcus cotangent

\end{itemize}

\section{Inverse of the hyperbolic trigonometric functions}

\begin{itemize}

\item
\cmd{arcsinh(x)}:
Arcus sine hyperbolicus

\item
\cmd{arccosh(x)}:
Arcus cosine hyperbolicus

\item
\cmd{arctanh(x)}:
Arcus-Tangent hyperbolicus

\item
\cmd{arccoth(x)}:
Arcus-Cotangent hyperbolicus

\end{itemize}

\chapter{Functions with multiple parameters}

The following functions can accept any number of parameters.
The individual parameters have to be specified separately by semicolon ";".

\begin{itemize}

\item
\cmd{Min(a;b;c;...)}:
Calculates the minimum of the given numbers.

\item
\cmd{Max(a;b;c;...)}:
Calculates the maximum of the given numbers.

\item
\cmd{Sum(a;b;c;...)}:
Calculates the sum of the given numbers.

\item
\cmd{Mean(a;b;c;...)}:
Calculates the mean value of the given numbers.

\item
\cmd{Median(a;b;c;...)}:
Calculates the median of the given numbers.

\item
\cmd{Var(a;b;c;...)}:
Calculates the sample variance of the given numbers.

\item
\cmd{SD(a;b;c;...)}:
Calculates the sample standard deviation of the given numbers.

\item
\cmd{SCV(a;b;c;...)}:
Calculates the squared coefficient of variation of the given numbers.

\item
\cmd{CV(a;b;c;...)}:
Calculates the coefficient of variation of the given numbers.

\end{itemize}

\chapter{Probability distributions}\label{sec:Wahrscheinlichkeitsverteilungen}

By using the following commands both values of the density and the cumulative distribution function
of the following probability distributions can be calculated as well as random numbers are based on
one of these probability distributions:

\section{Hypergeometric distribution \texorpdfstring{$Hg(N,K,n)$}{Hg(N,K,n)}}

\begin{itemize}

\item
\cmd{HypergeometricDist(k;N;K;n)}:
Calculates the counting probability density at $k$.

\item
\cmd{HypergeometricDist(N;K;n)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Binomial distribution \texorpdfstring{$B(n,p)$}{B(n,p)}}

\begin{itemize}

\item
\cmd{BinomialDist(k;n;p)}:
Calculates the counting probability density at $k$.

\item
\cmd{BinomialDist(n;p)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Poisson distribution \texorpdfstring{$P(l)$}{P(l)}}

\begin{itemize}

\item
\cmd{PoissonDist(k;l)}:
Calculates the counting probability density at $k$.

\item
\cmd{PoissonDist(l)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Exponential distribution with mean \texorpdfstring{$a$}{a}}

\begin{itemize}

\item
\cmd{ExpDist(x;a;0)}:
Calculates the probability density at $x$.

\item
\cmd{ExpDist(x;a;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{ExpDist(a)}:
Generates a random number based on this distribution.

\item
\cmd{ExpDistRange(min;max;a)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Uniform distribution in the interval \texorpdfstring{$[a;b]$}{[a;b]}}

\begin{itemize}

\item
\cmd{UniformDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{UniformDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{UniformDist(a;b)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Normal distribution with mean \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{NormalDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{NormalDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{NormalDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{NormalDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Log-normal distribution with mean \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{LogNormalDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{LogNormalDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{LogNormalDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{LogNormalDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Gamma distribution with parameters \texorpdfstring{$\alpha=a$}{a} and \texorpdfstring{$\beta=b$}{b}}

\begin{itemize}

\item
\cmd{GammaDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{GammaDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{GammaDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{GammaDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Gamma distribution with mean \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{GammaDistDirect(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{GammaDistDirect(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{GammaDistDirect(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{GammaDistDirectRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Erlang distribution with parameters \texorpdfstring{$n$}{n} and \texorpdfstring{$\lambda=l$}{l}}

\begin{itemize}

\item
\cmd{ErlangDist(x;n;l;0)}:
Calculates the probability density at $x$.

\item
\cmd{ErlangDist(x;n;l;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{ErlangDist(n;b)}:
Generates a random number based on this distribution.

\item
\cmd{ErlangDistRange(min;max;n;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Beta distribution in the interval \texorpdfstring{$[a;b]$}{[a;b]} and with parameters \texorpdfstring{$\alpha=c$}{c} and \texorpdfstring{$\beta=d$}{d}}

\begin{itemize}

\item
\cmd{BetaDist(x;a;b;c;d;0)}:
Calculates the probability density at $x$.

\item
\cmd{BetaDist(x;a;b;c;d;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{BetaDist(a;b;c;d)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Beta distribution in the interval \texorpdfstring{$[a;b]$}{[a;b]} and with mean \texorpdfstring{$c$}{c} and standard deviation \texorpdfstring{$d$}{d}}

\begin{itemize}

\item
\cmd{BetaDistDirect(x;a;b;c;d;0)}:
Calculates the probability density at $x$.

\item
\cmd{BetaDistDirect(x;a;b;c;d;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{BetaDistDirect(a;b;c;d)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Weibull distribution with parameters Scale=\texorpdfstring{$a$}{a} and Form=\texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{WeibullDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{WeibullDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{WeibullDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{WeibullDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Cauchy distribution with mean \texorpdfstring{$a$}{a} and Scale=\texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{CauchyDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{CauchyDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{CauchyDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{CauchyDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{\texorpdfstring{Chi$^2$}{Chi2} distribution with \texorpdfstring{$n$}{n} degrees of freedom}

\begin{itemize}

\item
\cmd{ChiSquareDist(x;n;0)}:
Calculates the probability density at $x$.

\item
\cmd{ChiSquareDist(x;n;1)}:
Chi$^2$ distribution with $n$ degrees of freedom.

\item
\cmd{ChiSquareDist(n)}:
Generates a random number based on this distribution.

\item
\cmd{ChiSquareDistRange(min;max;n)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Chi distribution with \texorpdfstring{$n$}{n} degrees of freedom}

\begin{itemize}

\item
\cmd{ChiDist(x;n;0)}:
Calculates the probability density at $x$.

\item
\cmd{ChiDist(x;n;1)}:
Chi distribution with $n$ degrees of freedom.

\item
\cmd{ChiDist(n)}:
Generates a random number based on this distribution.

\item
\cmd{ChiDistRange(min;max;n)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{F distribution with \texorpdfstring{$a$}{a} degrees of freedom for the numerator and \texorpdfstring{$b$}{b} degrees of freedom for the denominator}

\begin{itemize}

\item
\cmd{FDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{FDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{FDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{FDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Johnson SU distribution with parameters \texorpdfstring{$\gamma=a$}{a}, \texorpdfstring{$\xi=b$}{b}, \texorpdfstring{$\delta=c$}{c} and \texorpdfstring{$\lambda=d$}{d}}

\begin{itemize}

\item
\cmd{JohnsonSUDist(x;a;b;c;d;0)}:
Calculates the probability density at $x$.

\item
\cmd{JohnsonSUDist(x;a;b;c;d;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{JohnsonSUDist(a;b;c;d)}:
Generates a random number based on this distribution.

\item
\cmd{JohnsonSUDistRange(min;max;a;b;c;d)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Triangular distribution over \texorpdfstring{$[a;c]$}{[a;c]} with most likely value \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{TriangularDist(x;a;b;c;0)}:
Calculates the probability density at $x$.

\item
\cmd{TriangularDist(x;a;b;c;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{TriangularDist(a;b;c)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Pert distribution over \texorpdfstring{$[a;c]$}{[a;c]} with most likely value \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{PertDist(x;a;b;c;0)}:
Calculates the probability density at $x$.

\item
\cmd{PertDist(x;a;b;c;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{PertDist(a;b;c)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Laplace distribution with mean \texorpdfstring{$mu$}{mu} and scale factor \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{LaplaceDist(x;mu;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{LaplaceDist(x;mu;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{LaplaceDist(mu;b)}:
Generates a random number based on this distribution.

\item
\cmd{LaplaceDistRange(min;max;mu;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Pareto distribution with scale parameter \texorpdfstring{$x_{\rm min}=xmin$}{xmin} and shape parameter \texorpdfstring{$\alpha=a$}{a}}

\begin{itemize}

\item
\cmd{ParetoDist(x;xmin;a;0)}:
Calculates the probability density at $x$.

\item
\cmd{ParetoDist(x;xmin;a;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{ParetoDist(xmin;a)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Logistic distribution with mean \texorpdfstring{$\mu=mu$}{mu} and scale parameter \texorpdfstring{$s$}{s}}

\begin{itemize}

\item
\cmd{LogisticDist(x;mu;s;0)}:
Calculates the probability density at $x$.

\item
\cmd{LogisticDist(x;mu;s;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{LogisticDist(mu;s)}:
Generates a random number based on this distribution.

\item
\cmd{LogisticDistRange(min;max;mu;s)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Inverse gaussian distribution with \texorpdfstring{$\lambda=l$}{l} and mean \texorpdfstring{$mu$}{mu}}

\begin{itemize}

\item
\cmd{InverseGaussianDist(x;l;mu;0)}:
Calculates the probability density at $x$.

\item
\cmd{InverseGaussianDist(x;l;mu;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{InverseGaussianDist(l;mu)}:
Generates a random number based on this distribution.

\item
\cmd{InverseGaussianDist(min;max;l;mu)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Rayleigh distribution with mean \texorpdfstring{$mu$}{mu}}

\begin{itemize}

\item
\cmd{RayleighDist(x;mu;0)}:
Calculates the probability density at $x$.

\item
\cmd{RayleighDist(x;mu;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{RayleighDist(mu)}:
Generates a random number based on this distribution.

\item
\cmd{RayleighDistRange(min;max;mu)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Log-Logistic distribution with \texorpdfstring{$\alpha$}{alpha} and mean \texorpdfstring{$\beta$}{beta}}

\begin{itemize}

\item
\cmd{LogLogisticDist(x;alpha;beta;0)}:
Calculates the probability density at $x$.

\item
\cmd{LogLogisticDist(x;alpha;beta;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{LogLogisticDist(alpha;beta)}:
Generates a random number based on this distribution.

\item
\cmd{LogLogisticDistRange(min;max;alpha;beta)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Power distribution on \texorpdfstring{$[a;b]$}{[a;b]} with exponent \texorpdfstring{$c$}{c}}

\begin{itemize}

\item
\cmd{PowerDist(x;a;b;c;0)}:
Calculates the probability density at $x$.

\item
\cmd{PowerDist(x;a;b;c;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{PowerDist(a;b;c)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Gumbel distribution with expected value \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{GumbelDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{GumbelDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{GumbelDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{GumbelDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Fatigue life distribution with location parameter \texorpdfstring{$\mu$}{mu}, scale parameter \texorpdfstring{$\beta$}{beta} and form parameter \texorpdfstring{$\gamma$}{gamma}}

\begin{itemize}

\item
\cmd{FatigueLifeDist(x;mu;beta;gamma;0)}:
Calculates the probability density at $x$.

\item
\cmd{FatigueLifeDist(x;mu;beta;gamma;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{FatigueLifeDist(mu;beta;gamma)}:
Generates a random number based on this distribution.

\item
\cmd{FatigueLifeDistRange(min;max;mu;beta;gamma)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Frechet distribution with location parameter \texorpdfstring{$\delta$}{delta}, scale parameter \texorpdfstring{$\beta$}{beta} and form parameter \texorpdfstring{$\alpha$}{alpha}}

\begin{itemize}

\item
\cmd{FrechetDist(x;delta;beta;alpha;0)}:
Calculates the probability density at $x$.

\item
\cmd{FrechetDist(x;delta;beta;alpha;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{FrechetDist(delta;beta;alpha)}:
Generates a random number based on this distribution.

\item
\cmd{FrechetDistRange(min;max;delta;beta;alpha)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Hyperbolic secant distribution with mean \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{HyperbolicSecantDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{HyperbolicSecantDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{HyperbolicSecantDist(a;b)}:
Generates a random number based on this distribution.

\item
\cmd{HyperbolicSecantDistRange(min;max;a;b)}:
Generates a random number based on this distribution but limits the range of the value to $min\ldots max$.

\end{itemize}

\section{Left sawtooth distribution over \texorpdfstring{$[a;b]$}{[a;b]}}

\begin{itemize}

\item
\cmd{LeftSawtoothDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{LeftSawtoothDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{LeftSawtoothDist(a;b)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Left sawtooth distribution with mean \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{LeftSawtoothDistDirect(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{LeftSawtoothDistDirect(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{LeftSawtoothDistDirect(a;b)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Right sawtooth distribution over \texorpdfstring{$[a;b]$}{[a;b]}}

\begin{itemize}

\item
\cmd{RightSawtoothDist(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{RightSawtoothDist(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{RightSawtoothDist(a;b)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Right sawtooth distribution with mean \texorpdfstring{$a$}{a} and standard deviation \texorpdfstring{$b$}{b}}

\begin{itemize}

\item
\cmd{RightSawtoothDistDirect(x;a;b;0)}:
Calculates the probability density at $x$.

\item
\cmd{RightSawtoothDistDirect(x;a;b;1)}:
Calculates the cumulative distribution function at $x$.

\item
\cmd{RightSawtoothDistDirect(a;b)}:
Generates a random number based on this distribution.

\end{itemize}

\section{Distribution based on empirical values}

\begin{itemize}

\item
\cmd{EmpiricalDensity(x;value1;value2;value3;...;max)}:\\
Calculates the probability density at $x$.
The specified values will be used for the density in the range from 0 to $max$.

\item
\cmd{EmpiricalDistribution(x;value1;value2;value3;...;max)}:\\
Calculates the cumulative distribution function at $x$.
The specified values will be used for the density in the range from 0 to $max$.

\item
\cmd{EmpiricalRandom(value1;value2;value3;...;max)}:\\
Generates a random number based on this distribution.
The specified values will be used for the density in the range from 0 to $max$.

\item
\cmd{EmpiricalDistributionMean(value1;value2;value3;...;max)}:\\
Calculates the expected value of the distribution.

\item
\cmd{EmpiricalDistributionMedian(value1;value2;value3;...;max)}:\\
Calculates the median of the distribution.

\item
\cmd{EmpiricalDistributionQuantil(value1;value2;value3;...;max;p)}:\\
Calculates the quantil for the probability p of the distribution.

\item
\cmd{EmpiricalDistributionSD(value1;value2;value3;...;max)}:\\
Calculates the standard deviation of the distribution.

\item
\cmd{EmpiricalDistributionVar(value1;value2;value3;...;max)}:\\
Calculates the variance of the distribution.

\item
\cmd{EmpiricalDistributionCV(value1;value2;value3;...;max)}:\\
Calculates the coefficient of variation of the distribution.

\end{itemize}

\chapter{Erlang C calculator}

By using the following command some performance indicators can be calculated
using the extended Erlang C formula:

\begin{itemize}

\item
\cmd{ErlangC(lambda;mu;nu;c;K;-1)}:\\
Calculates the average queue length $\E[N_Q]$.

\item
\cmd{ErlangC(lambda;mu;nu;c;K;-2)}:\\
Calculates the average number of clients in the system $\E[N]$.

\item
\cmd{ErlangC(lambda;mu;nu;c;K;-3)}:\\
Calculates the average waiting time $\E[W]$.

\item
\cmd{ErlangC(lambda;mu;nu;c;K;-4)}:\\
Calculates the average residence time $\E[V]$.

\item
\cmd{ErlangC(lambda;mu;nu;c;K;-5)}:\\
Calculates the average accessibility $1-P(A)$.

\item
\cmd{ErlangC(lambda;mu;nu;c;K;t)}:\\
Calculates the the probability for the service level at the $t$ seconds threshold $P(W\le t)$.

\end{itemize}

The parameters have the following meanings:
\begin{itemize}
\item
\cm{lambda}:\\
Arrival rate $\lambda$ (in clients per time unit), i.e.\ inverse of the mean inter-arrival time.
\item
\cm{mu}:\\
Service rate $\mu$ (in clients per time unit), i.e.\ inverse of the mean service time.
\item
\cm{nu}:\\
Cancelation rate $\nu$ (in clients per time unit), i.e.\ inverse of the mean waiting time tolerance.
\item
\cm{c}:\\
Number of available parallel operating servers.
\item
\cm{K}:\\
Number of available places in the system (waiting and processing places together, i.e.\ it is $K\ge c$).
\end{itemize}

\chapter{Allen-Cunneen approximation formula}

By using the following command some performance indicators can be calculated
using the Allen-Cunneen approximation formula:

\begin{itemize}

\item
\cmd{AllenCunneen(lambda;mu;cvI;cvS;c;-1)}:\\
Calculates the average queue length $E[N_Q]$.

\item
\cmd{AllenCunneen(lambda;mu;cvI;cvS;c;-2)}:\\
Calculates the average number of clients in the system $\E[N]$.

\item
\cmd{AllenCunneen(lambda;mu;cvI;cvS;c;-3)}:\\
Calculates the average waiting time $\E[W]$.

\item
\cmd{AllenCunneen(lambda;mu;cvI;cvS;c;-4)}:\\
Calculates the average residence time $\E[V]$.
\end{itemize}

The parameters have the following meanings:
\begin{itemize}
\item
\cm{lambda}:\\
Arrival rate $\lambda$ (in clients per time unit), i.e.\ inverse of the mean inter-arrival time.
\item
\cm{mu}:\\
Service rate $\mu$ (in clients per time unit), i.e.\ inverse of the mean service time.
\item
\cm{cvI}:\\
Coefficient of variation of the inter-arrival times $\CV[I]$ (small values mean that the inter-arrival times are very homogeneous).
\item
\cm{cvS}:\\
Coefficient of variation of the service times $\CV[S]$ (small values mean that the operations are very homogeneous).
\item
\cm{c}:\\
Number of available parallel operating servers.
\end{itemize}


\documentclass[a4paper]{article}

\usepackage{amsmath}
\usepackage{amssymb}

\hbadness=99999
\voffset=-1in
\oddsidemargin=5pt
\textwidth=450pt
\textheight=700pt

\begin{document}
\title{Linear Algebra: Week 4 Notes and Exercises}
\author{Christopher Aytona}
\maketitle

\section{Notes}
Notes\\

Vector Space\\
1) $\vec{0} \in V$\\
2) $\vec{u}, \vec{v} \in V$ then must have $\vec{u} + \vec{v} \in V$\\
3) $c \in \mathbb{R}, \vec{u} \in V$ then must have $c \vec{u} \in V$\\
Exercise\\

2) a) True because scaling $\vec{u}$ with either a positive or negative value will still be in $W$.\\
$\vec{u} = \begin{bmatrix}
x_1\\
y_1
\end{bmatrix}, x_1 \geq 0, y_1 \geq 0$\\
$c \begin{bmatrix}
x_1\\
y_1
\end{bmatrix} = \begin{bmatrix}
cx_1\\
cy_1
\end{bmatrix}$\\
$c \geq 0 \Rightarrow cx_1 \geq 0 \Rightarrow cy_1 \geq 0$\\
$c \leq 0 \Rightarrow cx_1 \leq 0 \Rightarrow cy_1 \leq 0$\\
b)Let $\vec{u} = \begin{bmatrix}
4\\
2
\end{bmatrix}$, $\vec{v} = \begin{bmatrix}
-1\\
-8
\end{bmatrix}$ $\therefore \vec{u} + \vec{v} = \begin{bmatrix}
3\\
-6
\end{bmatrix}$ which is not in any of the quadrants associated with $W \therefore W$ is not a vector space .\\

6) $p(t) = a + t^2$\\
$V = \begin{bmatrix}
x_1&x_2&x_3
\end{bmatrix} \in \mathbb{R}^3 | x_1 \in \mathbb{R}, x_2 = 0, x_3 = 1$\\
$\begin{bmatrix}
a&0&1
\end{bmatrix}$
Its not a vector space because scaling or adding vectors will change the $x_3$.\\

\section{Exercises}

1. Let $V$ be the first quadrant in the $xy$-plane; that is let $V = \{
\begin{bmatrix}
x\\
y
\end{bmatrix} : x \geq 0, y \geq 0 \} $\\
a) If $u$ and $v$ are in $V$, is $u+v$ in $V$? Why?\\
If $\vec{u}, \vec{v} \in V$ is $\vec{u} + \vec{v} \in V$\\
$\vec{u} \in V \Rightarrow \vec{u} = \begin{bmatrix}
x_1\\
y_1
\end{bmatrix}, x_1 \geq 0, y_1 \geq 0$\\
$\vec{v} \in V \Rightarrow \vec{v} = \begin{bmatrix}
x_2\\
y_2
\end{bmatrix}, x_2 \geq 0, y_2 \geq 0$\\
$\vec{u} + \vec{v} = \begin{bmatrix}
x_1\\
y_1
\end{bmatrix} + \begin{bmatrix}
x_2\\
y_2
\end{bmatrix} = \begin{bmatrix}
x_1 + x_2\\
y_1 + y_2
\end{bmatrix} = x_1 + x_2 \geq 0, y_1 + y_2 \geq 0$\\
$\Rightarrow \vec{u} + \vec{v} \in V$\\
b) Find a specific vector $u$ in $V$ and a specific scalar $c$ such that $cu$ is not in $V$. (This is enough to show that $V$ is not a vector space.)\\
Let $\vec{u} = \begin{bmatrix}
1\\
1
\end{bmatrix}$ then $\vec{u} \in V$,\\
Let $c = -1$ then $c\vec{u} = -1\begin{bmatrix}
1\\
1
\end{bmatrix} = \begin{bmatrix}
-1\\
-1
\end{bmatrix} \notin V$\\
2. Let $W$ be the union of the first and third quadrants in the $xy$-plane. That is, let $W = \{\begin{bmatrix}
x\\
y
\end{bmatrix} : xy \geq 0 \}$\\
a) If $u$ is in $W$ and $c$ is any scalar, is $cu$ in W? Why?\\
If $\vec{u} \in W, c \in \mathbb{R}$, is $c\vec{u} \in W$\\
Let $\vec{u} = \begin{bmatrix}
x_1\\
y_1
\end{bmatrix}, x_1y_1 \geq 0$, Let $c \in \mathbb{R}$\\
$cu = c\begin{bmatrix}
x_1\\
y_1
\end{bmatrix} = \begin{bmatrix}
cx_1\\
cy_1
\end{bmatrix}$\\
$(cx_1)(cy_1) = c^2x_1y_1$\\
But $c^2 \geq 0, \forall c \in \mathbb{R}$\\
$c^2x_1y_1 \geq 0 \Rightarrow c\vec{u}\in W$\\
b) Find specific vectors $u$ and $v$ in $W$ such that $u + v$ is not in $W$. This is enough to show that $W$ is not a vector space.\\
Let $\vec{u} = \begin{bmatrix}
1\\
2
\end{bmatrix}$, let $\vec{v} = \begin{bmatrix}
-2\\
-1
\end{bmatrix}$\\
Then $\vec{u} + \vec{v} = \begin{bmatrix}
1-2\\
2-1
\end{bmatrix} = \begin{bmatrix}
-1\\
1
\end{bmatrix} \notin W, since (-1)(1) = -1$\\

In Exercise 5-8, determine if the given set is a subspace of $\mathbb{P}_n$ for an appropriate value of $n$. Justify your answers.\\
All polynomials $p(t) = at^2$, $a \in \mathbb{R}$\\
5. All polynomials of the form $p(t) = at^2$, where $a$ is in $\mathbb{R}$\\
If $a = 0, p(t) = 0t^2 = \vec{0}$ $\therefore \vec{0} \in \{p(t)\}$\\
If $u(t) = a_1t^2$, $v(t) = a_2t^2$, then $\vec{u} + \vec{v} = a_1t^2+a_2t^2 = (a_1+a_2)t^2 \in \{ p(t) \}$\\
If $u(t) = a_1t^2$ and $c \in \mathbb{R}$, $c\vec{u} = ca_1t^2 = (ca_1)t^2 \in \{p(t)\}$\\
$\therefore \{p(t)\}$ is a subspace\\
6. All polynomials of the form $p(t) = a + t^2$, where $a$ is in $\mathbb{R}$\\
$\vec{0} = 0+0t+t^2$ is not in $\{p(t)\}$\\
If $n(t) = a_1 + t^2$, $c = 0$\\
$c\vec{u} = 0(a_1 + t^2) = 0 \notin \{p(t)\}$\\
$\therefore$ not in subspace\\
7. All polynomials of degree at most 3, with integers of coefficients.\\
If the scalars are any number in $\mathbb{R}$ then $c = \frac{1}{10}$, $p(t) = 1+x+x^2 \Rightarrow cp(t) = \frac{1}{10} + \frac{1}{10}x + \frac{1}{10}x^2 \notin$ the set.\\
But if we restrict scalars to the set of integers then it will be a subspace.\\
8. All polynomials in $\mathbb{P}_n$ such that $p(0) = 0$.\\
$\vec{0} = 0+0t+0t^2 \cdots , \vec{0} = 0$\\
For $u(t) = a_0 +a_1t+ \cdots , u(0) = 0$\\
$v(t) = b_0 + b_1t+ \cdots, v(0) = 0$\\
$u(t) + v(t) = a_0+b_0 + (a_1+b_1)t + \cdots , (u + v) = 0$\\
if $u(0) = 0$, $c \in \mathbb{R}$ then $cu(0) = c(0) = 0$\\
$\therefore$ is a subspace.\\
9. Let $H$ be the set of all vectors of the form $\begin{bmatrix}
-2t\\
5t\\
3t
\end{bmatrix}$. Find a vector $v$ in $\mathbb{R}^3$ such that $H = Span\{v\}$. Why does this show that $H$ is a subspace of $\mathbb{R}^3$?\\
$\vec{v} = t\begin{bmatrix}
-2\\
5\\
3
\end{bmatrix}$\\
$t = 0 \Rightarrow \begin{bmatrix}
-2(0)\\
5(0)\\
3(0)
\end{bmatrix} = \begin{bmatrix}
0\\
0\\
0
\end{bmatrix} \in H$, so $\vec{0} \in H$\\
$\vec{u} = \begin{bmatrix}
-2t_1\\
5t_1\\
3t_1
\end{bmatrix}$, $\vec{v} = \begin{bmatrix}
-2t_2\\
5t_2\\
3t_2
\end{bmatrix} \Rightarrow \vec{u} + \vec{v} = \begin{bmatrix}
-2(t_1+t_2)\\
5(t_1+t_2\\
3(t_1+t_2)
\end{bmatrix} \in H$\\
$\forall c \in \mathbb{R}$ $c \vec{u} = \begin{bmatrix}
-2(ct)\\
5(ct)\\
3(ct)
\end{bmatrix} \in H$\\
$\therefore H$ is a subspace.\\

Which of the following sets are linearly independent?\\
Which form a basis for $\mathbb{R}^3$\\
$\begin{bmatrix}
1\\
0\\
0
\end{bmatrix}$, $\begin{bmatrix}
2\\
3\\
0
\end{bmatrix}$
$\begin{bmatrix}
1&2&|&0\\
0&3&|&0\\
0&0&|&0
\end{bmatrix}$
$\frac{1}{2}R_2 = \begin{bmatrix}
1&2&|&0\\
0&1&|&0\\
0&0&|&0
\end{bmatrix}$
$R_1 - R_2 = \begin{bmatrix}
1&0&|&0\\
0&1&|&0\\
0&0&|&0
\end{bmatrix}$\\
$t$ has no free parameter.\\
$\therefore$ are linearly independent.\\
$\begin{bmatrix}
1\\
0\\
0
\end{bmatrix}$, $\begin{bmatrix}
2\\
3\\
0
\end{bmatrix}$, $\begin{bmatrix}
4\\
5\\
6
\end{bmatrix}$\\
$\begin{bmatrix}
1&2&4&|&0\\
0&3&5&|&0\\
0&0&6&|&0
\end{bmatrix}$
$\frac{1}{6}R_3 = \begin{bmatrix}
1&2&4&|&0\\
0&3&5&|&0\\
0&0&1&|&0
\end{bmatrix}$
$R_1 - 4R_3 = \begin{bmatrix}
1&2&0&|&0\\
0&3&5&|&0\\
0&0&1&|&0
\end{bmatrix}$
$R_2 - 5R_3 = \begin{bmatrix}
1&2&0&|&0\\
0&3&0&|&0\\
0&0&1&|&0
\end{bmatrix}$
$\frac{1}{3}R_2 = \begin{bmatrix}
1&2&0&|&0\\
0&1&0&|&0\\
0&0&1&|&0
\end{bmatrix}$
$R_1 - 2R_2 = \begin{bmatrix}
1&0&0&|&0\\
0&1&0&|&0\\
0&0&1&|&0
\end{bmatrix}$\\
$t$ has no free parameter, $\therefore$ are linearly independent.\\
$\begin{bmatrix}
1\\
0\\
0
\end{bmatrix}$, $\begin{bmatrix}
2\\
3\\
0
\end{bmatrix}$, $\begin{bmatrix}
4\\
5\\
6
\end{bmatrix}$, $\begin{bmatrix}
7\\
8\\
9
\end{bmatrix}$\\
4 Vectors in $\mathbb{R}^3$ must have at least 1 free parameter. $\therefore$ linearly dependent.\\
\end{document}


\newpage

\section{Earley Method}

It works on any grammar (even nondeterministic ones) by using a vector of sets.

It builds a vector of size $n+1$ where $n=|x|$ where $E[i]$ is a set of $\langle s,j \rangle$ with $j<i$: $\langle q_A,j \rangle \in E[i]$ means that $x_{j+1\ldots i}$ is derived from $A$ via $0_A\rarr q_A$ in $M_A$.

\begin{algorithm*}[H]
    \caption{TerminalShift(E, i)}
    \SetAlgoLined
    \For{$\langle p,j \rangle \in E[i-1], q\in Q \text{ s.t. } p \xrightarrow{x_i} q$}{
        add pair $\langle q,j \rangle$ to $E[i]$\;
    }
\end{algorithm*}
Add new elements based on terminal shifts, keeping the same \emph{key}.

\begin{algorithm*}[H]
    \caption{Closure(E, i)}
    \SetAlgoLined
    \For{$\langle p,j \rangle \in E[i], X\in V, q\in Q \text{ s.t. } p \xrightarrow{X} q$}{
        add pair $\langle 0_X,i \rangle$ to $E[i]$\;
    }
\end{algorithm*}
Like the closure of Pilot, resetting the \emph{key} to the current index.

\begin{algorithm*}[H]
    \caption{NonTerminalShift(E, i)}
    \SetAlgoLined
    \For{$\langle f,j \rangle \in E[i], X\in V \text{ s.t. } f \text{ is final for } X$}{
        \For{$\langle p,l \rangle \in E[j], q\in Q \text{ s.t. } p \xrightarrow{X} q$}{
            add pair $\langle q,l \rangle$ to $E[i]$\;
        }
    }
\end{algorithm*}
For each final state $\langle q_X,j \rangle$ of the current set, go back to $j$ and search if there is some item that can be advanced using $X$, keep the key found in $j$.

\begin{algorithm*}[H]
    \caption{Completion(E, i)}
    \SetAlgoLined
    \Do{some pair has been added}{
        Closure(E, i)\;
        NonTerminalShift(E, i)\;
    }
\end{algorithm*}

\begin{algorithm*}[H]
    \caption{Earley}
    \SetAlgoLined
    $E[0] = \{\langle 0_S, 0 \rangle \}$\;
    \For{$i = 1$ \KwTo $n$}{
        E[i] = \{\}
    }
    Completion(E, 0)\;
    $i = 1$\;
    \While{$i \le n \land E[i-1] \ne \emptyset$}{
        TerminalShift(E, i)\;
        Completion(E, i)\;
        $i = i + 1$\;
    }
\end{algorithm*}

The input is accepted iff $\langle f_S, 0 \rangle \in E[n]$ (where $f_S$ is final).


\chapter{Conclusion and Summary}

In this study, we proposed an alternative approach to the static unequal area facility layout problem, which was previously solved using, among other approaches, genetic algorithms and particle swarm optimization. Our approach utilizes the grey wolf optimization to solve the problem. We have introduced modifications to this metaheuristic in order for it to be able to produce feasible solutions. We have conducted experiments varying the value of the $c$ parameter of our proposed GWO approach, and compared this approach against a GA-based hybrid approach and a PSO approach. Results from our experiment indicate that the value of the $c$ parameter impacts the performance of our approach, and that the appropriate value for the parameter is correlated with the size of the bounding region used. Additionally, we have found that the GA-based approach is generally better than our modified GWO approach and the PSO approach. However, they showed that there is promise in GWO as an algorithm for solving FLPs. The GA approach was shown to take longer to finish as the number of buildings increase. The PSO approach is the fastest among the three, but produces the worst solutions on average. Our approach, on the other hand, is the second best in both speed and solution quality. Hence, it provides a balance in speed and balance. Our approach is also simpler, making it easier to understand and experiment with. In the future, our proposed modified GWO may be further improved to produce significantly better results. Additionally, GWO is relatively new to the field, providing researchers with plentiful opportunities to improve the algorithm. Modifying the equations of our modified GWO, such as the decay rate of $\alpha$, is one avenue in which researchers may take to build upon our study. Another avenue is to identify whether the $c$ parameter's value can be mathematically modelled instead of being a parameter.


\section{Exercises in Probability}\label{S:xsProbability}
\begin{ExerciseList}
\Exercise
{In English language text, the twenty six letters in the alphabet occur with the following frequencies:
{\footnotesize $$
\mathsf{
\begin{array}{cccccccccccccccccc}
\sf E   &       13      \%&     \sf R   &       7.7     \%&     \sf A   &       7.3     \%&     \sf H   &       3.5     \%&     \sf F   &       2.8     \%&     \sf M    &      2.5     \%&     \sf W   &       1.6     \%&     \sf X   &       0.5     \%&     \sf J   &       0.2     \%\\
\sf T   &       9.3     \%&     \sf O   &       7.4     \%&     \sf S   &       6.3     \%&     \sf L   &       3.5     \%&     \sf P   &       2.7     \%&     \sf Y    &      1.9     \%&     \sf V   &       1.3     \%&     \sf K   &       0.3     \%&     \sf Z   &       0.1     \%\\
\sf N   &       7.8     \%&     \sf I   &       7.4     \%&     \sf D   &       4.4     \%&     \sf C   &       3       \%&     \sf U   &       2.7     \%&     \sf G    &      1.6     \%&     \sf B   &       0.9     \%&     \sf Q   &       0.3     \%&             &               \\
\end{array}
}
$$}
Suppose you pick one letter at random from a randomly chosen English
book from our central library with
$\Omega=\{\mathsf{A,B,C,\ldots,Z}\}$ (ignoring upper/lower cases),
then what is the probability of these events?
\begin{itemize}
\item[(a)]$\P(\{\mathsf{Z}\})$
\item[(b)]$\P(\textrm{`picking any letter'})$
\item[(c)] $\P(\{\mathsf{E},\mathsf{Z}\})$
\item[(d)]$\P(\textrm{`picking a vowel'})$
\item[(e)]$\P(\textrm{`picking any letter in the word WAZZZUP'})$
\item[(f)]$\P(\textrm{`picking any letter in the word WAZZZUP or a vowel'})$.
\end{itemize}
}
\label{Ex:RandomEnglishLetter}
\Answer
{\bit
\item[(a)] $\P(\{\mathsf{Z}\})=0.1\%=\frac{0.1}{100}=0.001$
\item[(b)] $\P(\textrm{`picking any letter'})= \P(\Omega) = 1$
\item[(c)] $\P(\{\mathsf{E},\mathsf{Z}\}) =\P(\{\mathsf{E}\} \cup
    \{\mathsf{Z}\} ) =  \P(\{\mathsf{E}\})+\P(\{\mathsf{Z}\}) =
    0.13+0.001=0.131$, by Axiom~(3)
\item[(d)] $\P(\textrm{`picking a
    vowel'})=\P(\{\mathsf{A,E,I,O,U}\})=(7.3\%+13.0\%+7.4\%+7.4\%+2.7\%)=37.8\%$,  by the addition rule for mutually exclusive events, rule (2).
\item[(e)] $\P(\textrm{`picking any letter in the word
    WAZZZUP'})=\P(\{\mathsf{W,A,Z,U,P}\})=14.4\%$,  by the
  addition rule for mutually exclusive events, rule (2).
\item[(f)] $\P(\textrm{`picking any letter in the word WAZZZUP or a vowel'})=$\\
$\P(\{\mathsf{W,A,Z,U,P}\})+\P(\{\mathsf{A,E,I,O,U}\})-\P(\{\mathsf{A,U}\})
  = 14.4\% + 37.8\% - 10\% = 42.2\%$,  by the addition rule for two
arbitrary events, rule (3).
\eit
}

\Exercise
Find the sample spaces  for the following experiments:
\begin{enumerate}
\item Tossing 2 coins whose faces are sprayed with black paint denoted by $\mathsf{B}$ and white paint denoted by $\mathsf{W}$.
\item Drawing 4 screws from a bucket  of left-handed and right-handed screws
  denoted by $\mathsf{L}$ and $\mathsf{R}$, respectively.
\item Rolling a die and recording the number on the upturned face  until the first $\mathsf{6}$ appears.
\end{enumerate}
\Answer
\be
\item $\{\mathsf{BB},\mathsf{BW},\mathsf{WB},\mathsf{WW}\}$

\item $\begin{aligned}\{\mathsf{ RRRR,RRRL,RRLR,RLRR,LRRR,RLRL,RRLL,LLRR,}
    \\ \mathsf{LRLR,LRRL,RLLR,LLLL, LLLR,LLRL,LRLL,RLLL}\}\end{aligned}$
\item $\{6,16,26,36,46,56,116, 126,136, 146, 156,
      216, 226, 236, 246, 256, \,\ldots\}$
\ee

\Exercise
Suppose we pick a letter at random from the word WAIMAKARIRI.
\begin{enumerate}
\item What is the sample space $\Omega$?
\item  What probabilities should be assigned to the outcomes?
\item What is the probability of {\emph not} choosing the letter  R?
\end{enumerate}
\Answer

\be
\item The sample space $\Omega=\{\mathsf{W},\mathsf{A},\mathsf{I},\mathsf{M},\mathsf{K},\mathsf{R}\}$.
\item   Since there are eleven letters in WAIMAKARIRI the probabilities are:
\cen{ $\P(\sf\{W\})=\frac{1}{11}$, $\P(\sf\{ A\})=\frac{3}{11}$, $\P( \sf\{ I\})
=\frac{3}{11}$,
    $\P(\sf\{ M\})=\frac{1}{11}$, $\P(\sf\{ K\})=\frac{1}{11}$, $\P(\sf\{
    R\})=\frac{2}{11}$\,.}

\item By the complementation rule, the probability of not choosing
    the letter R is:  \[1\,-\,\P(\text{choosing the letter R})\,=\,1\,-\, \frac{2}{11}\,=\,\frac{9}{11}\,.\]

\ee

\Exercise
There are seventy five balls in total inside the Bingo Machine.
Each ball is labelled by one of the following five letters:
$\mathsf{B}$, $\mathsf{I}$, $\mathsf{N}$, $\mathsf{G}$, and $\mathsf{O}$.
There are fifteen balls labelled by each letter.
The letter on the first ball that comes out of a BINGO machine after it has been well-mixed is the outcome of our experiment.
\begin{itemize}
\item[(a)] Write down the sample space of this experiment.
\item[(b)] Find the probabilities of each simple event.
\item[(c)] Show that $\P(\Omega)$ is indeed $1$.
\item[(d)] Check that the addition rule for mutually exclusive events holds for the simple events $\{B\}$ and $\{I\}$.
\item[(e)]Consider the following events:
$C = \{\mathsf{B},\mathsf{I},\mathsf{G}\}$ and $D = \{\mathsf{G},\mathsf{I},\mathsf{N}\}$.
Using the addition rule for two arbitrary events, find  $\P(C \cup D)$.
\end{itemize}

\Answer
\be
\item
First, the sample space is: $\Omega=\{ {\mathsf{B}, \mathsf{I},
  \mathsf{N}, \mathsf{G}, \mathsf{O} } \} \enspace . $
\medskip

\item The probabilities of simple events are:
$$
\P(\mathsf{B} )\;=\;\P(\mathsf{I})\;=\;\P(\mathsf{N})\;=\;\P(\mathsf{G})\;=\;\P(\mathsf{O})\;=\;{\frac{15}{75}\;=\;\frac{1}{5}} \enspace .
$$

\item

%Axiom~(1):
%$${0\leq \P(\mathsf{B})\;=\;\P(\mathsf{I})\;=\;\P(\mathsf{N})\;=\;\P(\mathsf{G})\;=\;\P(\mathsf{O})\;=\;\frac{1}{5} \leq 1 \enspace .}
%$$

%Axiom~(2):
Using the addition rule for mutually exclusive events,
\begin{eqnarray*}
\P(\Omega)
&=& \P(\mathsf{\{B,I,N,G,O\}})\\
&=& \P(\{\sf{B}\} \cup\{\sf{I}\}\cup \{\sf{N}\} \cup \{\sf{G}\} \cup \{\sf{O}\})\\
&=& \P(\sf B)+\P(\sf I)+\P(\sf N)+\P(\sf G)+\P(\sf O) \quad \text{simplifying notation} \\
&=& \frac{1}{5}+\frac{1}{5}+\frac{1}{5}+\frac{1}{5}+\frac{1}{5}\\
&=& 1
\end{eqnarray*}

\item Since the   events $\{\sf B\}$ and $\{\sf I\}$ are disjoint,
$$
\P(\{\sf{B}\} \cup \{\sf{I}\})\;=\;\P(\sf B)+\P(\sf I)\;=\;\frac{1}{5}+\frac{1}{5}\;=\;\frac{2}{5}\,.
$$

\medskip

\item  Using the addition rule for two arbitrary events we get,
\begin{eqnarray*}
\P(C \cup D) &=& \P(C)+\P(D)-\P(C\cap D)\\& =& \P(\{\sf{B},\sf{I},\sf{G}\}) + \P(\{\sf{G},\sf{I},\sf{N}\}) - \P(\{\sf{G},\sf{I}\})\\
& =& \frac{3}{5} +\frac{3}{5} - \frac{2}{5}\\& = &\frac{4}{5} \enspace .
\end{eqnarray*}
\ee

\end{ExerciseList}


%Correct the file name.
%X: book number
%Y: part number
%ZZZ: page number in three digits. So page 3 would be 003.

\documentclass[11pt]{amsbook}

\usepackage{../HBSuerDemir}	% ------------------------

\begin{document}

% ++++++++++++++++++++++++++++++++++++++
\hPage{b2p1/213}
% ++++++++++++++++++++++++++++++++++++++

\noindent b) the ellipsoid $4x^2+y^2+z^2=16$

\begin{hSolution}
 \includegraphics[width=0.45\textwidth]{images/b2p1-213-fig01}\\
a) The center is at $\hPairingParan{-1,0,2}$ and radius is equal to $2$. \\
 \includegraphics[width=0.45\textwidth]{images/b2p1-213-fig02}\\
b) Writing it in the form
$$
\frac{x^2}{2^2}+\frac{y^2}{4^2}+\frac{z^2}{4^2}=1
$$
one has $a=2$, $b=4$, $c=4$ and that part in the I. octant is shown in the figure.

\end{hSolution}

\begin{exmp}
Sketch the quadrics:\\

\begin{tabular}{ll}
a) $\frac{x^2}{4}-\frac{y^2}{9}-\frac{z^2}{4}=1$\quad \quad \quad \quad
b)  $\frac{x^2}{4}-z^2=2y$
\end{tabular}
\begin{hSolution}
 \includegraphics[width=0.45\textwidth]{images/b2p1-213-fig03}\\
a) The surface is a hyperboloid of two sheets with semi axes $a=2$, $b=3$, $c=2$ admitting $0x$ as axis. Cross sections // yz-plane cease to exist when $-2<x<2$.\\
 \includegraphics[width=0.45\textwidth]{images/b2p1-213-fig04}\\
b)The surface is a hyperbolic paraboloid (or a saddle shaped surface).\\
$x=0 \implies y=-\frac{z^2}{2}$ (a parabola)\\
$z=0 \implies y=x^2/8$ (a parabola)

\end{hSolution}
\end{exmp}
\section*{E. SECOND DEGREE SURFACES}
The quadrics being second degree surfaces, their equations are included in the general equation
\end{document}


Given that many of the techniques presented in the dissertation were based on the concepts based on Aitchison geometry, we will provide a brief overview behind Aitchison geometry.

Aitchison geometry is a framework focused on the analysis of quantities including proportions, percentages, probabilities and concentrations.  These quantities are also referred to as compositions.  At the heart of the framework is the characterization of the Aitchison simplex, where each element of the space is a composition.  A composition can be thought of as a set of proportions, or percentages.

Linear operations can be defined on compositions, known as ``perturbation'' and ``powering operations''.  These operations are linear in the Aitchison simplex and can be transformed into traditional addition and multiplication operations in Euclidean space through the use of log-ratio transformations.  Inner products can be defined in the Aitchison simplex, giving rise to the distance metrics such as the Aitchison distance.  It can also be shown that the Aitchison simplex forms a finite Hilbert space \cite{Pawlowsky-Glahn2015-qb}.

\section{Definition}
The Aitchison simplex is formally defined for D species as follows
\[\mathcal{S}^D=\left\{\mathbf{x}=[x_1,x_2,\dots,x_D]\in\mathbb{R}^D \,\left|\, x_i>0,i=1,2,\dots,D; \sum_{i=1}^D x_i=\lambda \right. \right\}. \]
Where $\lambda>0$ can be any positive real-valued constant.  By definition, the compositions are the quantities denoted by $\mathbf{x}$.

 \begin{figure}[H]
         \centering
         \includegraphics[width=0.5\textwidth]{appendix_c/Aitchison-simplex.jpg}
         \caption[An illustration of the Aitchison simplex.]
                 {An illustration of the Aitchison simplex.  Here, there are 3 parts, $x_1, x_2,  x_3$ represent values of different proportions.  A, B, C, D and E are 5 different compositions within the simplex.  A, B and C are all equivalent and D and E are equivalent.}
         \label{figcS1}
 \end{figure}
There are three core axioms that the Aitchison simplex, namely

\subsection{Scale invariance}
Whether data is represented as proportions, percentages or probabilities, in the context of the Aitchison simplex all of these measurements are equivalent since they only differ by a constant scaling factor.

\subsection{Subcompositional coherence}
Observations on shared species should be consistent. For example, supposed that there are 2 biologists that visited the exact same rainforest to count insects.  One biologist observed 3 species of spiders and 10 species of ants whereas the other biologist only observed 2 species of spiders and 7 species of ants.  If these biologists observed the same 2 spider species and the same 7 species of ants, their conclusions about those species should be the same.  For instance, they should notice that the ratio of those two spider species are consistent between their observations.  While the universal formal definition is still not clearly established, this concept can be formalized to distance metrics as follows

  \[
d(x_k, y_k) \leq d(x, y) \qquad
\forall x, y \in S^D, \; x_k, y_k \in S^k, \; S^k \subset S^D
\]

\subsection{Permutation invariance}
The ordering of how the proportions or were measured or counted doesn't matter.  This is analogous to how combinations are invariant to the order of selection.

\section{Vector Space Structure}
\subsection{Properties}
The Aitchison simplex has the following operators defined using the \textbf{closure} operation as follows

\subsubsection{Perturbation}
\[ x \oplus y = [\frac{x_1 y_1}{\sum_{i=1}^D x_i y_i},\frac{x_2}{\sum_{i=1}^D x_i y_i}, \dots,\frac{x_D y_D}{\sum_{i=1}^D x_i y_i}] =
C[x_1 y_1, ..., x_D y_D]  \qquad \forall x, y \in S^D
\]

\subsubsection{Powering}

\[
\alpha \odot x = [\frac{x_1^{\alpha}}{\sum_{i=1}^D x_i^{\alpha}},\frac{x_2^{\alpha}}{\sum_{i=1}^D x_i^{\alpha}}, \dots,\frac{x_D^{\alpha}}{\sum_{i=1}^D x_i^{\alpha}}] =
C[x_1 y_1, ..., x_D y_D]  \qquad \forall x \in S^D, \quad \alpha \in \mathbb{R}
\]

\subsubsection{Inner product}

\[
\langle x, y \rangle = \frac{1}{2D}
\sum\limits_{i=1}^{D}
\sum\limits_{j=1}^{D}
\log \frac{x_i}{x_j}
\log \frac{y_i}{y_j}
\qquad \forall x, y \in S^D
\]

Under these these operations alone, it is sufficient to show that the Aitchison simplex forms a Euclidean vector space.

\subsection{Orthonormal bases}
Since the Aitchison simplex forms a finite Hilbert space, it is possible to construct orthonormal bases in the simplex. Every composition can be decomposed as follows

\[ x = \bigoplus_{i=1}^D x_i \odot e_i \]

Where $e_1, \ldots e_{D-1} $ forms an orthonormal basis in the simplex \cite{ilr}.

\section{Linear transformations}

There are 3 well-characterized isomorphisms that transform from the Aitchison simplex to real space.  All of these transforms satisfy linearity and as given below

\subsection{Additive Logratio Transform}
The additive log ratio (alr) transform is an where $alr: S^D \rightarrow \mathbb{R}^{D-1} $.  This is given by

\[ alr(x) = \big[ \log \frac{x_1}{x_D} \ldots \log \frac{x_{D-1}}{x_D} \big]\]

The choice of denominator component is arbituary, and could be any specified component.
This transform is commonly used in chemistry with measurements such as pH.  In addition, this is the transform most commonly used for Multinomial logistic regression.  The alr transform is not an isometry, meaning that distances on transformed values will not be equivalent to distances on the original compositions in the simplex.

\subsection{Center Logratio Transform}
The center log ratio (clr) tranform is both an isomorphism and an isometry where \\$clr: S^D \rightarrow \mathbb{U}, \quad U \subset \mathbb{R}^{D} $

\[clr(x) = \big[ \log \frac{x_1}{g(x)} \ldots \log \frac{x_{D-1}}{g(x)} \big] \]

The inverse of this function is also known as the softmax function commonly used in neural networks.

\subsection{Isometric Logratio Transform}
The isometric log ratio (ilr) tranform is both an isomorphism and an isometry where $ilr: S^D \rightarrow \mathbb{R}^{D-1} $

\[
ilr(x) = \big[ \langle x, e_1 \rangle, \ldots \langle x, e_{D-1} \rangle]
\]

There are multiple ways to construct orthonormal bases, including using the Gram–Schmidt process Singular-value decomposition of clr transformed data.
Another alternative is to construct log contrasts from a bifurcating tree.  If are given a bifurcating tree, we can construct a basis from the internal nodes in the tree.

 \begin{figure}[H]
         \centering
         \includegraphics[width=0.5\textwidth]{appendix_c/Orthogonal-tree-basis.jpg}
         \caption[An illustration of the bifurcating trees as an orthonormal basis.]
                 {A representation of a tree in terms of its orthogonal components. l represents an internal node, an element of the orthonormal basis. This is a precursor to using the tree as a scaffold for the ilr transform.}
         \label{figcS1}
 \end{figure}

Each vector in the basis would be determined as follows

\[e_l = C[exp( \underbrace{0,...0}_{k}, \underbrace{a,...,a}_{r},\underbrace{b,...,b}_s,\underbrace{0,...0)}_t]\]

The elements within each vector are given as follows

\[a = \frac{\sqrt{s}}{\sqrt{r(r+s)}} \quad \textrm{and} \quad b = \frac{-\sqrt{r}}{\sqrt{s(r+s)}}\]

where $k, r, s, t$ are the respective number of tips in the corresponding subtrees shown in the figure.  It can be shown that the resulting basis is orthonormal \cite{groups_of_parts}.

Once the basis $\Psi$ is built, the ilr transform can be calculated as follows

\[
ilr(x) = C[\exp(clr(x) \Psi)]
\]

where each element in the ilr transformed data is of the following form

\[
b_i = \sqrt{\frac{rs}{r+s}} \log \frac{g(x_R)}{g(x_S)}
\]

where $ x_R$ and $ x_S$ are the set of values corresponding to the tips in the subtrees $R$ and $S$.


\section{Some classic CNN models}\label{sec:CNNs}
In this section, we will use the notation introduced above to
give a brief description of some classic CNN models.

\subsection{LeNet-5, AlexNet and VGG}
The  LeNet-5 \cite{lecun1998gradient}, AlexNet \cite{krizhevsky2012imagenet} and VGG \cite{simonyan2014very}
can be written as:
	\begin{equation}
	\begin{cases}
	f^{1,0} &= \theta^0(f), \\
	f^{\ell,i} &= \theta^{\ell,i} \circ \sigma (f^{\ell, j-1}), \quad i = 1:\nu_\ell ~\text{and}~ \ell = 1:J,\\
	f^{\ell+1,0} &= R_\ell^{\ell+1}( f^{\ell,m+\ell}).  \\
	\end{cases}
	\end{equation}
	where $R_\ell^{\ell+1}$ can be general pooling operators and $\theta^{\ell,i}$ can be convolution with stride 1,
	or fully connected operators.
	Then the CNN model will be defined by
	\begin{equation}\label{eq:cnndefine}
	H_0(f) = f^{L,\nu_\ell}.
	\end{equation}
	In these three classic CNN models, they still need some
	extra fully connected layers in nonlinear mapping $H_0$ before the logistic regression as it contains
	a fully connected layer as in \eqref{eq:log_reg}.
	These fully connected layers are removed in ResNet to be described below.
\subsection{ResNet}
The ResNet \cite{he2016deep} can be written as
	\begin{equation}\label{ori-ResNet}
	\begin{cases}
	f^{1,0} &=R_{\rm max}\circ \sigma \circ \theta^0(f), \\
	f^{\ell,i} &= \sigma \left( f^{\ell, i-1} + \mathcal{F}^{\ell, i} (f^{\ell,i-1}) \right), \quad i = 1:\nu_\ell ~\text{and}~ \ell = 1:J ,\\
	f^{\ell+1,0} &= \sigma \left( R_\ell^{\ell+1} (f^{\ell, \nu_\ell} )+ \mathcal{F}^{\ell, 0} (f^{\ell, \nu_\ell} ) \right), \quad \ell = 1:J-1,\\
	H_0(f) &=  R_{\rm ave}(f^{L,\nu_\ell}). \\
	\end{cases}
	\end{equation}
	Here
	$$
	\mathcal{F}^{\ell,i} (f^{i-1}) = \xi^{i} \circ \sigma \circ \eta^{i} (f^{i-1}).
	$$
	Generally, $\xi^{\ell,i}$ and $\eta^{\ell,i}$ takes the form of \label{eq:conv-1} with zero padding and stride 1,
	except, $\eta^{\ell,0}$  is taken as convolution with stride 2 with the same output dimension of $R_\ell^{\ell+1}$.

\subsection{iResNet}
	The iResNet\cite{he2016identity} can be written as:
	\begin{equation}\label{eq:iResNet1}
	\begin{cases}
	f^{1,0} &=R_{\rm max}\circ \sigma \circ \theta^0(f), \\
	f^{\ell,i} &= f^{\ell, i-1} + \mathcal{F}^{\ell, i} (f^{\ell,i-1}), \quad i = 1:\nu_\ell ~\text{and}~ \ell = 1:J ,\\
	f^{\ell+1,0} &=  R_\ell^{\ell+1} (f^{\ell, \nu_\ell} )+ \mathcal{F}^{\ell, 0} (f^{\ell, \nu_\ell} ) , \quad \ell = 1:J-1,\\
	H_0(f) &=  R_{\rm ave}(f^{L,\nu_\ell}). \\
	\end{cases}
	\end{equation}
	where
	$$
	\mathcal{F}^{\ell,i} (f^{\ell,i -1}) = \xi^{\ell,i} \circ \sigma \circ \eta^{\ell,i} \sigma (f^{\ell,i-1}).
	$$
	The only difference between ResNet and iResNet can be viewed as
	putting a $\sigma$ in different places.
	The connection of those three models are often shown with next diagrams:
	\begin{figure}[!htb]
		\begin{center}
			\includegraphics[width=.6\textwidth, height=.13\textheight]{comparison-net}
		\end{center}
		\caption{Comparison of CNN Structures}
	\end{figure}

Without loss of generality, we extract the key
feedforward steps on the same grid in different CNN models as follows.
\begin{description}
	\item[Classic CNN]
	\begin{equation}\label{eq:cCNN}
	f^{\ell,i} = \xi^i \circ \sigma (f^{\ell,i-1}) \quad \text{or} \quad f^{\ell,i} = \sigma \circ \xi^{i} (f^{\ell,i-1}) .
	\end{equation}
	\item[ResNet]
	\begin{equation}\label{eq:ResNet}
	f^{\ell,i} = \sigma( f^{\ell,i-1} + \xi^{\ell,i} \circ \sigma \circ \eta^{\ell,i}(f^{\ell,i-1})).
	\end{equation}
	\item[iResNet]
	\begin{equation}\label{eq:iResNet}
	f^{\ell,i} = f^{\ell,i-1} + \xi^{\ell,i} \circ \sigma \circ \eta^{\ell,i}\circ \sigma(f^{\ell,i-1}).
	\end{equation}
\end{description}


% chapters/dp.tex

\chapter{Dynamic Programming}	\label{chapter:dp}

\input{algs/dp/binom-recursive}

\begin{figure}[h]
  \includegraphics[width = 0.75\textwidth]{figs/binom-4-2}
  \caption{Calculate $\binom{4}{2}$ recursively.}
  \label{fig:binom-recursive}
\end{figure}

\begin{figure}[h]
  \includegraphics[width = 0.65\textwidth]{figs/pascal}
  \caption{Pascal triangle for binomial coefficients.}
  \label{fig:pascal}
\end{figure}

\input{algs/dp/binom-dp}

\[
  (n-k+1) + (k) + k (n-k) = nk - k^2 + n + 1
\]

\input{algs/dp/max-subarray-origin}
\input{algs/dp/max-subarray}


%% Chapter 4 : Wind Energy Estimation

\section{Kinetic Energy of Air:}
\
\
\
\
The wind turbine converts kinetic energy of air into electrical energy. The kinetic energy possessed by the air is due to the flow of winds. The eq (\ref{W1}) gives the kinetic energy of the air

\begin{equation}
\label{W1}
\text{K.E.(Joules)}=\frac{1}{2}mV^2
\end{equation}\\
where,\\
$ m $ = Mass of Air $ (kg) $\\
$ V $ = Velocity of air $ (m/s) $\\

\section{Power in Wind:}
\
\
\
\
The flow of the mass of air passing through the cross-section of the wind turbine blades is given by the eq (\ref{W2})

\begin{equation}
\label{W2}
\text{mass flowrate} (kg/sec) = mass flow per sec = \rho\times A\times V
\end{equation}

The volumetric flow rate of air is given by the eq (\ref{W3})

\begin{equation}
\label{W3}
\text{volumetric flowrate} (m^3/sec) = A \times V
\end{equation}\\
where,\\
$ \rho $ = Air Density $ (kg/m^{3}) $\\
$ A $ = Swept Area of Rotor $ (m^{2}) $\\

The mass flow rate of air through the cross-section of the wind turbine blades provides for the energy which is converted to electricity.\\

The eq (\ref{W4}) gives us the relationship between power and energy.

\begin{equation}
\label{W4}
\text{Power} = \frac{Energy}{Time}
\end{equation}

The power contained in wind (moving air) is given by eq (\ref{W5}), which is the combination of eq (\ref{W1},\ref{W2},\ref{W3},\ref{W4}).

\begin{equation}
\label{W5}
\text{Power in moving air(Watts)} = \left(\frac{1}{2}\right)\times (mass flow per second)\times V^2
\end{equation}

The eq (\ref{W6}) combines eq (\ref{W5},\ref{W3}) to give the mechanical power in wind in terms of air density, area and wind velocity; this is a more convenient equation for wind power computations.

\begin{equation}
\label{W6}
\text{Mechanical power in wind(Watts)} = \left(\frac{1}{2}\right) \times (\rho \times A ) \times V^3
\end{equation}

The area in eq (\ref{W6}) in context of wind turbine blades is the rotor-swept area (defined later in the text), but a more general equation of power in wind independent of the area variable is given in the eq (\ref{W7}). It gives the power in wind per meter square of area.

\begin{equation}
\label{W7}
\text{Specific wind power of a site} (W/m^2) = \left(\frac{1}{2}\right) \times \rho \times V^3
\end{equation}\\

\section{Power Extracted from Wind:}
\
\
\
\
The Fig (\ref{figc5h1}) illustrates the different components of a typical Wind Turbine.

\begin{figure}[H]
\centering
\includegraphics[scale=0.75]{Wind11}
\caption{Wind Turbine [6]}
\label{figc5h1} %% to refer use, \ref{}
\end{figure}

As the wind passes through the cross-section of the wind turbine blades, some portion of its kinetic energy is captured by the wind turbine blades and converted to electricity. In this process the wind loses some of its velocity due to loss of kinetic energy giving us two different wind velocities of upstream (wind velocity in front of the wind turbine) and downstream (wind velocity behind the wind turbine). Hence, the power extracted by the wind turbine from the wind is given by eq (\ref{W8}).

\begin{equation}
\label{W8}
P_0 = \left(\frac{1}{2}\right) \times \text{(mass flow per sec)} \times (V^2 - {V_0}^2)
\end{equation}\\
where,\\
$P_0$ = mechanical power extracted by the rotor (Watts)\\
$ V $ = upstream wind velocity at the entrance of rotor\\
$V_0$ = downstream wind velocity at the exit of rotor \\

The mass of the air passing through the rotor blades is given by the eq (\ref{W9}).

\begin{equation}
\label{W9}
\text{Mass  of air through the rotor blades} (kg/sec) = \rho \times A \times \left(\frac{V + V_0}{2}\right)
\end{equation}

Combining the eq (\ref{W8},\ref{W9}) we get a detailed equation for the mechanical power extracted by the wind turbine rotor from the wind in terms of the eq (ref{W99}).

\begin{equation}
\label{W99}
P_{0}= \frac{1}{2}\left[\rho A \frac{\left(V+V_{0} \right)}{2} \right]\left(V^{2}-V_{0}^{2} \right)
\end{equation}

On further rearranging the eq (\ref{W99}) we get the eq (\ref{W88}).

\begin{equation}
\label{W88}
P_{0} =\frac{1}{2} \rho A V^(3) \frac{\left(1 + \frac{V_0}{V}\right)\times \left[1 - \left(\frac{V_0}{V}\right)^2\right]}{2}
\end{equation}\\

Now the power extracted by the wind turbine rotor blades is expressed as a fraction of upstream wind power in eq (\ref{W10}).

\begin{equation}
\label{W10}
P_0 = \left(\frac{1}{2}\right) \times \rho \times A \times V^3 \times C_p
\end{equation}
where,\\
$C_P$ = Wind Turbine Power Co-efficient\\

The wind Turbine Power Co-efficient is an important variable which depends on the mechanical design of the rotor blades and is given by the eq (\ref{W11}).

\begin{equation}
\label{W11}
C_p = \frac{\left(1 + \frac{V_0}{V}\right)\times \left[1 - \left(\frac{V_0}{V}\right)^2\right]}{2}
\end{equation}

Maximum power extracted from the wind:

\begin{equation}
\label{W12}
P_{max} = \left(\frac{1}{2}\right) \times \rho \times A \times V^3 \times 0.59
\end{equation}\\

Theoretical max. value of $C_p = 0.59$ is called the Betz Limit.

If $C_p = 0.5$, maximum output power of the wind turbine is given by the eq (\ref{W13}).

\begin{equation}
\label{W13}
\text{$P_{max} (Watts/m^2)$}= \left(\frac{1}{4}\right) \times \rho \times V^3
\end{equation}\\

\section{Effect of Rotor-Swept Area on Wind Power}
\
\
\
\
The rotor-swept area is the cross-sectional area covered by the wind turbine rotor blades. For a horizontal axis wind turbine the rotor-swept area demarcates a circle, and is given by the eq (\ref{W14}).

\begin{equation}
\label{W14}
	\text{Rotor swept area}(m^2) = A_H = \left(\frac{\Pi}{4}\right) \times D^2
\end{equation}

From eq (\ref{W10}) we observe that the amount of power extracted by the wind turbine rotor from the wind is directly proportional to the rotor-swept area. Hence, to increase power extraction capacity of a wind turbine the lengths of its rotor blades can be increased.

\section{Effect of Air Density on Wind Power}
\
\
\
\
From eq (\ref{W10}) we can see that the power extracted by a wind turbine is directly proportional to the air density. Hence, denser the air more will be the power extracted from the wind.\\

However, the density of air depends on the on the pressure and temperature of the location as given by the ideal gas law in eq (\ref{W16}).

\begin{equation}
\label{W16}
\rho = \frac{P}{R \times T}
\end{equation}\\
where,\\
$ P $ = Air pressure $ (atm) $\\
$ T $ = Temperature $ (K) $\\
$ R $ = Gas constant $ 8.205745 \time 10^{-5} m^{3} atm K^{-1} mol^(-1) $\\

The air density at sea-level at $1$ atm  $15 \deg$Celsius is $1.2250 kg/m^3$. Using this as a reference $\rho$ is corrected, for the site specific temperature and pressure.Hence, the density of air now is directly proportional to pressure and inversely proportional to temperature of the location.\\

Temperature and pressure both vary with "altitude". Their combined effect is given by the eq (\ref{W17}), which is valid upto $6000$m or $20000$ft of site elevation above sea-level. This equation is however approximate, and the detailed effect of both temperature and pressure on the air density is given in the subsequent sections of the text.

\begin{equation}
\label{W17}
\rho = \rho_0 \times e^{-{\left(\frac{0.297\times H_m}{3048}\right)}}
\end{equation}\\
where,\\
$ \rho $ = Air Density at new height $(kg/m^3)$ \\
$ \rho_{o} $ = Air Density at sea level $(kg/m^3)$ \\
$ H_{m} $ = Altitude of the location $(m)$\\

\subsection{Correction for Pressure:}
\
\
\
\

To correct the air density at a given specific location, we first compute the air pressure at the location using its altitude in the eq (\ref{W19}). this gives us the pressure at the specific location.

\begin{equation}
\label{W19}
P = P_{o} \times e^{(-1.185 \times 10^{-4} \times H)}
\end{equation}\\
where,\\
$ P $ = Pressure at new height $(atm)$ \\
$ P_{o} $ = Pressure at sea level $(atm)$ \\
$ H_{m} $ = Altitude of the location $(m)$\\

\subsection{Correction for Temperature}
\
\
\
\
After correcting the air pressure for altitude of the location, we use this pressure in the ideal gas law equation along with the temperature of the specific location as given in eq (\ref{W20}).

\begin{equation}
\label{W20}
\rho = \frac{P \times M.W \times 10^{-3}}{R \times T}\\
\end{equation}\\
where,\\
$ M.W $ = Molecular weight of air $  $\\

The eq (\ref{W20}) computes the air density at the specific location accurately as it takes into account both the correction in pressure and temperature.

\section{Effect of Hub-Height on Wind Power:}
\
\
\
\

The wind shear at a ground level surface causes the wind speed to increase with height in accordance with eq (\ref{W36}).

\begin{equation}
\label{W36}
V_2 = V_1 \times \left(\frac{h_2}{h_1}\right)^\alpha
\end{equation}\\
where,\\
$V_1 = \text{wind speed measured at the reference height} \,h_1$\\
$V_2 = \text{wind speed estimated at height} \,h_2$\\
$\alpha = \text{ground surface friction coefficient}$\\

The Table (\ref{c5Tab1}) gives different values of $\alpha$ for different ground surface roughness class.

\begin{table}[H]
  \centering
  \caption{Ground Surface Friction Co-Efficient Claassification}
    \begin{tabular}{|l|c|}
    \hline
    \textbf{Terrain Characteristics} & \multicolumn{1}{l|}{\textbf{Friction Coefficient (α)}} \bigstrut\\
    \hline
    \textbf{Smooth hard ground, calm water } & 0.1 \bigstrut\\
    \hline
    \textbf{Tall grass on level ground } & 0.15 \bigstrut\\
    \hline
    \textbf{High crops, hedges and shrubs } & 0.2 \bigstrut\\
    \hline
    \textbf{Wooded countryside, many trees } & 0.25 \bigstrut\\
    \hline
    \textbf{Small town with trees and shrubs } & 0.3 \bigstrut\\
    \hline
    \textbf{Large city with tall buildings } & 0.4 \bigstrut\\
    \hline
    \end{tabular}%
  \label{c5Tab1}%
\end{table}%

From the eq (\ref{W36}) we can observe that the velocity of wind increases with height. Moreover, as the power extracted from the wind by the wind turbine is directly proportional to the cube of the wind velocity, increasing the hub height has a huge improvement in the power extraction capacity of a wind turbine.\\

\section{Wake Effect Models:}
\
\
\
\
The wake effect is one of the biggest factors for reduction in power capture capacity of wind turbines in a wind farm. The wake effect has two main impacts on the wind farm; firstly there is reduction of wind speed as we move towards the down stream turbines, sometimes causing the downstream turbines to completely stop this causes a considerable amount of loss in power capturing capacity of the wind farm and secondly the the downstream wind is more turbulent causing structural fatigue and eventually lower lifespan of wind turbines. Modeling of Wake Effect helps in the computation of downstream wind velocity deficit (helps in calculating the reduced power capture) and the turbulence patterns so that the wind turbines in a wind farm are arranged spatially to optimize the the power capture. The Fig (\ref{figc5h10}) shows a wake effect simulation in a wind farm.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{WakeEffect1}
\caption{Wake effect Simulation}
\label{figc5h10} %% to refer use, \ref{}
\end{figure}

\subsection{Jensen's Model:}
\
\
\
\

The analytical wake model developed by Jensen is simple and requires less inputs as compared other complex wake models. It is used in mostly is optimizing position of the wind turbines within a wind farm. It is based on the global momentum conservation and on the assumption that the wake has a linearly expanding diameter.\\

The Fig (\ref{figc5h11}) illustrates the principle of Jensen's wake model.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{WakeEffect2}
\caption{Jensen - Wake Model Principle [56]}
\label{figc5h11} %% to refer use, \ref{}
\end{figure}

The eq (\ref(W44),\ref(W45),\ref(W47),\ref(W48)) describe the Jensen wake model.

\begin{equation}
\label{W44}
	D_{wake} = D(1 + 2ks)\\
\end{equation}\\

\begin{equation}
\label{W45}
    u_{def} = U_{\infty}\left[\frac{1-\sqrt{1-C_T}}{(1 + 2ks)^2}\right]\\
\end{equation}\\

\begin{equation}
\label{W46}
     u = U_{\infty}\left[1 - \frac{1-\sqrt{1-C_T}}{(1 + 2ks)^2}\right]\\
\end{equation}\\

\begin{equation}
\label{W47}
     s = x/D\\
\end{equation}\\
    where,\\
    $ D_{wake} $ = Wake Diameter $ (m) $ \\
    $ D $ = Rotor Diameter $ (m) $ \\
    $ k $ = Wake Decay Constant (onshore=0.075 and offshore=0.05) \\
    $ s $ = Normalized downstream distance from turbine $ (m) $ \\
    $ x $ = Axial Distance between Turbines $ (m) $ \\
    $ u_{def} $ = Velocity deficit in fully developed Wake $ (m/s) $ \\
    $ U_{\infty} $ = Wind Speed $ (m/s) $ \\
    $ C_{T} $ = Induction Factor of Turbine \\
    $ u $ = Wind Speed after Wake effect $ (m/s) $ \\

\subsection{Frandsen's Model:}
\
\
\
\
The analytical wake model developed by Frandsen has been adopted in the Storpark Analytical Model (SAM). This model predicts the wind speed deficit in large offshore wind farms using a rectangular site area and straight rows of wind turbines with equidistant spacing between the wind turbines and rows. This model is more accurate than the Jensen model, but requires more input variables.\\

The eq (\ref(W48),\ref(W49),\ref(W50),\ref(W51)) describe the Frandsen wake model.

\begin{equation}
\label{W48}
	D_{wake} = D(\beta ^{(k/2)} + \alpha s)^{\frac{1}{k}}\\
\end{equation}\\

\begin{equation}
\label{W49}
	\beta = \frac{1 + \sqrt{1-C_T}}{2 \sqrt{1-C_T}}\\
\end{equation}\\

\begin{equation}
\label{W50}
	u_{def} = \frac{U_{\infty}}{2} \left(1 \pm \sqrt{1 - 2 \frac{A}{A_{wake}} C_T}\right)\\
\end{equation}\\

\begin{equation}
\label{W51}
     s = x/D\\
\end{equation}\\
    where,\\
    $ D_{wake} $ = Wake Diameter $ (m) $ \\
    $ D $ = Rotor Diameter $ (m) $ \\
    $ k $ = Wake Decay Constant $ k=2 \text{, for Schlichting solution to the wake expansion; } k=3 \text{, for square root shape chosen } $ \\
    $ \alpha $ = Initial Wake expansion \\
    $ s $ = Normalized downstream distance from turbine $ (m) $ \\
    $ x $ = Axial Distance between Turbines $ (m) $ \\
    $ u_{def} $ = Velocity deficit in fully developed Wake $ (m/s) $ \\
    $ U_{\infty} $ = Wind Speed $ (m/s) $ \\
    $ C_{T} $ = Induction Factor of Turbine \\
    $ A $ = Swept area of rotor $ (m^{2}) $ \\
    $ A_{wake} $ = Swept area of Wake $ (m^{2}) $ \\

\newpage

\section{Concept of TSR:}
\
\
\
\
Tip Speed Ratio (TSR) is defined as the ratio of the angular speed of the wind turbine rotor blade to the wind velocity, it is given by the eq (\ref{W38}).

\begin{equation}
\label{W38}
TSR = \frac{\text{Linear speed of the blade's outermost tip}}{\text{Free upstream wind velocity}}
\end{equation}\\

The TSR in terms of rotor radius and angular speed in rads/s is given by the eq (\ref{W39}).

\begin{equation}
\label{W39}
TSR = \frac{\omega \times R}{V}
\end{equation}\\
where,\\
$ R $ = rotor radius $ (m) $\\
$\omega$ = angular speed of the rotor $(rads/s)$\\

The TSR is an important quantity in determining the amount of power extracted from wind by the wind turbine, as the Wind Turbine Power Co-efficient $(C_{P})$ is a function of the TSR. The relationship between TSR and $C_{P}$ is dealt with in detail in the next section.\\

\subsection{Power Coefficient Analysis:}
\
\
\
\
The power extracted from the wind by the wind turbine is directly proportional to the the Wind Turbine Power Co-efficient $(C_{P})$ as seen in the eq (\ref{W10}). $C_{P}$ is experimentally measured by the Wind Turbine Manufactures and its graph is provided in the data-sheet.\\

$C_{P}$ describes the aerodynamic behaviour of the wind turbine rotor blades. It is a highly non-linear function of TSR and the blade pitch angle $(\theta)$. For a given $\theta$ the $C_{P}$ is plotted for a range of TSR values. The relationship between $C_{P}$, TSR and $\theta$ differs from turbine to turbine; however, its knowledge helps in designing maximum power tracking controllers which try to maintain $C_{P}$ at its maximum value under the given wind speed condition by adjusting the blade pitch angle (Pitch Control) and/or the gear ratio (Speed Control).\\

The eq (\ref{W41},\ref{W42}) gives a detailed analytical model for the relationship between $C_{P}$, TSR and $\theta$, it is developed by (Anderson & Bose, 1983).

\begin{equation}
\label{W41}
C_p(\lambda , \theta) = C_1\times(C_2  \frac{1}{\beta} - C_3 \beta \theta - C_4 \theta ^x - C_5)e^{-C_6 \frac{1}{\beta}}\\
\end{equation}\\

\begin{equation}
\label{W42}
\frac{1}{\beta} = \frac{1}{\lambda + 0.08\theta} - \frac{0.035}{1 + \theta ^3}\\
\end{equation}\\
where,\\
$ C_{P} $ = Wind Turbine Power Coefficient \\
$ C_{1},C_{2},C_{3},C_{4},C_{5},C_{6} \text{ and }x_ $ = Turbine rotor design dependent constants \\
$ \lambda $ = Tip speed ratio \\

The eq (\ref{W43}) describes another simpler analytical model for C_{P}, which does not take into account physical design differences between the wind turbine rotor blades; it is also developed by (Anderson & Bose, 1983).

\begin{equation}
\label{W43}
	C_p = \frac{1}{2}(\lambda - 0.022\theta ^2 - 5.6)e^{-0.17\lambda}\\
\end{equation}\\
where,\\
$\lambda = \frac{V_w \text{ (mph) }}{\omega _{b}  (rads_-1) }$\\
where,\\
$ \lambda $ = Tip Speed Ratio \\
$ V_w $ = Wind speed $ (mph) $  \\
$ \omega_b $ = Angular speed of turbine rotor $ (rads/s) $ \\

\section{Weibull Wind Speed Distribution:}
\
\
\
\
The variation in wind speed distribution is best described by the Weibull probability distribution function 'h' with two parameters:

\begin{enumerate}
\item \blindtext The shape parameter 'k'
\item \blindtext The scale parameter 'c'
\end{enumerate}

The probability of wind speed being $\upsilon$ during any time interval is given by eq (\ref{W21})

\begin{equation}
\label{W21}
h(\upsilon) = \left(\frac{k}{c}\right) \times \left(\frac{\upsilon}{c}\right)^{k-1} \times \exp{\left(\frac{\upsilon}{c}\right)}^k \text{, for $0< \upsilon < \infty$}
\end{equation}\\

The eq (\ref{W21}) tells us the probability of occurrence of a particular wind speed. As it is a probability distribution, hence its summation from infinity to infinity is 1. Therefore, we can multiply it with time parameter to get probability of wind speed in terms of hours in a year (if multiplied by 8760) or any other time parameter which fits best for the wind speed being described by the probability distribution.\\

Weibull probability distribution changes its shape according to the shape parameter $k$ as follows:

\begin{enumerate}
\item \blindtext 	$k=1$ makes it the exponential distribution, \,$h = \lambda \times e^{-(\lambda\upsilon)},\, where \, \lambda = \frac{1}			{c}$
\item \blindtext $k=2$ makes it the Rayleigh distribution, \,$h = 2 \times \lambda^2 \times \upsilon \times e^{-(\lambda\upsilon)^2}$
\item \blindtext $k>3$ makes it approach a normal bell-shaped distribution
\end{enumerate}

The eq (\ref{W25}) gives the relationship between the shape parameter (k), scale parameter (c) and the mean wind speed for a give period of time for which the wind data was gathered. Knowing $V_{mean}$ and adjusting the shape parameter (k) so as to come close to the actual wind speed distribution the scale parameter (c) can be computed.

\begin{equation}
\label{W25}
V_{mean} = c \times \sqrt{\left(1 + \frac{1}{k}\right)}
\end{equation}\\

Root mean cube wind speed is defined in similar manner as $V_(rms)$ in AC electrical circuits, it is given by eq (\ref{W28}).

\begin{equation}
\label{W28}
	V_(rmc) = 3 \times \sqrt{\frac{1}{8760}\int\limits_0^\infty h\upsilon^3 \, d\upsilon}
\end{equation}\\

Using $V_{rmc}$ the 'annual average power generation' can be computed as given in eq (\ref{W29}).

\begin{equation}
\label{W29}
	P_{rmc} = \frac{1}{4}\times \rho \times {V_{rmc}}^3
\end{equation}\\

Furthermore, using eq (\ref{W30}) we can compute the average annual energy production of the specific site.

\begin{equation}
\label{W30}
	\text{Average annual energy production of the site} = P_{rmc} \times \text{total number of hours per year}
\end{equation}\\

So, using the concepts of Weibull Distribution and Root Mean Cube Wind Speed, we can estimate the potential of a site for setting up a wind farm with minimum amount of data (just annual mean wind speed can suffice for performing the analysis).\\

\newpage

\section{Power Flow through Wind Turbine Grid Connected System}
\
\
\
\
The Fig (\ref{Windloss}) illustrates the power flow through a Wind Turbine grid connected system and the various losses incurred in the this system.

\begin{figure}[H]
\centering
\includegraphics[scale=0.75]{WindLoss1}
\caption{Flow Diagram - Power Flow and Power Losses in a Wind Turbine Grid Connected System}
\label{WindLoss} %% to refer use, \ref{}
\end{figure}

\subsection{Wind Speed Correction}
\
\
\
\
The wind speed measured in a Wind Turbine Power Plant by a weather station at ground level. In order to know the exact wind speed at the height of the wind turbine rotors, correction has to be implemented as directed by the eq (\ref{}).

Moreover, wake effect has to be taken into account to incorporate the downstream wind velocity deficit as explained in the section (5.7), either using Jensen or Frandsen wake effect models.

\subsection{Power Curve Correction}
\
\
\
\
As discussed in the section (5.5), the air density has a direct proportion to the power extracted by the wind turbine from the wind. The Power vs Wind Speed curves provided by the manufacturers are experimentally measured at sea level at a controlled temperature of $15^{\circ}C$. However the the altitude and the temperature at the specific wind farm location is different, hence power curve correction based on the air density correction has to performed for more accurate power estimation from the wind turbines.

\subsection{Ohmic and Transformer Losses}
\
\
\
\
AC cabling is done to connect wind turbines to the transformer. All these cables add to the resistance of the Wind Turbine system causing huge ohmic losses. Hence, in order to reduce these ohmic losses, the length of the cabling should be minimum and the cable material should be of low resistivity.\\

Transformers are another indispensible part of the grid connected Wind Turbine systems. They step-up the voltage of the Wind Turbine system output, so that the power can be transferred to the transmission lines operating at higher voltages. But, transformers consist of copper coils which result in resistive losses, and iron cores which cause iron losses. Hence, the power output to the grid from the the PV system is reduced.\\

\newpage

\section{MATLAB Model Algorithm}

The Fig (\ref{figc5h4} ) depicts an simplified flowchart of the algorithm which is developed for the creation of the Wind Energy Estimation Application.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{WindScheme}
\caption{Wind Turbine Energy Estimation Schematic}
\label{figc5h4} %% to refer use, \ref{}
\end{figure}

Based on the theory discussed in previous sections of this chapter and the algorithm developed as illustrated in Fig (\ref{WindLoss1},\ref{figc5h4}); a GUI based application for energy estimation of grid connected wind turbine power plants is developed in MATLAB, the results of which are presented in the next section and the application GUIs can be found in the Appendix.

\newpage

\section{Results}
\
\
\
\
The Wind Energy Estimation App has been tested with a hypothetical wind turbine power plant, and the Weibull Distribution sub-module has been tested with random site information. The results obtained are doumented in the following sections.

\subsection{Wind Turbine Power Plant Site Potential Estimation using Weibull Distribution App}
\
\
\
\
The Fig (\ref{WinResImg1}) shows the site potential estimation performed by the Weibull Distribution sub-module for monthly data.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{Weibull_Monthly}
\caption{Weibull Distribution-Monthly Simulation }
\label{WinResImg1} %% to refer use, \ref{}
\end{figure}

The Fig (\ref{WinResImg2}) shows the site potential estimation performed by the Weibull Distribution sub-module for yearly data.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{Weibull_Yearly}
\caption{ Weibull Distribution-Yearly Simulation }
\label{WinResImg2} %% to refer use, \ref{}
\end{figure}

\subsection{Cp Curve Generator App}
\
\
\
\
The Table (\ref{CpCurveTab1}) gives the rotor information used to generate C_{P} curves using equation (\ref{W41}).

\begin{table}[htbp]
  \centering
  \caption{Cp Curve Generator App - Equation 1 Simulation Parameters}
    \begin{tabular}{|l|l|}
    \hline
    \multicolumn{2}{|c|}{\textbf{Cp Curve Equation 1}} \bigstrut\\
    \hline
    \multicolumn{1}{|c|}{\textbf{Parameters }} & \multicolumn{1}{c|}{\textbf{Value}} \bigstrut\\
    \hline
    \multicolumn{1}{|c|}{Number of Rotor Types} & 3 \bigstrut\\
    \hline
    c1 & 0.5,0.7,0.3 \bigstrut\\
    \hline
    c2 & 116,150,85 \bigstrut\\
    \hline
    c3 & 0.4,0.6,0.2 \bigstrut\\
    \hline
    c4 & 0,0,0 \bigstrut\\
    \hline
    c5 & 5,10,3 \bigstrut\\
    \hline
    c6 & 21,31,11 \bigstrut\\
    \hline
    x  & 0,0,0 \bigstrut\\
    \hline
    Theta & 1,2,3,4 \bigstrut\\
    \hline
    \end{tabular}%
  \label{CpCurveTab1}%
\end{table}%

The Fig (\ref{WinResImg3},\ref{WinResImg4},\ref{WinResImg5}) shows the C_{P} curve graphs obtained from the Cp Curve Generator App for different values of the blade pitch angles.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{CpCurve_Eq1_1}
\caption{CpCurve Generator App-Equation 1 Rotor 1 Simulation}
\label{WinResImg3} %% to refer use, \ref{}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{CpCurve_Eq1_2}
\caption{CpCurve Generator App-Equation 1 Rotor 2 Simulation}
\label{WinResImg4} %% to refer use, \ref{}
\end{figure}
\begin{figure}[H]

\centering
\includegraphics[scale=0.5]{CpCurve_Eq1_3}
\caption{CpCurve Generator App-Equation 1 Rotor 3 Simulation}
\label{WinResImg5} %% to refer use, \ref{}
\end{figure}

The Table (\ref{CpCurveTab2}) gives the rotor information used to generate C_{P} curves using equation (\ref{W43}).

\begin{table}[htbp]
  \centering
  \caption{Cp Curve Generator App - Equation 2 Simulation Parameters}
    \begin{tabular}{|l|l|}
    \hline
    \multicolumn{2}{|c|}{\textbf{Cp Curve Equation 2}} \bigstrut\\
    \hline
    \multicolumn{1}{|c|}{\textbf{Parameters }} & \multicolumn{1}{c|}{\textbf{Value}} \bigstrut\\
    \hline
    Number of Rotor Types &  \bigstrut\\
    \hline
    c1 & 0.5 \bigstrut\\
    \hline
    c2 & 116 \bigstrut\\
    \hline
    c3 & 0.4 \bigstrut\\
    \hline
    c4 & 0 \bigstrut\\
    \hline
    c5 & 5 \bigstrut\\
    \hline
    c6 & 21 \bigstrut\\
    \hline
    x  & 0 \bigstrut\\
    \hline
    Theta & 0,5,10,15,20 \bigstrut\\
    \hline
    \end{tabular}%
  \label{CpCurveTab2}%
\end{table}%

The Fig (\ref{WinResImg6}) shows the C_{P} curve graphs obtained from the Cp Curve Generator App for different values of the blade pitch angles.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{CpCurve_Eq2_1}
\caption{CpCurve Generator App-Equation 2 Simulation }
\label{WinResImg6} %% to refer use, \ref{}
\end{figure}

\subsection{Hypothetical Wind Turbine Plant Information}
\
\
\
\
The Table (\ref{DataTab1}) gives the information of the hypothetical wind power plant, which was fed into the Data Acquisition App and the Wind Energy Estimation App for testing purposes due lack of real WTPP data.

\begin{table}[H]
  \centering
  \captionHypothetical Wind Turbine Power Plant Information Table}
    \begin{tabular}{|l|l|l|l|l|}
    \hline
    \multicolumn{5}{|c|}{\textbf{HYPOTHETICAL WIND TURBINE POWER PLANT}} \bigstrut\\
    \hline
    \multicolumn{5}{|c|}{\textbf{SITE INFORMATION}} \bigstrut\\
    \hline
    \textbf{LATITUDE} & \multicolumn{4}{l|}{23.275} \bigstrut\\
    \hline
    \textbf{LONGITUDE} & \multicolumn{4}{l|}{72.682} \bigstrut\\
    \hline
    \textbf{ALTITUDE (m)} & \multicolumn{4}{l|}{100} \bigstrut\\
    \hline
    \textbf{PLANT CAPACITY (MW)} & \multicolumn{4}{l|}{138} \bigstrut\\
    \hline
    \multicolumn{5}{|c|}{\textbf{WIND TURBINE PLANT INFORMATION}} \bigstrut\\
    \hline
    \textbf{PARAMETERS} & \multicolumn{4}{c|}{\textbf{WIND GENERATOR TYPES}} \bigstrut\\
    \hline
       & \textbf{Type1} & \textbf{Type2} & \textbf{Type3} & \textbf{Type4} \bigstrut\\
    \hline
    \textbf{No. of Sub-Models} & 1  & 2  & 3  & 4 \bigstrut\\
    \hline
    \textbf{No. of Turbines} & 5  & 5,10 & 5,10,15 & 5,10,15,20 \bigstrut\\
    \hline
    \textbf{Cut-In Wind Speed} & 4  & 4,4 & 4,4,4 & 4,4,4,3.5 \bigstrut\\
    \hline
    \textbf{Cut-Out Wind Speed} & 24 & 24,19 & 24,19,25 & 24,19,25,23 \bigstrut\\
    \hline
    \textbf{Rotor Radius} & 38.5 & 38.5,19.5 & 38.5,19.5,35.5 & 38.5,19.5,35.5,38.5 \bigstrut\\
    \hline
    \textbf{Hub-Height} & 80 & 80,55 & 80,55,73 & 80,50,73,80 \bigstrut\\
    \hline
    \end{tabular}%
  \label{DataTab1}%
\end{table}%

\subsection{Wind Turbine Power Curve GUI}
\
\
\
\
The Fig (\ref{WinResImg7},\ref{WinResImg8},\ref{WinResImg9},\ref{WinResImg10}) illustrates the Power (kW) vs Wind Speed (m/s) graphs of the four different wind turbines used in the simulation as observed in the Wind Power Curves sub-module.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{NegMicon}
\caption{Power vs Wind Speed Curve-Neg Micon 1.5MW}
\label{WinResImg7} %% to refer use, \ref{}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{Vestas}
\caption{Power vs Wind Speed Curve-Vestas 0.6MW}
\label{WinResImg8} %% to refer use, \ref{}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{Enercon}
\caption{Power vs Wind Speed Curve-Enercon 2MW }
\label{WinResImg9} %% to refer use, \ref{}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{GE}
\caption{Power vs Wind Speed Curve-GE 1.5MW}
\label{WinResImg10} %% to refer use, \ref{}
\end{figure}

\subsection{Wind Energy Estimation App Output}
\
\
\
\
The Fig (\ref{WinResImg11}) shows the monthly energy output to the grid obtained from the four different types of wind turbines present in the type four category of the hypothetical wind power plant as computed in the Wind Energy Estimation App. The wind speed data was randomly generated and the temperature data was taken from Meteonorm, both at the temporal resolution of 60 minutes.

\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{WindGraph1}
\caption{Hypothetical Wind Plant Month Wise Energy Estimation For Different Wind Generator Types}
\label{WinResImg11} %% to refer use, \ref{}
\end{figure}

We can clearly see that the energy output of the Enercon and GE  compared to Neg Micon and Vestas is higher, as the number of these turbines is higher.


%---------------------------Edge Ratio----------------------------------
\section{Edge Ratio}

The edge ratio of a tetrahedron is:
\[
\frac{L_{\max}}{L_{\min}}.
\]

\tetmetrictable{edge ratio}%
{$1$}%                  Dimension
{$[1,3]$}%              Acceptable range
{$[1,DBL\_MAX]$}%       Normal range
{$[1,DBL\_MAX]$}%       Full range
{$1$}%                  Equilateral tet
{--}%                   Citation
{v\_tet\_edge\_ratio}%  Verdict function name