\documentclass[fleqn,11pt,draft]{article}

\usepackage{amsmath,amsfonts,amssymb,graphicx}
 
\usepackage{wrapfig}





 \def\Ebox#1#2{%
 \begin{center}
\includegraphics[width=#1\hsize]{#2}
 \end{center}
 }


\newcounter{arabnum}
\newenvironment{arabnum}{\begin{list}{{\upshape \arabic{arabnum}.\ }}{\usecounter{arabnum}
\setlength{\leftmargin}{24pt}
\setlength{\rightmargin}{8pt}
\setlength{\itemindent}{-1pt}
}}{\end{list}}

     
\newcounter{rmnum}
\newenvironment{romannum}{\begin{list}{{\upshape (\roman{rmnum})}}{\usecounter{rmnum}
\setlength{\leftmargin}{24pt}
\setlength{\rightmargin}{8pt}
\setlength{\itemindent}{-1pt}
}}{\end{list}}

\newcounter{anum}
\newenvironment{alphanum}{\begin{list}{{\upshape (\alph{anum})}}{\usecounter{anum}
\setlength{\leftmargin}{24pt}
\setlength{\rightmargin}{8pt}
\setlength{\itemindent}{-1pt}
}}{\end{list}}




\setlength{\parindent}{0in}
\pagestyle{empty}

\setlength{\textheight}{8.5in}
\setlength{\textwidth}{6in}
\setlength{\parsep}{.15in}
\setlength{\oddsidemargin}{.1in}
 
\setlength{\topmargin}{-.5cm}

 
  
\def\subhead#1{\smallskip\subparagraph{#1}} 

\def\head#1{\subsection*{#1}}
 

\def\clA{{\cal A}}


\def\clN{{\cal N}}
 

\begin{document}

\null\vspace{-1.75cm}

{\Large
{\bf ECE 486 \hfill Assignment \#  2}

\vspace{.15in}
Issued:  January 25 \hfill Due:  February 1, 2024}
\rule{6in}{.01in}

\vspace*{.1cm}
 

\head{Reading Assignment:} 
\textbf{FPE},  Section 3.1.

\head{Problems:}

\begin{arabnum}
\setcounter{arabnum}{0}  

%#1 
\item
\begin{romannum}
\item 
Compute \textit{by hand} the Laplace transforms $F_i={\cal L}(f_i)$ of
\[
f_1(t)   = \sin(  2t) \ \text{(recall Euler's formula)}
 \qquad 
 f_2(t) =e^{-  3t}
  \qquad 
 f_3(t) = \sin(  2t) + e^{-  3t}
\] 

\item   Use the Final Value Theorem to compute $\lim_{t\to\infty} f_i(t)$ in each case based on the transform $F_i(s)$.  In which cases is the theorem valid?
\end{romannum}




 %#2 
\item Consider the following transfer functions:
\[
H_1(s) = \frac{2}{s+4}, \qquad H_2(s) = \frac{2}{s-4}
\]
Compute \textit{by hand} the step responses (i.e.,  the input is unity for $t\ge 0$, with zero initial conditions) of $H_1$ and $H_2$. Are their steady-state responses to the unit step function equal to the DC gains? 

\item Consider the following transfer functions:
\[
	H_1(s) = \frac{1}{s^2 - s + 2}, \qquad H_2(s) = \frac{s-3}{s^2 + 5s + 6}
\]
\begin{romannum}
	\item Use the Final Value Theorem to compute their DC gains.
	\item Use the MATLAB command {\tt step} to plot their step responses. (You may also find the command {\tt ltiview} convenient to use for such tasks.) Submit your plots.
	\item In each case, explain whether the Final Value Theorem gives the right result, and why.
\end{romannum}

\item The diagram below shows a balance system consisting of an inverted pendulum mounted on a cart. An external force $F$ is applied to the cart in the horizontal direction.
\Ebox{.4}{inverted_pendulum.pdf}
It can be shown that the angle $\theta$ and the force $F$ are related through the following ODE:\footnote{You don't have to derive it, but it's fun to try!}
$$
\ddot{\theta} +\frac{\gamma}{J}\dot{\theta} - \frac{mg\ell}{J} \sin \theta - \frac{\ell}{J} F \cos \theta = 0,
$$
where $m$ is the mass of the pendulum, $\ell$ is the distance from the base to the center of mass of the system, $\gamma$ is the coefficient of viscous friction, $J$ is the total angular momentum of the system, and $g$ is the acceleration due to gravity.
\begin{romannum}
	\item Write down a nonlinear state-space model for this balance system with input $u = F$ and output $y = \theta$.
	\item Show that the zero-state/zero-input point is an equilibrium point and linearize the system around it.
	\item For the linear state-space model from part (ii), determine the transfer function $H(s)$.
	
		\textit{Hint:} write out the differential equations, then switch to the $s$-domain using the differentiation rule for Laplace transforms, and use the resulting equations to solve for $Y(s)$ in terms of $U(s)$.
\end{romannum}

\item
Consider the following state-space model (so-called ``observer canonical form''):
	\begin{align*}
		\left(
		\begin{matrix}
			\dot{x}_1 \\ \dot{x}_2
		\end{matrix}
		\right) = \left(
		\begin{matrix}
			0 & -a_0 \\
			1 & -a_1
		\end{matrix}
		\right) \left(
		\begin{matrix}
			x_1 \\ x_2
		\end{matrix}\right) + \left(
		\begin{matrix}
			b_0 \\ b_1
		\end{matrix}\right)u, \qquad
		y = \left( \begin{matrix} 0 & 1 \end{matrix}\right) \left(
		\begin{matrix}
			x_1 \\
			x_2
		\end{matrix}\right).
	\end{align*}
Show that its transfer function is $H(s) = \displaystyle \frac{b_1s + b_0}{s^2 + a_1s + a_0}$.
	
	Hint: write out the differential equations, then switch to the $s$-domain using the differentiation rule for Laplace transforms, and use the resulting equations to solve for $Y(s)$ in terms of $U(s)$.
	
	Now consider another state-space model (so-called ``controller canonical form''):
	\begin{align*}
		\left(
		\begin{matrix}
			\dot{x}_1 \\ \dot{x}_2
		\end{matrix}
		\right) = \left(
		\begin{matrix}
			0 & 1 \\
			-a_0 & -a_1
		\end{matrix}
		\right) \left(
		\begin{matrix}
			x_1 \\ x_2
		\end{matrix}\right) + \left(
		\begin{matrix}
			0 \\ 1
		\end{matrix}\right)u, \qquad
		y = \left( \begin{matrix} b_0 & b_1 \end{matrix}\right) \left(
		\begin{matrix}
			x_1 \\
			x_2
		\end{matrix}\right).
	\end{align*}
	Following the same methodology, show that its transfer function is the same as the one above.
	
	This is meant to demonstrate that the same transfer function can be realized by several different state-space models.
\end{arabnum}
\end{document}



