text:
\chapter{Lower Depths}
 \index{Lower Depths} \index{Depths}

\startMonsterName
Aboleth	\CMTags{Group, Huge, Intelligent}
\stopMonsterName

Tentacle (d8+3 damage)	18 HP	0 Armor

\CMTags{Reach}

\startMonsterQualities
{\bf Special Qualities:}  Telepathy
\stopMonsterQualities

\startMonsterDescription
Deep below the surface of the world, in freshwater seas untouched by the sun dwell the aboleth. Fish the size of whales, with strange growths of gelatinous feelers used to probe the lightless shores. They’re served by slaves; blind albino victims of any race unfortunate enough to stumble on them, drained of thought and life by the powers of the aboleth’s alien mind. In the depths they bid and plot against each other, fishy cultists building and digging upward towards the surface until someday, they’ll breach it. For now, they sleep and dream and guide their pallid minions to do their bidding. {\em Instinct} : To command
\stopMonsterDescription

\startitemize[1,packed]

\item Invade a mind

\item Turn minions on them

\item Put a plan in motion

\stopitemize

\startMonsterName
Apocalypse Dragon	\CMTags{Solitary, Huge, Magical, Divine}
\stopMonsterName

Bite (2d10·b+9 damage 4 piercing)	26 HP	5 Armor

\CMTags{Reach, Forceful, Messy}

\startMonsterQualities
{\bf Special Qualities:}  Inch-thick metal hide, Supernatural knowledge, Wings
\stopMonsterQualities

\startMonsterDescription
The end of all things shall be a burning—of tree and earth and of the air itself. It shall come upon the plains and mountains not from beyond this world but from within it. Birthed from the womb of deepest earth shall come the Dragon that Will End the World. In its passing all will become ash and bile and the earth a dying thing will drift through planar space devoid of life. They say to worship it is to invite madness. They say to love it is to know oblivion. The awakening is coming. {\em Instinct} : To end the world
\stopMonsterDescription

\startitemize[1,packed]

\item Set a disaster in motion

\item Breath forth the elements

\item Act with perfect knowledge

\stopitemize

\startMonsterName
Chaos Spawn	\CMTags{Solitary, Gibbous}
\stopMonsterName

Chaotic touch (d10 damage)	19 HP	1 Armor

\CMTags{Close, Reach}

\startMonsterQualities
{\bf Special Qualities:}  Chaos form
\stopMonsterQualities

\startMonsterDescription
Driven from the city, a cultist finds solace in towns and villages. Discovered there, he flees to the hills and scratches his devotion on the cave walls. Found out, he is chased with knife and torch into the depths, crawling deeper and deeper until, in the deepest places, he loses his way. First, he forgets his name. Then he forgets his shape. His chaos gods, most beloved, bless him with a new one. {\em Instinct} : To undermine
\stopMonsterDescription

\startitemize[1,packed]

\item Rewrite reality

\item Unleash chaos from containment

\stopitemize

\startMonsterName
Chuul	\CMTags{Group, Large, Cautious}
\stopMonsterName

Claws (d8+1 damage 3 piercing)	10 HP	4 Armor

\CMTags{Close, Reach, Messy}

\startMonsterQualities
{\bf Special Qualities:}  Amphibious
\stopMonsterQualities

\startMonsterDescription
Let us, for a moment, consider the lobster. This one is your worst seafood nightmare come to life. A sort of vicious, half-man half-crawdad cursed with primal intelligence and blessed with a pair of razor-sharp claws. Strange things lurk in the stinking pools in caverns best forgotten and the Chuul is one of them. If you spot one, your best hope is a heavy mace to crack its shell and maybe a little garlic butter. Mmmm. {\em Instinct} : To split
\stopMonsterDescription

\startitemize[1,packed]

\item Split something in two with mighty claws

\item Retreat into water

\stopitemize

\startMonsterName
Deep Elf Assassin	\CMTags{Group, Intelligent, Organized}
\stopMonsterName

Poisoned blade (d8 damage 1 piercing)	6 HP	1 Armor

\CMTags{Close}

\startMonsterDescription
It was not so simple a thing as a war over religion or territory. No disagreement of Queens led to the great sundering of the elves. It was sadness. It was the very diminishing of the world by the lesser races and the glory of all the elves had built was cracking and turning to glass. Some, then, chose to separate themselves from the world; wracked with tears they turned their backs on men and dwarves. Others, though, they were overcome with something new. A feeling no elf had felt before. Spite. Hatred filled these elves and twisted them and they turned on their weaker cousins. Some still remain after the great exodus below. Some hide amongst us with spider-poisoned blades, meting out that strangest of punishments: elven vengeance. {\em Instinct} : To spite
\stopMonsterDescription

\startitemize[1,packed]

\item Poison them

\item Unleash an ancient spell

\item Call reinforcements

\stopitemize

\startMonsterName
Deep Elf Swordmaster	\CMTags{Group, Intelligent, Organized}
\stopMonsterName

Barbed blade (2d8·b+2 damage 1 piercing)	6 HP	2 Armor

\CMTags{Close}

\startMonsterDescription
The deep elves lost the sweetness and gentle peace of their bright cousins ages ago but did not abandon grace. They move with a swiftness and beauty that would bring a tear to any warrior’s eye. In the dark, they’ve practiced. A cruelty has infested their swordsmanship—a wickedness comes to the fore. Barbed blades and whips replace the shining pennant-spears of surface elven battles. The swordmasters of the deep elf clans do not merely seek to kill, but to punish with every stroke of their blades. Wickedness and pain are their currency. {\em Instinct} : To punish
\stopMonsterDescription

\startitemize[1,packed]

\item Inflict pain beyond measure

\item Use the dark to advantage

\stopitemize

\startMonsterName
Deep Elf Priest	\CMTags{Solitary, Divine, Intelligent, Organized}
\stopMonsterName

Smite (d10+2 damage)	14 HP	0 Armor

\CMTags{Close, Reach}

\startMonsterQualities
{\bf Special Qualities:}  Divine connection
\stopMonsterQualities

\startMonsterDescription
The spirits of the trees and the lady sunlight are far far from home in the depths where the deep elves dwell. New gods were found, there, waiting for their children to come home. Gods of the spiders, the fungal forests, and things that whisper in the forbidden caves. The deep elves, ever attuned to the world around them, listened with hateful intent to their new gods and found a source of power yet unrealized. Hate calls to hate and grim alliances were made. Even among these spiteful ranks, piety finds a way to express itself. {\em Instinct} : To pass on divine vengeance
\stopMonsterDescription

\startitemize[1,packed]

\item Weave spells of hatred and malice

\item Rally the deep elves

\item Pass on divine knowledge

\stopitemize

\startMonsterName
Dragon	\CMTags{Solitary, Huge, Terrifying, Cautious, Hoarder}
\stopMonsterName

Bite (2d10·b+5 damage 4 piercing)	16 HP	5 Armor

\CMTags{Reach, Messy}

\startMonsterQualities
{\bf Special Qualities:}  Elemental blood, Wings
\stopMonsterQualities

\startMonsterDescription
They are the greatest and most terrible things this world will ever have to offer. {\em Instinct} : To rule
\stopMonsterDescription

\startitemize[1,packed]

\item Bend an element to its will

\item Demand tribute

\item Act with disdain

\stopitemize

\startMonsterName
Gray Render	\CMTags{Solitary, Large}
\stopMonsterName

Rend (d10+3 damage)	16 HP	1 Armor

\CMTags{Close, Reach, Forceful}

\startMonsterDescription
On its own, the render is a force of utter destruction. Huge and leathery, with a maw of unbreakable teeth and claws to match, the render seems to enjoy little more than tearing things apart. Stone, flesh, or steel, it matters little. However, the gray render is so rarely found alone. They bond with other creatures. Some at birth, others as fully-grown creatures, and will follow their bonded master wherever it goes, bringing them offerings of meat and protecting them while they sleep. Finding an un-bonded render means certain riches, if you survive to sell it. {\em Instinct} : To serve
\stopMonsterDescription

\startitemize[1,packed]

\item Tear something apart

\stopitemize

\startMonsterName
Magmin	\CMTags{Horde, Intelligent, Organized, Hoarder}
\stopMonsterName

Flaming hammer (d6+2 damage)	7 HP	4 Armor

\CMTags{Close, Reach}

\startMonsterQualities
{\bf Special Qualities:}  Firey blood
\stopMonsterQualities

\startMonsterDescription
Dwarf-shaped and industrious, the magmin are among the deepest-dwellers of Dungeon World. Found in cities of brass and obsidian built nearest the molten core of the planet, the magmin live a life devoted to craft—especially that of fire and magical items related to it. Surly and strange, they do not often deign to speak to petitioners who appear at their gates, even those who have somehow found a way to survive the hellish heat. Even so, they respect little more than a finely made item and to learn to forge from a magmin craftsman means unlocking secrets unknown to surface blacksmiths. Like so much else, visiting the magmin is a game of risk and reward. {\em Instinct} : To craft
\stopMonsterDescription

\startitemize[1,packed]

\item Offer a trade or deal

\item Strike with fire or magic

\item Provide just the right item, at a price

\stopitemize

\startMonsterName
Minotaur	\CMTags{Solitary, Large}
\stopMonsterName

Axe (d10+1 damage)	16 HP	1 Armor

\CMTags{Close, Reach}

\startMonsterQualities
{\bf Special Qualities:}  Unerring sense of direction
\stopMonsterQualities

\startMonsterDescription
Head of a man, body of a bull. No, wait, I’ve got that backwards. It’s the bull’s head and the man’s body. Hooves sometimes? Is that right? I remember the old King said something about a maze? Blast! You know I can’t think under this kind of pressure. What was that? Oh gods, I think it’s coming… {\em Instinct} : To contain
\stopMonsterDescription

\startitemize[1,packed]

\item Confuse them

\item Make them lost

\stopitemize

\startMonsterName
Naga	\CMTags{Solitary, Intelligent, Organized, Hoarder, Magical}
\stopMonsterName

Bite (d10 damage)	12 HP	2 Armor

\CMTags{Close, Reach}

\startMonsterDescription
Ambitious and territorial above nearly all else, the naga are very rarely found without a well-formed and insidious cult of followers. You’ll see it in many mountain towns—a snake sigil scrawled on a tavern wall or a local church burned to the ground. People going missing into the mines. Men and women wearing the mark of the serpent. At the core of it all lies a naga; an old race now fallen into obscurity, still preening with the head of a man over its coiled, serpent body. Variations of these creatures exist depending on their bloodline and original purpose, but they are all master manipulators and magical forces to be reckoned with. {\em Instinct} : To lead
\stopMonsterDescription

\startitemize[1,packed]

\item Send a follower to their death

\item Use old magic

\item Offer a deal or bargain

\stopitemize

\startMonsterName
Salamander	\CMTags{Horde, Large, Intelligent, Organized, Planar}
\stopMonsterName

Flaming spear (2d6·b+3 damage)	7 HP	3 Armor

\CMTags{Close, Reach, Near}

\startMonsterQualities
{\bf Special Qualities:}  Burrowing
\stopMonsterQualities

\startMonsterDescription
The excavation uncovered a basalt gate, the reports called it. Black stone carved with molten runes. When they dug it up, the magi declared it inert but further evidence indicates that was an incorrect claim. The entire team went missing. When we arrived, the gate was glowing. Its light filled the whole cavern. We could see from the entrance that the area had become full of these creatures—like red and orange skinned men, tall as an ogre but with a snakes tail where there legs ought to be. They were clothed, too —some had black glass armor. They spoke to each other in a tongue that sounded like grease in a fire. I wanted to leave but the Sergeant wouldn’t listen. You’ve already read what happened next, sir. I know I’m the only one that got back, but what I said is true. The gate is open, now. This is just the beginning! {\em Instinct} : To consume in flame
\stopMonsterDescription

\startitemize[1,packed]

\item Summon elemental fire

\item Melt away deception

\stopitemize

max_stars_repo_name: maxlambertini/DungeonWorld-ConTeXt

max_issues_repo_name: maxlambertini/DungeonWorld-ConTeXt

max_forks_repo_name: maxlambertini/DungeonWorld-ConTeXt


text:
\pagebreak

