\chapter{Newton's law and Dynamical system}Newtons laws of motion describes how  matter behaves in the universe. These are the  three physical laws that, together, laid the foundation for classical mechanics. They describe the relationship between a body and the forces acting upon it, and it's motion in response to those forces. In describing motion it is essential to  specify a reference system . These are the physico-mathematical structures that have the purpose of allowing the objective description, also from a quantitative viewpoint, of physical phenomena that are observed in nature.
\subsubsection{Inertial frames of reference}
Inertial frames are related by a constant velocity along any axis. An object is at rest in an inertial frame when it’s position in space does not change with time.
\subsubsection{Non-Inertial frames of reference}
These are the accelerated frame of reference.
\\\\ It is always possible to find a co-ordinate system with respect to which isolated bodies move uniformly. This is the essence of Newton's first law of motion.

\section{First Law}
Newton's first law of motion is the assertion that inertial systems exist. Newton's first law is part definition and part experimental fact. Isolated bodies move uniformly in inertial systems by virtue of the definition of an inertial system. In contrast, that inertial systems exist is a statement about the physical world.
\begin{definition}
	Every body continues in it's state of rest, or of uniform motion in a straight line, unless it is compelled to change that state by forces impressed upon it.
	\begin{align*}
	\text{If ,} \ F_{ext}&=0 \Rightarrow V= Constant.
	\end{align*}
\end{definition}
After a bus or train starts, the acceleration is often so small we can barely perceive it. We are often startled because it seems as if the station is moving in the opposite direction while we seem to be at rest. Newton's First Law states that there is no physical way to distinguish between whether we are moving or the station is moving, because there is nearly zero total force acting on the body. Once we reach a constant velocity, our minds dismiss the idea that the ground is moving backwards because we think it is impossible, but there is no actual way for us to distinguish whether the train is moving or the ground is moving.
\section{Second Law}
Unlike first law of motion , the Newton's second law of motion is more quantitative and it is used in calculations involving the motion of particles.
\begin{definition}
	The second law states that the net force on an object is equal to the rate of change  of it's linear momentum $\vec{p}$ in an inertial reference frame,
	\begin{align*}
	\vec{F}&=\frac{d \vec{P}}{d t}=\frac{d(m \vec{v})}{d t}\\
	&=m \frac{d(\vec{v})}{d t}+\vec{v} \frac{d(m)}{d t}\\
	&=m \frac{d(\vec{v})}{d t} \qquad (\text{Iff mass is a constant})
	\end{align*}

	The second law can also be stated in terms of an object's acceleration.
\end{definition}
A force ${F}$ on a body of mass $m$ is ${F}= {F}_{i}$, where ${F}_{i}$ is the $i$ th applied force. If a is the net acceleration, and ${a}_{i}$ the acceleration due to ${F}_{i}$ alone, then we have,\\(In most of the cases, mass is a constant quantity then we take the assumption  that mass is a constant.)
\begin{align}
{F}&=\Sigma {F}_{i}=\Sigma m \vec{a}_{i} \notag\\
&=m {\Sigma}\vec{a}_{i}=m \vec{a} \quad (\text{Can be used only if mass is constant.})\\
\vec{a}&=\frac{d \vec{v}}{d t}=\frac{d^{2} \vec{x}}{d t^{2}}\qquad (\text{Acceleration.}  )\notag\\
{F}&=m \frac{d^{2} \vec{x}}{d t^{2}}\label{newtons1}
\end{align}
\begin{center}
	\framebox{
		\parbox[t][1.5cm]{4cm}{

			\addvspace{0.2cm} \centering

			${F}=m {a}$\\ \vspace{0.2cm}
			${F}=m \frac{d^{2} \vec{x}}{d t^{2}}$ } }
\end{center}
In cartesian coordinate system, the components of force, $F$, can be written as,
\begin{center}
	\framebox{
		\parbox[t][1.5cm]{6cm}{

			\addvspace{0.1cm} \centering

			\begin{align*}
			F_{x}&=m \frac{d^{2} x}{d t^{2}} \quad;\quad
			F_{y}=m \frac{d^{2} y}{d t^{2}} \quad;\quad
			F_{z}=m \frac{d^{2} z}{d t^{2}}\qquad
			\end{align*} } }
\end{center}\vspace{0.2cm}
The right-hand-side of Newton's Second Law is the product of mass with acceleration. Acceleration is a mathematical description of how the velocity of a body changes. Knowledge of all the forces acting on the body enables us to predict the acceleration. Equation.\ref{newtons1} is known as the equation of motion. Once we know this equation we may be able to determine the velocity and position of that body at all future times.
\section{Third Law}
The fact that force is necessarily the result of an interaction between two systems is made explicit by Newton's third law.
\begin{definition}
	Third law states that forces always appear in pairs . If body $b$ exerts force ${F}_{a}$ on body $a$, then there must be a force ${F}_{b}$ acting on body $b$, due to body $a$, such that $${F}_{b}=-{F}_{a} .$$ There is no such thing as a lone force without a partner.
\end{definition}
Newton's third law provides such a test. If the acceleration of a body is the result of an outside force, then somewhere in the universe there must be an equal and opposite force acting on another body.   If $\vec{F}_{12}$ be force on an object 1 due to an object 2, and $F_{21}$ be force on 2 due to 1 then,
$$
\vec{F}_{12}=-\vec{F}_{21}
$$
\section{Application of Newton’s Law of Motion}
\subsection{Free body diagram}
\begin{enumerate}
	\item Mentally divide the system into smaller systems, each of which can be treated as a point mass.
	\item Draw force diagram for each mass by considering the body by a point  and draw foce vector on the mass for each mas acting on it.
	\item Assign coordinates to the system of interest. The coordinate system must be an inertial frame.
	\item Assign positive values to all rotations, displacements, velocities, linear velocities, and rotational velocities, and all type of external forces in the problem.
	\item write it's  constraint equation. ( In many problems the objects are constrained to move.)
	\item Using all the force equations and constraint equations find every unknowns of the system.
\end{enumerate}
\section{Contact Force and Field Force}
\subsection{Contact Force}
Contact force is a type of force that requires contact to occur. This type of force is responsible for most of the visible interactions that happen between macroscopic collections of matter.
\begin{example}
	Pushing a car up a hill , Kicking a ball, Friction, Tension on a string.
\end{example}
\subsection{Field Force}
Field force or force field is a vector field that describes a non-contact force that acts on a particle at various positions in space. These forces can be defined as ways of showing a force felt over an area of space. For example, if we hold a compass near a magnetic field, its needle can move according to the magnetic field dimensions. The movement of the needle stops if we go away from the area that is affected by the magnetic field.
\begin{example}
	The gravity of gravitational force. Electric field, Magnetic field.
\end{example}
\section{Conservative and Non conservative Forces}
\subsection{Conservative Force }
Conservative forces are those forces for which work is done depends only on the initial and final points, while Non-Conservative forces are those forces for which the work is done or the kinetic energy did depend on the other factors such as velocity or the particular path taken by the body.
\begin{example}
	Gravitational forces, Magnetic force, Electrostatic force, Elastic spring force, Electric force,
\end{example}
\subsection{Non-Conservative Force }
Whenever the work done by a force in moving an object from an initial point to a
final point depends on the path, the force is called a non-conservative force.
If there is no scalar function $V$ such that $\mathbf{F}=-\nabla V$ [or, equivalently, if $\nabla \times \mathbf{F} \neq 0]$, then $F$ is called a non-conservative force feld.
\begin{example}
	Frictional force, Air resistance force, The force of gravity
\end{example}
\subsection{External forces and it's directions}
\subsubsection{Weight}
The weight of body is $w=m g$. The weight of the body is always in vertically
downward direction.
\subsubsection{Normal force}
When body of mass touching any surface then surface will exert normal force $N$. The direction of normal force is perpendicular to plane of surface.

\subsubsection{Tension}
Force $F$ is exerted on mass $m$ through string . Then any section of string is pulled by two equal and opposite forces. Any one of these forces is called tension. Tension always gives pulling effect. In the figure, the force $F$ is acted on mass $\mathrm{m}$ through string so there is tension $T$ in the string giving pulling effect.
\subsubsection{Friction}
Friction force is force which is responsible to oppose the motion .
There is two type of frictional force\\\\
\textbf{a.\ Static Friction:} \\\\When there is not any relative motion between surface and body $m$ then friction identified as static friction which is force is equal to external force acted on mass $m$. \textbf{The direction of frictional force is tangent or parallel to surface}. If $\mu$ is coefficient of
friction between surface and mass $m$ then maximum value of frictional force is $\mu N$.
\\\\
\textbf{b.\ Kinetic Friction:} \\\\If there is relative speed between surface and mass $m$ then frictional force is identifying as $f_{k}=\mu N$ where $\mu$ is coefficient of kinetic friction and $N$ is normal force. The direction of $f$ is directed opposite to the motion.

\begin{exercise}
	A block of mass ' $m$ ' is pulled with a force $\mathrm{F}$ at an angle $\theta$ with horizontal. The block does not move on the surface. Calculate force of friction on the block and value of coefficient of friction.
\end{exercise}
\begin{answer}
	\begin{align*}
	\intertext{The block is stationary, therefore horizontal components of F must be balanced by friction force.}
	f_{r}&=F \cos \theta\\
	\text{For vertical equilibrium,}\quad  N+F \sin \theta&=m g\\
	N&=m g-F \sin \theta
	\intertext{If $\mu$ be coefficient of static friction then,}
	f_{r} &\leq \mu N\\
	F \cos \theta &\leq \mu(m g-F \sin \theta)\\
	\mu &\geq \frac{F \cos \theta}{m g-F \sin \theta}
	\end{align*}
\end{answer}
\section{Connected body problems}
\subsection{Pulley Problem (Atwood's machine)}
\textbf{Case-1 : Both the masses are in vertical motion.}\\\\
Consider  the  arrangement  of  pulley and  blocks as shown  in  Figure  \ref{Pulley Problem1}. The  pulley  is assumed massless and frictionless and the connecting strings are massless and inextensible. \\
\begin{minipage}{0.30\textwidth}
	\begin{figure}[H]
		\includegraphics[height=4cm,width=2cm]{Laws of motion 0}
		\caption{Pulley Problem1}
		\label{Pulley Problem1}
	\end{figure}
\end{minipage}
\begin{minipage}{0.30\textwidth}
	\begin{figure}[H]
		\includegraphics[height=4cm,width=2.5cm]{Laws of motion1}
		\caption{Free body diagram(1)}
	\end{figure}
\end{minipage}\hfil
\begin{minipage}{0.30\textwidth}
	\begin{figure}[H]
		\includegraphics[height=3cm,width=4cm]{Laws of motion 2}
		\caption{Free body diagram(2)}
		\label{}
	\end{figure}
\end{minipage}
\begin{align}
\intertext{Consider for the masses, \ $ m_{2}>m_{1} $ and they are constant.}
\intertext{Let us write the force equations for $ m_{1}$  and  $m_{2}$ . In the case of $m_{1} $, }
T-m_{1} g&=m_{1} a  \qquad (\text{Where $T$ is the tension on the string.})\label{classical 1}
\intertext{In the case of $m_{2} $,}
m_{2} g-T&=m_{2} a \label{classical 2}
\intertext{ $a$, the acceleration will be the same for the two masses because the string is continuous. Solving equations.\ref{classical 1} and \ref{classical 2} , we get,}
\left(m_{2}-m_{1}\right) g&=\left(m_{1}+m_{2}\right) a \\ a&=\frac{m_{2}-m_{1}}{m_{1}+m_{2}} g \\
T&=m_{1}\left(g+\frac{m_{2}-m_{1}}{m_{1}+m_{2}} g\right)\\&=\frac{2 m_{1} m_{2}}{m_{1}+m_{2}} g
\end{align}
\textbf{Case-2 : One of the masses  in vertical motion and the other is in horizontal motion.}\\\\
Consider  the  arrangement  of  pulley and  blocks as shown  in  Figure  \ref{Pulley Problem2} . The  pulley  is assumed massless and frictionless and the connecting strings are massless and inextensible and the platform is frictionless.\\
\begin{minipage}{0.45\textwidth}
	\begin{figure}[H]
		\includegraphics[height=3cm,width=4.5cm]{Laws of motion3}
		\caption{Pulley Problem2}
		\label{Pulley Problem2}
	\end{figure}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
	\begin{figure}[H]
		\includegraphics[height=4cm,width=4cm]{Laws of motion4}
		\caption{Free body diagram}
	\end{figure}
\end{minipage}
\begin{align}
\intertext{Consider for the masses, \ $ m_{2}>m_{1} $ and they are constant.}
\intertext{Let us write the force equations for $ m_{1}$  and  $m_{2}$ . In the case of $m_{1} $, }
T&=m_{1} a  \quad (\text{Since the normal force and the gravitational forces cancells out.})\label{classical 3}
\intertext{In the case of $m_{2} $,}
m_{2} g-T&=m_{2} a \label{classical 4}
\intertext{ $a$, the acceleration will be the same for the two masses because the string is continuous. Solving equations.\ref{classical 3} and \ref{classical 4} , we get,}
m_{2} g&=m_{2} a+m_{1} a\\
a&=\frac{m_{2} }{m_{2} +m_{1}}g
\intertext{And the tension, $T$}
m_{2} g-2T&=(m_{2} - m_{1}) a\\
m_{2} g-2T&=(m_{2} - m_{1})\frac{m_{2} }{m_{2} +m_{1}}g=m_{2} \frac{(m_{2} - m_{1}) }{m_{2} +m_{1}}g\\
2T &=m_{2} \left[1- \frac{(m_{2} - m_{1}) }{m_{2} +m_{1}} \right]g\\
2T &=\frac{2(m_{2} m_{1}) }{m_{2} +m_{1}}g\\
T&=\frac{( m_{1} m_{2}) }{m_{2} +m_{1}}g
\end{align}
\textbf{Case-2 : One of the masses  in vertical motion and the other is in horizontal motion on a wedge.}\\\\
Consider  the  arrangement  of  pulley and  blocks as shown  in  Figure  \ref{Pulley Problem3} . The  pulley  is assumed massless and frictionless and the connecting strings are massless and inextensible and the platform is frictionless.\\
\begin{minipage}{0.45\textwidth}
	\begin{figure}[H]
		\includegraphics[height=3.5cm,width=6cm]{Laws of motion5}
		\caption{Pulley Problem}
		\label{Pulley Problem3}
	\end{figure}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
	\begin{figure}[H]
		\includegraphics[height=3.5cm,width=5cm]{Laws of motion6}
		\caption{Free body diagram}
	\end{figure}
\end{minipage}
\begin{align}
\intertext{Consider for the masses, \ $ m_{2}>m_{1} $ and they are constant.}
\intertext{Let us write the force equations for $ m_{1}$  and  $m_{2}$ . In the case of $m_{1} $, }
m_{1} g -T&=m_{1} a \label{classical5}
\intertext{In the case of $m_{2} $,}
m_{2} g \cos \theta &=N \quad (\text{They cancells out.})\\
T-m_{2} g \sin \theta &=m_{2}a \label{classical6}
\intertext{  Solving equations.\ref{classical5} and \ref{classical6} , we get,}
m_{1} g - m_{2} g \sin \theta &=(m_{1}+m_{2}) a\\
a&=\frac{(m_{1}  - m_{2}  \sin \theta)g}{(m_{1}+m_{2})}
\intertext{And the tension, $T$}
-2T+(m_{1} +m_{2}\sin \theta )g&=(m_{1}  - m_{2} )a\\
-2T+(m_{1} +m_{2}\sin \theta )g&=(m_{1}  - m_{2} )\frac{(m_{1}  - m_{2}  \sin \theta)g}{(m_{1}+m_{2})}\\
-2T&=-\frac{2m_{1}m_{2}+2m_{1}m_{2}\sin \theta}{m_{1}+m_{2}}\\
T&=\frac{m_{1}m_{2} (1+\sin\theta)}{m_{1}+m_{2}}
\end{align}
\begin{exercise}
	A block of mass 250 gm slides down  an incline of inclination $37^{\circ}$ with a uniform speed. Find the workdone against the friction as the block slides through 1.0 m
\end{exercise}

\begin{answer}$\left. \right.  $\\
	\begin{minipage}{0.45\textwidth}
		\begin{align*}
		W&= F.S\\
		&=FS\cos \theta
		\intertext{Since the workdone is against frictional force, The force responsible for the workdone is $mg\sin\theta$}
		W&=mg\sin\theta \times 1 \times   \cos \theta\\
		&=mg\sin 37 \times 1 \times   \cos 0 \quad  (\text{$\because$ F and S are parallel})\\
		&=0.25\times \times 9.8\times \sin 37 \times 1\\
		&=1.5 J
		\end{align*}
	\end{minipage}\hfill
	\begin{minipage}{0.45\textwidth}
		\begin{figure}[H]
			\includegraphics[height=3.5cm,width=4.5cm]{wedge}
		\end{figure}
	\end{minipage}

\end{answer}
\subsection{Block on a string}
Consider a mass $m$ whirls with constant speed $v$ at the end of a string of length $R$. We have to find the force on $m$ in the absence of gravity or friction. The figure.\ref{Block on string 1} is shown below.
\begin{figure}[H]
	\centering
	\includegraphics[height=4cm,width=8cm]{block on string 1}
	\caption{Block on string 1}
	\label{Block on string 1}
\end{figure}
\begin{align*}
\intertext{The only force on $m$ is the string force $T$, which acts toward the center. Here we need to use polar coordinate system.}
\intertext{ if $r$ and $\theta$ are the polar coordinates of the particle,then the acceleration is,}
a_{(r,\theta)}&=\left(\ddot{r}-r \dot{\theta}^{2}\right) \hat{{r}}+(r \ddot{\theta}+2 \dot{r} \dot{\theta}) \hat{\boldsymbol{\theta}}
\intertext{The radial acceleration,}
a_{r}&=\ddot{r}-r \dot{\theta}^{2} \qquad \text{Where $\dot{\theta}$ is the angular velocity.}
\intertext{$a_{r}$ is directed positive outward.}\\
\intertext{The tension on the wire is directed towards the origin then,}
T&=-T \hat{r}\\
-T &=m a_{r} \\
&=m\left(\ddot{r}-r \dot{\theta}^{2}\right)
\intertext{Here $r$ is the radius which is a constant. Then,}
\ddot{r}&=\ddot{R}=0 \text { and } \dot{\theta}=v / R . \\ \text { Hence, } a_{r}&=-R
(\frac{v}{R})^{2}=-v^{2} / R \\\text { And ,}\
T&=\frac{m v^{2}}{R}
\intertext{Since, the tension is directed towards the origin there is no outward forces on the mass $m$. When we  whirl a pebble at the end of a string, we feel an outward force. However, the force we feel does not act on the pebble, it acts on us. This force is equal in magnitude and opposite in direction to the force with which we pull the pebble, assuming the string's mass to be negligible.}
\end{align*}
\section{Dynamical systems}
We start with a very broad definition of a dynamical system and introduce the key theoretical concepts of phase space and fixed points (or limit cycles). While the definition may not cover all dynamical systems, it does cover a whole variety systems of interest to us. We give examples of systems with very simple dynamics to begin with and prepare ground for the treatment of more complicated systems which may not be analytically solvable.
\section{ Dynamical systems of order n}
$\text { A dynamical system of order } n \text { is defined as follows: }$
\begin{enumerate}
	\item The state of the system at any time $t$ is represented by $n$-real variables
	$$
	\left\{x_{1}, x_{2}, x_{3}, \ldots, x_{n}\right\} \Rightarrow \vec{r}
	$$
	as coordinates of a vector $\vec{r}$ in an abstract $n-$ dimensional space. We refer to this space as the state space of simply phase space ${ }^{1}$ in keeping with its usage in Hamiltonian dynamics. Thus the state of the system at any given time is a point in this phase space.
	\item The time evolution of the system, motion is represented by a set of first order equations- the so called "equations of motion":
	\begin{align}
	\frac{d x_{1}}{d t} &=v_{1}\left(x_{1}, x_{2}, \ldots, x_{n}, t\right) \\
	\frac{d x_{2}}{d t} &=v_{2}\left(x_{1}, x_{2}, \ldots, x_{n}, t\right) \\
	\frac{d x_{n}}{d t} &=v_{n}\left(x_{1}, x_{2}, \ldots, x_{n}, t\right)
	\end{align}
	or simply
	$$
	\frac{d \vec{r}}{d t}=\vec{v}(\vec{r}, t)
	$$
	where
	$$
	\vec{v} \Rightarrow\left\{v_{1}, v_{2}, \ldots, v_{n}\right\}
	$$
	is called the velocity function. While we use the notation $x$ and $v$ in analogy with mechanics, they do not always have the usual meaning of position and velocity.
\end{enumerate}
The statements 1 and 2 together define  $\textbf{a dynamical system of order n}$.\\
 If the velocity function does not depend on time explicitly, then the system is timeindependent or autonomous. The set of all possible motions in called \textbf{phase flow}.\\
We also require that the solution to be unique which requires $\vec{v}$ to obey certain conditions. Without going to mathematical details, it suffices to say that the solution of the differential equations in (1.5) are unique if the velocity vector $\vec{v}$ is a continuous function of its arguments and at least once differentiable. With the time evolution, the initial state of the system (denoted by a point in the phase space) evolves and follows a continuous trajectory which we shall call a \textbf{phase curve} which may be closed or open. Distinct phase curves are obtained when the initial state of the system is specified by a point which is not one of the points on the other trajectory. This leads to an important fact that two distinct trajectories can not intersect in a finite time period. The no intersection of phase space trajectories has to do with the fact that the evolution is deterministic. This is an important concept to which we shall return later.
\section{ First order systems}
This is the simplest case of a dynamical system. The equation of motion $^{2}$ is given by
$$
\frac{d x}{d t}=v(x, t)
$$
where $v$ is the velocity function. For any given $v(x, t), x(t)$ is completely determined given $x(t)$ at some $t=t_{0} .$ If, in particular, the system is autonomous, or $v$ is not explicitly dependent on time then the solution can be written as,
$$
t-t_{0}=\int_{x\left(t_{0}\right)}^{x(t)} \frac{d x^{\prime}}{v\left(x^{\prime}\right)}
$$
Thus the solution $x(t)$ depends only on the difference $\left(t-t_{0}\right)$. Thus the time evolution of the system depends entirely on the time elapsed no matter where the origin of time is fixed.
\begin{example} \textbf{ Radio-activity }
 A classic example of a dynamical system of first order is the Radio-active decay of a nucleus modelled by the equation
 $$
 \frac{d N}{d t}=-\sigma N
 $$
 where $N$ is number of nuclei present at some time $t$. The solution of course is well known,
 $$
 N(t)=N_{0} \exp \left\{-\sigma\left(t-t_{0}\right)\right\}
 $$
 where $N_{0}$ is the number of unstable nuclei present at $t_{0}$.
\end{example}
\begin{example}\textbf{ Spread of epidemics}
	Unlike radio-decay, here the growth is usually exponential at least in the initial period. If $\sigma$ is an explicit function of time, as in the case of diseases one may obtain a power-law growth instead of exponential growth. A case which has been studied in detail is the threat of AIDS which has devastated many parts of Africa and is threatening many other countries like India.

	In an effort to make quantitative assessment of the threat, efforts have been made to look at the reliable data compiled by Centres for Disease Control in the USA as a function of time. If $I$ is the number of infected persons in a population of size $N$, then the rate of change of $I$ may be given by
	$$\frac{d I}{d t} \approx \alpha I$$
	which gives rise to exponential growth in the initial phases which is usually true in an epidemic. However, it has been observed that in the case of AIDS that the growth shows a cubic dependence on time and not exponential. How is this achieved? Suppose the relative growth rate $\alpha$ is not a constant in time but a decreasing function of time, say,
	$$
	\alpha=m / t
	$$
	where $m$ is a constant. Then the equation may be written as
	$$
	\frac{d I}{d t} \approx m I / t
	$$
	which has a power law solution, namely,
	$$
	I=I_{1} t^{m}+I_{0}
	$$
	It turns out that for AIDS $m=3$.
\end{example}
\begin{example}\textbf{ Population growth}
	A similar exponential growth also occurs in the population growth of various species. When 24 wild rabbits from Europe, not indigenous to Australia, were introduced in Australia they had a disaster on hand. With abundant food with no natural enemies they were in millions within a few years. The impact was so deep
	and widespread that it was called a national tragedy. Since the birth rate is proportional to the size of the population, one gets an equation of motion
	$$
	\frac{d N}{d t}=\sigma N
	$$
	which is similar to radioactive decay equation, but with a positive sign indicating an exponential growth ( $\sigma$ is positive).

	The population problem, however, gets more complicated when considerations such as food and predators are introduced.
\end{example}
\begin{example}\textbf{ a non-linear equation}
	The equations of motion can, except in simple situations, get extremely complicated and the solutions are often not easy to obtain. However many qualitative features of a dynamical system may be obtained without actually solving the equations of motion. We will illustrate this with an example below- Consider the equation
	$$
	\frac{d x}{d t}=v(x)=-x\left(1-x^{2}\right)
	$$
	which is similar to the radioactive decay problem with a nonlinear term added.
\end{example}
Let us look at the properties of the velocity function:\\
\begin{itemize}
	\item The system is autonomous- no explicit time dependence.
	\item The velocity function has zeros at $x_{k}=0, \pm 1-x_{k}$ are the roots of $v(x)$. If the system is at $x_{k}$ at any time, it will continue to remain there for all times. $x_{k}$ are therefore called \textbf{fixed points}. The system is said to be in \textbf{equilibrium} when it is at a fixed point.
	\item The phase space is one dimensional. The phase flows may be indicated by a set of arrows, for example, pointing left(right) if the sign of $v(x)$ is positive(negative) and whose length is proportional to the magnitude of $v(x)$ as shown in figure below. For reference we have also shown $v(x)$ as a function of $x$. The $\mathrm{x}$-axis is the one dimensional phase space of the system.\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=5cm]{diagram-20220214-crop}
		\caption{}
		\label{}
	\end{figure}
\end{itemize}
\textbf{ Properties of Fixed Points}
\begin{itemize}
	\item  The set of zeros of the function $v(x)$ are called the fixed points of the system. The fixed points divide the phase space into several regions.
	\item $x_{k}$ is \textbf{a stable fixed point or sink} if the flow is directed towards the fixed point, otherwise $x_{k}$ is an \textbf{unstable fixed point or repellor.} In the above example obviously $x_{k}=0$ is a stable fixed point where as $x_{k}=\pm 1$ are unstable. It is easy to see that the system evolves towards stable fixed point and away from an unstable fixed point. That is, if $x_{0}$ is a fixed point then define
	$$
	\lambda=\left.\frac{d v}{d x}\right|_{x_{0}}
	$$
	If $\lambda<0$ the fixed point is stable otherwise it is unstable. $\lambda$ is called the characteristic value or some times called Lyapunov exponent.
	\item A fixed point may be both stable and unstable, ie., the neighbouring states approach the fixed point on one side but leave from the other side. We call this a \textbf{saddle point}. This property leads to the so called structural instability, that is even a small perturbation some time can change the nature of fixed point. For example analyse the system with $v(x)=x^{2}$.
	\item The system can not cross a fixed point, by definition. The motion is therefore bounded by the fixed point or fixed points. A system which starts out in the open interval between fixed points remains there for arbitrarily long periods of time. These intervals are therefore called invariant sets. In the example- 4 above the invariant sets are $(-\infty,-1) ;(-1,0) ;(0,1) ;(1, \infty)$
\end{itemize}
Often the motion may be terminating. The terminating motion happens when at some time $t$ the solution of the differential equation is undefined.
\section{ Second order systems}
If the nonlinear differential equation under investigation is of second order and does not contain the independent variable time $t$ explicitly, then it is possible to extract some information regarding the properties of the solution by a geometrical method without actually going into tedious solution of the equation. The dynamical systems whose equations of motion do not involve time $t$ explicitly are called 'autonomous systems'. The equations of motion of second order autonomous systems have the general form
$$
\ddot{x}+g(\dot{x})+f(x)=0
$$
If the velocity $(\dot{x})$ of system is treated as other independent variable and denoted by $y(=\dot{x})$. then equation (1) may be reduced to two first order differential equations as\\
$$\begin{aligned}
	&\frac{d x}{d t}=y \\
	&\frac{d y}{d t}=-[g(y)+f(x)]
\end{aligned}$$
 Equations represent special case of more general system \\
 $$\begin{aligned}
 	&\frac{d x}{d t}=P(x, y) \\
 	&\frac{d y}{d t}=Q(x, y)
 \end{aligned}$$
 $\text { where } P(x, y) \text { and } Q(x, y) \text { are the functions of variables } x \text { and } y \text {. }$\\
Thus Phase space is the superposition of position and momentum space and in phase space the position and velocity coordinated are treated on equal footings.\\
$$\frac{dy}{dx}=-\frac{g(y)+f(x)}{y},y\neq0$$
This differential equation defines a definite curve in the phase space.This curve is called phase tajectory or simply trajectory of the system in the phase space.The phase trajectory is defined by general equations\\
$$\frac{dy}{dx}=\frac{Q(x,y)}{P(x,y)}$$
\subsection{Illustration of phase trajectories}
\textbf{1-Linear harmonic oscillator}\\
The differential equation of linear harmonic oscillator is\\
$$m\frac{d^2x}{dt^2}+kx=0,\frac{dx}{dt}=y$$
These equations may be expressed as \\
$$\frac{dy}{dt}+\frac{k}{m}=0, \frac{dx}{dt}=y$$
Then $$\frac{dy}{dx}=-\frac{kx}{my}$$
or $$mydy+kxdx=0$$
Integrating\\
$$\frac{my^2}{2}+\frac{kx^2}{2}=C$$
The arbitrary constant C is determining by requiring that $x=x_0$ at y=0;This fixes the total energy of the oscillator and C is given by\\
$$ C=0+\frac{kx_0^2}{2}=E$$
Now the equation become
$$my^2+kx^2=2E$$
$$\implies \frac{x^2}{2E/k}+\frac{y^2}{2E/m}=1$$
This equation has the form
$$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$$
\begin{figure}[H]
	\centering
	\includegraphics[height=5cm,width=8cm]{diagram-20220215-20220215103508-crop-crop}
	\caption{}
	\label{}
\end{figure}
This is well known equation of ellipse with center at the origin,semi-major axis $a=\sqrt{\frac{2E}{k}}$ and semi minor axis $b=\sqrt{\frac{2E}{m}}$\\
The phase trajectory of a differential equation is a definite ellipse for a given value of total energy E.Different ellipse in a phase plane corresponds to different vauesof total energy of the system.The equation $y=\dot{x}$ indicates that the representative point P(x,y) traverse the phase trajectory in clockwise sense.The centre of any ellipse x=0,y=0 is a singular point of the system.This singular point is enclosed by all trajectories.A singular of this type which is enclosed by all trajectories and approched by none is called a \textbf{vortex point}.The vortex point is position of stable equilibium of the system.\\
If $x=x_0,y=y_0$ at t=0 the time integral of the differential equation gives\\
$$x=\frac{y_0}{\omega}\sin \omega t+x_0\cos \omega t$$
$$y=y_0\cos \omega t-\omega x_0 \sin \omega t$$
With $ \omega=\sqrt{\frac{k}{m}}$.These are parametric equation of the ellipse.\\
The period of revolution of representative point \\
$$T=\frac{2 \pi }{\omega}=2\pi \sqrt{\frac{m}{k}}$$
\textbf{2-A Periodic Motion}\\
Consider a particle of mass $m$ being repulsed from the origin along $X$ axis by a force proportional to its distance from the origin.\\
$F \infty x$ or $F=k x$, where $k$ is a constant.\\
From Newton's second law $F=m \frac{d^{2} x}{d t^{2}}$, therefore equation of motlon becomes\\
$\therefore \qquad m \frac{d^{2} x}{d t^{2}}=k x $\\
\begin{equation}
\text { or }  \frac{d^{2} x}{d t^{2}}=\frac{k}{m} x \text { or } \frac{d^{2} x}{d t^{2}}=a^{2} x\label{psd01}
\end{equation}
where \qquad
$a^{2}=\frac{k}{m}$\\
Equation (\ref{psd01}) is equivalent to two differential equations of first order as
$$
y=\frac{d x}{d t}, \quad \frac{d y}{d t}=a^{2} x
$$
Dividing these equations the phase trajectories are given by the equations
$$
\begin{aligned}
\frac{d y}{d x} &=\frac{a^{2} x}{y} \\
\Rightarrow \quad y d y &-a^{2} x d x=0
\end{aligned}
$$
Integrating we get
\begin{equation}
y^{2}-a^{2} x^{2}=C
\end{equation}
\begin{figure}[H]
	\centering
	\includegraphics[height=4cm,width=5cm]{diagram-20220215-crop}
\end{figure}
where $C$ is a constant. This equation represents a hyperbola in the phase plane. Different values of $C$ correspond to different hyperbolas, whose two asymptotes are
$$
y=\pm a x .
$$
The origin $O$ is a singular point of a special type called the saddle point. In this case, there are two special trajectories that pass through the singular point (for which $C=0$ ). The motion of the representative point $P(x, y)$ along the trajectories that approach the saddle point is asymptotic with time $t$. The trajectories in the neighbourhood of a saddle point represent the possible motions that occur in the neighbourhood of a point of unstable equilibrium.\\
\textbf{3-Motion of a Damped Oscillator}\\
The differential equation of a damped harmonic oscillator with coefficient of damping ' $b$ ' is" given by
$$
\frac{m d^{2} x}{d t^{2}}=-b \frac{d x}{d t}-k x
$$
where $k$ is spring factor. This equation may be written as
$$
\begin{array}{l}
\frac{d^{2} x}{d t^{2}}+\frac{b}{m} \frac{d x}{d t}+\frac{k}{m} x=0 \\
\frac{d^{2} x}{d t^{2}}+2 r \frac{d x}{d t}+\omega_{0}^{2} x=0
\end{array}
$$
or\\
\begin{equation}
\text{where }\quad 2 r=\frac{b}{m}\text{ and }\omega_{0}^{2}=\frac{k}{m} \label{psd02}\\
\end{equation}
This equation is equivalent to two differential equations of first order given by
and
$$
\left.\begin{array}{l}
y=\frac{d x}{d t} \\
\frac{d y}{d t}=-\left(2 r y+\omega_{0}^{2} x\right)
\end{array}\right\}
$$
Dividing these equations, we get the equation of phase trajectory as
$$
\frac{d y}{d x}=-\frac{2 r y+\omega_{0}{ }^{2} x}{y}
$$
\textbf{Case (i) Underdamped case}\\
If $r^{2}<\omega_{0}{ }^{2}$, the motion of particle is damped oscillatory motion. Substituting $\omega=\sqrt{\omega_{0}{ }^{2}-r^{2}}$\\
The general solution of equation (\ref{psd02}) is
$$x=A e^{-r t} \cos (\omega t+\phi)$$
$$y=\dot{x}=-A e^{-r t}[r \cos (\omega t+\phi)+\omega \sin (\omega t+\phi)\}$$where $A$ and $\phi$ are arbitrary constants.
\begin{figure}[H]
	\centering
	\includegraphics[height=4cm,width=4cm]{diagram-20220215(2)-crop}
	\caption{}
	\label{}
\end{figure}
These equations represent family of spirals; one spiral is shown in Figure . The origin $O$ is a singular point called the focal point. The representative point $P(x, y)$ spirals to approach the focal point at origin in an asymptotic manner. In this case the focal point at origin is a point of stable cquilibrium.\\
The representative point spirals to approach the focal point in an infinite number of times about it, so we may conclude that it does not approach $O$ with a definite direction.\\
\textbf{Case (ii) Overdamped Motion. }\\
If damping is large, then $r^{2}>\omega_{0}^{2}$ and motion is not oscillatory and is called overdamped motion.\\
Let
$$
\omega=\sqrt{r^{2}-\omega_{0}^{2}}
$$
In this case the general solution of equation $(\ref{psd02})$ is expressed as \\
\begin{equation}
\text{and}\qquad
\left.\begin{array}{l}
\quad x(t)=A e^{-\pi} \cosh (\omega t+\phi) \\
y(t)=\hat{x}(t)=A e^{-r t}[\omega \sinh (\omega t+\phi)-r \cosh (\omega t+\phi)]
\end{array}\right\}\label{psd03}
\end{equation}
\begin{figure}[H]
	\centering
	\includegraphics[height=3cm,width=5cm]{diagram-20220215(1)-crop}
	\caption{}
	\label{}
\end{figure}
where $A$ and $\phi$ are constants. Equations (\ref{psd03}) represents the phase trajectories of overdamped oscillator. A typical trajectory is shown in Figure  the origin $O$ is a singular point. The phase trajectories are such that the representative point $P(x, y)$ approaches towards the singular point with a definite direction; such a singular point is called a node or nodal point. The nodal point $O$ is the position of stable equilibrium. The four types of singular points are listed in the following table :\\\\
\begin{tabular}{|l|l|l|l|}
	\hline Name of singular point & \multicolumn{1}{|c|}{ Type of motion } & \multicolumn{1}{|c|}{ Type of equilibrium } & Approach \\
	\hline 1. Vortex point & Oscillatory & Stable & none \\
	\hline 2. Saddle point & Aperiodic & Unstable & only along asymptotes \\
	\hline 3. Focal point & Damped oscillatory & Stable & with no definite direction \\
	\hline 4. Nodal point & Aperiodic & Stable & with a definite direction \\
	\hline
\end{tabular}
\begin{example}\textbf{Falling body in a gravitational field}\\
Let $x$ denote the height at some time $t$. The force equation may be written as two first order equations:
$$
\begin{gathered}
\frac{d x}{d t}=v_{x}(x, y)=y \\
\frac{d y}{d t}=v_{y}(x, y)=-g
\end{gathered}
$$
where $g$ is the acceleration due to gravity. Thus the velocity field is given by,
$$
\vec{v}=(y,-g)
$$
Since $g$ is never zero there are no fixed points in this system. The equation of the phase curve and its solution is	\\
$$
\frac{d y}{d x}=-\frac{g}{y} \Rightarrow x=x_{0}-y^{2} / 2 g
$$
where $x_{0}$ is the height at $t=0$. The phase curves are therefore parabolas as shown in the figure below.\\
\begin{figure}[H]
	\centering
	\includegraphics[height=4cm,width=5cm]{diagram-20220215(6)-crop}
	\caption{}
	\label{}
\end{figure}
Different phase curves correspond to different initial conditions. The phase flows are characterised by the arrows of length and orientation given by
$$
|\vec{v}|=\sqrt{y^{2}+g^{2}}, \quad \tan (\theta)=-g / y
$$
\end{example}

\section{Linear stability analysis}
We shall confine our analysis to 2 nd order autonomous systems, for example, motion of a particle in one dimension or systems with one degree of freedom (dof). The motivation, as we shall see below, for a general stability analysis is to derive the local and where possible global properties of a dynamical system qualitatively, that is, without actually solving the evolution equations.
For an autonomous system of order 2 we have\\
$$\begin{aligned}
	&\frac{d x}{d t}=v_{x}(x, y) \\
	&\frac{d y}{d t}=v_{y}(x, y)
\end{aligned}$$
where $(x, y)$ define the state of the system in the phase space. We shall assume that $\vec{v}$ is some function of $x, y$ which may be non-linear and therefore have many roots. The fixed point is defined through
$$
v_{x}\left(x_{k}, y_{k}\right)=0=v_{y}\left(x_{k}, y_{k}\right)
$$
and there may be many solutions. The nature of fixed points and the phase flows in the neighbourhood will be determined by the derivatives evaluated at the fixed point.
Consider one such fixed point $\left(x_{0}, y_{0}\right)$. The stability around this fixed point may be obtained by giving a small displacement around the fixed point:
$$
\begin{aligned}
&x(t)=x_{0}+\delta x(t) \\
&y(t)=y_{0}+\delta y(t)
\end{aligned}
$$
Now Taylor expand the velocity function $\vec{v}$ around the fixed point.
$$
\begin{aligned}
&v_{x}(x, y)=v_{x}\left(x_{0}, y_{0}\right)+\left.\frac{\partial v_{x}}{\partial x}\right|_{x_{0}, y_{0}} \delta x+\left.\frac{\partial v_{x}}{\partial y}\right|_{x_{0}, y_{0}} \delta y+\ldots \\
&v_{y}(x, y)=v_{y}\left(x_{0}, y_{0}\right)+\left.\frac{\partial v_{y}}{\partial x}\right|_{x_{0}, y_{0}} \delta x+\left.\frac{\partial v_{y}}{\partial y}\right|_{x_{0}, y_{0}} \delta y+\ldots
\end{aligned}
$$
By definition the first term is zero since $\left(x_{0}, y_{0}\right)$ is a fixed point. For an infinitesimal variation in $(\delta x, \delta y)$ we may linearise the equations of motion-
$$
\left(\begin{array}{c}
d x / d t \\
d y / d t
\end{array}\right)=\left(\begin{array}{c}
d \delta x / d t \\
d \delta y / d t
\end{array}\right)=\left(\begin{array}{ll}
V_{x x} & V_{x y} \\
V_{y x} & V_{y y}
\end{array}\right)\left(\begin{array}{l}
\delta x \\
\delta y
\end{array}\right)
$$
or in a short form, and shifting the origin to $\left(x_{0}, y_{0}\right)$,
$$
\frac{d \delta \vec{r}}{d t}=A \delta \vec{r}
$$
where $A$ is a $2 \times 2$ matrix given by,
$$
A=\left(\begin{array}{ll}
\frac{\partial v_{x}}{\partial x} & \frac{\partial v_{x}}{\partial y} \\
\frac{\partial v_{y}}{\partial x} & \frac{\partial v_{y}}{\partial y}
\end{array}\right)_{x_{0}, y_{0}}
$$
The local stability analysis is best done in the eigenbasis or in some other convenient basis which we shall call the Standard Basis.

If the system is already linear the above analysis is globally, not just locally, valid since
$$
\begin{aligned}
&\frac{d x}{d t}=v_{x}(x, y)=a x+b y \\
&\frac{d y}{d t}=v_{y}(x, y)=c x+d y
\end{aligned}
$$
and the matrix $A$ is given by,
$$
A=\left(\begin{array}{ll}
a & b \\
c & d
\end{array}\right)
$$
However, we need not restrict the analysis only to linear systems. Consider the change of basis
$$
M\left(\begin{array}{l}
\delta x \\
\delta y
\end{array}\right)=\left(\begin{array}{l}
\delta X \\
\delta Y
\end{array}\right)
$$
such that
$$
B=M A M^{-1}=\left(\begin{array}{cc}
\lambda_{1} & 0 \\
0 & \lambda_{2}
\end{array}\right)
$$
where $\lambda_{i}$ are the eigenvalues of the stability matrix given by
$$
\begin{aligned}
&\lambda_{1}=\frac{1}{2}\left(\tau-\sqrt{\tau^{2}-4 \delta}\right) \\
&\lambda_{2}=\frac{1}{2}\left(\tau+\sqrt{\tau^{2}-4 \delta}\right)
\end{aligned}
$$
where
$$
\begin{gathered}
\tau=V_{x x}+V_{y y} \\
\delta=V_{x x} V_{y y}-V_{x y} V_{y x}
\end{gathered}
$$
are respectively the trace and the determinant of the stability matrix. The eigenvalues are real or complex depending on whether $\tau^{2} \geq 4 \delta$ or $\tau^{2}<4 \delta .$ We shall consider these cases separately.

In the transformed coordinates the linearised equations of motion and their solutions in the neighbourhood of the fixed point are given by
$$
\begin{aligned}
\delta \dot{X} &=\lambda_{1} \delta X \Rightarrow \delta X(t)=C_{1} \exp \left(\lambda_{1} t\right) \\
\delta \dot{Y} &=\lambda_{2} \delta Y \Rightarrow \delta Y(t)=C_{2} \exp \left(\lambda_{2} t\right)
\end{aligned}
$$
The equation for the phase curve is
$$
\left(\delta X / C_{1}\right)^{\lambda_{2}}=\left(\delta Y / C_{2}\right)^{\lambda_{1}}
$$
\subsection{ Classification of the fixed points}
We use the properties of the eigenvalues to classify the fixed points. While in the first order systems motion either moves towards or away from the fixed point, the second order systems are richer in the sense there is much more variety in the nature of fixed points.\\
\begin{enumerate}
	\item \textbf{$\text { Stable Node, } \lambda_{1}, \lambda_{2}<0$}
	$$
	\delta X, \delta Y \rightarrow 0
	$$
	as $t \rightarrow \infty$\\
	If in particular $\lambda_{1}=\lambda_{2}<0$ and the equation is separable, $A=\lambda I$, it is called a stable star. (See Figure). If not a change of basis may be induced such that the matrix
	$$
	B=\left(\begin{array}{ll}
	\lambda & 0 \\
	c & \lambda
	\end{array}\right)
	$$
	or equivalently $c=0$ and $b \neq 0$. In this case
	$$
	\begin{gathered}
	\delta \dot{X}=\lambda \delta X \Rightarrow \delta X(t)=C_{1} \exp (\lambda t) \\
	\delta \dot{Y}=c \delta X+\lambda \delta Y \Rightarrow \delta Y(t)=\left(C_{2}+C_{1} c t\right) \exp (\lambda t)
	\end{gathered}
	$$
	For $\lambda<0$ this is called an improper node.
	\item \textbf{$\text { Unstable Node, } \lambda_{1}, \lambda_{2}>0 \text {. }$}
	$$\delta X, \delta Y \rightarrow \infty$$
	as $t \rightarrow \infty .$ If in particular $\lambda_{1}=\lambda_{2}>0$ and $A=\lambda I$ it is called a unstable star.
	(See Figure).\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=7cm,width=8cm]{diagram-20220215(3)-crop}
		\caption{}
		\label{}
	\end{figure}
	\item \textbf{$\text { Hyperbolic fixed point, } \lambda_{1}>0, \lambda_{2}<0 $}
	$$|\delta X| \rightarrow \infty,|\delta Y| \rightarrow 0$$
	as $t \rightarrow \infty$. This fixed point is also called a saddle point. These are rather special. If in particular the system has only one fixed point then the saddle point divides the phase space into four quadrants, each of which is an invariant subspace. That is a trajectory starting in one of the quadrants remains confined to the same quadrant for all times. These regions are separated by trajectories heading towards or away from the fixed point. The set of points along these trajectories are called invariant manifolds.\\\\
	Next consider the case when the eigenvalues are complex.
	\item \textbf{$\text { Stable spiral fixed point, } \lambda_{1}=-\alpha+i \beta, \lambda_{2}=-\alpha-i \beta \text { where } \alpha, \beta>0$}
	Correspondingly we have,
	$$
	\delta X=C_{1} e^{-\alpha t+i \beta t}, \quad \delta Y=C_{2} e^{-\alpha t-i \beta t}
	$$
	By a change of basis the solutions may be written as
	$$
	\begin{gathered}
	\delta X^{\prime}=e^{-\alpha t}\left(C_{1} \cos \theta t+C_{2} \sin \theta t\right) \\
	\delta Y^{\prime}=e^{-\alpha t}\left(-C_{1} \sin \theta t+C_{2} \cos \theta t\right)
	\end{gathered}
	$$
	The fixed point is called the spiral fixed point by looking at the behaviour of the real and imaginary parts as shown in the figure or the solutions given above explicitly in terms of the rotation angle $\theta$. It is stable since for large times the system tends towards the fixed point.
	\item \textbf{$\text { Unstable spiral fixed point, } \lambda_{1}=\alpha+i \beta, \lambda_{2}=\alpha-i \beta \text { where } \alpha, \beta>0 $}
	Correspondingly we have,
	$$
	\delta X=C_{1} e^{\alpha t+i \beta t}, \quad \delta Y=C_{2} e^{\alpha t-i \beta t}
	$$
	The fixed point is unstable since for large times the system moves away from the fixed point.
	\item \textbf{$\text { Elliptic fixed point, } \lambda_{1}=i \omega=-\lambda_{2}$}
 Correspondingly we have,\\
 $$\delta X=C_{1} e^{i \omega t}, \quad \delta Y=C_{2} e^{-i \omega t}$$
 The system is confined to ellipses around the fixed point- each ellipse corresponds to a given initial condition.\\
 \begin{figure}[H]
 	\centering
 	\includegraphics[height=7cm,width=8cm]{diagram-20220215(4)-crop}
 	\caption{}
 	\label{}
 \end{figure}
\end{enumerate}
\subsection{Limit cycle}
In first-order systems all motions tend to fixed points or to infinity. In second order systems, in addition to fixed points, the system may also exhibit \textbf{a limit cycle} which is a closed trajectory encircling the fixed point. The trajectories within and outside tend towards the limiting trajectory as time $t \rightarrow \infty .$ Such a behaviour occurs typically in systems that are oscillatory. A rigorous analysis of limit cycles, their occurrence and stability is beyond the scope of these lectures.\\
\begin{figure}[H]
	\centering
	\includegraphics[height=4cm,width=5cm]{diagram-20220215(5)-crop}
	\caption{}
	\label{}
\end{figure}
 However, it may be noted that they occur in systems where the long-term motion of the system is limited to some finite region in the state space. Because of the no intersection theorem, it is entirely reasonable to assume that in this bounded region the trajectory either approaches a fixed point or a closed trajectory (cycle) as $t \rightarrow \infty$. Indeed this is the content of the famous \textbf{Poincare-Bendixson Theorem.}
\section{Application to Commonly-Encountered Systems}
\subsection{ Simple Pendulum}
In this example, because the Hamiltonian is constant and equal to the energy of the system, the easiest way to generate a phase plot is to derive the Hamiltonian in terms of $\boldsymbol{p}$ and $\boldsymbol{q}$. The Hamiltonian of the simple pendulum illustrated in Figure 1, consisting of a mass $m$ suspended by a massless string of length $l$ is given by:
$$
H(\theta, p)=T+V=\frac{p^{2}}{2 m l^{2}}-m g l \cos \theta
$$
In this particular case, it's obvious that $\theta=q$, the generalized coordinate and the Hamiltonian is timeindependent and is equal to the total energy of the pendulum system.\\
Figure 2 is the phase-space representation of the motion of the pendulum for four different values of the Hamiltonian or energy of the system.\\
 \par The innermost (green) curve or trajectory represents the motion of the pendulum for the lowest of the four energy levels. The pendulum has sufficient energy to swing through an angle of approximately $\pm \frac{\pi}{2}$ and obviously has the lowest maximum value of momentum. As time advances, the phase point representing the instantaneous state of the pendulum system repeatedly traces out the green trajectory, one period represented by a single orbit.
The blue trajectory represents the motion of the pendulum with slightly higher energy than the green trajectory as demonstrated by the higher maximum value for the momentum and $\theta$.
The purple trajectory represents a higher energy than the blue or green and shows the swing angle $\theta$ approaching $\pm \pi$, the maximum swing angle while still retaining 'back and forth' motion.
The orange, outermost trajectory represents the highest of the four energy levels and clearly demonstrates that the pendulum is now rotating continuously in one direction (no longer exhibiting 'back and forth' motion) by virtue of the open trajectory. An obvious implication of the open trajectory is that the system's momentum never falls to zero and continues in the same direction without limit.\\
\begin{figure}[H]
	\centering
	\includegraphics[height=6cm,width=10cm]{diagram-20220215(7)-crop}
	\caption{}
	\label{}
\end{figure}
The phase-space trajectory that represents the motion of the pendulum at the limit where the motion changes from 'back and forth' to continuous rotation is called the separatrix. The purple trajectory in figure 2 is very close in energy to the separatrix and is extremely close to it in shape.\\
\begin{note}
	$\text { Driven, damped SHO at resonance. }$\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=6cm,width=10cm]{diagram-20220215(11)-crop}
		\caption{}
		\label{}
	\end{figure}
