\documentclass[12pt]{article}
\usepackage{latexsym}
%\input spec_frac
\begin{document}
\title{Help for 316-V, problem 4.1.4}
\maketitle

\section{Problem 4.1.4} Discussion of Resonance: consider the
forced/damped system: 
\[ m y^{\prime\prime} + b y^\prime + ky = \cos{\Omega t} \ . \]
\begin{enumerate}
\item Find the synchronous solution 
$y(t) = A \cos{\Omega t} + B \sin{\Omega t}$
\item Sketch graphs of the coefficients $A$, $B$ as functions of
$\Omega$ for $m=1$, $b = 0.1$, $ k = 25$.
\end{enumerate}
{\bf Solution:}
\begin{enumerate}
\item
We substitute:
\begin{eqnarray*}
y(t) & = & A \cos{\Omega t} + B \sin{\Omega t} \\
y^\prime(t) & = & -\Omega A \sin{\Omega t} + \Omega B \cos{\Omega t} \\
y^{\prime\prime} (t) & = & -\Omega^2 A\cos{\Omega t} - \Omega^2 B \sin{\Omega t}
\end{eqnarray*}
into the ODE:
\begin{eqnarray*}
ky & = & kA \cos{\Omega t} + kB \sin{\Omega t} \\
+  &   & +\\
b\frac{dy}{dt} & = & -b\Omega A \sin{\Omega t} + b\Omega  B \cos{\Omega t} \\
+  &   & + \\
m\frac{d^2y}{dt^2} & = & -m\Omega^2 A \cos{\Omega t} - m\Omega^2  B \sin{\Omega t} \\ 
=  &   & = \\ 
\cos{\Omega t}  & = & ((k-m\Omega^2)A+b\Omega B) \cos{\Omega t} 
+ ( -b\Omega A + (k-m\Omega^2) B) \sin{\Omega t}  
\end{eqnarray*}
from which follows that:
\[ \begin{array}{rrcr}
(k-m\Omega^2) A & + b\Omega  B & = & 1 \\
-b\Omega A & + (k-m\Omega^2) B & = & 0 \end{array} \]
Solving this system we find:
\[ A = \frac{k-m\Omega^2}{(k-m\Omega^2)^2+(b\Omega)^2} \]
\[ B = \frac{b\Omega}{(k-m\Omega^2)^2+(b\Omega)^2} \]
Then, the solution is:
\[ y(t) = \frac{(k-m\Omega^2)\sin{\Omega t}+
                 b\Omega \cos{\Omega t}}{(k-m\Omega^2)^2+(b\Omega)^2} \]
\item We now plot $A$, $B$ as functions of $\Omega$; we give the plot 
using both Maple and Matlab.
\begin{enumerate}
\item {\bf MATLAB}:\\
function rescoeff(m,b,k)\\
\% plots the forced vibration coefficients A,B as functions \\
\% of the forcing frequency Omega \\
Om(1:202) = 0; dOm = 2*sqrt(k/m)/200; \\
for i = 1:201 \\
   a1 = Om(i)*b;  \\
   Om2 = Om(i)*Om(i);  \\
   a2 = k - m*Om2;  \\
   denom = a1*a1 + a2*a2; \\   
   A(i) = a2 / denom;  \\
   B(i) = a1 / denom; \\
   Om(i+1)   = Om(i) + dOm; \\
end \\
subplot(2,1,1) \\
plot(Om(1:201),A,'r-') \\
title(sprintf('graph of A vs. Omega, with Omega0= \%6.2f', sqrt(k/m)))\\
subplot(2,1,2) \\
plot(Om(1:201),B,'b-') \\
title(sprintf('graph of B vs. Omega, with Omega0= \%6.2f', sqrt(k/m)))\\
\item {\bf MAPLE} \\
restart;\\
k:=25:\\
m:=1:\\
b:=.1:\\
A:=Om-$>$(k-m*Om$\wedge$ 2)/((k-m*Om$\wedge$ 2)$\wedge$2+(b*Om)$\wedge$ 2);\\
B:=Om-$>$(b*Om)/((k-m*Om$\wedge$ 2)$\wedge$ 2+(b*Om)$\wedge$ 2);\\
Om0 := evalf(sqrt(k/m));\\
plot(A(Om), Om=0..2*Om0);\\
plot(B(Om), Om=0..2*Om0);\\
\end{enumerate}
\end{enumerate}
\end{document}
