% SIMIODE-TeacherStudent-Template.tex and simiode.cls for LaTeX2e
% Version 22 November 2016.
%
% This template is to be used with the  class file "simiode.cls".
%
% The latest version of this class and template files
% can be found at
%
%       <http://www.SIMIODE.org> in the Author section.
%
% A "Quick Start Guide" appears below.
%
% This file must be processed with version LaTeX2e or higher.
% Appreciation to Mark Frantz, IUPUI; John Thoo, Yuba College; and Eric Sullivan, Carroll College.
%
\documentclass{simiode}
%
% With this version of the tex file and the associated SIMIODE.cls file you can produce BOTH a Student Version and a Teacher Version of your modeling scenario or technique narrative.
%
% Student Version contains the title STUDENT VERSION along with the NAME OF SCENARIO, with no abstract, no keywords, no tags, no author identifiers, and no COMMENTS section. The Student Version contains only the STATEMENT of the modeling scenario only with appropriate figures, data, instructions, and perhaps a bibliography appropriate for student resourcing, but nothing in the bibliography which would "give away" the nature of the modeling scenario, etc.
%
%The Teacher Version contains the material in the Student Version, namely the title NAME OF SCENARIO, now headed with   TEACHER VERSION, but also full author  identification, abstract, key words, tag words, and, following the STATEMENT, a section of COMMENTS which can be discussion of presentation  ideas, "solutions," techniques, etc.
%
% Authors can prepare a full Teacher Version using the notions immediately below  to create a pdf for review, but in review please eliminate all information about the author as we use a double-blind referee system. Such information will be restored when accepted and published in SIMIODE at www.simiode.org.
%
%***********   Toggle the following line to turn the teacher version on (1) or off (0). ***********
%
\def\TeacherEdition{0} % Toggle this line's value.
\newcommand{\teacher}[1]{\ifnum\TeacherEdition=1 #1 \fi}
%
% The \teacher{ } command wraps any text that will appear only in the teacher version of
% the document. See this file for examples. This has been done for you in the document below.
% Rename the pdf after you compile each final version.
%
\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
%\usepackage{hyperref}
\usepackage{url}
\usepackage{exercise}
%
\renewcommand{\baselinestretch}{1.3}
%
% NOTE regarding macros %%
%
% Any macros defined for your paper should be contained in
% the top matter. Likewise, any environment definitions such
% as \newtheorem or \newenvironment should also go in the
% top matter.
%
% Do not \input your macros as separate files within your
% final version because more files make it harder for the
% editors and users to keep track of and/or modify and
% append your paper.
%
% Top matter is above and the beginning of the document below.
%
\begin{document}

\newpage
%
% You only need to change the NAME OF SCENARIO in the next line and delete the footnote.
% See above for instructions on toggling from Teacher Version to Student Version.
%
\title{\ifnum\TeacherEdition=1 TEACHER VERSION
%\footnote{DELETE THIS FOOTNOTE BEFORE SUBMISSION.  In the \TeX \, source code there is a toggle/option to produce a Teacher Version or a Student Version by ``carving'' out with  $\backslash$teacher\{\} that material which should only appear in the Teacher version. See the source code.}
\else STUDENT VERSION \fi\\Dimensionless Variables and \\Scaling for Differential Equations}



\markboth{Dimensionless Variables and Scaling for Differential Equations}{Dimensionless Variables and Scaling for Differential Equations}

\author{Kurt Bryan\\
Department of Mathematics\\
Rose-Hulman Institute of Technology\\
Terre Haute IN  47840 USA\\
\teacher{kurt.bryan@rose-hulman.edu}
}

\makeStitlePDFLaTex


\begin{abstract}

This material introduces the idea of ``rescaling'' for ordinary differential equations (ODE's) by the introduction of dimensionless variables. In practice this is an extremely common and useful prelude to the analysis and solution of ODE's, and yet is not often taught in an introductory course. Most ODE texts do not cover the material, but the benefits of understanding these techniques are myriad: rescaling indicates the appropriate physical scale on which the relevant independent and dependent variables exist, and can help determine conditions under which certain terms in an ODE model can be safely ignored, sometimes leading to great simplification. Proper scaling is also a useful prelude to the numerical solution of ODE's, and can improve the stability and efficiency of numerical methods.

\end{abstract}


\section*{MOTIVATION: A SPRING-MASS PROBLEM}

Consider a classic spring-mass system: a mass of $m$ kilograms is constrained to move
along a line and is attached to a spring; refer to Figure \ref{fig1}, in which the mass moves only
along the horizontal axis (no gravity!)
\begin{figure}[ht]
\centerline{\includegraphics[width=0.7\textwidth]{springmass.jpg}}
\caption{A spring-mass system.}
\label{fig1}
\end{figure}
Hooke's Law models the force $F$ exerted by the spring on the mass as given by
$F=-kx$, where $x$ is the displacement of the mass from equilibrium ($x=0$) and $k>0$ is some constant
that depends on the stiffness of the spring.
Note that in order for $F=-kx$ to balance dimensionally $k$ must have dimensions
of force per distance (since $k=-F/x$). In metric MKS (meters-kilograms-seconds) units $k$ has units
of Newtons per meter or equivalently, kilograms per second squared.

Let us suppose that the spring is the only force acting on the mass, so there is no friction.
From Newton's Second Law we have $F=ma$ where $a$ is the acceleration of the mass. If the position of the mass is given by $x(t)$ then $a=\frac{d^2x}{dt^2}$ and $F = ma$
leads to $-kx(t) = m\frac{d^2x}{dt^2}$ or
\begin{equation}
\label{de1}
m\frac{d^2 x}{dt^2} + kx(t) = 0,
\end{equation}
an ordinary differential equation (ODE).
Typical initial conditions are $x(0)=x_0$ (initial position) and $\frac{dx}{dt}(0)=v_0$ (initial velocity).
\begin{Exercise}
\label{exer1}
Suppose the initial conditions are $x(0)=x_0$ for some $x_0$ and $\frac{dx}{dt}(0)=0$. Show the solution to (\ref{de1}) is then $x(t) = x_0 \cos(t\sqrt{\frac{k}{m}})$, and that
the period of the resulting motion is $P = 2\pi \sqrt{\frac{m}{k}}$. Verify that the quantity $P$ so defined does indeed have the dimension of time.
\end{Exercise}

\section*{CHARACTERISTIC VARIABLE SCALES}

The period $P$ of the spring-mass problem is an important feature of the physical system and is itself of interest, quite apart from the specific form
of the solution. For example, if we want to measure the motion of an actual spring-mass system we should take data on a time scale comparable to $P$, perhaps
$10$ or $20$ measurements per period, to clearly capture the motion of the system. Taking data more often than this might be overkill (if the period
is $3$ seconds it makes little sense to measure the mass position every microsecond.) Or perhaps we want to solve (\ref{de1}) numerically using
Euler's method or something more sophisticated. The time scale of the problem will dictate the size of the time steps we take as we repeatedly
extrapolate the solution forward in time. The time steps should be somewhat smaller than $P$ if we are to track the motion accurately, but making them too small is wasteful.

In the spring-mass problem the period $P$ is proportional to the quantity
\begin{equation}
\label{timescale}
t_c = \sqrt{\frac{m}{k}}.
\end{equation}
Here $t_c$ is the \textit{characteristic time scale} of the problem.
The quantity $t_c$, which does indeed have units of time, provides some indication of how fast the system is changing. For the spring-mass system we found this quantity by writing out the ODE (\ref{de1}), solving, and then finding $P$, but solving is a
luxury we don't always have. However, it's usually possible to find the characteristic time scale for a problem without solving an ODE, or even
writing down an ODE model! And indeed, more complex systems may have
multiple time scales---different features of the physical system may change at different rates. Moreover, time isn't the only scale of interest. A system may have a characteristic length, or mass, or other physical dimension.
\section*{A BIT OF DIMENSIONAL ANALYSIS}

Let's go back and find the time scale of the spring-mass system without solving or even writing down an ODE. First, we'll use ``$M$'' to denote the physical dimension of mass (not tied to any system units), ``$T$'' to denote the dimension of time, and ``$L$'' to denote length. The mass $m$ in the spring-mass system has physical dimension $M$ (duh!), which we'll indicate by writing $[m] = M$.
From $F = ma$ and the fact that $[a] = LT^{-2}$ (acceleration has units of length per time squared) we find that $[F] = MLT^{-2}$. This means that
the spring constant $k$ has dimensions $[F/x] = MLT^{-2}L^{-1}$ or $[k] = MT^{-2}$.

The characteristic time scale of the spring-mass system ought to depend on the values of $k$ and $m$, and in fact a simple hypothesis is that
\begin{equation}
\label{chartime}
t_c = k^{a} m^{b}
\end{equation}
for some numbers $a$ and $b$. Since $[t_c] = T$ we must choose $a$ and $b$ so that the right side of (\ref{chartime}) has the dimension of time.
Using $[m] = M$ and $[k]=MT^{-2}$, the right side of (\ref{chartime}) has dimension
$$
[k^{a} m^{b}] = (MT^{-2})^a M^b = M^{a+b}T^{-2a}.
$$
Since both sides of (\ref{chartime}) must have dimension $T$ we need
\begin{align*}
a+b & = 0\\
-2a & = 1.
\end{align*}
This yields $a = -1/2$ and $b = 1/2$. From (\ref{chartime}) we conclude that $t_c = k^{-1/2} m^{1/2} = \sqrt{m/k}$. This is what we found in equation
(\ref{timescale})!

\begin{Exercise}
\label{exer2}
A pendulum of length $R$ swings without friction in an environment with gravitational acceleration $g$. The mass of the bob at the end of the pendulum is $m$.
Let $t_c$ denote the characteristic time scale for the problem and suppose that
$$
t_c = R^{a} g^{b} m^{c}
$$
for constants $a,b,c$.
Find the dimension of each of $R,g,$ and $m$, and show that the characteristic time scale for this problem is given by $t_c = \sqrt{R/g}$ (and so the time scale does not depend on the mass of the bob, already a valuable piece of information!) Note that you don't actually need to use the ODE that governs a swinging pendulum.
\end{Exercise}

\begin{Exercise}
\label{exer3}
Consider a damped spring-mass system with mass $m$, spring constant $k$, and in which the frictional force on the mass is given by $-\mu x'(t)$ for some positive constant $\mu$. The appropriate ODE is
   \begin{equation}
   \label{damped}
    m\frac{d^2x}{dt^2} + \mu \frac{dx}{dt} + kx(t) = 0
    \end{equation}
    with some initial conditions.
Show that $[\mu]=MT^{-1}$ (use the fact that $\mu x'(t)$ has the dimension force). If
$$
t_c = k^{a} m^{b} \mu^{c}
$$
show that we need
\begin{align*}
a+b+c & = 0\\
-2a - c & = 1
\end{align*}
and that any solution is of the form
$$
a = b-1,\;\;\;c = 1-2b
$$
where $b$ can be chosen arbitrarily. As a result, any characteristic time scale must be of the form
\begin{equation}
\label{tcgen}
t_c = k^{b-1} m^b \mu^{1-2b} = \frac{\mu}{k}\left ( \frac{mk}{\mu^2} \right )^b
\end{equation}
for some $b$.
Note that the parenthesized expression $mk/\mu^2$ is dimensionless.
Equation (\ref{tcgen}) shows that there are infinitely many possible time scales!
\end{Exercise}

\begin{Exercise}
\label{exer4}
We can nail down a specific physically relevant time scale by choosing a value for $b$ in (\ref{tcgen}); different choices highlight
different time scales on which the phenomena evolves. Show that the choice $b=1/2$
in (\ref{tcgen}) yields the previous time scale $t_c = \sqrt{m/k}$ that captures the period of the motion.
\end{Exercise}

\begin{Exercise}
\label{exer5}
How about a time scale that involves the damping constant $\mu$? This could give insight into the rate at which the solution decays, rather than oscillates.
It makes intuitive sense that as $\mu$ gets larger, the motion of the mass should damp to zero faster (though it never really gets there), so let's look for a time scale
in which $\mu$ appears to a negative power.  Show that the choice $b=1$ in (\ref{tcgen}) yields another time scale $t'_c = m/\mu$.

To gain some insight into how $t'_c$ relates to the solution, take $m=1,\mu=0.1,k=1$ and solve the ODE (\ref{damped}) with $x(0)=1,x'(0)=0$ (analytically or numerically)
and then plot the solution from $t=0$ to $t=200$;
the solution should substantially decay to zero by around $t=100$. Compare this to the value of $m/\mu$. Then redo the computation but change the damping to $\mu=0.2$. How long does it take the solution to decay
to a comparable level now, and how does it relate to $m/\mu$? Try $\mu=0.5$ and $\mu=1$, and compare $m/\mu$ to the decay time of the solutions. In plain English, what does the time scale $m/\mu$ quantify here?
\end{Exercise}

\begin{Exercise}
\label{exer6}
Consider the ODE (\ref{damped}) with initial conditions $x(0)=x_0$ and $\frac{dx}{dt}(0)=0$. We now seek a characteristic length scale $x_c$ for this problem, something of the form
$$
x_c = k^{a} m^{b} \mu^{c} x_0^{d}.
$$
Given that $[x_0] = L$, show that anything of the form
$$
x_c = k^{b} m^b \mu^{-2b} x_0 = x_0\left (\frac{mk}{\mu^2}\right )^b
$$
has dimension length. What's the simplest choice for $b$?!

\end{Exercise}

\section*{ANOTHER MOTIVATIONAL EXAMPLE}

Consider a spring-mass system with a nonlinear ``hard'' spring that exerts a restoring force
of the form $F(x)=-kx - qx^3$ for positive constants $k$ and $q$. This models a spring that
exerts more force than would be dictated by Hooke's Law, especially for large displacements.
Suppose the mass is displaced by
an amount $x_0$ at $t=0$ and released with no initial velocity.
The same $F=ma$ argument that led to (\ref{de1}) yields
\begin{align}
m\frac{d^2x}{dt^2} + kx + qx^3 & = 0,\label{hardspring}\\
x(0) & = x_0,\nonumber\\
\frac{dx}{dt}(0) & = 0.\nonumber
\end{align}
This ODE is nonlinear and can't be solved in any simple
closed form.  However, if the nonlinear $qx^3$ term wasn't present
then this would be the spring-mass problem we've already solved.  Can we safely
ignore that term and use the linear system as a good approximation?

\begin{Exercise}
\label{exer7}
To gain some insight into when the $qx^3$ term may or may not significantly influence the solution,
consider the case where $m=1$, $k=1$, and
$q=0.01$ in (\ref{hardspring}), for a couple different initial displacements $x_0$.
\begin{itemize}
\item[(a)] Use a computer package to solve the ODE (\ref{hardspring})
numerically for initial displacement $x_0=1$, from $t=0$ to $t=25$. Plot the solution. Solve and plot again without the $qx^3$
term, and compare the solutions. Did the nonlinear term make much difference?

\item[(b)] Repeat the last exercise with $x_0=5$.

\item[(c)] Repeat the procedure with $x_0=5$, but now take $k=20$.
\end{itemize}
\end{Exercise}

\section*{DIMENSIONLESS VARIABLES AND SCALING}

In Exercise \ref{exer7} you should find that, depending on the values of $k$ and $x_0$, $q=0.01$ might be small enough that the $qx^3$ terms makes
little difference, or it might make a lot of difference! Maybe it depends on $m$ too. Trying to sort out when a term like this is important and
when it's not can be quite difficult. But a rescaling or ``change-of-variable'' argument can make it much easier analyze.

Let's start with a simple example of how rescaling works.
In the ODE (\ref{de1}) with initial conditions $x(0)=x_0,\frac{dx}{dt}(0)=0$, the independent variable $t$ has physical dimension ``time,'' of course, while the dependent variable $x$ has dimension ``length.'' The relevant time scale
on which $t$ evolves is given by (\ref{timescale}) and from Exercise \ref{exer6} above, the relevant spatial scale on which $x(t)$ changes is $x_c = x_0$.
We will make a change of variables in both time and space to make both variables ``dimensionless.''

Specifically, define a new independent time variable $\bar{t} = t/t_c$ with $t_c$ as given in (\ref{timescale}), and also define a new dependent spatial variable $\bar{x}=x/x_c$
where $x_c = x_0$ (from Exercise \ref{exer6}).
Both $\bar{t}$ and $\bar{x}$ are dimensionless---they are ``pure numbers'' with no units in whatever system of units we work in. We can move back and forth between the $t$ and $\bar{t}$
time scales (since $t=t_c\bar{t}$), as well as the $x$ and $\bar{x}$ systems ($x=x_c\bar{x}$).

From Exercise \ref{exer1}, the motion of the mass in the original $(t,x)$ variables is given by $x(t)=x_0\cos(t\sqrt{k/m})$, but the motion can also be described in the dimensionless $(\bar{t},\bar{x})$ variables. We use a new function $\bar{x}(\bar{t})$ to indicate the position of the mass, so that for any choice of $\bar{t}$ (which corresponds to some time $t=t_c\bar{t}$ in the original time variable) we have
\begin{equation}
\label{eqn37}
\bar{x}(\bar{t}) = \frac{x(t)}{x_c}.
\end{equation}
Since $t=t_c\bar{t}$ we can also write this explicitly, $\bar{x}(\bar{t}) = \frac{x(t_c\bar{t})}{x_c}$. Alternatively, since $\bar{t}=t/t_c$ (\ref{eqn37})
also yields $x(t) = x_c \bar{x}(t/t_c)$.

The function $\bar{x}(\bar{t})$ satisfies an ODE similar to (\ref{de1}), but simpler. To see this, start with (\ref{eqn37})
in the form $x(t) = x_c \bar{x}(\bar{t})$
and differentiate both side with respect to $t$ twice (use the chain rule, and note $d\bar{t}/dt = 1/t_c$) to find
\begin{align}
\frac{dx}{dt} & = x_c \frac{d\bar{x}}{d\bar{t}} \frac{d\bar{t}}{dt} = \frac{x_c}{t_c}\frac{d\bar{x}}{d\bar{t}}\label{deriv1}\\
\frac{d^2x}{dt^2} & = \frac{x_c}{t_c}\frac{d^2\bar{x}}{d\bar{t}^2}\frac{d\bar{t}}{dt} = \frac{x_c}{t_c^2}\frac{d^2\bar{x}}{d\bar{t}^2}\label{deriv2}
\end{align}
Substituting these relations into the ODE (\ref{de1}) produces
$$
\frac{mx_c}{t_c^2}\frac{d^2\bar{x}}{d\bar{t}^2} + kx_c\bar{x} = 0.
$$
However, $t_c^2=m/k$ and so the above equation collapses to
\begin{equation}
\label{rescalede}
\frac{d^2\bar{x}}{d\bar{t}^2} + \bar{x} = 0.
\end{equation}
after dividing by $k x_c$. The general solution to (\ref{rescalede}) is just $\bar{x}(\bar{t}) = c_1\cos(\bar{t}) + c_2\sin(\bar{t})$.
The initial condition for $\bar{x}(0)$ is $\bar{x}(0)=x(0)/x_c = x_0/x_c = 1$! Thus we find that we must take $c_1=1,c_2=0$ in the general solution and so
$$
\bar{x}(\bar{t}) = \cos(\bar{t}).
$$
Of course, we can translate this back to $x(t)$ using $x(t)=x_c \bar{x}(t/t_c)$ and find
$$
x(t) = x_c \cos(t/t_c) = x_0\cos(t\sqrt{k/m}).
$$

\section*{RESCALING FOR APPROXIMATION}

But the point above is not simply to solve the ODE (\ref{de1}) by rescaling to a simpler ODE. When we properly rescale
variables, it not only simplifies the ODE of interest, but also makes it much easier to see which terms are important and which might have a negligible
effect on the solution (and so can be omitted), and how this depends on the various parameters in the ODE. Let's return to the hard spring system governed
by (\ref{hardspring}) as an example.

Since our goal is determine when the $qx^3$ term might be negligible so that the solution to the ODE (\ref{de1}) suffices as an approximation, let's
again rescale with dimensionless variables $\bar{t}=t/t_c$ and $\bar{x}=x/x_c$, where $t_c$ is given by (\ref{timescale}) and $x_c=x_0$. With $\bar{x}(\bar{t})=x(t)/x_c$
as before, (\ref{deriv1}) and (\ref{deriv2}) still hold. Using these in (\ref{hardspring}) yields
$$
\frac{mx_c}{t_c^2} \frac{d^2\bar{x}}{d\bar{t}^2} + kx_c \bar{x} + qx_c^3\bar{x}^3 = 0.
$$
Use $t_c^2 = m/k$, $x_c=x_0$, and  divide through by $mx_c$ to find
\begin{equation}
\label{barxeqn}
\frac{d^2\bar{x}}{d\bar{t}^2} + \bar{x} + \epsilon \bar{x}^3 = 0
\end{equation}
where
\begin{equation}
\label{epsdef}
\epsilon = \frac{qx_0^2}{k}.
\end{equation}
The initial conditions become $\bar{x}(0)=1$ and $\frac{d\bar{x}}{d\bar{t}}(0)=0$.
You can easily check that $\epsilon$ is dimensionless. If we solve (\ref{barxeqn}) for $\bar{x}(\bar{t})$ we can recover the solution $x(t)$
to (\ref{hardspring}). Moreover, if we take $\epsilon=0$ we obtain the solution to (\ref{de1}).

This helps make it clear when the nonlinear term can be neglected. If we let $\bar{x}_{\epsilon}(\bar{t})$ denote the solution to
(\ref{barxeqn}) for a fixed $\epsilon$ (so $\bar{x}_0(\bar{t}) = \cos(\bar{t})$) we expect that $\bar{x}_{\epsilon}$ is well-approximated
by $\bar{x}_0$ when $\epsilon$ is sufficiently close to $0$. To illustrate, in the left panel of Figure \ref{fig2} is shown $\bar{x}_{\epsilon}(\bar{t})$
versus $\bar{x}_0(\bar{t})=\cos(\bar{t})$ when $\epsilon=0.05$, for $5$ periods, so $0\leq \bar{t}\leq 10\pi$. The same information is shown in the right panel for
$\epsilon=1$.
\begin{figure}[ht]
\centerline{\includegraphics[width=0.4\textwidth]{hardspr1.jpg}\ \ \includegraphics[width=0.4\textwidth]{hardspr2.jpg}}
\caption{Solution to (\ref{barxeqn}) (solid curve) versus $\cos(t)$ (dashed curve) when $\epsilon=0.05$ (left) and
$\epsilon=1$ (right).}
\label{fig2}
\end{figure}
If we consider the approximation on the left sufficient for our purposes (but not on the right) then something like $\epsilon\leq 0.05$ makes sense
as a criteria for dropping the nonlinear term. But in light of (\ref{epsdef}) this is just the condition
\begin{equation}
\label{ignore} \frac{qx_0^2}{k} \leq 0.05.
\end{equation}
If (\ref{ignore}) holds we are justified in dropping the nonlinear term in (\ref{hardspring}), at least if we're only interested in the first five periods of the
solution. If we want the solutions to agree for a longer time period, or agree even more closely, we might need to lower $0.05$. In any case, the critical quantity that
dictates when the solution to the nonlinear problem (\ref{hardspring}) agrees with the solution to the linear problem (\ref{de1}) is the dimensionless quantity $qx_0^2/k$.
This also shows that the mass $m$ plays no role in when the approximation is valid.
\section*{SUMMARY}

Rescaling via the introduction of dimensionless variables can make the analysis and solution of ODE's (and other problems in applied mathematics!) much
easier. In particular
\begin{itemize}
\item It can illuminate the nature of the solution to an ODE by indicating the natural scale for the quantities of interest, in time, space or other physical dimensions.
\item It allows us to determine when and how equations can be simplified by dropping ``negligible'' terms.
\item It can aid in the numerical solution of the problem. For example, if we want to solve (\ref{hardspring}) numerically for a large selection of different values of
$m$, $k$, $q$, and $x_0$, the introduction of dimensionless variables shows that we really only need to solve (\ref{barxeqn}) for the relevant values of $\epsilon$, which
may lead to much less work.
\item As it turns out, the introduction of dimensionless variables is an essential part of many types of experimentation. For example, you can't easily put a full scale
jumbo jet into a wind tunnel; you'd likely use a scale model. But will the results for the scale model correspond to the behavior of a full size jet?  Dimensional analysis
of the type we've done can help assure that it will. See \cite{barenblatt} for more on this topic and dimensional analysis in general.
\end{itemize}

\begin{Exercise}
\label{exer8}
Consider the damped spring-mass equation (\ref{damped})
with initial conditions $x(0)=x_0$, $\frac{dx}{dt}(0)=0$.
Rescale the problem to the dimensionless form
$$
\frac{d^2\bar{x}}{d\bar{t}^2} + \epsilon \frac{d\bar{x}}{d\bar{t}} + \bar{x} = 0
$$
with appropriate initial conditions using $x_c=x_0$ and $t_c=\sqrt{m/k}$.

What is $\epsilon$ in terms of
$m,\mu,k,$ and $x_0$?  Compare the damped and undamped solutions for a few
values of $\epsilon$, say over the first five cycles.  Under what
conditions (analogous to (\ref{ignore})) on $m,\mu,k,$ and $x_0$ can
we reasonably ignore the damping for five cycles?
\end{Exercise}

\begin{Exercise}
\label{exer9}
A series RC (resistor-capacitor) circuit is governed by the ODE
\begin{equation}
\label{rcde}
R\frac{dq}{dt} + \frac{q(t)}{C} = 0
\end{equation}
where $R$ is the resistance of the resistor, $C$ is the capacitance of the capacitor, and $q(t)$ is the charge on the capacitor.
We assume there is no voltage source in the circuit. Suppose the capacitor starts with initial charge $q(0)=q_0$.

Let us use the symbol ``$Q$'' for the fundamental physical dimension of electric charge, so for example, $[q]=Q$. It turns out that voltage
or electrical potential is ``work per unit charge.'' If we take work as ``force times distance'' then work has dimension $ML^2T^{-2}$, and so
voltage $V$ has dimension $[V] = ML^2T^{-2}Q^{-1}$. The fundamental relation that governs a capacitor is $q=CV$, and so $[C] = Q/[V] = M^{-1}L^{-2}T^2 Q^2$.
Similarly from Ohm's law $V=IR$ (where $I$ is current in the circuit, so $[I] = QT^{-1}$, charge per time) we find $[R] = [V/I] = ML^2T^{-1}Q^{-2}$.
\begin{enumerate}
\item[(a)] Use $[R] = ML^2T^{-1}Q^{-2}$ and $[C] =  M^{-1}L^{-2}T^2 Q^2$, along with $[q_0]=Q$ to find a time scale $t_c$ for this ODE, of the form
$$
t_c = R^a C^b q_0^c.
$$

\item[(b)] Find a ``charge scale'' $q_c$ for the problem, also in the form $q_c = R^a C^b q_0^c$ (different $a,b,c$ than for $t_c$.)

\item[(c)] Let $\bar{t} = t/t_c$ and $\bar{q}=q/q_c$. Show that the rescaled ODE involving $\bar{q}(\bar{t})$ is
$$
\frac{d\bar{q}}{d\bar{t}} + \bar{q} = 0
$$
with $\bar{q}(0)=1$. Solve this DE and use it to find the solution to (\ref{rcde}).

\end{enumerate}
\end{Exercise}

\begin{Exercise}
\label{exer10}
Suppose an object of mass $m$ falls at velocity $v(t)$ under the influence of gravitational acceleration $g$. Let's take $v>0$ to indicate
downward motion, which is all we're interested in. As it falls the mass experiences
a drag force $F(v)$ that is a function of the object's velocity $v$. Suppose that $F(v) = -k_1 v - k_2 v^2$ for some positive constants $k_1$ and $k_2$, so
that the force is always upward (which is the negative direction) when $v>0$. From $F = ma$ we find
\begin{equation}
\label{veqn}
m\frac{dv}{dt} = g - k_1 v(t) - k_2 v^2(t).
\end{equation}
Note $g>0$ here.
\begin{enumerate}
\item[(a)] What are the dimensions of $k_1$ and $k_2$? (Hint: $F(v)$ is a force, so $k_1 v$ and $k_2 v^2$ must be forces as well).

\item[(b)] Show that any characteristic time that can be formed from $m,g,k_1,$ and $k_2$ is of the form
$$
t_c = \frac{m}{k_1}\left (\frac{mgk_2}{k_1^2}\right )^c
$$
for some choice of $c$ (note the quantity in parentheses is dimensionless). Hint: mimic the procedure for $t_c$ after equation (\ref{damped}) in Exercise \ref{exer3}.

\item[(c)] Show that any characteristic velocity that can be formed from $m,g,k_1,$ and $k_2$ is of the form
$$
v_c = \frac{mg}{k_1}\left (\frac{mgk_2}{k_1^2}\right )^d
$$
for some choice of $d$.

\item[(d)] Let $\bar{v}(\bar{t}) = v(t)$ where $\bar{v}=v/v_c$ and $\bar{t}=t/t_c$, with $t_c$ and $v_c$ are obtained
from the above formulae, both with $d=0$. Show that this leads to an ODE for $\bar{v}$ of the form
\begin{equation}
\label{eps1}
\frac{d\bar{v}}{d\bar{t}} = 1 - \bar{v} - \epsilon \bar{v}^2
\end{equation}
where $\epsilon = mgk_2/k_1^2$ (dimensionless).

Solve (\ref{eps1}) with $\epsilon=0$ and $\bar{v}(0)=0$. Call this solution $\bar{v}_0(t)$. Then
compute (numerically or symbolically) the solution to (\ref{eps1}) with $\bar{v}(0)=0$ for each of $\epsilon=0.01,0.1,1.0$
and plot with $\bar{v}_0(t)$ for $0\leq t\leq 5$. Experiment. How small must $\epsilon$ be before the solution to (\ref{eps1})
agrees well with $\bar{v}_0$ on this time interval?

Based on this, what is a reasonable quantitative criteria (involving $m,g,k_1,$ and $k_2$) for dropping the quadratic
term in $F(v)$ and using the simpler linear ODE?

\item[(e)] Find a choice for $c$ and $d$ in the formulae for $t_c$ and $v_c$ above that leads to values of $t_c$ and $v_c$ so that the rescaled ODE is of the form
\begin{equation}
\label{eps2}
\frac{d\bar{v}}{d\bar{t}} = 1 - \epsilon\bar{v} - \bar{v}^2.
\end{equation}
Mimic the computations in part (d) above to find
a reasonable quantitative criteria (involving $m,g,k_1,$ and $k_2$) for dropping the linear
term in $F(v)$ and using the ODE in which $F(v)$ is purely quadratic.
\end{enumerate}
\end{Exercise}


\teacher{
\section*{NOTES FOR THE TEACHER}

This material is usually taught in engineering courses (frequently mechanical engineering, as part of a fluids course).
I always squeeze in a couple days of this material into my introductory ODE course. Students enjoy it, for finding the characteristic scales of a physical
problem involves only very simple high school algebra, at least once the essential variables (mass, damping, charge, viscosity, etc.) are settled upon.
And the students are always impressed by how comically powerful the technique is, for it allows you to figure out all kinds of things about a physical
phenomena without understanding everything about the physics. The temptation is to spend too much time on this material!

I usually work this material in as part of the treatment of second order ODE's, when nonlinear equations become difficult (if not impossible) to solve analytically,
like the hard spring ODE. It's
a real relief to have a technique at that point that allows us to determine when certain terms in a nonlinear ODE are not really needed. I also emphasize that the
applicability of these techniques goes well beyond ODE's: scaling is an important part of almost all areas of applied mathematics, physics, and engineering.

\section*{EXERCISE SOLUTIONS}
\begin{enumerate}
\item One can simply plug $x(t) = x_0 \cos(t\sqrt{\frac{k}{m}})$ into the DE to see that it works, and $x(0)=x_9$ with $x'(0)=0$ is easy to check.  The solution goes through an entire
period $P$ when $P\sqrt{k/m} = 2\pi$, so $P=2\pi \sqrt{m/k}$. Since $m$ has dimension mass and $k$ has dimension mass per time squared, $m/k$ has dimension time squared.
Thus $\sqrt{m/k}$ has dimension time. Note $2\pi$ is dimensionless.

\item We find $[R]=L,[g]=LT^{-2},$ and $[m]=M$. Then
$$
[t_c] = M^{c} L^{a+b} T^{-2b}.
$$
Thus we need
\begin{align*}
c & = 0\\
a+b & = 0\\
-2b & = 1
\end{align*}
with solution $a=1/2, b=-1/2,c=0$. This means $t_c = \sqrt{R/g}$.

\item Since $\mu x'$ is a force $F$ and $[F] = MLT^{-2}$ we find $[\mu] = MLT^{-2}(LT^{-1})^{-1} = MT^{-1}$.
Then
$$
[t_c] = (MT^{-2})^a M^b (MT^{-1})^c = M^{a+b+c} L^0 T^{-2a-c}
$$
which must be of the form $M^0 L^0 T^1$, so that
\begin{align*}
a+b+c & = 0\\
-2a - c & = 1.
\end{align*}
The solution is easily found to be of the form
$$
a = b-1,\;\;\;c = 1-2b
$$
where $b$ can be chosen arbitrarily, and so any characteristic time scale must be of the form
\begin{equation}
\label{tcgen}
t_c = k^{b-1} m^b \mu^{1-2b} = \frac{\mu}{k}\left ( \frac{mk}{\mu^2} \right )^b
\end{equation}
for some $b$.

\item Choose $b=1/2$ in (\ref{tcgen}) yields
$$
t_c = k^{-1/2} m^{1/2} \mu^0 = \sqrt{m/k}
$$
as before.

\item Choosing $b=1$ yields
$$
t_c = k^{0} m^1 \mu^{-1} = m/\mu.
$$
When $m=1$ and $\mu=0.1$ we have $m/\mu=10$, and the solution decays (visually) to zero at around $t=100$. When $\mu=5$ we have $m/\mu=0.2$ and
the solution decays to zero (visually) at around $t=50$. In general the solution decays to zero, within a given tolerance, at around time $t\approx 10m/\mu$.

\item With the dimensions of $k,m,\mu$ as above and $[x_0]=L$ we find that if $x_c = k^{a} m^{b} \mu^{c} x_0^{d}$ then
$$
[x_c] = (MT^{-2})^a M^b (MT^{-1})^c L^d = M^{a+b+c} L^d T^{-2a-c}
$$
which must be of the form $M^0 L^1 T^0$. Then clearly $d=1$, while $a+b+c=0$ and $-2a-c=0$ lead to $a=b$ and $c=-2b$ where $b$ is arbitrary. So anything of the form
$$
x_c = k^{b} m^b \mu^{-2b} x_0 = x_0\left (\frac{mk}{\mu^2}\right )^b
$$
has the correct dimension. With $b=0$ we obtain the simple scale $x_c=x_0$.

\item
\begin{itemize}
\item[(a)] In this case the solutions should look fairly close.

\item[(b)] Now the nonlinear term should make quite a large difference.

\item[(c)] Changing $k$ to $20$ makes the solutions agree well again!
\end{itemize}

\item With $\frac{dx}{dt} = x_c \frac{1}{t_c} \frac{d\bar{x}}{d\bar{t}}$ and $\frac{d^2x}{dt^2} = x_c \frac{1}{t_c^2} \frac{d^2\bar{x}}{d\bar{t}^2}$ the ODE for the damped
spring-mass system becomes
$$
mx_c \frac{1}{t_c^2} \frac{d^2\bar{x}}{d\bar{t}^2}+\mu x_c \frac{1}{t_c} \frac{d\bar{x}}{d\bar{t}} + kx_c \bar{x} = 0.
$$
But $x_c$ divides out, and with $t_c=\sqrt{m/k}$ we obtain
$$
\frac{d^2\bar{x}}{d\bar{t}^2}+\epsilon \frac{d\bar{x}}{d\bar{t}} + \bar{x} = 0
$$
with $\epsilon = \mu/\sqrt{mk}$. The initial conditions are $\bar{x}(0)=1$ and $\frac{d\bar{x}}{d\bar{t}}(0)=0$.

Plotting show that something in the vicinity of $\epsilon=0.01$ or smaller is necessary before the damped
solution does not decay too much; of course, it's a judgement call. But this would lead to something like
$$
\frac{\mu}{\sqrt{mk}} \leq 0.01
$$
as a condition.

\item
\begin{enumerate}
\item[(a)] With $[R] = ML^2T^{-1}Q^{-2}$, $[C] =  M^{-1}L^{-2}T^2 Q^2$, and $[q_0]=Q$ we find
$$
[t_c] = M^{a-b} L^{2a-2b} T^{-a+2b} Q^{-2a+2b+c}.
$$
Thus we need $a-b=0,2a-2b=0,-a+2b=1$, and $-2a+2b+c=0$. The equations are consistent and we find $a=1,b=1,c=0$. Thus
$$
t_c = RC.
$$

\item The same reasoning with $q_c = R^a C^b q_0^c$ yields $a-b=0,2a-2b=0,-a+2b=0$, and $-2a+2b+c=0$ with solution $a=0,b=0,c=1$. So $q_c = q_0$.

\item With $\frac{dq}{dt} = q_c \frac{1}{t_c} \frac{d\bar{q}}{d\bar{t}}$ the original ODE for the RC circuit becomes
$$
\frac{d\bar{q}}{d\bar{t}} + \bar{q} = 0
$$
with $\bar{q}(0)=1$. The solution is $\bar{q}(\bar{t}) = e^{-\bar{t}}$. But then $q(t) = q_c \bar{q}(t/t_c) = q_0 e^{t/(RC)}$.

\end{enumerate}

\item
\begin{enumerate}
\item Since force has dimension $MLT^{-2}$ we find that $[k_1] = MLT^{-2}(LT^{-1})^{-1} = MT^{-1}$ and $[k_2] = MLT^{-2}(LT^{-1})^{-2}=ML^{-1}$.

\item Take $t_c = m^a g^b k_1^c k_2^d$ and so
$$
[t_c] = M^a (LT^{-2})^b (MT^{-1})^c (ML^{-1})^d = M^{a+c+d} L^{b-d} T^{-2b-c}.
$$
This requires $a+c+d=0,b-d=0,-2b-c=1$ with solution $a=a=d+1,b=d,c=-2d-1$ and $d$ a free variable. Then
$$
t_c = m^{d+1} g^d k_1^{-2d-1}k_2^d = \frac{m}{k_1}\left (\frac{mgk_2}{k_1^2}\right )^d.
$$
Of course, $d$ can be anything.

\item Take $v_c = m^a g^b k_1^c k_2^d$ and so
$$
[v_c] = M^a (LT^{-2})^b (MT^{-1})^c (ML^{-1})^d = M^{a+c+d} L^{b-d} T^{-2b-c}.
$$
Since velocity has dimension $LT^{-1}$ this requires $a+c+d=0,b-d=1,-2b-c=-1$ with solution $a=a=d+1,b=d+1,c=-2d-1$ and $d$ a free variable. Then
$$
v_c = m^{d+1} g^{d+1} k_1^{-2d-1}k_2^d = \frac{mg}{k_1}\left (\frac{mgk_2}{k_1^2}\right )^d.
$$
Of course, $d$ can be anything (not necessarily the same as in the previous part).

\item[(d)] Take $d=0$ in both parts above, so $t_c = m/k_1$ and $v_c = mg/k_1$. With $\bar{v}(\bar{t}) = v(t)$ where $\bar{v}=v/v_c$ and $\bar{t}=t/t_c$ we find
\begin{equation}
\label{eps1}
\frac{d\bar{v}}{d\bar{t}} = 1 - \bar{v} - \epsilon \bar{v}^2
\end{equation}
where $\epsilon = mgk_2/k_1^2$ (dimensionless).

Choosing something like $\epsilon=0.01$ gives good agreement between $\bar{v}_0$ and $\bar{v}_{\epsilon}$. That is, something of the form
$$
\frac{mgk_2}{k_1^2}\leq 0.01
$$
is a reasonable criterion for dropping the quadratic term.

\item[(e)] Taking $d=-1/2$ to define $t_c$ leads to $t_c = \sqrt{\frac{m}{gk_2}}$. Also, $d=-1/2$ leads to $v_c = \sqrt{mg/k_2}$. This leads to
\begin{equation}
\label{eps2}
\frac{d\bar{v}}{d\bar{t}} = 1 - \epsilon\bar{v} - \bar{v}^2.
\end{equation}
with $\epsilon=k_1/\sqrt{mgk_2}$. Again, something in the range $\epsilon=0.01$ works well, so that
$$
\frac{k_1}{\sqrt{mgk_2}} \leq 0.01
$$
is a reasonable criterion for dropping the linear term.
\end{enumerate}
\end{enumerate}
%\section*{ACKNOWLEDGEMENTS}
}
\begin{thebibliography}{99}
\bibitem{barenblatt} Barenblatt, G.I., 2003. \textit{Scaling}. New York: Cambridge Texts in Applied Mathematics (Volume 34).
\end{thebibliography}




\end{document}