\end{note}
\subsection{Damped Mass on a Spring}
In this example, a mass $m$ attached to the free end of a spring with spring constant $k$ is subject to a damping force $\gamma$ as shown in figure 4 . A mass on an ideal spring exhibits simple harmonic oscillations and is described by the following differential equation:
$$
m \frac{d^{2} \boldsymbol{x}}{d t^{2}}+k \boldsymbol{x}=0
$$
When the oscillations are subject to a damping force, the motion is described by:
$$
m \frac{d^{2} \boldsymbol{x}}{d t^{2}}+\gamma \frac{d \boldsymbol{x}}{d t}+k \boldsymbol{x}=0
$$
Solving this differential equation provides us with the generalized coordinate $\boldsymbol{x}(t)=\boldsymbol{q}$. The generalized momentum can then be determined from the derivative of $\boldsymbol{x}(t)$.\\
$$
\boldsymbol{p}=m \dot{\boldsymbol{x}}(t)
$$
The obvious difference between this example and the simple pendulum is that $\boldsymbol{p}$ and $\boldsymbol{q}$ are both timedependent.
Solving the differential equation for the damped motion to find $\boldsymbol{q}$ and then differentiating to obtain $\boldsymbol{p}$, the phase-plot shown in figure 5 can be generated.\\
\begin{figure}[H]
	\centering
	\includegraphics[height=6cm,width=10cm]{diagram-20220215(8)-crop}
	\caption{figure 4 and 5}
	\label{}