\section{Educat\textcolor{mycolor}{ion}}
  \subsection{Artesis Plantijn University \href{https://ap.be}{AP}}
    \hspace*{\fill}{\textcolor{mygrey}{2017-2020}}

    Bachlor's Electronics-ICT.
    \subsubsection{Duration}
      3 years.
    \subsubsection{Relevant Coursework}
      Electronics, PCB manufacturing, Rest api's, testing, UX design, Angular, Mobile development (android and flutter), Embedded systems, IoT.
  \subsection{Holon Institute of Technology \href{https://www.hit.ac.il/en}{HIT}}
    \hspace*{\fill}{\textcolor{mygrey}{2020}}

    Studying abroad in Isreal as an exchange student for Artesis Plantijn University (Erasmus project).
    \subsubsection{Duration}
      6 months.
    \subsubsection{Relevant Coursework}
      Data analysis/mining, Artificial Intelligence (NLP), Compiler design.

    \subsection{Gesubsidieerd Technisch Institute Mortsel \href{https://gtimortsel.be/}{GTI}}
    \hspace*{\fill}{\textcolor{mygrey}{2016}}

    High School.
    \subsubsection{Duration}
      3 years.
    \subsubsection{Relevant Coursework}
      Electronics, Mechanics/Physics.

ext: tex


text:
\input{PreambleCommon}
\input{../WeekTitles}
\begin{document}

\newpage
\setfont
\pagestyle{fancy}
\renewcommand{\Week}{7}
\renewcommand{\WeekTitle}{\WeekTitleSeven}

\fancyhead[LE,RO]{Week \Week}  % default, usually only for first page
\fancyfoot{}
\sectionbox{Week \#\Week: \WeekTitle}

\vspace{5mm}
\goals
\begin{itemize}
\item Understand and express real world situations in terms of first order differential equations
\item Tell the difference between linear and nonlinear differential equations
\item Solve basic first order separable and linear differential equations
\item Use MATLAB to solve nonlinear first order differential equations
\end{itemize}

\topic{Sources of Differential Equations}
\section*{Differential Equations}

An equation relating an unknown function and one or more of its
derivatives is a \textbf{differential equation}.

We study differential equations because they are an incredibly
powerful tool for modelling real world problems.

%\newpage
%
%\begin{problem}Express the following sentence as an equation:\\[1ex]
%The rate at which water is leaking from the tank is
%      proportional to the square root of the volume of water in the
%      tank.
%\end{problem}

%\newpage
%
%\vfill
%\begin{problem}Express the following sentence as an equation: \\[1ex]The
%  rate at which a rumour spreads is proportional to the product of the
%  people who have heard it and those who have not.
%\end{problem}
%
%\vfill

%\newpage
%\begin{problem}Express the following sentence as an
%  equation:\\[1ex]
%As the meteorite plummets toward the Earth, its
%      acceleration is inversely proportional to the square of its
%      distance from the centre of the Earth.
%\end{problem}
%
%\vfill
%
%The previous examples indicate how easily differential equations can
%be constructed.  Unfortunately, starting with those equations, we have
%a lot of work to do before we can predict will happen, given the
%equation.

% \newpage
% \topic{The Exponential Differential Equation}
% We now consider the most fundamental differential equation.
% \begin{problem}
%   Consider
%   \begin{equation}
%     \label{eq:one}
%     \tag{*}
%     \frac{dy}{dt} = k y \qquad \text{where k } \in \mathbb{R}
%   \end{equation}
%   What functions (if any) satisfy \eqref{eq:one} when $k = 1$?

% \newpage
% $$\eqref{eq:one} ~~~~~  \frac{dy}{dt} = k y \qquad \text{where } k \in \mathbb{R}$$
%   For what values of $k$ does a function $y$ exists that satisfies
%     \eqref{eq:one}?

% \newpage
% $$\eqref{eq:one} ~~~~~  \frac{dy}{dt} = k y \qquad \text{where } k \in \mathbb{R}$$
%   How many functions satisfy \eqref{eq:one} for each value of $k$?

% \newpage
% $$\eqref{eq:one} ~~~~~  \frac{dy}{dt} = k y \qquad \text{where } k \in \mathbb{R}$$
%   How many functions $y$ are there such that $y$ and $\dfrac{dy}{dt}$ are
%     continuous for all real $t$, $y(0) = 0$, and satisfy \eqref{eq:one}?  What
%     are they?

% \newpage
% $$\eqref{eq:one} ~~~~~  \frac{dy}{dt} = k y \qquad \text{where } k \in \mathbb{R}$$
%   How many functions $y$ are there such that $y$ and $\dfrac{dy}{dt}$ are
%     continuous for all real $t$, $\mathbf{ y(1) = 1}$, and satisfy \eqref{eq:one}?  What
%     are they?
% \end{problem}

% \newpage

%    First, we observe that $e^{kx}$ satisfies \eqref{eq:one}: $\dfrac{d}{dx}
%    \bigl( e^{kx}) \bigr) = k e^{kx}$.  Suppose $g(x)$ is another function that
%    satisfies \eqref{eq:one}.  Since $e^{kx}$ is never zero, we may write $g(x) =
%    e^{kx} h(x)$ for another function $h(x)$.  Hence, $g'(x) = \tfrac{d}{dx}
%    \bigl( e^{kx} h(x) \bigr) = k e^{kx} h(x) + e^{kx} h'(x) = k \, g(x)$ so
%    $h'(x) = 0$ and $h(x)$ is a constant.  Therefore, the only possible solution
%    to \eqref{eq:one} is a constant multiple of $e^{kx}$.
%    \begin{enumerate}
%    \item All functions of the form $A e^x$ where $A \in \mathbb{R}$.
%    \item There are solutions for every value of $k$.
%    \item There are infinitely many solutions for each value of $k$.
%    \item There is only one function with the required properties: $f(x) = 0$.
%    \item There is only one function with the required properties: $g(x) =
%      e^{k(x-1)} = e^{-k} e^{kx}$.
%    \item When $k = \ln(2)$, there is a unique function: $g(x) = 2^{x-1} =
%      e^{\ln(2) (x-1)}$; otherwise there is no function.
%    \end{enumerate}

\newpage
\topic{Using MATLAB to Solve Differential Equations}
\section*{Using MATLAB to Solve Differential Equations}
Since this course has a strong computational component, we will be using MATLAB to solve the majority of differential equations problems we come across. Be sure to watch the videos that accompany each problem to see how to enter code into MATLAB. This link also provides some help:\\
http://www.mathworks.com/help/matlab/ref/ode45.html\\
ode45 is going to be your new best friend when it comes to differential equations!

\newpage
\topic{General and Particular Solutions}
\begin{boxnote}
  The \textbf{solution} is the \emph{family} of all possible
  functions that satisfy a differential equation.  It normally
  involves some parameters,
  i.e.\ arbitrary constants.  \\[1ex]
  A \textbf{particular solution} is a specific function with satisfies
  the differential equation. We will be dealing with particular solutions in this course.
\end{boxnote}

\newpage
\begin{problem}
  Use MATLAB to create a plot of the solution to the differential equation $\dfrac{dy}{dx} = \dfrac{1}{x^2-1}$ which also satisfies $y(2) = 1$. Use the plot to describe the behaviour of this solution.
\end{problem}

% \begin{proof}[Solution]
%   Integration gives $\int \frac{dy}{dx} \; dx = \int \; dt \;\; \Longrightarrow
%   \;\; y = \int \frac{1}{x^2-1} \; dx$.  Hence, partial fractions yields
%   \begin{align*}
%     y &= \int \frac{1}{x^2-1} \;dx = \int \frac{1}{(x-1)(x+1)} \; dx = \int
%     \frac{1}{2(x-1)} - \frac{1}{2(x-1)} \; dx \\ &= \frac{1}{2} \ln|x-1| + -
%     \frac{1}{2}\ln|x+1| + C \, .
%   \end{align*}
%   Therefore, the general solution is $y = \frac{1}{2} \ln \left| \frac{x-1}{x+1}
%   \right| + C$.
% \end{proof}

\newpage
\topic{Initial Value Problems}
\begin{boxnote}
  A first-order \textbf{initial value problem} is a differential
  equation $$y'(x) = F\bigl( x, y(x) \bigr)$$ together with a point
  $(x_0, y_0)$ in the domain of $F$ \\called the
  \textbf{initial condition}.  \\[1ex]
  A \textbf{solution} to an initial value problem is a function $y$
  that satisfies the differential equation and $y(x_0) = y_0$.  This
  solution will be a \textbf{particular solution} to the differential
  equation.
\end{boxnote}

\begin{problem}
  Find the solution to the differential equation $\dfrac{dy}{dt} = 2t+1$; $y(0) = 3$. Now use MATLAB to create a plot of the solution, and use the plot to describe the behaviour of this solution.
\end{problem}
\newpage
\hfill$\dfrac{dy}{dt} = 2t+1$; $y(0) = 3$.

% \begin{proof}[Solution]
%   Integration gives $\int \frac{dy}{dt} \; dt = \int 2t +1 \; dt \;\;
%   \Longrightarrow \;\; y = t^2 +t + C$.  Since $3 = y(0) = C$, the unique
%   solution is $y = t^2 + t +3$.
% \end{proof}

\newpage

\begin{problem}
  Use MATLAB to create a plot of the solution to the initial value problem: $\dfrac{dy}{dx} = x^2 e^x$; $y(0) = 2$. Describe the behaviour of the solution.
\end{problem}

% \begin{proof}[Solution]
%   Integration gives $\int \frac{dy}{dx} \; dx = \int \; dt \;\; \Longrightarrow
%   \;\; y = \int x^2 e^x \; dx$.  Hence, integration by parts yields
%   \[
%   y = \int x^2 e^x \;dx = x^2 e^x - 2 \int x e^x \; dx = x^2 e^x - 2 \bigl( x
%   e^x + \int e^x \; dx \bigr) = x^2 e^x -2 x e^x + 2 e^x + C \, .
%   \]
%   Since $2 = y(0) = 2+C$, we have $C = 0$ and the unique solution is $y = x^2e^x
%   -2x e^x +2 e^x$.
% \end{proof}

\newpage
%\topic{Verifying Solutions}
%\begin{boxnote}
%  As with `regular' (algebraic, or {\bf non}-differential) equations,
%  solving a differential equation from scratch can be very difficult.
%  It is much easier to verify whether a possible solution (given or
%  guessed at) is correct.
%\end{boxnote}
%
%\begin{problem}
%  Determine which of the functions \\[.5ex]
%$$y_1 = k e^t \mbox{~~~~or~~~~} y_2 = e^{kt}$$\\[.5ex]
%is actually a solution to  $\dfrac{dy}{dt} = k y$.
%\end{problem}
%
%\newpage
%\begin{problem}
%  Show that $g(x) = \sin(x) - \cos(x)$ is a solution to the initial value
%  problem:
%  \begin{xalignat*}{3}
%    \frac{d^2y}{dx^2} + y &= 0 & y(0) &= -1 & y'(0) &= 1
%    \, .
%  \end{xalignat*}
%\end{problem}
%
%\newpage

% \begin{proof}[Solution]
%   Since $g'(x) = \cos(x) + \sin(x)$ and $g''(x) = -\sin(x) +\cos(x) = - g(x)$,
%   we see that $g(x)$ is a particular solution to the differential equation.  As
%   $g(0) = -\cos(0) = -1$ and $g'(0) = \cos(0) = 1$, it also satisfies the
%   initial conditions.
% \end{proof}

%\newpage

% \topic{Existence and Uniqueness}
% \section*{Existence and Uniqueness}

% \noindent
% When does a first-order initial value problem have a solution?
%
%\newpage
% \topic{Visualizing Solutions}
% \subsection*{Visualizing Solutions}

% When considering a differential equation with only a first derivative, recall that:
% \begin{center}
% $\dfrac{dy}{dx}$ represents the \define{slope} of $y(x)$.
% \end{center}
% For $\dfrac{dy}{dx} = f(x,y)$, a \define{slope field} is obtained by
% drawing a line segment in the direction $\bigl( 1, f(x,y) \bigr)$ from
% the point $(x,y)$.  A \define{particular solution} must be tangent to the
% slope field at each point.

% \newpage

% \begin{problem}
%   Draw a few of the line segments in the slope field for  \\
%   $\dfrac{dy}{dx} = - \dfrac{x}{y}$.
% \end{problem}
% \mypstrickspic{Graphs/week01_empty_slope_field2}

% \begin{proof}[Solution]
%   On the $y$-axis, the slope is $0$; on the $x$-axis, the line segments are
%   vertical and the slope is infinite; at the origin the slope is undefined.

%   The slope field suggests that the solution curves are circles centered at the
%   origin.  To verify this, we differentiate implicitly
%   \[
%   0 = \frac{d}{dx} \bigl( x^2 + y^2 - r^2 \bigr) = 2x + 2y \frac{dy}{dx} \;\;
%   \Longrightarrow \;\; \frac{dy}{dx} = - \frac{x}{y} \, .  \qedhere
%   \]
% \end{proof}

%\newpage

% Below is a more complete slope field for $\dfrac{dy}{dx} = -
% \dfrac{x}{y}$.  Using the slope field, guess the formulae for the
% solution curves.
%   \begin{center}
%     \includegraphics[width=10.5cm,height=10.5cm]{Graphs/slopeField0}
%   \end{center}

% \newpage
% \begin{minipage}{5in}
% Verify your proposed solution to the DE $\dfrac{dy}{dx} = - \dfrac{x}{y}$.
% \end{minipage}
% \begin{minipage}{8cm}
%     \includegraphics[width=8cm,height=8cm]{Graphs/slopeField0}
% \end{minipage}

% \topic{Euler's Method}
% \subsection*{Euler's Method / Geometric Idea}

% Fix a starting $A_0$ coming from the initial conditions.  From the differential
% equation, we know the slope of the tangent line.  Take a small step along the
% tangent line to $A_1$.  Along this small step, the slope does not change too
% much, so $A_1$ is close to the solution curve.  Iterating this process, we have
% a polygonal approximation for the solution curve.

% \vspace*{0.5em}
% \comment{Building on this idea, we obtain}

% \begin{boxnote}
%   Consider the initial value problem $\dfrac{dy}{dt} = f(x,y)$; $y(x_0) = y_0$.
%   If $f$ and $\dfrac{\partial f}{\partial y}$ are continuous in some
%   neighbourhood of $(x_0,y_0)$, then the initial value problem has a unique
%   solution in some neighbourhood of $x_0$.
% \end{boxnote}

% \newpage

% \begin{problem}
%   Does this theorem apply to the following initial value problem:
%   $\dfrac{dy}{dx} = x^2-y; y(1) = 6$?
% \end{problem}

% \begin{proof}[Solution]
%   Since $f(x,y) = x^2-y$ and $f_y(x,y) = 1$ are both continuous on $\RR^2$, the
%   hypothesis of the theorem are satisfies, so there is a unique solution in the
%   interval $1-h < x <1-h$ for some positive number $h$.  In fact, the general
%   solution is $y = x^2-2x+2+Ce^{-x}$ because
%   \[
%   \frac{dy}{dx} = 2x-2-Ce^{-x} = x^2 - \bigl( x^2-2x+2+Ce^{-x} \bigr) = x^2-y \, .
%   \]
%   Moreover, $y(1) = 6$ if and only if $C = 5e$.
% \end{proof}

% \newpage
% \begin{problem}
%   Does this theorem apply to the following initial value problem:
%   $\dfrac{dy}{dt} = 3y^{2/3}; y(2) = 0$?
% \end{problem}

% \begin{proof}[Solution]
%   We have $f(x,y) = 3y^{2/3}$ and $f_y(x,y) = 2y^{-1/3}$.  However, $f_y(x,y)$
%   is not continuous (or even defined) at $y = 0$.  Consequently, there is no
%   neighbourhood of $(2,0)$ in which both $f$ and $f_y(x,y)$ are continuous, so
%   the theorem doesn't apply.

%   In this case, the initial value problem does not have a unique solution.
%   Indeed, both $y_1(x) = 0$ and $y_2(x) = (x-2)^3$ satisfy the initial value
%   problem.  \comment{The reason for nonuniqueness in this case is that the
%     velocity decreases too slowly when approaching the equilibrium position.  As
%   a result, the solution manages to reach the singular point in a finite time.}
% \end{proof}

% The slope fields for these differential equations are:

% %\includegraphics[width=6.5cm]{./Graphs/slopeField1.png}
% \hfill
%\includegraphics[width=6.5cm]{./Graphs/slopeField2.png}

% \topic{Picard's Method}
% \subsection*{Picard's Method}

% Consider the sequence of functions
% \begin{xalignat*}{2}
%   g_0(x) &:= y_0 \, , & g_i (x) &:= y_0 + \int_{x_0}^{x} f\bigl( u, g_{i-1}(u)
%   \bigr) du \, ,
% \end{xalignat*}
% Prove that the sequence converges and that the limit is a solution.

% \newpage
% \topic{Visualizing Solutions - Long-Term Behaviour}
% \begin{problem}
%   Consider $\dfrac{dy}{dt} = 2-y$.  By constructing a slope field,
%   what can you say about the long-run behaviour of $y$ (i.e. what
%   happens to $y$ as $t \to \infty$, and does the same thing happen to
%   all solutions)?
% \end{problem}

% \mypstrickspic{Graphs/week01_empty_slope_field1}

% \begin{proof}[Solution]
%   From the slope field, we see that all solution curves have $y=2$ as a
%   horizontal asymptote; i.e.\ $\lim\limits_{t \to \infty} y = 2$.
%   \begin{center}
% %    \includegraphics[width=6.5cm]{./Graphs/slopeField3.png}
%   \end{center}
%   When $y = 2$, we have $\dfrac{dy}{dt} = 0$, so the solution curve doesn't
%   change; when $y > 2$, we have $\dfrac{dy}{dt} < 0$ and the solution curve
%   decreases; when $y < 2$, we have $\dfrac{dy}{dt} > 0$ and the solution curve
%   increases.
% \end{proof}

\newpage
\topic{Separable Differential Equations}
\section*{Separable Equations}

\noindent
We now introduce our first technique for solving first-order
differential equations.

If the right side of the equation $\dfrac{dy}{dx} = f(x,y)$ is the
product of a function in $x$ and a function in $y$, then the equation
is \textbf{separable}.  By separating the variables and integrating,
we obtain an implicit solution to the differential equation.

\begin{problem}
  Solve $\dfrac{dy}{dx} = \dfrac{x-5}{y^2}$, with y(1) = 4. Use MATLAB to create a plot of the solution.
\end{problem}
%\newpage
%\hfill   $\dfrac{dy}{dx} = \dfrac{x-5}{y^2}$.

% \begin{proof}[Solution]
%   We have
%   \[
%   \int y^2 \; dy = \int (x-5) \; dx \;\; \Longrightarrow \;\; \tfrac{1}{3} y^3 =
%   \tfrac{1}{2}x - 5x + C \;\; \Longrightarrow \;\; y = \left( \tfrac{3}{2} x^2 -
%     15 x + C \right)^{1/3}  \, . \qedhere
%   \]
% \end{proof}

\newpage
\topic{Separable Equations - Example 1}
\begin{problem}
  Use MATLAB to create a plot of the solution to the initial value problem $\dfrac{dx}{dt} = \dfrac{x-1}{t+3}$; $x(-1) =
  0$.
\end{problem}

%\newpage
%\hfill $\dfrac{dx}{dt} = \dfrac{x-1}{t+3}$; $x(-1) = 0$

% \begin{proof}[Solution]
%   Separating the variables and integrating gives
%   \[
%   \int \frac{dx}{x-1} = \int \frac{dt}{t+3} \;\; \Longrightarrow \;\; \ln | x-1
%   | = \ln |t+3| + C  \, .
%   \]
%   Since $x(-1) = 0$, it follows that $0 = \ln|1| = \ln|0-1| = \ln|-1+3| +C =
%   \ln(2) +C$, so $C = - \ln(2)$.  Hence, near $x(-1) = 0$, we obtain
%   \[
%   \ln(1-x) = \ln(t+3) - \ln(2) = \ln\left(\tfrac{t+3}{2} \right) \;\;
%   \Longrightarrow \;\; 1-y = \tfrac{t+3}{2} \;\; \Longrightarrow \;\; -
%   \tfrac{1}{2}(x+1) \, . \qedhere
%   \]
% \end{proof}

\newpage
%\topic{Separable Equations - Example 2}
%\begin{problem}
%  Solve $\dfrac{dz}{dr} = \dfrac{6 r^5 -2 r +1}{\cos(z) + e^z}$.
%\end{problem}
%
%\newpage
%
%  \hfill  $\dfrac{dz}{dr} = \dfrac{6 r^5 -2 r +1}{\cos(z) + e^z}$.

% \begin{proof}[Solution]
%   Separating the variables and integrating gives
%   \[
%   \int \cos(z) + e^z \; dz = \int 6r^5-2r+1 \; dr \;\; \Longrightarrow \;\;
%   \sin(z) + e^z = r^6-r^2+r+C \, .
%   \]
%   In this case, one cannot solve explicitly for $z$ in terms of $r$.
% \end{proof}

%\newpage
%\topic{Separable Equations - The Exponential DE}
%\begin{problem}
%  Solve $\dfrac{dy}{dx} = ky$.  Note: This equation describes exponential
%    growth or decay.
%\end{problem}

% \begin{proof}[Solution]
%   Separating the variables and integrating gives
%   \[
%   \int \frac{dy}{y} = \int k \; dx \;\; \Longrightarrow \;\; \ln|y| = kx + C
%   \;\; \Longrightarrow \;\; y = e^C e^{kx} = A e^{kx} \, . \qedhere
%   \]
% \end{proof}

%\newpage
%\topic{Separable Equations - Heating and Cooling}
%\begin{problem}
%  Newton's law of cooling states that the rate of change in the temperature $H$
%  of a body is proportional to the difference between its temperature $H$ and
%  that of its surroundings $S$.  Solve $$\dfrac{dH}{dt} = k(S-H)$$  where H(0)
%\end{problem}
%%
%\newpage
%\hfill $\dfrac{dH}{dt} = k(S-H)$   \\
%\vspace{3in}
%What happens to the temperature $H$ as $t \to \infty$?

% \begin{proof}[Solution]
%   Separating the variables and integrating gives
%   \[
%   \int \frac{dH}{S-H} = \int k \; dt \;\; \Longrightarrow \;\; - \ln|S-H| = kt +
%   K \;\; \Longrightarrow \;\; S-H = Ce^{-kt} \;\; \Longrightarrow \;\; H =
%   S-Ce^{-kt} \, .
%   \]
%   It follows that $\lim\limits_{t \to \infty} H = \lim\limits_{t \to \infty}
%   S-Ce^{-kt} = S$.
% \end{proof}

%\newpage
%\topic{Separable Equations - Explosion Equation}
%\begin{problem}
%  Solve the explosion equation: $\dfrac{dx}{dt} = x^2$ where $x(0) > 0$.  Give a
%  physical interpretation of the solution.  Note: This equations occurs in
%    chemistry when the rate of a reaction is proportional to the concentration
%    of the two reagents.
%\end{problem}

% \begin{proof}[Solution]
%   Separating the variables and integrating gives
%   \[
%   \int \frac{dx}{x^2} = \int \; dt \;\; \Longrightarrow \;\; - \frac{1}{x} =
%   t + C \;\; \Longrightarrow \;\; x = - \frac{1}{t+C} \, .
%   \]
%   Since $0 < x(0) = - \frac{1}{C}$, we have $C < 0$.  It follows that the
%   solution curve has a vertical asymptote at $t = - C > 0$.  In other words, the
%   solution becomes infinitely large in finite time.  \comment{Physically, this
%     conclusion corresponds to the explosive nature of the process.  Typically
%     the mathematical model is inapplicable if $t$ is too close to $-C$.}
% \end{proof}

\newpage
\topic{Separable Equations - Logistic Equation}
\begin{problem}
 Use MATLAB to plot the solution to the logistic equation: $\dfrac{dP}{dt} = (1-P)P$, where P(0) = 0.1. Try different values for the initial condition, what happens to the solution as the initial condition changes?
\end{problem}
%\newpage
%\hfill $\dfrac{dP}{dt} = (1-P)P$

%\newpage
%\hfill $\dfrac{dP}{dt} = (1-P)P$

% \begin{proof}[Solution]
%   Separating the variables and integrating gives
%   \begin{align*}
%     \int \frac{dP}{(1-P)P} &= \int \; dt \;\; \Longrightarrow \;\; \int
%     \frac{1}{P} + \frac{1}{1-P} \; dP = t+C \;\; \Longrightarrow \;\; \ln|P| -
%     \ln|1-P| = t+C \\
%     \frac{P}{1-P} &= Ae^t \;\; \Longrightarrow \;\; (1+Ae^t)P = Ae^t \;\;
%     \Longrightarrow \;\; P = \frac{Ae^t}{1+Ae^t} \, .
%   \end{align*}
%   More qualitatively, we see that the population has two equilibrium at $P = 0$
%   and $P = 1$.  For $0 < P < 1$, the population is increasing and for $P > 1$
%   the population is decreasing.  Hence, the equilibrium population $0$ is
%   unstable (as soon as a population arises it begins to grow), while the
%   equilibrium population $1$ is stable (a smaller population increases and a
%   larger one decreases).  Observe, that the solution curve has two horizontal
%   asymptotes:
%   \[
%   \lim_{t \to \infty} P = \lim_{t \to \infty} \frac{Ae^t}{1+Ae^t} = 1 \, ,
%   \qquad \lim_{t \to -\infty} P = \lim_{t \to -\infty} \frac{Ae^t}{1+Ae^t} = 0
%   \, . \qedhere
%   \]
% \end{proof}

% \newpage
%\topic{Separation of Variables - }
% \begin{problem}
%   Solve $\dfrac{dy}{dx} = \dfrac{x^2+3y^2}{2xy}$.
% \end{problem}
%
% \begin{proof}[Solution]
%   Set $w := \dfrac{y}{x}$ so $y = xw$, $\dfrac{dy}{dx} = w + x \dfrac{dw}{dx}$,
%   and
%   \begin{align*}
%     w &+ x \dfrac{dw}{dx} = \dfrac{dy}{dx} = \dfrac{x^2+3y^2}{2xy} =
%     \dfrac{1+3(y/x)^2}{2(y/x)} = \dfrac{1+3w^2}{2w} \;\; \Longrightarrow \;\; x
%     \dfrac{dw}{dx} = \dfrac{1+3w^2-2w^2}{2w} = \dfrac{1+w^2}{2w} \\
%     \;\; \Longrightarrow \;\; &\int \frac{2w}{1+w^2} \; dw = \int \dfrac{dx}{x}
%     \;\; \Longrightarrow \;\; \ln(1+w^2)= \ln|x| + K \;\; \Longrightarrow \;\;
%     1+w^2 = Cx \\ \;\; \Longrightarrow \;\; & 1+(y/x)^2 = Cx \;\;
%     \Longrightarrow \;\; x^2 + y^2 - Cx^3 = 0 \, . \qedhere
%   \end{align*}
% \end{proof}
\newpage

\topic{First-order Linear Equations}
\section*{First-order Linear Equations}

\noindent
How does one integrate first-order linear equations?

A \textbf{linear first-order equation} is one that can be expressed in the form
$$a_1(x) y' + a_0(x) y = b(x)$$
Assuming that $a_1(x) \neq 0$, we can rewrite the equation in the
\textbf{standard form}:
\[
\dfrac{dy}{dx} + P(x) y = Q(x) \, .
\]
Note: when $P(x)$ and $Q(x)$ are constants, this equation is also
\textbf{separable} (seen earlier).

\newpage
\begin{problem}
  Use MATLAB to plot the solution to $\dfrac{dy}{dt} +2y = 3$ with y(3) = 4.
\end{problem}

% \begin{proof}[Solution]
%   Separating variables and integrating gives
%   \[
%   \frac{dy}{dt} = 3-2y \;\; \Longrightarrow \;\; \int \frac{dy}{3-2y} = \int \;
%   dt \;\; \Longrightarrow \;\; -\tfrac{1}{2} \ln|3-2y| = t + K \;\;
%   \Longrightarrow \;\; y = \tfrac{3}{2} + C e^{-2t} \, . \qedhere
%   \]
% \end{proof}

%\newpage
%
%Although separation of variables method cannot be used in general,
%Euler popularized an alternative:
%\begin{center}
%  Multiply the standard form by an appropriate {\em integrating
%    factor} so that resulting equation is easily integrable.
%\end{center}
%
%More specifically, we multiply our standard form by by $M(t)$ to obtain
%$$M(t) \dfrac{dy}{dt} + 2 M(t) y = 3 M(t)$$
%Can we choose $M(t)$ so that the left side is simply the derivative of
%one function?

% \begin{proof}[Solution]
% Since $\dfrac{d}{dt} \Bigl( M(t) y \Bigr) = M(t) \dfrac{dy}{dt} +
% \begin{proof}[Alternative Solution]
%   Multiply by $M(t)$ to obtain $M(t) \dfrac{dy}{dt} + 2 M(t) y = 3 M(t)$.  Can
%   we choose $M(t)$ so that the left side is simply the derivative of one
%   function?  Since $\dfrac{d}{dt} \Bigl( M(t) y \Bigr) = M(t) \dfrac{dy}{dt} +
%   M'(t) y$, we $M'(t) = 2M(t)$ or $M(t) = e^{2t}$.  Multiplying by the
%   integrating factor $e^{2t}$ yields
%   \[
%   \frac{d}{dt} \Bigl( e^{2t} y \Bigr) = e^{2t} \frac{dy}{dt} + 2e^{2t}y =
%   3e^{2t} \;\; \Longrightarrow \;\; e^{2t} y = \int 3e^{2t} \; dt =
%   \tfrac{3}{2}e^{2t} + C \;\; \Longrightarrow \;\; y = \tfrac{3}{2} + C e^{-2t}
%   \, . \qedhere
%   \]
% \end{proof}

%\newpage
%
%\topic{Integrating Factors}
%\section*{Integrating Factors}
%For $\dfrac{dy}{dt} + P(t) \, y = Q(t)$, the \textbf{integrating factor} is
%defined to be $$M(t) = e^{\bigl( \int P(t) \; dt \bigr)}.$$
%
%Show how multiplying the DE by $M(t)$ results in the left side being the derivative of a product.

% $\dfrac{d}{dx} \Bigl( M(x) \Bigr) = \dfrac{d}{dx} \Bigl( \exp\bigl( \int P(x) \;
% dx \bigr) \Bigr) = M(x) P(x)$, multiplication and integration yield
% \begin{align*}
%   \dfrac{d}{dx} \Bigl( M(x) y \Bigr) &= M(x) \dfrac{dy}{dx} + M(x) P(x) y
%   = M(x) Q(x) \\
%   M(x) y &= \int M(x) Q(x) \; dx \;\; \Longrightarrow \;\; y = \exp\left( - \int
%     P(x) \; dx \right) \left[ \int M(x) Q(x) \; dx \right] \, .
% \end{align*}

\newpage
\begin{problem}
  Use MATLAB to plot the solution to $\dfrac{dy}{dx} +2 y = 3e^x$, with y(0) = 1 \\[1ex]
  Note: this is a linear DE, but it is not separable.
\end{problem}
%\newpage
%  \hfill $\dfrac{dy}{dx} +2 y = 3e^x$.  \\[1ex]

%\newpage
%\begin{problem}
%  Verify that the solution found satisfies $\dfrac{dy}{dx} +2 y = 3e^x$.  \\[1ex]
%\end{problem}
% \begin{proof}[Solution]
%   Since the integrating factor is $M(x) = \exp\left( \int 2 \; dx \right) =
%   e^{2x}$, we obtain
%   \begin{align*}
%     \dfrac{d}{dx}\bigl( e^{2x} y \bigr) &= e^{2x} \dfrac{dy}{dx} +2 e^{2x} y =
%     3e^{3x} \;\; \Longrightarrow \;\; e^{2x}y = \int 3e^{3x} \; dx = e^{3x} + C
%     \;\; \Longrightarrow \;\; y = e^{x} + Ce^{-2x} \, . \qedhere
%   \end{align*}
% \end{proof}

\newpage
\topic{Linear DEs - IVP Example 1}
\begin{problem}
  Use MATLAB to plot the solution to the initial value problem where  \\
$$\dfrac{1}{x} \dfrac{dy}{dx} -
  \dfrac{2y}{x^2} = x \cos(x)
\mbox{   and  }
y\left(\tfrac{\pi}{2}\right) = 3$$
\end{problem}

%\newpage
%\hfill $\ds \dfrac{1}{x} \dfrac{dy}{dx} -
%  \dfrac{2y}{x^2} = x \cos(x)
%\mbox{   and  }
%y\left(\tfrac{\pi}{2}\right) = 3$

%\newpage
%  Verify that the solution found satisfies
%$\dfrac{1}{x} \dfrac{dy}{dx} - \dfrac{2y}{x^2} = x \cos(x)$.

\newpage

% \begin{proof}[Solution]
%   The standard form of this equation is $\dfrac{dy}{dx} - \dfrac{2}{x} y = x^2
%   \cos(x)$.  Since the integrating factor is $M(x) = \exp \left( \int -2x^{-1}
%     \; dx \right) = \exp \bigl( -2 \ln|x| \bigr) = x^{-2}$, we obtain
%   \begin{align*}
%     \dfrac{d}{dx}\Bigl( x^{-2} y \Bigr) &= x^{-2} \dfrac{dy}{dx} - \dfrac{2}{x}
%     y = \cos(x) \;\; \Longrightarrow \;\; x^{-2} y = \int \cos(x) \; dx =
%     \sin(x) + C \\ \;\; \Longrightarrow \;\; y &= x^2 \sin(x) + Cx^2 \, .
%   \end{align*}
%   Setting $x = \tfrac{\pi}{2}$ yields $3 = \bigl( \tfrac{\pi}{2} \bigr)^2 \sin
%   \bigl( \tfrac{\pi}{2} \bigr) + C \bigl( \tfrac{\pi}{2} \bigr)^2 =
%   (1+C)\tfrac{\pi^2}{4}$, so $C = \tfrac{12}{\pi^2}-1$.  Therefore, the solution
%   is $y = x^2 \sin(x) + \bigl( \tfrac{12}{\pi^2}-1 \bigr) x^2$.
% \end{proof}
%
%\newpage
%\topic{Linear DEs - IVP Example 2}
%\begin{problem}
%  Solve $t x' + 2x = 4t^2$ and $x(1) = 2$.
%\end{problem}

%\newpage
%  \hfill $t x' + 2x = 4t^2$ and $x(1) = 2$.

%\newpage
%\begin{problem}
%  Verify that the solution found satisfies $t x' + 2x = 4t^2$ and
%  $x(1) = 2$.
%\end{problem}

%\begin{minipage}{6in}
%~\end{minipage}
%\begin{minipage}{3in}
%\begin{align*}
%t x' + 2x &= 4t^2\\
%x(1) & = 2
%\end{align*}
%\end{minipage}
% \begin{proof}[Solution]
%   The standard form of this equation is $\dfrac{dx}{dt} + \dfrac{2}{t} x = 4t$.
%   Since the integrating factor is $M(t) = \exp \left( \int 2t^{-1} \; dt \right)
%   = \exp \bigl( 2 \ln|t| \bigr) = t^2$, we obtain
%   \begin{align*}
%     \dfrac{d}{dt}\bigl( t^2 x \bigr) &= t^2 \dfrac{dx}{dt} + 2t x = 4t^3 \;\;
%     \Longrightarrow \;\; t^2 x = \int 4t^3 \; dx = t^4 + C \\ \;\;
%     \Longrightarrow \;\; x &= t^2 + C t^{-2} \, .
%   \end{align*}
%   Setting $t = 1$ yields $2 = 1+C$, so $C = 1$.  Therefore, the solution
%   is $x = t^2 -t^{-2}$.
% \end{proof}

%\newpage
% \topic{Linear DEs - Solution Design}
% \begin{problem}
%   Consider the initial value problem where
% $$y' + \tfrac{2}{3}y = 1 - \tfrac{1}{2} x \mbox{ and }y(0) = y_0.$$
% Find the value of $y_0$ for which the solution touches, but does not cross, the $x$-axis.
% \end{problem}

% \newpage
% \hfill $y' + \tfrac{2}{3}y = 1 - \tfrac{1}{2} x \mbox{ and }y(0) = y_0$

% % \begin{proof}[Solution]
%    Since the integrating factor is $M(x) = \exp \bigl( \int 2/3 \; dx \bigr) =
%    \exp \bigl( 2x/3 \bigr) = e^{2x/3}$, we obtain
%    \begin{align*}
%      \dfrac{d}{dt} \bigl( e^{2x/3} y \bigr) &= e^{2x/3} \dfrac{dy}{dx} +
%      \frac{2}{3} e^{2x/3} y = \Bigl( 1-\frac{1}{2}x \Bigr) e^{2x/3} \;\;
%      \Longrightarrow \;\; e^{2x/3} y = \int e^{2x/3} - \tfrac{1}{2}xe^{2x/3} \;
%      dx \\
%      \Longrightarrow \;\; e^{2x/3}y &= \tfrac{3}{2}e^{2x/3} -
%      \tfrac{3}{4}xe^{2x/3} + \int \tfrac{3}{4}e^{2x/3} \; dx =
%      \tfrac{3}{2}e^{2x/3} -
%      \tfrac{3}{4}xe^{2x/3} + \tfrac{9}{8} e^{2x/3} + C \\
%      \Longrightarrow \;\; y &= \tfrac{21}{8} - \tfrac{3}{4}x + Ce^{-2x/3} \, .
%    \end{align*}
%    Setting $x = 0$ yields $y_0 = \tfrac{21}{8} + C$ so $C = y_0 - \tfrac{21}{8}$.
%    The solution curve $y = \tfrac{21}{8} - \tfrac{3}{4}x + \bigl( y_0 -
%    \tfrac{21}{8} \bigr) e^{-2x/3}$ is tangent to the $x$-axis at $x_0$ provided
%    that we have both $0 = \tfrac{21}{8} - \tfrac{3}{4}x_0 + \bigl( y_0 -
%    \tfrac{21}{8} \bigr) e^{-2x_0/3}$ and $0 = - \tfrac{3}{4} - \tfrac{2}{3}
%    \bigl( y_0 - \tfrac{21}{8} \bigr) e^{-2x_0/3}$.  Hence, we obtain $\bigl( y_0
%    - \tfrac{21}{8} \bigr) e^{-2x_0/3} = -\tfrac{9}{8}$, $0 = \tfrac{12}{8} -
%    \tfrac{3}{4}x_0$, $x_0 = 2$, and $y_0 = -\tfrac{9}{8} e^{4/3} + \tfrac{21}{8}
%    \approx -1.642876$.
% % \end{proof}

%\newpage
%\topic{Linear DEs - Examining Solution Properties}
%\begin{problem}
%  Let $a$ and $\lambda$ be positive constants and let $b$ be any real number.
%  Show that every solution to $y' + ay = be^{-\lambda t}$ has the property that
%  $y \to 0$ as $t \to \infty$.
%\end{problem}

%\newpage
%
%~
%
%\newpage
%~

%\newpage

% \begin{proof}[Solution]
%   Since the integrating factor is $M(x) = \exp \bigl( \int a \; dt \bigr) = \exp
%   \bigl( at \bigr) = e^{at}$, we obtain
%   \begin{align*}
%     \dfrac{d}{dt} \bigl( e^{at} y \bigr) &= e^{at} \dfrac{dy}{dx} + a e^{at} y =
%     b e^{(a-\lambda) t} \;\; \Longrightarrow \;\; e^{at} y = \int be^{(a-\lambda
%       ) t} \; dt
%   \end{align*}
%   If $a \neq \lambda$, then we have $e^{at}y = \tfrac{b}{a-\lambda}
%   e^{(a-\lambda)t} + C$ so $y = \tfrac{b}{a-\lambda}
%   e^{-\lambda t} + C e^{-at}$.  Similarly, if $a = \lambda$, then we have
%   $e^{at}y = bt +C$ so $y = bte^{-at} + C e^{-at}$,  In either case, we see that
%   $y \to 0$ as $t \to \infty$.
% \end{proof}

%\newpage
%\topic{Applications - Tank}
%\section*{Applications}
%
%In the beginning slide of this week, we noted that many physical, chemical and biological
%behaviours can naturally be represented by differential equations.
%
%In the next few examples, we study the types of predictions that can
%be inferred from solutions to DEs that arise in applications.
%
%\newpage
%
%\begin{problem}
%  At time $t = 0$ a tank contains $Q_0$ kg of salt dissolved in 100 litres of
%  water.  Assume that water containing $1/4$ kg of salt per litre is entering
%  the tank at a rate of $r$ litres per minute, and that the well-stirred mixture
%  is draining from the tank at the same rate.
%  \begin{enumerate}
%  \item Set up the initial value problem that describes this flow process.
%
%%\newpage
%%~
%
%\newpage
%  \item If $r = 3$ and $Q_0 = 14$, use MATLAB to plot the solution to the initial value problem. What happens to the amount of salt as time goes on? Does it reach a certain amount and stay there, or does the level of salt grow forever?
%  \end{enumerate}
%
%%\newpage
%%~
%\end{problem}
%\newpage
% %\begin{proof}[Solution] $\;$
%
%   \begin{enumerate}
%   \item Assume that salt is neither created nor destroyed in the tank.  Hence,
%     variations in the amount of salt are due solely to the flows in and out of
%     the tank.  More precisely, we have
%     \begin{align*}
%       \dfrac{dQ}{dt} &= \text{rate in} - \text{rate out} = \bigl( \tfrac{1}{4}
%       \; \text{kg} \cdot \text{L}^{-1} \bigr)\bigl( r \; \text{L} \cdot
%       \text{min}^{-1} \bigr) - \bigl( \tfrac{Q}{100} \; \text{kg} \cdot
%       \text{L}^{-1} \bigr) \bigl( r \; \text{L} \cdot \text{min}^{-1} \bigr) =
%       \frac{r}{4} - \frac{r}{100} Q
%     \end{align*}
%     and $Q(0) = Q_0$.
%   \item Since the standard form is $\dfrac{dQ}{dt} + \dfrac{r}{100} Q =
%     \dfrac{r}{4}$, the integrating factor is
%     \[
%     M(t) := \exp \bigl( \int \tfrac{r}{100} \; dt \bigr) = e^{rt/100} \, .
%     \]
%     Multiplication and integration yield
%     \begin{align*}
%       \dfrac{d}{dt} \Bigl( e^{rt/100} Q \Bigr) &= e^{rt/100} \dfrac{dQ}{dt} +
%       \frac{r}{100} e^{rt/4} Q = \frac{r}{100}e^{rt/100} \\
%       e^{rt/100} Q &= \int \frac{r}{4}e^{rt/100} \; dt = 25e^{rt/100} + C \;\;
%       \Longrightarrow \;\; Q = 25 + C e^{-rt/100} \, .
%     \end{align*}
%     Setting $t = 0$, we obtain $Q_0 = 25+C$ or $C = Q_0-25$, so $Q(t) = 25 +
%     (Q_0 -25)e^{-rt/100}$.  Moreover, $Q_L = \lim\limits_{t \to \infty} Q(t) =
%     25$ so the limiting concentration is $\tfrac{Q_L}{100} = \frac{1}{4} \;
%     \text{kg} \cdot \text{L}^{-1}$.
%   \item If $r = 3$ and $Q_0 = 2 Q_L = 50$, then the solution becomes $Q(t) = 25
%     +25 e^{-0.03 t}$.  Since $2\%$ of $25$ is $0.5$, we wish to find the time
%     $T$ at which $Q(t)$ has the value $25.5$;
%     \[
%     25.5 = 25 +25e^{-0.03T} \;\; \Longrightarrow \;\; T = \frac{\ln(50)}{0.03}
%     \approx 130.4 \; \text{min} \, .
%     \]
%     To determine $r$ so that $T = 45$ min, set $t = 45$, $Q_0 = 50$, $Q(t) =
%     25.5$ and solve for $r$:
%     \[
%     25.5 = 25 +25e^{45r/100} \;\; \Longrightarrow \;\; T = \frac{100 \ln(50)}{45}
%     \approx 8.69 \; \text{L} \cdot \text{min}^{-1} \, .
%     \]
%   \end{enumerate}
%% \end{proof}
%\newpage
%
%\topic{Applications - Gravity-Fed Water Flow}
%\begin{problem}
%A titration buret (a tall, narrow cylinder used to measure liquids)
%has a hole in the bottom, out of which the liquids flow.  If the buret
%is filled with water, the height of the water in the buret drops at a
%rate proportional to the {\em square root} of the current water
%height.
%\end{problem}
%
%\begin{enumerate}[(1)]
%\item \label{buret_de} Let $h$ be the height of water in buret. Write
%  the differential equation for the rate of change of $h$ with respect
%  to the current height.  \vspace{1in}
%
%\item The differential equation in (a) has a constant of
%  proportionality in it.  Is that constant positive or negative?
% \vspace{1.5in}
%
%\newpage
%
%\item At what height $h$ does the water level become constant?
%  Explain why this height is reasonable in the context of the problem.
%  \vspace{1.5in}
%
%%\newpage
%%
%%\item Find the general solution to the differential equation.
%
%\newpage
%\item The buret originally is filled up with water to a height of 16
%  cm, and after 10 seconds the water level has dropped to a height of
%  4 cm.  Determine the time at which the buret will be empty.
%\end{enumerate}
%
%\newpage
%\topic{Applications - Pond}
%\begin{problem}
%  Consider a pond that initially contains $10$ million litres of fresh water.
%  Water containing an undesirable chemical flows into the pond at the rate of
%  $5$ million litres per year; the mixture in the pond flows out at the same
%  rate.  The concentration $\gamma(t)$ of chemical in the incoming water varies
%  periodically with time according to the expression $\gamma(t) = 2 + \sin(2t)
%  \; \text{g} \cdot \text{L}^{-1}$.
%  \begin{enumerate}
%  \item Construct a mathematical model of this flow process.
%\newpage
%  \item Determine the amount of chemical in the pond at any time.
%
%%\newpage
%%~
%\newpage
%  \item Describe the effect of the variation in the incoming concentration.
%  \end{enumerate}
%\end{problem}
%
%%\newpage
%%~
%\newpage
%
%   \begin{enumerate}
%   \item Let $t$ denote time measured in years and $Q(t)$ the amount of chemical
%     measured in grams.
%     \begin{align*}
%       \dfrac{dQ}{dt} &= \text{rate in} - \text{rate out} = \bigl( 2 + \sin(2t)
%       \; \text{g} \cdot \text{L}^{-1} \bigr) \bigl( 5 \times 10^6 \; \text{L}
%       \cdot \text{a}^{-1} \bigr) - \bigl( \tfrac{Q}{10^7} \; \text{g} \cdot
%       \text{L}^{-1} \bigr) \bigl( 5 \times 10^6 \; \text{L} \cdot \text{a}^{-1}
%       \bigr) \\ &= \bigl( 5 \times 10^6 \bigr)\bigl(2 + \sin(2t) \bigr) -
%       \frac{Q}{2}
%     \end{align*}
%     For convenience, let $q(t) = Q(t) 10^{-6}$, so $\dfrac{dq}{dt} +
%     \dfrac{1}{2}q = 10 +5 \sin(2t)$.  To begin, there is no chemical in the
%     pond, so $q(t) = 0$.
%   \item  Since the integrating factor $M(t) := \exp\bigl( \frac{1}{2} \; dt
%     \bigr) = e^{t/2}$, we have
%     \begin{align*}
%       \frac{d}{dt} \Bigl( e^{t/2} q \Bigr) &= e^{t/2} \dfrac{dq}{dt} +
%       \frac{1}{2}e^{t/2} q = 10 e^{t/2} + 5 e^{t/2} \sin(2t) \\
%       e^{t/2} q &= \int 10 e^{t/2} + 5 e^{t/2} \sin(2t) \; dt = 20e^{t/2} + 5
%       \int e^{t/2} \sin(2t) \; dt
%     \end{align*}
%     Using integration by parts twice, we have
%     \begin{align*}
%       \int e^{t/2} \sin(2t) \; dt &= 2e^{t/2}\sin(2t) - \int 4e^{t/2} \cos(2t)
%       \;dt \\ &= 2e^{t/2}\sin(2t) - 8 e^{t/2} \cos(2t) - \int 16e^{t/2} \sin(2t)
%       \;dt
%     \end{align*}
%     so $q(t) = 20 + \tfrac{10}{17} \sin(2t) - \tfrac{40}{17} \cos(2t) +
%     Ce^{-t/2}$.  Setting $t = 0$ yields $0 = 20 - \tfrac{40}{17} + C$ so $C = -
%     \tfrac{300}{17}$ and $q(t) = 20 + \tfrac{10}{17} \sin(2t) - \tfrac{40}{17}
%     \cos(2t) + \tfrac{300}{17} e^{-t/2}$.
%   \item The exponential term in the solution is important for small $t$, but
%     diminishes rapidly as $t$ increases.  Later, the solution consists of an
%     oscillation, due to the $\sin(2t)$ and $\cos(2t)$ terms, about the constant
%     level $q=20$.  If the $\sin(2t)$ term were not present in the differential
%
%   \end{enumerate}
%
%
%\newpage
%\textbf{Remark}
%  Our model rests on several implicit assumptions.  First, the amount of water
%  is controlled entirely by the rates of flow in and out --- none is lost by
%  evaporation or by seepage into the ground or gained by rainfall.  Second, the
%  same is also true of the chemical --- none is absorbed by fish or other
%  organisms.  Third, the concentration of chemical is uniform throughout the
%  pond.  Whether the results obtained from the model are accurate depend
%  strongly on the validity of these assumptions.

\end{document}


text:
\documentclass[12pt]{article}
\usepackage{latexsym,amssymb,amsmath} % for \Box, \mathbb, split, etc.
% \usepackage[]{showkeys} % shows label names
\usepackage{cite} % sorts citation numbers appropriately
\usepackage{path}
\usepackage{url}
\usepackage{verbatim}
\usepackage[pdftex]{graphicx}

% horizontal margins: 1.0 + 6.5 + 1.0 = 8.5
\setlength{\oddsidemargin}{0.0in}
\setlength{\textwidth}{6.5in}
% vertical margins: 1.0 + 9.0 + 1.0 = 11.0
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{12pt}
\setlength{\headsep}{13pt}
\setlength{\textheight}{625pt}
\setlength{\footskip}{24pt}

\renewcommand{\textfraction}{0.10}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.85}
\renewcommand{\floatpagefraction}{0.90}

\makeatletter
\setlength{\arraycolsep}{2\p@} % make spaces around "=" in eqnarray smaller
\makeatother

% change equation, table, figure numbers to be counted inside a section:
\numberwithin{equation}{section}
\numberwithin{table}{section}
\numberwithin{figure}{section}

% begin of personal macros
\newcommand{\half}{{\textstyle \frac{1}{2}}}
\newcommand{\eps}{\varepsilon}
\newcommand{\myth}{\vartheta}
\newcommand{\myphi}{\varphi}

\newcommand{\IN}{\mathbb{N}}
\newcommand{\IZ}{\mathbb{Z}}
\newcommand{\IQ}{\mathbb{Q}}
\newcommand{\IR}{\mathbb{R}}
\newcommand{\IC}{\mathbb{C}}
\newcommand{\Real}[1]{\mathrm{Re}\left({#1}\right)}
\newcommand{\Imag}[1]{\mathrm{Im}\left({#1}\right)}

\newcommand{\norm}[2]{\|{#1}\|_{{}_{#2}}}
\newcommand{\abs}[1]{\left|{#1}\right|}
\newcommand{\ip}[2]{\left\langle {#1}, {#2} \right\rangle}
\newcommand{\der}[2]{\frac{\partial {#1}}{\partial {#2}}}
\newcommand{\dder}[2]{\frac{\partial^2 {#1}}{\partial {#2}^2}}

\newcommand{\nn}{\mathbf{n}}
\newcommand{\xx}{\mathbf{x}}
\newcommand{\uu}{\mathbf{u}}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usepackage{titlesec}
\newcommand{\junk}[1]{{}}
\usepackage{xcolor}
\definecolor{darkblue}{rgb}{0,0,0.4}
\usepackage[colorlinks = true,
linkcolor = darkblue,
urlcolor  = darkblue,
citecolor = darkblue,
anchorcolor = darkblue]{hyperref}
% set two lengths for the includegraphics commands used to import the plots:
\newlength{\fwtwo} \setlength{\fwtwo}{0.45\textwidth}
% end of personal macros

\begin{document}
\DeclareGraphicsExtensions{.jpg}

\begin{center}
\textsc{\Large Computer Networks} \\[2pt]
	\textsc{\large Assignment 2}\\
	\vspace{0.5cm}
  Ali Gholami \\[6pt]
  Department of Computer Engineering \& Information Technology\\
  Amirkabir University of Technology  \\[6pt]
  \def\UrlFont{\em}
  \url{https://aligholamee.github.io}\\
    \href{aligholami7596@gmail.com}{\textit{aligholami7596@gmail.com}}
\end{center}

\begin{abstract}
This assignment takes a brief look at the challenges through the data transferring in a network. In problem 1 and 2, the \textit{delay} issue is discussed. Terms like \textit{Transmission Delay, Queuing Delay, Propagation Delay \& Processing Delay} is discussed. Problem 3, takes a deeper point of view for the \textit{Packet Switching \& Circuit Switching} communication. Advantages \& Disadvantages of both techniques is discussed also.
\end{abstract}

\subparagraph{Chapter 1 key words.} \textit{Store \& Forward, Cut Through, Circuit Switching, Virtual Circuit Switching, Packet Switching, Datagram, Queuing Delay, Transmission Delay, Propagation Delay, Processing Delay, Traffic Intensity, Frequency Division Multiplexing, Time Division Multiplexing.}

\section{Switch in The Middle}

Assume there is a single packet switcher between two nodes in a network. The transmission rate from the first node through the packet switcher is shown by \textit{R1}. The transmission rate from the packet switcher through the other node is shown by \textit{R2}. Given that the packet switcher conducts \textit{Store \& Forward} method to transmit the data, find the \textit{end-to-end delay} of sending a packet with size \textit{L}.

\subsection*{Solution}

The transmission rate for the path between \textit{$N_1$} \& \textit{Switch} is \textit{$R_1$}. Meaning that, it takes 1 second for $R_1$ bytes of data to be transferred from \textit{$N_1$} to the \textit{Switch}. Hence a packet with the length \textit{L} will take \textit{$\frac{L}{R_1}$} to be transferred. When the packet transmission through the switch is completed, the switch starts transmitting the packet to the \textit{$N_2$}. It takes \textit{$\frac{L}{R_2}$} for this transmission to be completed as we discussed above.

\begin{equation}
		D_{end-to-end} = \frac{L}{R_1} + \frac{L}{R_2}
\end{equation}

\section{P Packets N Links}
The formula for transmitting a single packet with length \textit{L} through \textit{N} links is given in equation 1.2. Assume the transmission rate to be \textit{R} for all of the paths through links. Find the formula to send \textit{P} packets through this linkage of nodes.

\begin{equation}
	D_{end-to-end} = \frac{N*L}{R}
\end{equation}

\subsection*{Solution}
Before getting into the details, I'll give an example for the above formula. Assuming that \textit{N} is 2. We have a \textit{source} node that sends the data, a \textit{middle} link node and a \textit{destination} node. The \textit{end-to-end} delay will be $\frac{2L}{R}$; Hence we can say that the packet transmission system is using the \textit{Store \& Forward} method. Having the same assumption(\textit{N = 2}) in mind, we can say that sending \textit{P} packets through this network will take

\begin{equation}
D_{(end-to-end\ |\ N=2)} = \frac{2L}{R} + (P-1)*\frac{L}{R}
\end{equation}

That's because the first packet will take $\frac{L}{R}$ to be completely sent to the node in the \textit{middle}. When the middle node starts sending the first packet to the final node, the transmission of the second packet has started already. By the time the first packet reaches the final node, the second packet is in the middle node. Currently, it has been $\frac{2L}{R}$ passed from the moment that first packet was sent. It only take an $\frac{L}{R}$ for the second packet to be completely transferred to the final node. Generalizing the idea in mind, we can find out that sending \textit{P} packets with \textit{N = 2} is equal to what's represented in equation 1.3. If we have \textit{N} links, we have to wait $\frac{NL}{R}$ for the first packet. It also takes

\begin{equation}
D_{(end-to-end\ |\ N=P-1)} = (P-1)*\frac{L}{R}
\end{equation}
for the other packets to be transmitted through the network.\\

Finally, we'll have to wait
\begin{equation}
D_{(end-to-end)} = \frac{NL}{R} + (P-1)*\frac{L}{R}
\end{equation}
for \textit{P} packets to be sent over an \textit{N} link network.

\section{Circuit Switching vs Packet Switching}

Assume a program that transmits data in a constant rate. This program also keeps running for some time. Answer the following questions and give your reasons.

a) Which one do you think is a better network implementation choice for this type program? A \textit{Circuit Switched} network or a \textit{Packet Switched} one?

b) Assuming that this network implements the \textit{Packet Switching} method and the traffic generated by this program is as above. Also, assume that the total transmission rate of all programs is less than the \textit{transmission rate} of individual links. Do we need a mechanism to handle the congestion in such a network?

\subsection*{Solution}

a) A \textit{Circuit Switched} network is a better approach for this type of program. The program described above is a \textit{sensitive} use case in the network. Let's assume we have a \textit{Video Platform} like \textit{Youtube}. It is important to mention that in a \textit{Packet Switched} network, the average time for packet transmission might be similar to the \textit{Circuit Switched} approach. but, the \textit{constance} \& \textit{steadiness} of data stream is an important factor in such programs. In a \textit{Circuit Switched} network, there is an initial delay to form the pathways through the nodes, but the \textit{Quality of Service} is much higher than the other approach. There is also much less \textit{Header Overhead} for sending the packets. According to the sayings of \textit{Prof. Khorsandi}, instead of using a \textit{Circuit Switched} network, we can implement a \textit{Dual-Queue Based} approach containing a \textit{Sensitive Queue} \& a  \text{Insensitive Queue}. One for the sensitive workloads \& the other one for the routine jobs. According to this idea, there are \textit{14} queues used in the current implementation of \textit{Packet Switched} networks.\\
\\
b) By definition, \textit{conjestion} occurs when an increase in the offered load results in a decrease in the effective throughput of the network. The main cause is that the \textit{packet arrival rate} at some gateway exceeds its \textit{service rate}.

\begin{equation}
	Arrival\ Rate > Service\ Rate
\end{equation}

At this point, packets are buffered, leading to delays. The additional delay can cause sources to retransmit, increasing the load on the bottleneck. This feedback leads to a rapidly deteriorating situation where retransmissions dominate the traffic, and effective throughput rapidly diminishes\cite{CCSK}.
Since the \textit{interval rate} of all programs is won't exceed the \textit{service rate}, we \textbf{won't} need any congestion handling mechanism.

\begin{thebibliography}{9}
	\bibitem{CCSK}
	Srinivasan Keshav.
	\textit{A Mechanism for Congestion Control in Computer Networks}.
	Computer Systems Research Group,
	Computer Science Division,
	Department of Electrical Engineering and Computer Science,
	University of California, Berkeley,
	Berkeley, CA 94720.

\end{thebibliography}

\end{document}

max_stars_repo_name: aligholamee/Compnets

max_issues_repo_name: aligholamee/Compnets

max_forks_repo_name: aligholamee/Compnets


text:
\documentclass[a4paper,UTF8,fleqn]{book}
\usepackage{geometry}
\geometry{left=2.0cm, right=2.0cm, top=2.5cm, bottom=2.5cm}

\usepackage{ctex}

\usepackage{physics}

\usepackage[colorlinks, linkcolor=black]{hyperref}
\usepackage{amsmath}
\numberwithin{equation}{section}

\usepackage{multicol}
\columnseprule=1pt

% \usepackage{pgfplots}

\setlength{\parindent}{2em}
\setlength{\parskip}{0.5\baselineskip}

\title{习题}
\date{}
\begin{document}
\allowdisplaybreaks[3]
\maketitle
\tableofcontents
\chapter{The Smooth, Expanding Universe}
\input{contents/chap2/derivation.tex}
\section{Exercise 1.}
\input{contents/chap2/ex_01.tex}
% \section{Exercise 2.}
% \input{contents/chap2/ex_02.tex}
% \section{Exercise 3.}
% \input{contents/chap2/ex_03.tex}
% \section{Exercise 4.}
% \input{contents/chap2/ex_04.tex}
% \section{Exercise 5.}\label{sec5}
% \input{contents/chap2/ex_05.tex}
% \section{Exercise 6.}
% \input{contents/chap2/ex_06.tex}
% \section{Exercise 7.}
% \input{contents/chap2/ex_07.tex}
% \section{Exercise 8.}
% \input{contents/chap2/ex_08.tex}
% \section{Exercise 9.}
% \input{contents/chap2/ex_09.tex}
% \section{Exercise 10.}
% \input{contents/chap2/ex_10.tex}
% \section{Exercise 11.}
% \input{contents/chap2/ex_11.tex}
% \section{Exercise 12.}\label{1:12}
% \input{contents/chap2/ex_12.tex}
% \section{Exercise 13.}
% \input{contents/chap2/ex_13.tex}
% \section{Exercise 14.}
% \input{contents/chap2/ex_14.tex}
% \section{Exercise 15.}
% \input{contents/chap2/ex_15.tex}
% \section{Exercise 16.}
% \input{contents/chap2/ex_16.tex}
% \section{Exercise 17.}
% \input{contents/chap2/ex_17.tex}
% \section{Exercise 18.}
% \input{contents/chap2/ex_18.tex}
\section{Exercise 19.}
\input{contents/chap2/ex_19.tex}

\chapter{Beyond Equilibrium}
\end{document}

max_stars_repo_name: BlackTeaKun/cosmology

max_issues_repo_name: BlackTeaKun/cosmology

max_forks_repo_name: BlackTeaKun/cosmology


text:
%!TEX root =  ../master.tex
\section{One Dimension}\label{sec:1D}

Here we consider L\"uscher's formula in one dimension with a contact interaction.
Since the sum in the quantization condition \eqref{general luscher} or the one-loop finite-volume sum \eqref{I0 FV} with $D=1$ is convergent we have %, the counterterm $\counterterm_{D=1}^\spherical=0$ and we obtain
\begin{align}\label{eq:tuning-1d}
    C(\Lambda)
    &=
            -\frac{1}{\mu a_{1}}
    &
    \frac{a_{1}}{L}
        &=
            \frac{1}{2 \pi^{2}}
            \sum_{n=-\infty}^{\infty} \frac{1}{n^{2}-x}
        \equiv
            \frac{1}{2 \pi^{2}}
            S^\bigcirc_{1}\left(x\right)
    &
    \Bigg(x
        &=
            \frac{2\mu E L^2}{4\pi^2}\Bigg)
    \, ,
\end{align}
where the contact strength $C(\Lambda)$ does not run.
The energy $E$ is a finite-volume energy on a torus of circumference $L$.
In one dimension the sum in the zeta function is well behaved and has a compact form,
\begin{equation}\label{eq:1d luscher}
S^\bigcirc_{1}(x) \equiv \sum_{n=-\infty}^{\infty} \frac{1}{n^{2}-x}=-\pi \frac{\cot (\pi \sqrt{x})}{\sqrt{x}}\ ,
\end{equation}
which gives a closed form expression for L\"uscher's formula,
\begin{equation}\label{eq:1d luscher constant}
\frac{a_{1}}{L} =-\frac{1}{pL}\cot\left(\frac{pL}{2}\right),
\end{equation}
consistent with those found in \Refs{Luscher:1990ck,Zhu:2019dho}.

Since there is no counterterm in one dimension, the dispersion form of L\"uscher's formula is straightforward to obtain.  If one identifies the lattice spacing as the cutoff, then the sum in the zeta function is restricted to the Brillouin zone and one has
\begin{equation}
    \frac{a_{1}}{L}
    =
    \frac{1}{2 \pi^{2}} \sum_{n=-\frac{N}{2}}^{\frac{N}{2}-1} \frac{1}{\tilde{K}^N_{nn}-x}
    =
    \frac{1}{2 \pi^{2}} \sum_{n=-\frac{N}{2}}^{\frac{N}{2}-1} \frac{1}{\frac{N^2}{4\pi^2}\left(\sum_{s}\gamma_s^{(\nstep)}\cos\frac{2\pi n s}{N}\right)-x}
    \equiv
    \frac{1}{2 \pi^{2}} S^{\dispersion}_{1}\left(x\right),\label{eq:1d dispersion luscher}
\end{equation}
where we explicitly show that the dispersion function $S^{\dispersion}$ depends on $\nstep$ and $N$ but not on $L$ or $\epsilon$ explicitly.

As stressed in the previous section, only continuum-extrapolated energies should be used in the quantization condition \eqref{1d luscher}, or induced momentum dependence terms will result.
For example, in \Figref{luescher1d} we show the induced momentum dependence terms when non-continuum eigenvalues $x^\dispersion$ are inserted into $S^{\spherical}_1$ (colored points) for lattice sizes of $N=4$, 10, 12, and 14 and $\nstep=\infty$.
However, we also show the scattering data determined through $S^{\dispersion}_1(x^\dispersion)$ (black points), which lie on a flat line, as expected.

\begin{figure}
\center
    \center
    \input{figure/1d.pgf}
%\includegraphics[width=.65\textwidth]{figure/1d.pdf}
    \caption{
    	Phase shifts and zeta functions in the spherical and dispersion scenario in one dimension.
		\\
		\textit{(top)}
        	Finite-spacing eigenvalues $x^\dispersion=2\mu E^\dispersion L^2/4\pi^2$ of the Schr\"odinger equation are inserted into respective zeta functions to obtain phase shifts.
			The eigenvalues are obtained for a contact interactions fixed to $ a_{1}/L=1/10$ (closed symbols) and $a_{1}/L=0$ (open symbols) using the analytic result for the interaction strength $C(\Lambda)$ \eqref{tuning-1d} and not by tuning to a zero of any zeta.
			Different markers correspond to different discretizations: $N=4$ (triangles), 10 (squares), 12 (diamonds), and 14 (hexagons).
        	For analysis, the colored points are obtained using $S^\spherical_1(x^\dispersion)$; corresponding to $N=4$ (red), 10 (green), 12 (blue), and 14 (purple).
        	The thin colored lines are the derived induced momentum-dependent terms for each $N$ as given in \Tabref{induced terms in 1 d}.
        	The black points are obtained using the $N$-appropriate $S^{\dispersion}_1(x^\dispersion)$ and exhibit the correct flat-line behavior.
        	The dashed gray line is $S_1^\spherical$, as in the bottom panel.
        \\
        \textit{(bottom)}
        	Two one-dimensional zeta functions, the spherical function $S_1^{\spherical}$ (light gray) given in \eqref{1d luscher} and $S_1^{\dispersion}$ (red) given in \eqref{1d dispersion luscher} with $N=4$ and $\nstep=\infty$.
        	The difference between the dispersion and spherical curves is responsible for moving the red triangles to the black triangles in the top panel.
        }
        \label{fig:luescher1d}
\end{figure}

We can derive the functional form of these induced momentum-dependent terms following the exact steps taken in \Secref{3d induced momenta}, again assuming $\nstep=\infty$,
\begin{align*}
S^\bigcirc_{1}\left(x^\dispersion\right)&=S^{\dispersion}_{1}\left(x^\dispersion\right)+\left(S^\bigcirc_{1}\left(x^\dispersion\right)  -S^{\dispersion}_{1}\left(x^\dispersion\right)\right) %\sum_{n=-\infty}^{\infty} \frac{1}{n^{2}-x^\dispersion} &=\sum_{n\in \operatorname{B.Z.}} \frac{1}{n^{2}-x^\dispersion} +\sum_{n\notin \operatorname{B.Z.}} \frac{1}{n^{2}-x^\dispersion} \\
 %&=  S^{\dispersion}_{1}\left(x^\dispersion\right)+\sum_{n\notin \operatorname{B.Z.}} \frac{1}{n^{2}-x^\dispersion}\\
=\frac{2\pi^2 a_{1}}{L}+ \sum_{n\notin \operatorname{B.Z.}} \frac{1}{n^{2}-x^\dispersion} \\
&=\frac{2\pi^2 a_{1}}{L}+\alpha_1(N)+ \alpha_2(N)x^\dispersion+\alpha_3(N)(x^\dispersion)^2+\ldots\ .
\end{align*}
where again we assume $\nstep=\infty$ energy.
In the second term we assumed $n^2\gg x^\dispersion$ since the sum is restricted to modes outside the Brillouin zone.
%Assuming $n^2\gg x^\dispersion$, we can expand in powers or $x^\dispersion$,
%\begin{equation}
%    \frac{1}{2 \pi^{2}} \sum_{n=-\infty}^{\infty} \frac{1}{n^{2}-x^\dispersion}
%        =
%    \frac{a_{1}}{L}+\frac{1}{2 \pi^{2}} \sum_{n\notin \operatorname{B.Z.}} \frac{1}{n^{2}-x^\dispersion}
%        =
%    \frac{a_{1}}{L}+\frac{1}{2 \pi^{2}} \sum_{n\notin \operatorname{B.Z.}} \left(\frac{1}{n^2}+\frac{x^\dispersion}{n^4}+\frac{(x^\dispersion)^2}{n^6}+\mathcal{O}((x^\dispersion)^3)\right)
%\end{equation}
%We make the replacement $\sum_{n\notin\operatorname{B.Z.}}\mapsto\left(\sum_{n=-\infty}^\infty-\sum_{n\in\operatorname{B.Z.}}\right)$, which allows each summation
The coefficients $\alpha_i(N)$ can be determined to arbitrary precision.
\Tabref{induced terms in 1 d} shows these terms for $N=4$, 10, 12, and 14.
The thin colored lines in \Figref{luescher1d} correspond to the functions given in this table.
In the limit $N\goesto\infty$ all states are included in the Brillouin zone so all terms vanish and one recovers the flat, momentum-independent behavior.

\begin{table}
    \caption{
    The coefficients $\alpha_i(N)$ of the induced momentum-dependent terms to order $(x^\dispersion)^2$ due to a contact interaction using $S^\bigcirc_1(x^\dispersion)$ as a function of discretization $N$.
    Here $x^\dispersion$ is determined by a finite-spacing finite-volume $\nstep=\infty$ eigenenergy.}
    \label{tab:induced terms in 1 d}
    \begin{tabular}{S[table-format=2.1]S[table-format=2.6]S[table-format=2.7]S[table-format=2.8]}
{$N$} & {$\alpha_1$} & {$\alpha_2$} & {$\alpha_3$} \\ \midrule
      4 &   1.03987  & 0.102146 & 0.0190611 \\
    10  &   0.40265  & 0.005543 & 0.0001404 \\
    12  &   0.33487  & 0.003171 & 0.0000549 \\
    14  &   0.28668  & 0.001983 & 0.0000250 \\
    \end{tabular}
\end{table}

Analyzing the finite-spacing dispersion zeta function $S^{\dispersion}_1$ with $\nstep=\infty$ produces the flat behavior all the way through.
This demonstrates that in the one-dimensional case, it was not the contact operator that caused the momentum dependence, but that the dependence was induced by leveraging the continuum finite-volume formalism itself.

Finally, we draw the reader's attention to the structure of $S^\dispersion$ at any finite $N$ in the bottom panel of \Figref{luescher1d}, where the $N=4$ dispersion zeta is shown.
Note that any flat function of $x$ can only ever intercept the zeta function three times---which makes sense, as there are only three states in the parity-even sector of a one-dimensional $N=4$ lattice: $\ket{0}$, $(\ket{-1}+\ket{+1})/\sqrt{2}$ and $\ket{2}$ (which, being on the edge of the Brillouin zone, is the same state as $\ket{-2}$).
If one tunes a contact interaction so that the scattering amplitude vanishes, one will see one state with $0<x<1$, one with $1<x<4$, and one state with $\abs{x}$ very large and a sign depending on whether one is slightly above or below zero numerically.
The finiteness of the parity-even sector puts constraints on the interactions that can be faithfully put onto such a small lattice: one cannot create any interaction where the scattering amplitude intersects the $N=4$ $S^{\dispersion}$ four times, because that would entail too many finite-volume states.
Of course, this is a generic feature in any number of dimensions, and the constraint ultimately vanishes in the continuum limit $N\goesto\infty$; as $N$ increases the number of accessible $n^2$ shells grows in a dimension-dependent way.

max_stars_repo_name: ckoerber/luescher-nd

max_issues_repo_name: ckoerber/luescher-nd

max_forks_repo_name: ckoerber/luescher-nd


text:
\chapter{Version control with Git}
\label{chap:git}

% TODO
% Add section on trouble shooting

\section{What is Version Control?}

Version control, also known as revision control or source control, is
the management and tracking of changes to documents, computer programs,
large web sites, and other collections of information in an automated
way.

Any project (collections of files in directories) under version control
has changes and additions/deletions to its files and directories
recorded and archived over time so that you can recall specific
versions later. With version control of biological computing projects,
you can:

 \begin{compactitem}\itemsep10pt{}

		\item record of all changes made to a set of files and directories,
		including text (usually ASCII) data files, so that you can access
		any previous version of the files

    \item branch (and merge) new projects

		\item ``roll back'' data, code, documents that are in plain text
		format (other file formats can also be versioned; see section on
		binary files below).

	\end{compactitem}

Note also that version control (usually git) is in fact the technology
embedded in the versioning of various word processor and
spreadsheet applications (e.g., Google Docs, Sheets, Overleaf).

\begin{figure} \centering
  \includegraphics[width=.5\textwidth]{VC.png}
  \caption{A general idea of how version control works.}
\end{figure}

\section{Why Version Control?}

{\centering  \includegraphics[width=.5\textwidth]{cvs.png}\\
  \tt
maktoons.blogspot.com/2009/06/if-dont-use-version-control-system.html}

 Or here's another one: \url{http://www.phdcomics.com/comics/archive/phd101212s.gif}

\section{git}

We will use git, developed by Linus Torvalds, the ``Linu'' in Linux. In
git each user stores a complete local copy of the project, including the
history and all versions. So you do not rely as much on a centralized
(remote) server. We will use bitbucket.org -- it gives you unlimited
free private repositories if you register with an academic email!
First, install and configure {\tt git}:

\begin{lstlisting}
$ sudo apt-get install git
$ git config --global user.name "Your Name"
$ git config --global user.email "your.login@imperial.ac.uk"
$ git config --list
\end{lstlisting}

\section{Your first repository}

Time to bring your {\tt CMEECourseWork} under version control:

\begin{lstlisting}
$ cd CMEECourseWork
$ git init
$ echo "My CMEE 2016-17 Coursework Repository" > README.txt
$ git config --list
$ ls -al
$ git add README.txt #Staging
$ git status
$ git commit -m "Added README file." #you can use -am too
$ git status #what does it say now?
$ git add -A
$ git status
\end{lstlisting}

Nothing has been sent to a remote server yet (see section
\ref{ssec:git_comds})! So let's go to your git service (bitbucket or
github) and setup:

 \begin{compactitem}[$\quad\star$]\itemsep4pt
	\item Login to your bitbucket or github account
	\item \sloppy Set up your {\tt ssh} based access

	bitbucket:
	\url{https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html}

	github: \url{https://help.github.com/articles/connecting-to-github-with-ssh}

  \item Then create repository there with name {\tt CMEECourseWork}

	\item \sloppy Then grab the repository url and use {\tt git remote add origin
	https...}

	bitbucket:  \url
	{https://confluence.atlassian.com/bitbucket/set-up-a-repository-877174034.html}

	github: \url{https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/}

 \end{compactitem}

You are done. Now let's learn to use git!

\section{{\tt git} commands}

Here are some basic git commands:

\begin{tabular}{p{.3\textwidth} p{.7\textwidth}}
	{\tt git init} & Initialize a new repository\\
	{\tt git clone} & Download a repository from a remote server\\
	{\tt git status} & Show the current status\\
	{\tt git diff} & Show differences between commits\\
	{\tt git blame} & Blame somebody for the changes!\\
	{\tt git log} & Show commit history\\
	{\tt git commit} & Commit changes to current branch\\
	{\tt git branch} & Show branches\\
	{\tt git branch name} & Create new branch\\
	{\tt git checkout name} & Switch to a different commit/branch\\
	{\tt git pull} & Upload from remote repository\\
	{\tt git push} & Send changes to remote repository\\
\end{tabular}

\subsection{{\tt git} command structure}
\label{ssec:git_comds}
Here is a graphical outline of the git command structure. Note that
only when you {\tt push} or  {\tt fetch} do you need an internet
connection, as before that you are only archiving in a local (hidden)
repository.

  \begin{center}
		\includegraphics[width=.6\textwidth]{git.png}
	\end{center}

Keep in mind, the main mantra is, ``commit often, comment always''!

  \begin{center}
		\includegraphics[width=.6\textwidth]{git_xkcd.png}
	\end{center}

\section{Ignoring Files}

You will have some files you don't want to track (log files, temporary
files, executables, etc). You can ignore entire classes of files with
{\tt .gitignore} (be in your {\tt CMEECourseWork}!):

\begin{lstlisting}
$ echo -e "*~ \n*.tmp" > .gitignore

$ cat .gitignore
*~
*.tmp

$ git add .gitignore

$ touch temporary.tmp

$ git add *
The following paths are ignored by one of your .gitignore
files:
temporary.tmp
Use -f if you really want to add them.
fatal: no files added
\end{lstlisting}

You can also create a global gitignore file that lists rules for files
to be ignored in every Git repository on your computer:
\url{https://help.github.com/articles/ignoring-files/}

\subsection{Dealing with binary files}

A binary file is computer-readable but not human-readable, that
is, it cannot be read by opening them in a text viewer. Examples of
binary files include compiled executables, zip files, images, word
documents  and videos. In contrast, text files are stored in a form (usually ASCII)
that is human-readable by opening in a suitable text reader (e.g.,
geany, gedit). Without some git extensions and configurations (coming up
next), binary files cannot be properly version-controlled because each version of
the entire file is saved {\it as is} in a hidden directory in the repository ({\tt .git}).

However, with some more effort, git can be made to work for binary formats like *.docx or image formats
such as *.jpeg, but it is harder to compare versions; have a look at
\url{https://git-scm.com/docs/gitattributes} and
\url{https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes}\footnote{There you will find the following phrase: ``...one of the most annoying problems known to humanity: version-controlling Microsoft Word documents.'' . LOL!}

Also see: \url{https://opensource.com/life/16/8/how-manage-binary-blobs-git-part-7}

\subsection{Dealing with large files}

As such, git was designed for version control of workflows and software
projects, {\it not} large files (say, >100mb) (which may be plain-text
or binary). Binary files are particularly problematic because each version of
the file is saved {\it as is} in \texttt{.git}, when you have a large
number of versions it means that there
are the same number of binary files in the hidden directory (for example
100 $\times$ >100mb files!).

In this course at least, you should not try to keep large files
(especially binary files under version control). You will run into this
problem in the GIS week (where you will have to handle and store large
raster image files) in particular \footnote{None of the computing weeks
assessments will require you to use such large files anyway}. We
suggest that you include files larger than some size in your
{\tt .gitignore}.  For example, you can use the following bash command:
\begin{lstlisting}
find . -size +100M | cat >> .gitignore
\end{lstlisting}
The 100M means 100 mb -- you can reset it to whatever you want.

You may also explore alternatives such as {\tt git-annex}
(e.g., see \url{https://git-annex.branchable.com/}), and {\tt git-lfs}
(e.g., see \url{https://www.atlassian.com/git/tutorials/git-lfs}).

\section{Removing files}

To remove a file (i.e. stop version controlling it) use {\tt git rm}:

\begin{lstlisting}
$ echo "Text in a file to remove" > FileToRem.txt

$ git add FileToRem.txt

$ git commit -am "added a new file that we'll remove later"
master 5df9e96 added a new file that we'll remove later
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 FileToRem.txt

$ git rm FileToRem.txt
rm 'FileToRem.txt'

$ git commit -am "removed the file"
master b9f0b1a removed the file
 1 files changed, 0 insertions(+), 1 deletions(-)
 delete mode 100644 FileToRem.txt
\end{lstlisting}

I typically just do all my stuff and then just use {\tt git add -A}

\section{Accessing history of the repository}

To see particular changes introduced, read the repo's log :

\begin{lstlisting}
$ git log
commit 08b5c1c78c8181d4606d37594681fdcfca3149ec
Author: Your Name <your.login@imperial.ac.uk>
Date:   Wed Oct 8 16:41:51 2014 -0500

    removed the file

commit 13f701775bce71998abe4dd1c48a4df8ed76c08b
Author: Your Name <your.login@imperial.ac.uk>
Date:   Wed Oct 5 16:41:16 2015 -0500

    added a new file that we'll remove later

commit a228dd3d5b1921ef18c5efd926ef11ca47306ed5
Author: Your Name <your.login@imperial.ac.uk>
Date:   Wed Oct 5 10:03:40 2015 -0500

    Added README file
\end{lstlisting}

For a more detailed version, add {\tt -p} at the end.

\section{Reverting to a previous version}

If things go horribly wrong with new changes, you can revert to the
previous, ``pristine'' state:

\begin{lstlisting}
$ git reset --hard
$ git commit -am "returned to previous state" #Note I used -am here
\end{lstlisting}

If instead you want to move back in time (temporarily), first find the
``hash'' for the commit you want to revert to, and then check-out:

\begin{lstlisting}
$ git status
# On branch master
nothing to commit (working directory clean)

$ git log
commit c797824c9acbc59767a3931473aa3c53b6834aae
Author: Your Name <your.login@imperial.ac.uk>
Date:   Wed Aug 22 16:59:02 2014 -0500
.
.
.

$ git checkout c79782
\end{lstlisting}

Now you can play around. However, if you commit changes, you create a
``branch'' (git plays safe!). To go back to the future, type {\tt git
checkout master}

\section{Branching}

Imagine you want to try something out, but you're not sure it will work
well. For example, say you want to rewrite the Introduction of your
paper, using a different angle, or you want to see whether switching to
a library for a piece of code improves speed. What you then need is
branching, which creates a project copy in which you can experiment:

\begin{lstlisting}
$ git branch anexperiment

$ git branch
  anexperiment
* master

$ git checkout anexperiment
Switched to branch 'anexperiment'

$ git branch
* anexperiment
  master

$ echo "Do I like this better?" >> README.txt

$ git commit -am "Testing experimental branch"
[anexperiment 9f17dc1] Testing experimental branch
 1 files changed, 2 insertions(+), 0 deletions(-)
\end{lstlisting}

If you decide to merge the new branch after modifying it:

\begin{lstlisting}
$ git checkout master

$ git merge anexperiment
Updating 08b5c1c..9f17dc1
Fast-forward
 README.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

$ cat README.txt
My CMEE 2015-16 Coursework Repository
Do I like this better?
\end{lstlisting}

If there are no conflicts (i.e., some files that you changed also
changed in the master in the meantime), you are done, and you can
delete the branch:

\begin{lstlisting}
$ git branch -d anexperiment
Deleted branch anexperiment (was 9f17dc1).
\end{lstlisting}

If instead you are not satisfied with the result, and you want to
abandon the branch:
\begin{lstlisting}
$ git branch -D anexperiment
\end{lstlisting}

When you want to test something out, always branch! Reverting changes,
especially in code, is typically painful. Merging can be tricky,
especially if multiple people have simultaneously worked on a
particular document. In the worst-case scenario, you may want to delete
the local copy and re-clone the remote repository.

\begin{center}
	\includegraphics[width=.4\textwidth]{git_xkcd_1.png}
\end{center}

\section{Running git commands on a different directory}

Since {\tt git} version 1.8.5, you can run git directly on a
different directory than the current one using absolute or relative
paths. For example, using a relative path, you can do:
\begin{lstlisting}
git -C ../SomeDir/ status
\end{lstlisting}

\section{Running git commands on multiple repositories at once}
For git pulling in multiple subdirectories (each a separate
repository):

\begin{lstlisting}
	$ find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \;
\end{lstlisting}

Breaking down these commands one by one,

{\tt find .} searches the current directory\\
{\tt -type d} to find directories, not files\\
{\tt -mindepth 1} for setting min search depth to one sub-directory\\
{\tt -maxdepth 1} for setting max search depth to one sub-directory\\
{\tt -exec git -C \{\} pull $\textbackslash$ } runs a custom git command for every git repo found\\

\subsection[Practical]{Practicals}
  \begin{enumerate} \itemsep10pt
		\item The only practical submission for {\tt git} is the {\tt
		.gitgnore} and overall git repository {\tt readme} file --- make
		sure these in your coursework repository.

		And of course, if you haven't gotten git with bitbucket
		going, you won't be able to submit any of your practicals anyway!

   \end{enumerate}

\section{Practical wrap-up}

  \begin{compactitem}

\item Invite me (s.pawar@imperial.ac.uk) to your {\tt CMEECourseWork} repository

\item The {\tt CMEEMasteRepo} will contain data and code files for
upcoming practicals

\item You will clone {\tt CMEEMasteRepo} using {git clone
git@bitbucket.org:mhasoba/cmee2015masterepo.git}

 \item You will thereafter {\tt git pull} {\tt CMEEMasteRepo}

\item You will {\tt git pull} inside {\tt CMEEMasteRepo} thereafter
(always use {\tt git status} first)

\item {\tt cp} files from {\tt CMEEMasteRepo} to your {\tt
CMEECourseWork} as and when needed --- don't work in the amster repo,
as you will lose your work when I next update it!

\end{compactitem}

\section{Readings \& Resources}

There is a wealth of information on {\tt git} out there - just google it!

\begin{compactitem}

\item Excellent book on Git: \url{http://git-scm.com/book}
\item Also, \url{https://www.atlassian.com/git/}
\item A git tutorial: \url{https://try.github.io}

\end{compactitem}

max_stars_repo_name: mathemage/TheMulQuaBio


text:
\documentclass[fancy]{article}
\setDate{November 2018}
\begin{document}

\begin{Name}{1}{ldlsat}{author}{LDL Tools}{title}
ldlsat -- SAT solver for LDL
\end{Name}

\section{Synopsis}
ldlsat <option>* <infile>

\section{Description}
ldlsat reads a single LDL formula from <infile>,
converts them to a LDL formula φ,
examines if φ is satisfiable or not, and then
returns either "valid" (¬φ is unsatisfiable), "satisfiable", or "unsatisfiable"

\section{Options}
\begin{description}
\item[\Opt{-v}, \Opt{--verbose}]
become verbose
%
\item[\Opt{-h}, \Opt{--help}]
show usage
\end{description}

\section{See Also}
ldl2mso, ldlmc

\section{Author}
\URL{https://ldltools.github.io}\\
\Email{ldltools@outlook.com}

\section{Copyright}
(C) Copyright IBM Corp. 2018.

\end{document}

max_stars_repo_name: ldltools/ldlsat

max_issues_repo_name: ldltools/ldlsat

max_forks_repo_name: ldltools/ldlsat


text:
\section{[Empirical Model]}
\label{sec:EMP}

\subsection{[Subsection 1]}
\label{Emp:Pan}

\subsection{[Subsection 2]}
\label{Emp:TS}