\end{figure}
The phase plot clearly shows how the momentum and displacement diminish with time resulting in a dramatic spiral trajectory. Without the damping force, the trajectory would be a closed ovoid similar to that for the simple pendulum with small oscillations. Figure 5 also shows how the damping force is reduced with diminishing momentum, a fact that is easily implied from the velocity term of the differential equation $\gamma \frac{d x}{d t}$.
\section{How to draw a phase curve:}
Step 1: Draw a curve of potential $U(x)\quad V_{S} \quad x$, where $U(x)$ as vertical axis and $x$ as horizontal axis.\\
Step 2: Just below of potential $U(x)$ vs $x$ curve, draw momentum $P(x)$ as vertical axis and $x$ as horizontal axis.\\
Step 3: For different values of constant energy in $U(x) V s x$ draw the trend of $P(x)$ vs $x$ in all classical allowed region.\\
Step 4: Use sign convention as mention above.
\begin{example}
If potential in one dimension is given by $V(x)=-\frac{x^{2}}{2}+\frac{x^{4}}{4}$ then plot the phase curve ie curve between momentum $p_{x}$ as function of $x$ for all possible range of energy $E$.
\end{example}
\begin{answer}
	To plot phase curve first one should plot potential $(V$ vs $x)$, then on the same axis one should plot momentum with common $x$ axis.

	We can check how momentum is changing with position keeping in mind how potential is changing with position.

	One will plot the phase curve by assuming that if the potential is increasing, then kinetic energy will be decreasing and if the potential is decreasing, then kinetic energy will be increasing because total energy will always remain constant. One should plot the phase curve for different range of energy.
	For example in the given potential, there are three range of energy.\\
For example in the given potential, there are three range of energy.\\
\textbf{Case 1:}  If $-\frac{1}{4}<E<0$ the particle has motion about stable equilibrium point $x=1,-1$ the motion is bounded.\\
\textbf{Case 2:} If $0<E<\infty$ the particle has motion about unstable equilibrium point $x=0$ the motion is bounded.
\textbf{Case 3:} At $E=0$ the particle can be landed exactly at unstable equilibrium point which is nature of transition from case 1 to case 2 .\\
\textcolor{red}{figure}
\begin{figure}[H]
	\centering
	\includegraphics[height=5cm,width=7cm]{diagram-20220222-crop}
\end{figure}
\end{answer}
\begin{example}
 If potential in one dimension is given by $V(x)=-k x^{2}$ then plot the phase curve i.e. curve between momentum $p_{x}$ as function of $x$ for all possible range of energy $E$.
\end{example}
\begin{answer}
	To plot phase curve first one should plot potential $(V$ vs $x)$, then on the same axis one should plot momentum with common $x$ axis .

	We can check how momentum is changing with position keeping in mind how potential is changing for a given value of energy. For given value of potential the phase curve is hyperbolic as shown in equation $E=\frac{p_{x}^{2}}{2 m}-k x^{2} \Rightarrow \frac{p_{x}^{2}}{2 m E}-\frac{x^{2}}{E / k}=1$\\
	One will plot the phase curve by assuming that if the potential is increasing, then kinetic energy will be decreasing and if potential is decreasing then kinetic energy will be increasing, because total energy will always remain constant. One should plot the phase curve for different range of energy. For example in this potential there are three range of energy\\
	\textbf{Case 1:} $E<0$, the particle will come from $-\infty .$ As it is approaches the potential its kinetic energy as well as momentum decreases finally became zero at turning point $A$ and turn back towards $-\infty$ with increasing kinetic energy and momentum.\\
	Same trend will also follow when particle approaching the potential from $x=\infty$, for turning point $A^{\prime}$.\\
	\textbf{Case 2:} $E>0$, the particle will come from $x=-\infty$. As it approaches the potential. its kinetic energy as well as momentum decreases till $x=0$. As it crosses $x=0$ and move towards $x=\infty$, again kinetic energy as well as momentum increases and same trend will be followed, when particle approaches the potential to $x=\infty$.\\
	\textbf{Case 3:} $E=0$, the particle can reach at $x=0$, which is unstable equilibrium point and the phase curve will also be separated between $E<0$ and $E>0$, identified as separatix. $E=\frac{p_{x}^{2}}{2 m}-k x^{2}$ for $E=0 \Rightarrow p_{x} \propto \pm x$ which is straight line.\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=7cm]{diagram-20220222(1)-crop}
	\end{figure}
\end{answer}
\begin{example}
 The energy of simple pendulum is given by $E=\frac{p_{\theta}^{2}}{2 m a^{2}}-m g a \cos \theta$, where $p_{\theta}$ angular momentum and $-m g a \cos \theta$ is potential energy.
\end{example}
\begin{answer}
	One will plot the phase curve by assuming that if the potential energy is increasing, then kinetic energy will be decreasing and if the potential energy is decreasing then kinetic energy will be increasing, because total energy will always remain constant. One should plot the phase curve for different range of energy. For example in this potential there are three range of energy.
	The stable equilibrium point is $\theta=0$. $\theta=-\pi$ and $\theta=\pi$ are unstable equilibrium points.\\
	\textbf{Case 1:}$\text { For energy }-m g a<E<m g a$  particle is bounded about stable equilibrium point .so phase curve is periodic.\\
	\textbf{Case 2:} For energy $E>m g a$ motion will become unbounded and phase curve will be a periodic. Liberation will take place.\\
	\textbf{Case 3:} For energy $E=m g a$ particle will reach at unstable equilibrium point it also separate two type of motion (mention in case 1 and case 2 ) identified as separatix.
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=7cm]{diagram-20220222(2)-crop}
	\end{figure}
\end{answer}
\begin{example}
	Phase curves for the Kepler effective potential $U(x)=-x^{-1}+\frac{1}{2}x^{-2}$
\end{example}
\begin{answer}
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=7cm]{diagram-20220225(2)-crop}
	\end{figure}
\end{answer}
\begin{example}
	Phase space trajecteries for double well potential
\end{example}
\begin{answer}
\begin{figure}[H]
	\centering
	\includegraphics[height=5cm,width=7cm]{phase 2}
\end{figure}
\end{answer}
\begin{example}
	Phase curves for the potential $U(x)=-\sech^2(x)$
\end{example}
\begin{answer}
\begin{figure}[H]
	\centering
	\includegraphics[height=5cm,width=7cm]{phase 3}
\end{figure}
\end{answer}

\newpage
\begin{abox}
	Practice set 1
	\end{abox}
\begin{enumerate}
	\item The trajectory on the $z p_{z}$ - plane (phase-space trajectory) of a ball bouncing perfectly elastically off a hard surface at $z=0$ is given by approximately by (neglect friction):
	{\exyear{NET JUNE 2011}}
\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(3)-crop}
	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(4)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(5)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(6)-crop}
	\end{figure}
\end{tasks}
	\item The bob of a simple pendulum, which undergoes small oscillations, is immersed in water. Which of the following figures best represents the phase space diagram for the pendulum?
	{\exyear{NET JUNE 2012}}
\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(7)-crop}
	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(8)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(9)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(10)-crop}
	\end{figure}
\end{tasks}
	\item Which of the following set of phase-space trajectories is not possible for a particle obeying Hamilton's equations of motion?
	{\exyear{NET DEC 2012}}
\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(13)-crop}
	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(14)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(15)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(16)-crop}
	\end{figure}
\end{tasks}
	\item The Hamiltonian of a classical particle moving in one dimension is $H=\frac{p^{2}}{2 m}+\alpha q^{4}$ where $\alpha$ is a positive constant and $p$ and $q$ are its momentum and position respectively. Given that its total energy $E \leq E_{0}$ the available volume of phase space depends on $E_{0}$ as
	{\exyear{NET DEC 2014}}
\begin{tasks}(2)
	\task[\textbf{A.}] $E_{0}^{3 / 4}$
	\task[\textbf{B.}]$E_{0}$
	\task[\textbf{C.}]$\sqrt{E_{0}}$
	\task[\textbf{D.}]is independent of $E_{0}$
\end{tasks}
	\item Which of the following figures is a schematic representation of the phase space trajectories (i.e., contours of constant energy) of a particle moving in a one-dimensional potential $V(x)=\frac{-1}{2} x^{2}+\frac{1}{4} x^{4}$
	{\exyear{NET JUNE 2015}}
\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(24)-crop}
	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(25)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(26)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(27)-crop}
	\end{figure}
\end{tasks}
	\item A particle moves in one dimension in a potential $V(x)=-k^{2} x^{4}+\omega^{2} x^{2}$ where $k$ and $\omega$ are constants. Which of the following curves best describes the trajectories of this system in phase space?
	{\exyear{NET DEC 2017}}
\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(42)-crop}
	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(43)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(44)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210926(45)-crop}
	\end{figure}
\end{tasks}
\end{enumerate}
\colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}

	\begin{tabular}{|p{1.5cm}|p{1.5cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{a}&2&\textbf{d}\\\hline
		3&\textbf{b}&4&\textbf{a}\\\hline
		5&\textbf{a}&6&\textbf{c}\\\hline
	\end{tabular}
\end{table}
\newpage
\begin{abox}
	Practice set 2
	\end{abox}
\begin{enumerate}
	\item The Hamiltonian of particle of mass $m$ is given by $H=\frac{p^{2}}{2 m}-\frac{\alpha q^{2}}{2}$. Which one of the following figure describes the motion of the particle in phase space?
	{\exyear{GATE 2014}}

\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20210915(5)-crop}
	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20210915(6)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20210915(7)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20210915(8)-crop}
	\end{figure}
\end{tasks}
	\item A particle moves in one dimension under a potential $V(x)=\alpha|x|$ with some non-zero total energy. Which one of the following best describes the particle trajectory in the phase space?
	{\exyear{GATE 2018}}

\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(11)-crop}

	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(12)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(13)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(14)-crop}
	\end{figure}
\end{tasks}
	\item A particle moves in one dimension under a potential $V(x)=\alpha|x|$ with some non-zero total energy. Which one of the following best describes the particle trajectory in the phase space?
	{\exyear{GATE 2018}}
\begin{tasks}(2)
	\task[\textbf{A.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(11)-crop}

	\end{figure}
	\task[\textbf{B.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(12)-crop}
	\end{figure}
	\task[\textbf{C.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(13)-crop}
	\end{figure}
	\task[\textbf{D.}]\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20210915(14)-crop}
	\end{figure}
\end{tasks}
\end{enumerate}
\colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}

	\begin{tabular}{|p{1.5cm}|p{1.5cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{d}&2&\textbf{a}\\\hline
		3&\textbf{b}&&\\\hline
	\end{tabular}
\end{table}
\newpage
\begin{abox}
	Practise set-3
\end{abox}
\begin{enumerate}[label=\color{ocre}\textbf{\arabic*.}]
	\item  A large mass $\mathrm{M}$ and a small mass ${m}$ hang at the two ends of a string that passes through a smooth tube as shown in fig. The mass $m$ moves around a circular path in a horizontal plane. The length of the string from mass $m$ to the top of the tube is $l$, and $\theta$ is the angle the string makes with the vertical. What should be the frequency $(v)$ of rotation of mass $m$ so that mass	$M$ remains stationary?
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=3.5cm]{pq05}
	\end{figure}
	\begin{answer}
		\begin{align*}
		\text{Tension in the string }\mathrm{T}&=\mathrm{Mg}\\
		\text{Centripetal force on the body }&=\operatorname{mr} \omega^{2}=\operatorname{mr}(2 \pi \mathrm{v})^{2}
		\intertext{ This is provided by the component of tension acting horizontally i.e. $T \sin \theta=M g \sin \theta $.}
		\therefore \mathrm{mr}(2 \pi v)^{2}&=\mathrm{} \sin \theta=
		\mathrm{Mg} \frac{r}{l} \\ v&=\frac{1}{2 \pi} \sqrt{\frac{\mathrm{Mg}}{\mathrm{m l} }}
		\end{align*}
	\end{answer}
	\item A string of negligible mass going over a clamped pulley of mass $\mathrm{m}$ supports a block of mass $M$ as shown in fig. The force on the pulley by the clamp is given by\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=4.5cm,width=3.2cm]{pq06}
	\end{figure}
	\begin{tasks}(2)
		\task[\textbf{A.}]$\sqrt{2} \mathrm{Mg}$
		\task[\textbf{B.}] $\sqrt{2} \mathrm{mg}$
		\task[\textbf{C.}]  $\left[\sqrt{\left.(\mathrm{M}+\mathrm{m})^{2}+\mathrm{m}^{2}\right]} \mathrm{g}\right.$
		\task[\textbf{D.}] $\left[\sqrt{\left.(\mathrm{M}+\mathrm{m})^{2}+\mathrm{M}^{2}\right]} \mathrm{g}\right.$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\intertext{Force on the pulley by the clamp $=$ resultant of $\mathrm{T}=(\mathrm{M}+\mathrm{m}) \mathrm{g}$ and $\mathrm{mg}$ acting along horizontal and vertical respectively}
		\therefore \mathrm{F}&=\sqrt{[(\mathrm{M}+\mathrm{m}) \mathrm{g}]^{2}+(\mathrm{mg})^{2}}\\&=\left[\sqrt{(\mathrm{M}+\mathrm{m})^{2}+\mathrm{m}^{2}}\right] \mathrm{g}
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item Find the mass $M$ of the hanging block in figure which will prevent smaller block from slipping over the triangular block. All surfaces are frictionless and the string and the pulley are light.
	\begin{figure}[H]
		\centering
		\includegraphics[height=2.7cm,width=6cm]{pq09}
	\end{figure}
	\begin{answer}
		\begin{align}
		\intertext{Since $\mathrm{m}$ does not slip on M' (relative velocity of $\mathrm{m}$ w.r.t. M' is zero)}\notag
		\intertext{$\therefore \mathrm{M}^{\prime}, \mathrm{m}$ will move with same acceleration as that of $\mathrm{M}$, Since surfaces are smooth}\notag
		\text{$\therefore$ frictional force is zero}\notag\\
		\text{Net force }&=\mathrm{Mg}=\left(\mathrm{M}+\mathrm{M}^{\prime}+\mathrm{m}\right) \mathrm{a}\notag\\
		\therefore \mathrm{a}&=\frac{\mathrm{Mg}}{\mathrm{M}+\mathrm{M}^{\prime}+\mathrm{m}}\label{pq01}
		\intertext{Now let us see m, w.r.t. M'}\notag
		\end{align}
		\begin{figure}[H]
			\centering
			\includegraphics[height=2.5cm,width=4cm]{pq09(2)}
		\end{figure}
		\begin{align}
		\intertext{Downward acceleration of $\mathrm{m}$ on slope $=0$}
		\therefore \mathrm{N}-\mathrm{ma} \sin \theta+\mathrm{mg} \cos \theta&=0\\
		(\text{net }&\perp\text{ force }=0)\notag\\
		\text{and }m g \sin \theta-\operatorname{ma} \cos \theta&=0\label{pq03}\\
		[\because&\text{ net force along slope }=0]\notag\\
		\text{From eq }^{n} \cdot(\ref{pq03}) g \sin \theta=a \cos \theta\text{ or }a&=g \tan \theta\label{pq04}
		\intertext{From eq $^{\mathrm{n}}$. (\ref{pq04}) and (\ref{pq01}),}\notag\\
		\text{we have }\tan \theta&=\frac{M}{M+M^{\prime}+m} \notag\\\Rightarrow M \cot \theta&=M+M^{\prime}+m\notag\\
		\Rightarrow \mathrm{M}&=\frac{\mathrm{M}^{\prime}+\mathrm{m}}{\cot \theta-1}\notag
		\end{align}
	\end{answer}
	\item A mass of $15 kg$ and another of mass $6kg$ are attached to a pulley system as shown in the fig. A is a fixed pulley while $B$ is a movable one. Both are considered light and frictionless. Find the acceleration of $6kg$ mass.
	\begin{figure}[H]
		\centering
		\includegraphics[height=6.5cm,width=4cm]{pq13}
	\end{figure}
	\begin{answer}
		Tension is the same throughout the string. It is clear that $\mathrm{M}_{1}$ will descend downwards while $\mathrm{M}_{2}$ rises up. If the acceleration of $\mathrm{M}_{1}$ is a downwards, $\mathrm{M}_{2}$ will have an acceleration ' $2 \mathrm{a}$ ' upward.
		\begin{figure}[H]
			\centering
			\includegraphics[height=6cm,width=4cm]{pq13(2)}
		\end{figure}
		\begin{align*}
		\intertext{Now,}
		\mathrm{M}_{1} \mathrm{~g}-2 \mathrm{~T}&=\mathrm{M}_{1} \mathrm{a}\\
		\mathrm{T}-\mathrm{M}_{2} \mathrm{~g}&=\mathrm{M}_{2} \cdot 2 \mathrm{a}
		\intertext{or}
		\mathrm{M}_{1} \mathrm{~g}-2 \mathrm{M}_{2} \mathrm{~g}&=\mathrm{a}\left(\mathrm{M}_{1}+4 \mathrm{M}_{2}\right)\\
		\Rightarrow a&=\frac{M_{1}-2 M_{2}}{M_{1}+4 M_{2}} g=\frac{15-12}{15-24} g=\frac{3}{39} g\\
		\therefore \mathrm{a}&=\frac{\mathrm{g}}{13}\\
		\therefore \text{ acceleration of }6 \mathrm{~kg}\text{ mass }&=2 \mathrm{a}=\frac{2 \mathrm{~g}}{13}
		\end{align*}
	\end{answer}
	\item A mass $m$ is revolving in a vertical circle at the end of a string of length $20 \mathrm{~cm}$. By how much does the tension of the string at the lowest point exceed the tension at the topmost point?
	\begin{answer}
		\begin{align*}
		\intertext{The tension $T_{1}$ at the topmost point is given by,}
		\mathrm{T}_{1}=\frac{\mathrm{m} \mathrm{v}_{1}^{2}}{20}-\mathrm{mg}
		\intertext{Centrifugal force acting outward while weight acting downward}
		\text{The tension $T_{2}$ at the lowest point, }T_{2}&=\frac{m v_{2}^{2}}{20}+m g
		\intertext{Centrifugal force and weight (both) acting downward}
		\mathrm{T}_{2}-\mathrm{T}_{1}&=\frac{\mathrm{m} \mathrm{v}_{2}{ }^{2}-\mathrm{m} \mathrm{v}_{1}^{2}}{20}+2 \mathrm{mg} ; \\ \mathrm{v}_{1}^{2}&=\mathrm{v}_{2}^{2}-2 \mathrm{~g} \mathrm{~h}\text{ or}\\
		\mathrm{v}_{2}^{2}-\mathrm{v}_{1}^{2}&=2 \mathrm{~g}(40)=80 \mathrm{~g}\\
		\therefore \quad T_{2}-T_{1}&=\frac{80 \mathrm{mg}}{20}+2 \mathrm{~m} \mathrm{~g}=6 \mathrm{mg}
		\end{align*}
	\end{answer}
	\item
	A block of mass $m$ is placed on a smooth wedge of inclination $\theta$. The whole system is accelerated horizontally so that the block does not slip on the wedge. The force exerted by the wedge on the block (g is acceleration due to gravity) will be
	\begin{tasks}(4)
		\task[\textbf{A.}]	$\mathrm{mg} / \cos \theta$
		\task[\textbf{B.}] $\mathrm{mg} \sin \theta$
		\task[\textbf{C.}] $m g \cos \theta$
		\task[\textbf{D.}] $\mathrm{mg}$
	\end{tasks}
	\begin{answer}
		\begin{align}
		N&=m a \sin \theta+m g \cos \theta\\
		\text{also }\mathrm{m} \mathrm{g} \sin \theta&=\mathrm{m} \operatorname{a} \cos \theta\label{pq06}\\
		\text{from }(\ref{pq06}) a&=g \tan \theta\notag\\
		\therefore \mathrm{N}&=\mathrm{mg} \frac{\sin ^{2} \theta}{\cos \theta}+\mathrm{mg} \cos \theta\notag\\
		\text{or }N&=\frac{m g}{\cos \theta}\notag
		\end{align}
		\begin{figure}[H]
			\centering
			\includegraphics[height=4cm,width=4cm]{pq05(s)}
		\end{figure}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item The coefficient of static friction, $\mu_{\mathrm{s}}$, between block $\mathrm{A}$ of mass $2 \mathrm{~kg}$ and the table as shown in the figure is $0.2$. What would be the maximum mass value of block $\mathrm{B}$ so that the two blocks do not move? The string and the pulley are assumed to be smooth and massless. ( $\left.\mathrm{g}=10 \mathrm{~m} / \mathrm{s}^{2}\right)$
	\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{pq07}
	\end{figure}
	\begin{tasks}(4)
		\task[\textbf{A.}]$0.4 \mathrm{~kg}$
		\task[\textbf{B.}] $4.0 \mathrm{~kg}$
		\task[\textbf{C.}] $2.0 \mathrm{~kg}$
		\task[\textbf{D.}] $0.2 \mathrm{~kg}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\mathrm{m}_{\mathrm{B}} \mathrm{g}&=\mu_{\mathrm{s}} \mathrm{m}_{\mathrm{A}} \mathrm{g} \quad\left\{\because \mathrm{m}_{\mathrm{A}} \mathrm{g}=\mu_{\mathrm{s}} \mathrm{m}_{\mathrm{A}} \mathrm{g}\right\}\\
		\Rightarrow \mathrm{m}_{\mathrm{B}}&=\mu_{\mathrm{s}} \mathrm{m}_{\mathrm{A}}\\
		\text{	or }m_{B}&=0.2 \times 2=0.4 \mathrm{~kg}
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item A person of mass $60 \mathrm{~kg}$ is inside a lift of mass $940 \mathrm{~kg}$ and presses the button on control panel. The lift starts moving upwards with an acceleration $1.0 \mathrm{~m} / \mathrm{s}^{2}$. If $\mathrm{g}=10 \mathrm{~ms}^{-2}$, the tension in the supporting cable is
	\begin{tasks}(4)
		\task[\textbf{A.}]$8600 \mathrm{~N}$
		\task[\textbf{B.}] $9680 \mathrm{~N}$
		\task[\textbf{C.}] $11000 \mathrm{~N}$
		\task[\textbf{D.}]  $1200 \mathrm{~N}$
	\end{tasks}
	\begin{answer}$\left. \right. $
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=4cm]{pq06(s)}
		\end{figure}
		\begin{align*}
		\text{	Total mass }&=(60+940) \mathrm{kg}=1000 \mathrm{~kg}
		\intertext{Let $\mathrm{T}$ be the tension in the supporting cable, then}
		\mathrm{T}-1000 \mathrm{~g}&=1000 \times 1\\
		\Rightarrow \mathrm{T}&=1000 \times 11=11000 \mathrm{~N}
		\end{align*}
		So the correct answer is \textbf{Option (C)}
	\end{answer}
	\item A given object takes $\mathrm{n}$ times as much time to slide down a $45^{\circ}$ rough incline as it takes to slide down a perfectly smooth $45^{\circ}$ incline. The coefficient of kinetic friction between the object and incline is given by
	\begin{tasks}(4)
		\task[\textbf{A.}]$\left(1-\frac{1}{n^{2}}\right)$
		\task[\textbf{B.}] $\frac{1}{1-\mathrm{n}^{2}}$
		\task[\textbf{C.}] $\sqrt{\left(1-\frac{1}{n^{2}}\right)}$
		\task[\textbf{D.}] $\sqrt{\left(\frac{1}{1-\mathrm{n}^{2}}\right)}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\text{	We have }\sqrt{\frac{2 s}{g(\sin \theta-\mu \cos \theta)}}&=n \sqrt{\frac{2 s}{g \sin \theta}}\\
		\frac{2 s}{g(\sin \theta-\mu \cos \theta)}&=\frac{2 s \times n^{2}}{g \sin \theta}\\
		\text{here }\theta&=45^{\circ} \Rightarrow \frac{1}{1-\mu}=\mathrm{n}^{2}\\ \text{ or } \mu&=\left(1-1 / \mathrm{n}^{2}\right)
		\end{align*}
		So the correct answer is \textbf{Option (A)}
	\end{answer}
	\item Two fixed frictionless inclined planes making an angle $30^{\circ}$ and $60^{\circ}$ with the vertical are shown in the figure. Two blocks A and $B$ are placed on the two planes. What is the relative vertical acceleration of $A$ with respect to $B$ ?
	\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5.5cm]{pq091}
	\end{figure}

	\begin{answer}
		\begin{align*}
		m g \sin \theta&=m a\\
		\therefore a&=g \sin \theta\\
		&\text{where a is along the inclined plane}\\
		\therefore&\text{vertical component of acceleration is $g \sin ^{2} \theta$}\\
		\intertext{Then the  relative vertical acceleration of $\mathrm{A}$ with respect to $\mathrm{B}$ is}
		g\left(\sin ^{2} 60-\sin ^{2} 30\right]&=\frac{g}{2}\\&=4.9 \mathrm{~m} / \mathrm{s}^{2}\quad
		(\text{in vertical direction})
		\end{align*}
	\end{answer}
\end{enumerate}

Classical Mechanics  -CSIR/chapter/Newton's law and dynamical system.tex


% --------------------------------------------------------------
%
% Should be compiled by XeLatex
%
% --------------------------------------------------------------

\documentclass[12pt]{article}
 \usepackage[noindent]{ctex}
\usepackage{xeCJK}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[english]{babel} %Castellanización
%\usepackage[T1]{fontenc} %escribe lo del teclado
\usepackage[utf8]{inputenc} %Reconoce algunos símbolos
\usepackage{lmodern} %optimiza algunas fuentes
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage{hyperref} % Uso de links
\usepackage{url}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}

 \if0
\newenvironment{theorem}[2][Theorem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{lemma}[2][Lemma]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{exercise}[2][Exercise]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{problem}[2][Problem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{question}[2][Question]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{corollary}[2][Corollary]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\fi

\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}

\begin{document}

% --------------------------------------------------------------
%                         Should be compiled by XeLatex
% --------------------------------------------------------------

\title{\textbf{Homework 3: Recurrent Neural Networks}}
\author{Student Name: \hspace{2in} Student ID:\\ Sun Yat-sen University}

\date{}
\maketitle
%\small
\section{\begingroup \large Exercise 1: Backpropagation through Time \endgroup}
\noindent Consider the RNN (Recurrent Neural Network) in Figure~\ref{fig:rnn}:
\begin{figure*}[h]
\label{fig:rnn}
\centering
\includegraphics[scale=1.2]{rnn.pdf}
\vspace{-1em}
\caption{A recurrent neural network.}
\end{figure*}

\noindent Each state $h_t$ is given by:
\begin{equation*}
h_t = \sigma(W h_{t-1} + U x_t), \text{where } \sigma(z) =\frac{1}{1+\exp(-z)} \,.
\end{equation*}
Let $L$ be a loss function defined as the sum over the losses $L_t$ at every time step until time $T$: $L=\sum_{t=0}^T L_t$, where $L_t$ is a scalar loss depending on $h_t$.

In the following, we want to derive the gradient of this loss function with respect to the parameter $W$.

(a) Suppose we have $y=\sigma(Wx)$ where $y\in \mathbb{R}^n, x\in \mathbb{R}^d$ and $W \in \mathbb{R}^{n \times d}$. Derive the Jacobian $\frac{\partial y}{\partial x} = \mathrm{diag}(\sigma') W \in \mathbb{R}^{n \times d}$.

(b) Derive the quantity $\frac{\partial L}{\partial W} = \sum_{t=0}^T \sum_{k=1}^t \frac{\partial L_t}{\partial h_t} \frac{\partial h_t}{\partial h_k} \frac{\partial h_k}{\partial W}$.

\section{\begingroup \large Exercise 2: Vanishing/Exploding Gradients in RNNs \endgroup}

\noindent In this exercise, we want to understand why RNNs (Recurrent Neural Networks) are especially prone to the Vanishing/Exploding Gradients problem and what role the eigenvalues of the weight matrix play. Consider part (b) of exercise 1 again.

(a) Write down $\frac{\partial L}{\partial W}$ as expanded sum for $T = 3$. You should see that if we want to backpropagate through $n$ ￼timesteps, we have to multiply the matrix $\mathrm{diag}(\sigma')W$ $n$ times with itself.

(b) Remember that any diagonalizable (square) matrix $M$ can be represented by its eigendecomposition $M=Q\Lambda Q^{-1}$  where $Q$ is a matrix whose $i$-th column corresponds to the $i$-th eigenvector of $M$ and $\Lambda$ is a diagonal matrix with the corresponding eigenvalues placed on the diagonals. Recall that every eigenvector $v_i$ satisfies this linear equation $M v_i = \lambda_i v_i$, where $\lambda_i = \Lambda_{ii}$ is an eigenvalue of $M$. Proof by induction that for such a matrix the product $\prod_{i=1}^n M$ can be represented as: $M^n = Q \Lambda^n Q^{-1}$.

(c) Consider the weight matrix $\begin{bmatrix} 0.58 & 0.24 \\ 0.24 & 0.72 \end{bmatrix}$. Its eigendecomposition is:
\begin{equation*}
W = Q \Lambda Q^{-1} = \begin{bmatrix} 0.8 & -0.6 \\ 0.6 & 0.8 \end{bmatrix} \begin{bmatrix} 0.4 & 0 \\ 0 & 0.9 \end{bmatrix} \begin{bmatrix} 0.8 & 0.6 \\ -0.6 & 0.8 \end{bmatrix}
\end{equation*}
Calculate $W^{30}$. What do you observe? What happens in general if the absolute value of all eigenvalues of $W$ is smaller than $1$? What happens if the absolute value of any eigenvalue of $W$ is larger than $1$? What if all eigenvalues are $1$?

\section{\begingroup \large Exercise 3: LSTMs \endgroup}

 \noindent Recall the elements of a module in an LSTM and the corresponding computations, where $\odot$ stands for pointwise multiplication. For a good explanation on LSTMs you can refer to \url{http://colah.github.io/posts/2015-08-Understanding-LSTMs/}. Consider the LSTM in Figure~2.
 \begin{figure*}[!t]
\label{fig:lstms}
\centering
\includegraphics[scale=1.0]{lstm}
\vspace{-1em}
\caption{A Long Short Term Memory network.}
\end{figure*}

 (a) What do the gates $f_t$, $i_t$ and $o_t$ do?

 (b) Which of the quantities next to the figure are always positive?

 \noindent Let’s now try to understand how this architecture approaches the vanishing gradients problem. To calculate the gradient $\frac{\partial L}{\partial \theta}$, where $\theta$ stands for the parameters $(W_f, W_o, W_i, W_c)$, we now have to consider the cell state $C_t$ instead of $h_t$. Like $h_t$ in normal RNNs, $C_t$ will also depend on the previous cell states $C_{t-1}, \ldots, C_0$, so we get a formula of the form:
 \begin{equation*}
 \frac{\partial L}{\partial W} = \sum_{t=0}^T \sum_{k=1}^t \frac{\partial L}{\partial C_t} \frac{\partial C_t}{\partial C_k} \frac{\partial C_k}{\partial W},
 \end{equation*}
 where note that the real formula is a bit more complicated since $C_t$ also depends on $f_t$, $i_t$ and $\widetilde{C}_t$, which in turn all depend on $W$, but this can be neglected.

 (c) We know that $\frac{\partial C_t}{\partial C_k} = \prod_{i=k+1}^t \frac{\partial C_t}{\partial C_{t-1}}$. Let $f_t=1$ and $i_t=0$ such that $C_t = C_{t-1}$ for all $t$. What is the gradient $\frac{\partial C_t}{\partial C_k}$ in this case?

\end{document}


\chapter{High Dimensional Problems}
In observational studies we usually have  observed predictors or covariates
$X_1,X_2,\dots,X_p$ and a response variable $Y$. A scientist is
interested in the relation between the covariates and the response, a
statistician summarizes the relationship with
\begin{equation}
\label{regdef}
E(Y|X_1,\dots,X_p) = f(X_1,\dots,X_n)
\end{equation}
Knowing the above expectation helps us
\begin{itemize}
\item understand the process producing $Y$
\item assess the relative contribution of each of the predictors
\item predict the $Y$ for some set of values $X_1,\dots,X_n$.
\end{itemize}

One example is the air pollution and mortality data. The response
variable $Y$ is daily mortality counts. Covariates that are measured
are daily
measurements of particulate air pollution $X_1$, temperature $X_2$,
humidity $X_3$, and other pollutants $X_4$,\dots,$X_p$.

Note: In this particular example we can consider the past
as covariates. GAM is more appropriate for data for which this doesn't
happen.

In this section we will be looking at a diabetes data set which comes
from a study of the factors affecting patterns in insulin-dependent
diabetes mellitus in children.  The objective was to investigate the
dependence of the level of serum C-peptide on various other factors in
order to understand the patterns of residual insulin secretion. The
response measurements $Y$ is the logarithm of C-peptide concentration
(mol/ml) at diagnosis, and the predictor measurements are age and base
deficit, a measurement of acidity.

A model that has the form of (\ref{regdef}) and is often used is
\begin{equation}
\label{guasreg}
Y = f(X_1,\dots,X_n) + \varepsilon
\end{equation}
with $\varepsilon$ a random error with mean 0 and variance $\sigma^2$
independent from all the $X_1,\dots,X_p$.

Usually we make a further assumption, that $\varepsilon$ is normally
distributed. Now we are not only saying something about the
relationship between the response and covariates but also about the
distribution of $Y$.

Given some data, ``estimating'' $f(x_1,\dots,x_n)$ can be
``hard''. Statisticians like to make it easy assuming a linear
regression model
\[
f(X_1,\dots,X_n)  = \alpha + \beta_1 X_1 + \dots + \beta_p X_p
\]
This is useful because it
\begin{itemize}
\item is very simple
\item summarizes the contribution of each predictor with one
  coefficient
\item provides an easy way to predict $Y$ for a set of covariates
$X_1,\dots,X_n$.
\end{itemize}

It is not common to have an observational study with continuous
predictors where there is ``science'' justifying this model. In many
situations it is more useful to let the data ``say''  what the regression
function is like. We may want to stay away from linear regression
because it forces linearity and we may never see what
$f(x_1,\dots,x_n)$ is really like.

In the diabetes example we get the following result:

\centerline{\epsfig{figure=Plots/plot-07-01.ps,angle=270,width=.8\textwidth}}

So does the data agree with the fits? Let's see if a ``smoothed''
version of the data agrees with this result.

But how do we smooth? Some of the smoothing procedures we have
discussed may be generalized to cases where we have multiple covariates.

There are ways to define
splines so that $g: I \subset {\mathbb R}^p \rightarrow \mathbb R$. We
need to define knots in $I \subset {\mathbb R}^p$  and restrictions on the multiple partial
derivative which is difficult but can be done.

It is much easier to generalize loess. The only difference is that
there are many more polynomials to choose from:
$\beta_0, \beta_0 + \beta_1 x, \beta_0 + \beta_1 x + \beta_2 y,
\beta_0 + \beta_1 x + \beta_2 y + \beta_3 xy, \beta_0 + \beta_1 x +
\beta_2 y + \beta_3 xy + \beta_4 x^2$, etc...

This is what we get when we fit local planes and use 15\% and 66\% of
the data.
\begin{tabular}{cc}
\epsfig{figure=Plots/plot-07-02.ps,angle=270,width=.5\textwidth}&
\epsfig{figure=Plots/plot-07-03.ps,angle=270,width=.5\textwidth}
\end{tabular}
However, when the number of covariates is larger than 2 looking at
small ``balls'' around the target points becomes difficult.

Imagine we have equally spaced data and that each covariate is in
$[0,1]$. We want to fit loess using
$\lambda \times 100 \%$ of the data in the local fitting. If we have
$p$ covariates and we are forming $p-dimensional$ cubes, then each
side of the cube must have size $l$ determined by $l^p = \lambda$. If
$\lambda=.10$ (so its supposed to be very
local) and $p=10$ then $l = .1^{1/10} = .8$. So it really isn't
local!  This is known as {\it the curse of dimensionality}.

\input{section-07-01}
\input{section-07-02}
\input{section-07-03}


\section{Problem in Neural Network}
\label{sec:Problem}

Though neural network is able to achieve numerous back breaking tasks, it is
fairly challenging to well train a neural network. Among all the difficulties,
gradient explosion and vanishing is the most famous one. In this section, we
will discuss a few problems in training a neural network.

\subsection{Explosion and Vanishing}
Intuitively, using the computation like
$ Z^{[l]} = W^{[l]}A^{[l-1]} $ and
$ dA^{[L-1]} = W^{[L-1]T}dZ^{[L]} $ in FP and BP, if $ W $ is much larger
than 1 or much smaller than 1, after several multiplication in the deep
neural network the final result $ Z^{[l]} = \prod\limits_{l=1}^LW^{[l]}A^{[0]} $
will gradually tend to be infinity or zero. Here we further illustrate
the explosion and vanishing with a simple problem from \parencite{shamir2018exponential}:

\begin{exmp}
    Suppose there is only one parameter $ w $.
    for a data set $\{x,\ y\}$ and a special architecture,
    the cost function is:
    \begin{equation}
        J(w) = (w^7 + 1)^2
    \end{equation}
    The plot of $J(w)$ is illustrated in \autoref{fig:exmp1}. The global
    minimum $ w^* = -1 $, a basin exists in the region of $ [-1.05,\ -0.95] $.
    But in the region of $ [-\infty,\ -1.05],\ [1.05,\ \infty] $, $ J(w) $
    is extremely steep, which is the explosion, and in the region of
    $ [-0.95,\ 1.05] $, $ J(w) $ is unusually flat, which is the vanishing.
    If the initial value $ w_0 $ falls into the basin, GD will converge
    quickly. If not, let's say $ w_0 = 0.5 $, then it would be terrible to
    traverse through the plateau with a tiny update in each iteration.
\end{exmp}

\begin{figure}[H]
    \centering
    \includegraphics[width=10cm]{exmp1}
    \caption{\label{fig:exmp1}Plot of $ J(w) = (w^7 + 1)^2 $}
\end{figure}

\subsection{Saddle Points in Non-convex Optimization}
Though there seems to be no rigorous proof of the prevalence of saddle points
in high dimensional non-convex optimization, one line of the evidence
is carried out astonishingly from statistical physics. It suggests that
among a myriad of critical points, most are likely to be saddle points.
To understand the landscape in the neural network optimization, we first
introduce the Hessian Matrix to pave the way for further discussion.

\subsubsection{Hessian Matrix}
\begin{defn}
    \label{def:Hessian}
    Suppose $ f: \mathbb{R}^n\rightarrow R $, all second partial derivatives
    of $ f $ exist and are continuous over the domain. The Hessian Matrix
    $ \mathbf{H} \in \mathbb{R}^{n\times n} $ of $ f $ is defined and arranged
    as follow:
    \begin{equation}
        \mathbf{H} =
        \begin{pmatrix}
            \frac{\partial^2f}{\partial x_1^2} & \frac{\partial^2f}{\partial x_1\partial x_2} & \cdots & \frac{\partial^2f}{\partial x_1\partial x_n} \\
            \frac{\partial^2f}{\partial x_2\partial x_1} & \frac{\partial^2f}{\partial x_2^2} & \cdots & \frac{\partial^2f}{\partial x_2\partial x_n} \\
            \vdots & \vdots & \ddots & \vdots \\
            \frac{\partial^2f}{\partial x_n\partial x_1} & \frac{\partial^2f}{\partial x_n\partial x_2} & \cdots & \frac{\partial^2f}{\partial x_n^2}
        \end{pmatrix}
    \end{equation}
    If the second partial derivatives are continuous, then the order of partial
    derivatives does not matter. Thus, $ \mathbf{H} $ is a symmetric matrix.
\end{defn}

\par Since the Hessian Matrix is symmetric, the eigenvalues are real numbers,
i.e. $ \lambda_i \in R $. For a cost function $ J(\theta) $, where
$ \theta \in \mathbb{R}^n $ represents the high dimensional variable. The
properties of critical points\footnote{Critical points are points
$ \theta $ where $ \nabla J(\theta) = 0 $. } can be described by the eigenvalues
of the Hessian.
\begin{enumerate}
    \item If $ \forall \lambda_i \in R^+ $, i.e. Hessian is positive definite, then the critical point is a local minimum.
    \item If $ \forall \lambda_i \in R^- $, i.e. Hessian is negative definite, then the critical point is a local maximum.
    \item If $ \forall \lambda_i \neq 0 $, some are positive and others are negative,
        then the critical point is a (horse) saddle point with min-max structure.
    \item If Hessian matrix is singular, i.e. $ |\mathbf{H}| = 0 $, then
        the critical point is called degenerate critical point and it is
        a monkey saddle point.
\end{enumerate}

\begin{figure}[ht]
    \centering
    \subfigure[local minimum]{
        \begin{minipage}[t]{0.5\linewidth}
        \centering
        \includegraphics[width=6cm]{minimum.png}
        \end{minipage}%
    }%
    \subfigure[local maximum]{
        \begin{minipage}[t]{0.5\linewidth}
        \centering
        \includegraphics[width=6cm]{maximum.png}
        \end{minipage}%
    }%

    \subfigure[horse saddle point]{
        \begin{minipage}[t]{0.5\linewidth}
        \centering
        \includegraphics[width=6cm]{horse.png}
        \end{minipage}%
    }%
    \subfigure[monkey saddle point]{
        \begin{minipage}[t]{0.5\linewidth}
        \centering
        \includegraphics[width=6cm]{monkey.png}
        \end{minipage}%
    }%
    \centering
    \caption{\label{fig:activation}Different types of critical point}
\end{figure}

\subsubsection{The Prevalence of Saddle Points}
\label{sssec:Saddle}
In the early version of neural network algorithms, parameters are initialized
with standard Gaussian noise. The article by Bray et al. \parencite{bray2007statistics}
computes the average number of critical points of a Gaussian distribution
on a high dimensional space. They derive the distribution of critical points
with a relation between $ \alpha $ and $ \epsilon $, where $ \alpha $ is
the fraction of negative eigenvalues of the Hessian at the critical points,
$ \epsilon $ is the error at the critical points. In a Gaussian field $ \phi $
defined over volume $ V $ of an N-dimensional Euclidean space. The normalized
density of eigenvalues defined as:
\begin{equation}
    \rho(\lambda) = \frac{1}{N}\sum\limits_{i=1}^N\delta(\lambda-\lambda_i)
\end{equation}
The average of eigenvalues is defined as:
\begin{equation}
    \bar(\lambda)=\int \lambda\rho(\lambda) d\lambda
\end{equation}
And it can be computed via:
\begin{equation}
    \bar{\lambda}(\epsilon)=2 \frac{f^{\prime}(0) \epsilon}{f^{\prime \prime}(0) P}
\end{equation}
where $ P $ is defined as follow:
\begin{equation}
    P=\frac{f^{\prime}(0)^{2}}{f^{\prime \prime}(0)^{2}}+\frac{f(0)}{f^{\prime \prime}(0)}\left(1-\frac{2}{N}\right) \approx \frac{f^{\prime}(0)^{2}}{f^{\prime \prime}(0)^{2}}+\frac{f(0)}{f^{\prime \prime}(0)}
\end{equation}
Finally, the relation between $ \alpha $ and $ \epsilon $ is given by:
\begin{equation}
    \frac{2}{\pi} \int_{\frac{\bar{\lambda}}{2 \sqrt{f^{\prime \prime}(0)}}}^{1} (1-u^{2})^{\frac{1}{2}}du=\alpha
\end{equation}
where $ u $ just a temporary variable in the integration computation.
\par In the $ \epsilon-\alpha $ graph, there is a global minimum at
$ \alpha = 0,\ \epsilon = \epsilon_{min} $ and
a global maximum at $ \alpha = 1,\ \epsilon = \epsilon_{max} $. Other
critical points a located on a monotonically increasing curve as $ \alpha $
ranges from 0 to 1. Some experiments validating such proposal is finished
by Dauphin et al. \parencite{dauphin2014identifying} in \autoref{fig:aevalidation}.
This implies that local minimums, i.e. critical points
that $ \alpha\rightarrow 0 $, are more closer to global minimum, while
the majority of critical points that have high error are likely to have
a large percentage of negative eigenvalues, i.e. most of critical points
are saddle points.

\begin{figure}[H]
    \centering
    \includegraphics[width=14cm]{aevalidation}
    \caption{\label{fig:aevalidation}(a) and (c) show how critical points
    are distributed in the $ \epsilon-\alpha $ plane. (b) and (d) plot the
    distributions of eigenvalues of the Hessian at three different
    critical points.}
\end{figure}

\subsection{Learning Rate Selection}
The choice of stepsize has long been a puzzle to practitioners in neural
networks. In fact, it is not peculiar to GD but a common problem in optimization.
If the learning rate is too large, with high probability GD will diverge. If
learning rate is too small, the time GD takes to converge is unbearable.
In practice, the most widely used scheme is setting learning rate as a small
constant like 0.1 or 0.01. The drawback of such scheme is obvious: it does not
guarantee the convergence of GD.
\par First we review the general optimization problem:
\begin{align*}
    x_{k+1} = x_{k} - \alpha_k d_k
\end{align*}
We list other commonly used scheme in the following.

\subsubsection{Goldstein Rule}
Goldstein rule is the first effective rule for stepsize selection in
general optimization problem that does not depend on linear minimization.
Let $ \sigma \in (0,\ 0.5),\ \alpha_k $ satisfied:
\begin{equation}
    \sigma \leq \frac{f\left(x^{k}+\alpha^{k} d^{k}\right)-f\left(x^{k}\right)}{\alpha^{k} ||d^{k}||^2} \leq 1-\sigma
\end{equation}

\subsubsection{Armijo Rule}
\label{sssec:Armijo}
It is natural to devise a scheme that successively reduce $ \alpha $, when
$ f(x_{k+1}) < f(x_k) $ is not satisfied. The Armijo rule is exactly based
on the this devisal. Here, let $ s \in R,\ \beta,\ \sigma \in [0,\ 1],\
\alpha_k=\beta^{m_k}s $, where $ m_k $ is the first nonnegative integer
satisfies:
\begin{equation}
    f(x_{k}) - f(x_{k} - \beta^{m_k}sd_k) \geq -\sigma\beta^{m_k}s\nabla ||d_k||^2
\end{equation}
\par Usually $ \sigma \in [10^{-5},\ 10^{-1}],\ \beta \in [0.1,\ 0.5],\ s=1 $.

\subsubsection{Diminishing Learning Rate}
During the process of optimization, we let $ \alpha_k\rightarrow 0 $.
The primary downside of such scheme is that after multiple iterations
the stepsize may be too small to descent. So an additional requirement
is added:
\begin{equation}
    \sum\limits_{k=0}^\infty\alpha_k = \infty
\end{equation}


\documentclass[12]{scrartcl}
\usepackage{amssymb,amsmath,gensymb,dsfont,calc,multicol,fullpage}
\makeatletter
\newcommand\Aboxed[1]{
   \@Aboxed#1\ENDDNE}
\def\@Aboxed#1&#2\ENDDNE{%
   &
   \settowidth\@tempdima{$\displaystyle#1{}$}
   \setlength\@tempdima{\@tempdima+\fboxsep+\fboxrule}
   \kern-\@tempdima
   \boxed{#1#2}
}
\makeatother

\begin{document}

\title{Homework 14, Section 2.5: 12, 19, 24}
\author{Alex Gordon}
\date{\today}
\maketitle
\section*{Homework}
\subsection*{12.}
$ \begin{bmatrix} 1&0&0 \\ 2&1&0 \\ -3&2&1 \end{bmatrix}$
\subsection*{19.}
The equation is the Schur complement on the system matrix. $W(s) = I_m - C(A - sI_n)^{-1}B$
\subsection*{24.}
Since $Q$ is a square and  $Q^T Q = 1$, $Q$ then we know that Q is invertible. Using the invertible matrix theorem, it can be derived that $A$ is the product of invertible matrices and hence is invertible. We now know that in the equation $Ax = b$, that there is a unique solution for all $b$. As far as what computations with Q and R will produce the answer, I think that computer $bQ^t$ and then row reducing $RQ^Tb$ will produce the proper reduction.

\end{document}