text:
\begin{document}
\begin{frontmatter}

\title{Model Predictive Control for Energy-Efficient Operations of Data Centers with Cold Aisle Containments\thanksref{footnoteinfo}}

\thanks[footnoteinfo]{This work is funded in part by JSPS KAKENHI Grant Number 18K13777, the National Natural Science Foundation of China (NSFC) under Grant No.~61502255, and Inner Mongolia Science and Technology Plan.}

\author[naist]{Masaki Ogura}
\author[Wan]{Jianxiong Wan}
\author[naist]{Shoji Kasahara}

\address[naist]{Nara Institute of Science and Technology,
Ikoma, Nara 630-0192 Japan (e-mail:
oguram@is.naist.jp, kasahara@is.naist.jp)}
\address[Wan]{Inner Mongolia University of Technology,
Hohhot, 010080, Inner Mongolia, China (e-mail: jxwan@imut.edu.cn)}

\begin{abstract}
In this paper, we study a problem of controlling cooling facilities and computational equipments for energy-efficient operations of data centers. Although a plethora of approaches have been proposed in previous literatures, there is a lack of rigorous methodologies for effectively addressing the problem. To bridge this gap, we propose MPC frameworks for jointly and optimally tuning the Computer Room Air Conditioner (CRAC) supplying air temperature as well as the number of active servers for minimizing the overall energy consumption. We specifically find that, when a standard model of data centers with contained cold aisles and cooling facilities are used, the optimization problems arising from the MPC framework can be transformed to  convex optimization problems that can be solved efficiently. We present several numerical simulations to illustrate the effectiveness of our theoretical results.
\end{abstract}

\begin{keyword}
Model predictive control, convex optimization, geometric programming, chance-constrained optimization
\end{keyword}

\end{frontmatter}

\section{Introduction}

Data centers are major energy consumers in the current Information Technology (IT) industry. It is predicted that data centers in the U.S.~alone will consume $140$ billion~kWH electricity by~$2020$~\citep{Delforge2014}. The huge energy consumption not only poses an enormous monetary burden to data center operators, but also leads to serious concerns for environmental issues~\citep{Gao2012b}. Therefore, it is imperative for researchers to find efficient ways to cut down the data center energy consumption.

Dissecting the energy consumption of a data center shows that the IT and cooling subsystems play dominant roles~\citep{Dayarathna2016}. Unfortunately, majority of the works from the Computer Science community concentrated only on the control of IT facilities. \cite{Lin2016a} used an integer linear programming to model the energy minimization problem where the control variables were the state of servers (on/off) and workload dispatching policy. An enhanced genetic algorithm and a heuristic greedy sequence approach were proposed to solve the integer linear programs. VMAP+ proposed by~\cite{Lee2017b} reduces the energy consumption via allocation and migration of virtual machines.

TIGER~\citep{Chavan2016a} also uses the same idea to cut the cooling cost in storage clusters but the control knob is the file placement strategy. Although the above IT side control methods are thermal-aware to some extent, they can only affect the heat generation pattern of the data center and have limited impact on the cooling subsystem.

Recently, joint optimization techniques which integrate control knobs from both IT and cooling subsystems are proposed to balance the energy consumption in these components. \cite{Parolini2012} introduced a control framework which includes both thermal management and workload scheduling. Under the simplified assumption that the temperature of rack exhaust air is constant, \cite{Li2012e} derived a closed form solution to the joint optimization problem. \cite{Fang2016} used the framework of Model Predictive Control (MPC) to coordinate the actions of Computer Room Air Conditioners (CRACs) and servers.

In this paper, we present MPC formulations for achieving overall energy minimization in data centers. We specifically study the data centers with Cold Aisle Containments (CACs) that are adopted in nearly all modern data centers. Furthermore, we show that the finite-horizon control problems that have to be iteratively solved under MPC formalisms can be transformed to convex optimization problems, which allows us to efficiently find the optimal control inputs by off-the-shelf solvers. These features are in contrast to the previous works in \cite{Parolini2012,Fang2016}, where data centers with open aisle systems involving hot air recirculations are considered while the optimality of the control inputs is not guaranteed.

This paper is organized as follows. In Section~\ref{sec:problemFormulation}, we introduce the model of data centers and formulate the energy minimization problem. In Section~\ref{sec:deterministic}, the energy minimization problem is cast into an MPC problem under the assumption that user request rates are predictable. In Section~\ref{sec:stochastic}, we present a scenario-based MPC formulation in which we do not require predictions but utilize a history of past data. We illustrate the effectiveness of the proposed methods via numerical simulations in Section~\ref{sec:simulation}.

\section{Problem Formulation}\label{sec:problemFormulation}

We formulate the problem studied in this paper. We first present the model of data centers with CACs in Section~\ref{ref:model}. In  Section~\ref{sec:problem}, we formulate the overall energy minimization problem.

\subsection{Data Center Description}\label{ref:model}

Let us first briefly overview the structure of the data centers studied in this paper. A typical machine room layout for modern data centers is shown in Fig. \ref{fig:DCMR}. Racks are placed on the raised floor with inlets faced towards each other to form a cold aisle. Almost all power drawn by servers is dissipated as heat, which jeopardizes the reliability of servers. A CRAC is installed near the side wall of the machine room and constantly blows cold air (blue arrows) into the underfloor plenum, leading to a positive pressure differential between the plenum and cold aisle which forces the cold air to be ejected from the perforated tiles located in front of racks. With the help of built-in fans, servers suck in the cold air, dump the waste heat into it, and finally discharge it into the hot aisle. The hot airflow (red arrows) will return to the CRAC though the ceiling.

In traditional open aisle data centers, the hot air recirculation, which is a phenomenon that the hot air reenters the cold aisle and mixes with the supplying cold air, can be easily observed in the rack top and aisle ends due to the nonuniform pressure distribution inside the cold aisle. Since the hot air recirculation compromises the cooling efficiency, researchers developed containment systems for cold or hot aisles. The containment systems usually consist of concrete barrier plates installed at rack top and aisle ends which minimize the effect of air mixing. It was shown that CACs provide ``close to perfect cold air delivery''~\citep{Arghode2013}.

\begin{figure}[tb]
\centering
\includegraphics[width =.95\linewidth]{DCMR-eps-converted-to.pdf}
\caption{A typical machine room layout with cold aisle containment inside data centers.}
\label{fig:DCMR}
\end{figure}

We then describe the mathematical model of the data centers \citep{Fu2017,Parolini2012}. We assume that there are a total number of~$J$ users requesting service from a data center. For each nonnegative integer~$t$, let $L_j(t)$ denote the request rate of user~$j$ at time~$t$. The request from user~$j$ is assumed to be processed in the $j$th cluster of servers located in the data center. We assume that the number of the servers in the $j$th cluster, denoted by~$m_j(t)$, can be dynamically tuned by the operator of the data center. We denote  by~$T_{\cpu, j}(t)$ the temperature of the CPUs in the $j$th cluster at time~$t$.

We adopt a standard model of the CPU temperatures, which is described below. We model the energy consumption of a single server in the $j$th cluster by
\begin{equation}\label{eq:def:p_j}
p_j(t) = a_1 \frac{L_j(t)}{m_j(t)} + a_2,
\end{equation}
where $a_1$ is the marginal energy consumption for increased CPU utilization, and $a_2$ is the energy consumption of remaining components apart from CPU \citep{Dayarathna2016}. Therefore, these two parameters are all positive constants. Then, the dynamics of the CPU temperature is described by the linear difference equation
\begin{equation}\label{eq:temperatureDynamics}
T_{\cpu, j}(t+1) = \alpha_j T_c(t) +  \varsigma_j p_j(t) + \beta_j T_{\cpu, j}(t),
\end{equation}
where $T_c(t)$ is the CRAC supplying air temperature and $\alpha_j, \beta_j, \varsigma_j$ are heat exchange rates~\citep{Parolini2012}.

\subsection{Problem Formulation}\label{sec:problem}

The energy consumption of a server cluster handling the requests from user~$j$ at time~$t$ is modeled as $P_j(t) = p_j(t)m_j(t)$. Then, the total energy consumption of the data center at time~$t$ can be expressed by $P(t) = \sum_{j=1}^J P_j(t)$. On the other hand, the energy consumption at the CRAC is modeled by
\begin{equation}\label{eq:def:C}
C(t) = P(t)/\CoP(T_c(t)),
\end{equation}
where $\CoP(T) = 0.0068T^2 + 0.0008T + 0.458$ is a function describing the cooling efficiency of CRAC at the temperature~$T$ and is widely adopted in the literature~\citep{Moore2005}. Therefore, the total energy consumption in the data center at time~$t$ equals $E(t) = P(t) + C(t)$.

We finally state the constraints that have to be satisfied during the operation of the data center. First, the temperature of the CRAC can be controlled only within the following interval
\begin{equation}\label{eq:const:T_c}
\ubar T_c \leq T_c(t)\leq \bar T_c,
\end{equation}
where $\ubar T_c$ and $\bar T_c$ are given positive constants. The second requirement is on the response times of users. Let $D_j(t)$ denote the response time of user $j$. We require that
\begin{equation}\label{eq:delayConst}
D_j(t) \leq \bar D_j,
\end{equation}
where $\bar D_j$ is an upper bound of tolerable response time specified by user $j$. We assume the system is a classical $M/M/1$ queueing system~\citep{Harchol-Balter2013}. Under this assumption, the response time admits the representation~$D_j(t) = {1}/{(m_j(t)\mu_j - L_j(t))}$, where $\mu_j$ is the average service rate for user~$j$.

We finally require that the CPU temperatures are kept below a certain safety level. Specifically, we require that
\begin{equation}\label{eq:cpuTemperatureConst}
T_{\cpu, j}(t) \leq \bar T_{\cpu, j},
\end{equation}
where $\bar T_{\cpu, j} > 0$ is a constant given by hardware manufacturers to ensure the server reliability.

We can now state our energy minimization problem studied in this paper:

\begin{problem}\label{prb:dyn}
Find a sequence of the CRAC temperatures~$T_c = \{T_c(t)\}_{t=t_0}^{t_f}$ and the amount of active servers~$m_j = \{m_j(t)\}_{t=t_0}^{t_f}$ ($j=1$, \dots, $J$) solving the following optimization problem:
\begin{subequations}\label{eq:opt:original}
\begin{align}
\minimize_{T_c,\,m_1,\,\dotsc,\,m_J}\ \ \ & \sum_{t=t_0}^{t_f} E(t)\label{eq:objective}
\\
\st\ \ \ &

\mbox{\eqref{eq:const:T_c}--\eqref{eq:cpuTemperatureConst}}.
\end{align}
\end{subequations}
\end{problem}

The difficulty of Problem~\ref{prb:dyn} mainly stems from the nonlinearity of the objective function~\eqref{eq:objective} as well as the constraint~\eqref{eq:cpuTemperatureConst}. The energy consumption~\eqref{eq:def:C} at CRAC involves the inverse of a quadratic function of the cooling temperature. Furthermore, by equations~\eqref{eq:def:p_j} and~\eqref{eq:temperatureDynamics}, the CPU temperature involves the inverse of $m_j$. For these reasons, it is not a trivial task to directly solve the optimization problem~\eqref{eq:opt:original}.

\section{Model Predictive Control}\label{sec:deterministic}

In this section, we present an MPC formulation for solving problem \ref{prb:dyn}. Assuming that a prediction on the user request rate is available at each time instant, we formulate the energy minimization problem as an iteration of optimal control problems within smaller time-windows. We show that, under a mild and reasonable assumption on the CRAC supplying air temperature, the problem can be transformed to a convex optimization problem.

\subsection{Convexity}

In this section, we place the following assumption:

\begin{assumption}\label{asm:deterministic}
There exists a positive integer~$t_h$ such that, at each time~$\tau \geq t_0$, we can predict the number of requests~$\{L_j(t)\}_{t=\tau}^{\tau + t_h}$ for all user~$j$.
\end{assumption}

This assumption allows us to formulate the following finite-horizon optimal control problem for $\tau = t_0, \dotsc, t_f$:
\begin{subequations}\label{eq:mpc:deterministic}
\begin{align}
\minimize_{T_c,\,m_1,\,\dotsc,\,m_J,\,\gamma}\ \ \ & \gamma
\\
\st\ \ \ \,& \mbox{\eqref{eq:const:T_c}--\eqref{eq:cpuTemperatureConst}},
\\
& \sum_{t=\tau}^{\tau + t_h}  E(t) \leq \gamma,  \label{eq:performance_gamma}
\end{align}
\end{subequations}
where we have introduced the slack variable~$\gamma$.

In order to state the main result of this section, we introduce the following notations. Let $\tau \geq t_0$ be arbitrary. For $t \in \{\tau, \tau+1, \dotsc, \tau + t_h\}$, let $T_{\cpu, j} (t; u_\tau)$ denote the temperature~$T_{\cpu, j} (t)$ when we apply the control inputs
\begin{equation}\label{eq:def:realInputSeq}
\begin{multlined}[.9\linewidth]
u_\tau = \{T_c(t), m_1(t), \dotsc, m_J(t)\colon  \\ 1\leq j\leq J,\,\tau\leq t\leq \tau+t_h\} \in (\mathbb{R}_+^{t_h+1})^{J+1},
\end{multlined}
\end{equation}
where $\mathbb{R}_+$ denotes the set of positive numbers. The notation~$E(t; u_\tau)$ is understood in the same manner. The following theorem shows that we can transform the MPC problem~\eqref{eq:mpc:deterministic} to a convex optimization problem and is the first main result of this paper.

\begin{thm}\label{thm:deterministic}
Assume that
\begin{equation}\label{eq:asm:T>11}
\ubar T_c \geq 11.
\end{equation}
Then, the solution of the optimization problem~\eqref{eq:mpc:deterministic} is given by
\begin{equation}\label{eq:optimalInputRepresentation}
T_c(t) = e^{x^\star(t)},\ m_j(t) = e^{y_j^\star(t)},
\end{equation}
where $x^\star = \{x^\star(t)\}_{t=\tau}^{\tau+t_h}$ and $y_j^\star = \{y_j^\star(t)\}_{t=\tau}^{\tau+t_h}$ ($j=1, \dotsc, J$) solve the convex optimization problem
\begin{subequations}\label{eq:convexProg:deterministic}
\begin{align}
\minimize_{x,\,y_1,\,\dotsc,\,y_J,\,\Gamma}\ \ \ & \Gamma
\\
\st\ \ \,& u_\tau =
\begin{multlined}[t]
\{e^{x(t)}, e^{y_1(t)}, \dotsc, e^{y_J(t)} \colon \\  1\leq j\leq J,\,\tau\leq t\leq \tau+t_h\},\end{multlined}\label{eq:exponentialInputSeq}
\\
&
\log \ubar{T}_c \leq x(t)\leq \log \bar T_c,  \label{eq:x_bound}
\\
& y_j(t) \geq \log(\bar D_j^{-1} + L_j(t)) - \log \mu_j,
\label{eq:exp:delayConst}
\\
&
\log T_{\cpu, j}(t; u_\tau) \leq \log \bar T_{\cpu, j},
\label{eq:exp:cpuTempConst}
\\
& \log \sum_{t=\tau}^{\tau + t_h}  E(t;  u_\tau) \leq \Gamma.
\label{eq:lessthanGamma}
\end{align}
\end{subequations}

\end{thm}

\begin{remark}

As can be seen in ASHRAE's Thermal Guidelines \citep{ASHRAE2011}, data center operators usually choose a supplying air temperature between $18$ and $27^\circ$C. Therefore, in most of the standard cases, the optimization problem~\eqref{eq:convexProg:deterministic} has a unique minimum which can be obtained by traditional convex optimization techniques.
\end{remark}

In the proof of Theorem~\ref{thm:deterministic}, the following lemma plays an important role.

\begin{lem}\label{lem:convexity:1+1/cop}
Define the function $f \colon (0, \infty) \to (0, \infty)$ by
\begin{equation}\label{eq:def:fcop}
f(T) = 1 + \CoP(T)^{-1}.
\end{equation}
Then, the function
\begin{equation}\label{eq:def:F}
F\colon \mathbb{R} \to \mathbb{R} \colon x \mapsto \log(f(e^x))
\end{equation}
is convex on the interval $[\log(11), \infty)$.
\end{lem}

\begin{pf}
A straightforward calculation shows that
there exists a polynomial~$p$ having positive coefficients such that

$F''(\log T) = T{p(T)^{-2}}q(T)$,

where $q(T) = q_5 T^5 + q_4 T^4 + q^3T^3 + q^2 T^2 + q_1T + q_0$ is the polynomial with the coefficients $q_5 = \num[group-separator={,}]{9826}$, $q_4 =\num[group-separator={,}]{2023}$, $q_3 =136$, $q_2 =-\num[group-separator={,}]{81426}$, $q_1 =-\num[group-separator={,}]{141899850}$, and $q_0 =-\num[group-separator={,}]{4173525}$. The polynomial~$q$ has the real zeros at $T = -10.99$, $-0.029$, and $10.94$. Furthermore, $q(11)  = \num[group-separator={,}]{37362464}$ is positive. Therefore, by the continuity of polynomials, the derivative~$F''(\log T)$ is positive for all $T \in [11, \infty)$.
\end{pf}

We also review the notion of posynomials~\citep{Boyd2007} for the proof of Theorem~\ref{thm:deterministic}. Let $f \colon \mathbb{R}^n_{+}\to \mathbb{R}_{+}$ be a function. We say that $f$ is a \emph{monomial} if there exist $c>0$ and real numbers~$a_1$, \dots,~$a_n$ such that $f(v) = c v_{\mathstrut 1}^{a_{1}} \dotsm v_{\mathstrut n}^{a_n}$. We say that $f$ is a \emph{posynomial} if $f$ is the sum of finitely many monomials. The following lemma shows the log-log convexity of posynomials and is used in the proof of Theorem~\ref{thm:deterministic}.

\begin{lem}[\cite{Boyd2007}]\label{lem:llconvexity}
Let $f \colon \mathbb{R}_{+}^n \to \mathbb{R}_{+}$ be a posynomial. Define the function $F\colon \mathbb{R}^n \to \mathbb{R}$ by $F(w) = \log f(\exp[w])$, where $\exp[\cdot]$ denotes the entry-wise exponentiation. Then, $F$ is convex.
\end{lem}

Let us prove Theorem~\ref{thm:deterministic}.

\begin{pf}
Under the transformations $x(t) = \log T_c(t)$, $y_j(t) = \log m_j(t)$, and $\Gamma = \log \gamma$, the constraints~\eqref{eq:const:T_c}, \eqref{eq:delayConst}, \eqref{eq:cpuTemperatureConst}, and \eqref{eq:performance_gamma} are equivalent to the constraints~\eqref{eq:x_bound}, \eqref{eq:exp:delayConst}, \eqref{eq:exp:cpuTempConst}, and \eqref{eq:lessthanGamma}, respectively. Therefore, the solution of the optimization problem~\eqref{eq:mpc:deterministic} is given by \eqref{eq:optimalInputRepresentation} with $x^\star$, $y_1^\star$, \dots, $y_J^\star$ being the solutions of the optimization problem~\eqref{eq:convexProg:deterministic}.

Let us show the convexity of the optimization problem~\eqref{eq:convexProg:deterministic} under the assumption~\eqref{eq:asm:T>11}. It is sufficient to show the convexity of the mappings $\psi \colon
(x, y_1, \dotsc, y_J) \mapsto \log T_{\cpu, j}(t; u_\tau)$ and $\phi

\colon (x, y_1, \dotsc, y_J) \mapsto \log \sum_{t=\tau}^{\tau + t_h} E(t; u_\tau)$. Equation \eqref{eq:temperatureDynamics} implies that $T_{\cpu, j}(t; u_\tau)$ is a posynomial in the variables in~\eqref{eq:def:realInputSeq} because
\begin{equation*}
\begin{multlined}[.9\linewidth]
T_{\cpu, j}(t; u_\tau) = \beta_j^{t-\tau} T_{\cpu, j}(\tau) \\+ \sum_{s = 0}^{t-\tau} \beta_j^{t-\tau-s} \biggl(\alpha_j T_c(s) + a_1\varsigma_j \frac{L_j(s)}{m_j(s)} + a_2\varsigma_j\biggr).
\end{multlined}
\end{equation*}
Therefore, Lemma~\ref{lem:llconvexity} implies the convexity of~$\psi$. Also, Equation~\eqref{eq:def:C} shows $E(t;u_\tau) = P(t;u_\tau) f(e^{x(t)})$ for the function~$f$ defined in \eqref{eq:def:fcop}.
Therefore, to show the convexity of~$\phi$, it is sufficient to show that the function~$F$ defined in~\eqref{eq:def:F} and the mapping $\theta\colon

(x, y_1, \dotsc, y_J) \mapsto \log P(t; u_\tau)$ are both convex. The convexity of the mapping~\eqref{eq:def:F}  follows from Lemma~\ref{lem:convexity:1+1/cop} and the assumption~\eqref{eq:asm:T>11}. We can prove the convexity of $\theta$ in a similar way as $\psi$. We omit the details of the proof due to limitations of space.
\end{pf}

\subsection{Suppression of Fluctuations}

As we observe in Section~\ref{sec:simulation}, the input sequence obtained by iteratively solving the optimization problem~\eqref{eq:convexProg:deterministic} often exhibits relatively large fluctuations. These fluctuations are unfavorable in practice since 1) servers cannot be turned on/off too frequently, and 2) the drastic change in server inlet temperature may compromise system reliability. In this section, we propose adding a regularization term to the objective function in the optimization problem~\eqref{eq:convexProg:deterministic} for suppressing undesirable fluctuations. Furthermore, we show that this modification preserves the convexity of MPC control problems.

For a positive vector~$\xi$ of length $n_\xi$, define the posynomial
\begin{equation*}
V(\xi) = \sum_{i=1}^{n_{\xi}-1} \left(\frac{\xi_i}{\xi_{i+1}} + \frac{\xi_{i+1}}{\xi_{i}} \right).
\end{equation*}
This function measures the amount of fluctuations in the sequence~$\{\xi_1, \dotsc, \xi_{n_\xi}\}$ because the function $V$ attains its minimum if and only if $\xi_1 = \cdots = \xi_{n_\xi}$, i.e., when the sequence has no fluctuation. We then formulate an alternative finite-horizon optimal control problem as follows:
\begin{equation}\label{eq:mpc:deterministic:var}
\begin{aligned}
\minimize_{T_c,\,m_1,\,\dotsc,\,m_J,\,\gamma}\ \ \,& \begin{multlined}[t]
\gamma + w_T V(T_{c}(\tau:\tau+t_h))  \\+\sum_{j=1}^J w_j V(m_{j}(\tau:\tau+t_h))
\end{multlined}
\\
\st\ \ \ & \mbox{\eqref{eq:const:T_c}--\eqref{eq:cpuTemperatureConst}, \eqref{eq:performance_gamma},}
\end{aligned}
\end{equation}
where $f(\tau:\tau+t_h)$ denotes the real vector $[f(\tau)\ \cdots \ f(\tau+t_h)]^\top$ for a function $f$. Adding the term $w_T V(T_{c}(\tau:\tau+t_h)) +\sum_{j=1}^J w_j V(m_{j}(\tau:\tau+t_h))$ to the original objective, we expect that the resulting control inputs show less fluctuations than the one from the previous optimization problem~\eqref{eq:mpc:deterministic}.

The next theorem shows that the optimization problem~\eqref{eq:mpc:deterministic:var} can be transformed to a convex optimization problem. The proof of the theorem is omitted due to limitations of space.

\begin{thm}
Assume \eqref{eq:asm:T>11}.
Then, the solution of the optimization problem~\eqref{eq:mpc:deterministic:var} is given by \eqref{eq:optimalInputRepresentation}, where
$x^\star = \{x^\star(t)\}_{t=\tau}^{\tau+t_h}$ and $y_j^\star = \{y_j^\star(t)\}_{t=\tau}^{\tau+t_h}$ ($j=1, \dotsc, J$) solve the convex optimization problem
\begin{align*}
\minimize_{x,\,y_1,\,\dotsc,\,y_J,\,\Gamma}\ \ \ & \begin{multlined}[t]
\log\Bigl(e^\Gamma + w_T V(e^{x(\tau:\tau+t_h)})  \\+\sum_{j=1}^J w_j V(e^{y_j(\tau:\tau+t_h)})\Bigr)
\end{multlined}
\\
\st\ \ \ &

\mbox{\eqref{eq:exponentialInputSeq}--\eqref{eq:lessthanGamma}}.
\end{align*}
\end{thm}

\section{Scenario-based MPC}\label{sec:stochastic}

In practice, precise predictions on the user request rate (required in Assumption~\ref{asm:deterministic}) may not be available to the operator of the data center. To overcome this limitation, in this section we introduce a scenario-based MPC formalism. Specifically, we model the number of requests~$L_j(t)$ as random variables and place the following assumption in this section.

\begin{assumption}\label{asm:predictDistribution}
There exists a positive integer $t_h$ such that, at each time~$\tau$, a set of~$N$ independent sample paths
\begin{equation}\label{eq:realizations}
\{L_j^{(k)}(t)\}_{1\leq j\leq J,\,\tau\leq t\leq \tau+t_h}\quad (k=1, \dotsc, N)
\end{equation}
of the stochastic process~$L_j$ are available.
\end{assumption}

\begin{remark}
Assumption~\ref{asm:predictDistribution} is not restrictive under our problem setting for the following reason. Typically, the operator of the data center can use a long history of past data on user requests. Furthermore, the history of data can often be regarded as a realization of a stationary stochastic process. In this case, the operator can easily obtain statistically-sound sample paths~\eqref{eq:realizations} from the past data. An implementation of this procedure is discussed in Section~\ref{sec:simulation}.
\end{remark}

Let $E^{(k)}(\cdot; u_\tau)$ and $T_{\cpu, j}^{(k)}(\cdot; u_\tau)$ denote the trajectories of the system when the user requests rates at times~$t = \tau, \dotsc, \tau + t_h$ are those in~\eqref{eq:realizations} and the control input~$u_\tau$ of the form~\eqref{eq:def:realInputSeq} is applied. Then, we can formulate the following scenario-based optimization problem:
\begin{align}
\minimize_{T_c,\,m_1,\,\dotsc,\,m_J,\,\gamma}\ \ \,& \begin{multlined}[t]
\gamma + w_T V(T_{c}(\tau:\tau+t_h))  \\+\sum_{j=1}^J w_j V(m_{j}(\tau:\tau+t_h))
\end{multlined}
\notag
\\
\st\ \ \ & \eqref{eq:exponentialInputSeq},\,\eqref{eq:x_bound},
\notag
\\
&
\log T_{\cpu, j}^{(k)}(t; u_\tau) \leq \log \bar T_{\cpu, j}, \label{eq:convexProg:stochastic}
\\
& y_j(t) \geq \log(\bar D_j^{-1} + L_j^{(k)}(t)) - \log \mu_j,
\notag
\\
& \log \sum_{t=\tau}^{\tau + t_h}  E^{(k)}(t;  u_\tau) \leq \Gamma.
\notag
\end{align}

In order to evaluate the reliability of the control inputs obtained by iteratively solving the optimization problem~\eqref{eq:convexProg:stochastic}, we introduce the following definition adopted from~\citet{Campi2008}. For simplicity of presentations, we hereafter focus on the case of $w_T = w_j = 0$ (i.e., no penalty on fluctuations).

\begin{definition}[\citet{Campi2008}]
The \emph{satisfaction probability} of a control input $u_\tau \in (\mathbb{R}_+^{t_h+1})^{J+1}$ and a performance level~$\gamma$, denoted by $s(u_\tau, \gamma)$, is defined as the probability that inequalities~\eqref{eq:delayConst}, \eqref{eq:cpuTemperatureConst}, and~\eqref{eq:performance_gamma} hold true for all $\tau \leq t\leq  \tau+t_h$.
\end{definition}

The following theorem allows us to estimate the satisfaction probability. The proof of the theorem follows from the convexity of the optimization problem~\eqref{eq:convexProg:stochastic} (after the logarithmic transformations used in Section~\ref{sec:deterministic}) and Theorem~1~in \cite{Campi2008}. The details are omitted due to limitations of space.

\begin{thm}
Assume that inequality~\eqref{eq:asm:T>11} holds true. Let $x^\star = \{x^\star(t)\}_{t=\tau}^{\tau+t_h}$, $y_j^\star = \{y_j^\star(t)\}_{t=\tau}^{\tau+t_h}$, and $\Gamma^\star$ be the solutions of the convex optimization problem \eqref{eq:convexProg:stochastic}. Let $u^\star_\tau = \{e^{x^*(t)}, e^{y_1^*(t)}, \dotsc, e^{y_J^*(t)} \colon 1\leq j\leq J,\,\tau\leq t\leq \tau+t_h\}$. Then, $\Pr(s(u_\tau^\star, \log \Gamma^\star) > \epsilon) \leq \sum_{i=0}^{(t_h+1)J}\binom{N}{i} \epsilon^i (1-\epsilon)^{N-i}$.
\end{thm}

\newcommand{\figureDate}{D05-Apr-2018_19-52-04_S05-Apr-2018_19-48-48}
\newcommand{\folderName}{../../simulations/figures/\figureDate}
\renewcommand{\folderName}{}

\section{Numerical Simulations}\label{sec:simulation}

In this section, we illustrate the effectiveness of the theoretical results obtained in the previous sections by using the real-world Google Workload Data Trace~\citep{Reiss2011} of~$J=3$ users. We pre-process the data so that the average workload arrival rate is calculated per minute. The first $\num[group-separator={,}]{30000}$ arrival rate samples are used to train our scenario-based MPC model. To evaluate the performance of the proposed MPC policy (Section~\ref{sec:deterministic}) and scenario-based MPC policy (Section~\ref{sec:stochastic}), we introduce an Offline Optimal Static (OOS) policy, which uses a constant CRAC supplying air temperature in all decision epochs to minimize the overall energy consumption while enforcing constraints \eqref{eq:const:T_c}, \eqref{eq:delayConst}, and \eqref{eq:cpuTemperatureConst}, provided that the controller has full system information in the future.

Note that the constant temperature policy is widely used in the industry, and OOS presumably has better performance than the conventional constant temperature policy since OOS is equipped with future system information. The deterministic MPC policy requires, at each time $t= \tau$, correct predictions of $L_j(t)$ from $t=\tau$ to $t = \tau + t_h$.  On the other hand, at each time, the scenario-based MPC policy only needs to know the request rate at the current time as well as the past history of the user request rates.

To implement our scenario-based MPC policy, we find $N=100$ different sequences $\{L_{j}(t)\}_{t = t_{0k}}^{t_{0k} + t_h}$ ($k=1, \dotsc, N$) for each time $t=\tau$ and user $j$ such that $L_j(t_{0k}) = L_j(\tau)$ from the past data, and use the sequences as the sample paths~\eqref{eq:realizations} required by Assumption~\ref{asm:predictDistribution}. If there are not enough number of sequences satisfying $L_j(t_{0k}) = L_j(\tau)$, we instead use a sequence such that $L_j(t_{0k})$ is as close to $L_j(\tau)$ as possible.

\subsection{Result Analysis}

We set $t_h = 5$, $a_1 = 10$, $a_2 = 1$, $\alpha_j = 0.05$, $\beta_j = 0.95$, $\varsigma = 1.5$, and  $\mu_j = 1$. We assume that the cooling temperature can be tuned within the interval $18 \leq T_c(t)\leq 27$, which satisfies the assumption~\eqref{eq:asm:T>11}. The maximum CPU temperature and the upper bound of response times are set as $\bar T_{\cpu, j} = 80$ and~$\bar D_j = 0.05$, respectively. We use the initial value~$T_{\cpu, j}(t_0) = 27$. We let $t_0 = \num[group-separator={,}]{30000}$ and~$t_f = \num[group-separator={,}]{30200}$. For simplicity, the weight, $w_m$, for penalizing the fluctuations in the number of servers is set to be zero.

\begin{figure}[tb]
\centering
\includegraphics[width=.95\linewidth,trim={0mm 0mm 0mm 1mm},clip]{compareOptConst_edited.pdf}
\caption{Total IT and cooling energy. Circles: MPC policies, Squares: Scenario-based MPC policies, Solid line: Offline Optimal Static (OOS) policy.}
\label{fig:deterministic:comparisonEnergy}
\end{figure}

\begin{figure}[tb]
\centering
\includegraphics[width=.95\linewidth,trim={0mm 3mm 0mm 5mm},clip]{deterministicTemperatures.pdf}
\caption{Cooling temperatures with MPC policies.}
\label{fig:deterministic:temperatures}
\vspace{3mm}
\centering
\includegraphics[width=.95\linewidth,trim={0mm 3mm 0mm 5mm},clip]{stochasticTemperatures.pdf}
\caption{Cooling temperatures with scenario-based MPC policies.}
\label{fig:stochastic:temperatures}
\end{figure}

In Fig.~\ref{fig:deterministic:comparisonEnergy}, we compare the energy consumption for the three strategies. We see that the MPC policy without penalization ($w_T = 0$) achieves the best performance. The introduction of the penalization term in~\eqref{eq:mpc:deterministic:var} with $w_T= 10^6$ only slightly deteriorates the performance by $0.56\%$. The scenario-based MPC without penalization consumes $7.67\%$ more energy compared to its MPC counterpart, and the penalization further mildly degrades the performance by $7\%$. However, the scenario-based approach still saves $0.8\%$ overall energy compared to OOS, which achieves the lowest energy consumption when $T_c=20.9^\circ$C. Note that OOS requires full future information and is the opportunistic lower bound of practical static policies. We here also emphasize that the scenario-based policy is the most realistic among other policies because it does not require predictions, which is hard to be precise in practice.

Figs.~\ref{fig:deterministic:temperatures} and \ref{fig:stochastic:temperatures} show the instant CRAC supplying air temperature $T_c$ for MPC and scenario-based MPC, respectively. If there is no penalization term, $T_c$ in MPC is generally $1^\circ$C higher than scenario-based MPC. However, if the penalization term is presented, $T_c$ in MPC is $1.7^\circ$C lower than scenario-based MPC. Since a higher $T_c$ increases the CRAC efficiency, we can conclude that scenario-based MPC with penalization has the potential to save the cooling energy. In addition, it is shown that the penalization greatly suppresses fluctuations in $T_c$. More specifically, the variance of $T_c$ drops from $5.8$ to $1.1$ for MPC, and from $6.0$ to $1.2$ for scenario-based MPC.

\begin{figure}[tb]
\centering
\includegraphics[width=.95\linewidth,trim={-1mm 15mm 0mm 18.5mm},clip]{server1.pdf}
\caption{Servers allocated to user 1. From top to bottom: the CPU temperature, the number of the servers, and the response time.}
\label{fig:deterministic:sever1}
\end{figure}

Finally, we illustrate the trajectories of the CPU temperature, the number of  servers, and the response time for the first cluster of servers in Fig.~\ref{fig:deterministic:sever1}. We can see that OOS generally achieves the lowest CPU temperature, since the constant CRAC supplying air setpoint has to be low enough to guarantee the thermal constraint \eqref{eq:cpuTemperatureConst} in the worst case. In contrast, the CPU temperature in deterministic MPC is very close to the threshold $\bar{T}_{\cpu,j}$ since the supplying air temperature can be dynamically tuned. Scenario-based MPC uses more servers than basic MPC due to the lack of future system information. The delay constraint \eqref{eq:delayConst} is satisfied for all three policies.

\section{Conclusions}

In this paper, we have studied the problem of minimizing the energy consumption in data centers with cold aisle containment. We have proposed standard and scenario-based MPC policies to solve the problem. Since our formulation allows the sequences of optimal control problems to be reduced to convex optimization problems, we can efficiently and uniquely identify control inputs with a guaranteed optimality. With several numerical simulations, we have confirmed the effectiveness of the proposed policies.


text:
\section{Set of Homomorphisms is Subgroup of All Mappings}
Tags: Homomorphisms, Subgroups

\begin{theorem}
Let $\struct {S, \circ}$ be an [[Definition:Algebraic Structure|algebraic structure]].
Let $\struct {T, \oplus}$ be an [[Definition:Abelian Group|abelian group]].
Let $\struct {T^S, \oplus}$ be the [[Definition:Induced Structure|algebraic structure on $T^S$ induced by $\oplus$]].
Then the set of all [[Definition:Homomorphism (Abstract Algebra)|homomorphisms]] from $\struct {S, \circ}$ into $\struct {T, \oplus}$ is a [[Definition:Subgroup|subgroup]] of $\struct {T^S, \oplus}$.
\end{theorem}

\begin{proof}
Let $H$ be the set of all [[Definition:Homomorphism (Abstract Algebra)|homomorphisms]] from $\struct {S, \circ}$ into $\struct {T, \oplus}$.
=== {{GroupAxiom|0}} ===
From [[Homomorphism on Induced Structure]], we have that $\forall f, g \in H: f \oplus g$ is a [[Definition:Homomorphism (Abstract Algebra)|homomorphism]] from $\struct {S, \circ}$ into $\struct {T, \oplus}$.
Hence $\struct {H, \oplus}$ is [[Definition:Closed Algebraic Structure|closed]].
=== {{GroupAxiom|3}} ===
From [[Inverse Mapping in Induced Structure]], if $g$ is a [[Definition:Homomorphism (Abstract Algebra)|homomorphism]] then its [[Induced Structure Inverse]] $g^*$ is one also.
Thus $g \in H \implies g^* \in H$.
So by the [[Two-Step Subgroup Test]], $\struct {H, \oplus}$ is a [[Definition:Subgroup|subgroup]] of $\struct {T^S, \oplus}$.
{{qed}}
\end{proof}

config: wiki


TITLE: what prime numbers can be written as the sum of two consecutive squares?
QUESTION [3 upvotes]: title. I Tried using Gaussian integers but it got me nowhere. I'm not even sure a 'nice' characterization is possible.

REPLY [1 votes]: Basically, we are looking for primes $p=n^2 + (n+1)^2$ according to Wojowu. But primes, except the first two, are either of the form $p=6k+1$ or $p=6k-1$.
So we are looking for solutions of $2n^2 + 2n + 1 = 6k-1$ and $2n^2 +2n +1 = 6k+1$. So the problem is now reduced to solving a quadratic equation in $n$ with a parameter $k$. We demand that the discriminant $d$ of these quadratic equations be a square.
The case of $p=6k-1$ has a $d=12k-3$. $d$ is a square for $k=1,7,19,...$ and the corresponding primes are $p=5=1^2 + 2^2$, $p=41=4^2 + 5^2$ and $p=113=7^2 +8^2$. Most probably, not all square values of d will lead to a prime.
The case of $p=6k+1$ has a $d=12k+1$. $d$ is a square for $k=2,10,30,52...$ and the primes are $p=13= 2^2 + 3^2$, $p=61=5^2 + 6^2$, $p=181=9^2 + 10^2$, $p=313=12^2 +13^2$.
It would be nice if someone could write a program (I cannot) to look for more $k$ values that lead to primes. By the way, the first two primes cannot be written as a sum of two consecutive primes.


TITLE: Shell Method Problem
QUESTION [0 upvotes]: Use the shell method to find the volume of the solid generated by revolving the regions bounded by the curves and lines about the y-axis.
$y=x^2$, $y = 5 -4x$, $x = 0$ for $x \ge0$
I have the integral set up as
$$2\pi \int_{-5}^0(x)(-4x+5-x^2) \, dx$$
I'm having issues typing that in correctly. The integral evaluates to $875\pi/5$ when the answer is $11\pi/6$. Why is my setup wrong? Everything I look at about it seems right and am having trouble.

REPLY [0 votes]: The region that is being rotated can be seen below; it's the region below $y=5-4x$ and above $y=x^2$, with $x\in[0,1]$. So, the volume is$$\int_0^12\pi x(5-4x-x^2)\,\mathrm dx=\frac{11\pi}6.$$


TITLE: Example of $A \subseteq B$, $\dim(A)=\dim(B)$, $J$ non-maximal ideal of $B$ and $J \cap A$ a maximal ideal of $A$
QUESTION [0 upvotes]: Let $A \subseteq B$ be two $k$-algebras, $k$ is a field of characteristic zero.
Assume that $\dim(A)=\dim(B) < \infty$.

Is it possible to find
  a non-maximal ideal $J$ of $B$ such that $J \cap A$ is a maximal ideal of $A$?

Please see this question, in which the following example appears:
$A=k[x] \subset k[x,y]=B$. $J = (x,y^2)$ is not a maximal ideal of $k[x,y]$
and $J \cap k[x] = (x)$ is a maximal ideal of $k[x]$;
but in this example we have $\dim(A)=1 < \dim(B)=2$.
Thank you very much!

REPLY [2 votes]: When you don't require $J$ to be prime, things can get weird, even for integral extensions, as Youngsu pointed out (see $k[x^2] \subseteq k[x]$, where $x^2k[x] \cap k[x^2] = x^2k[x^2]$).
The important positive result that works even when $J$ is not prime is the following: if $A \subseteq B$ is an epimorphism of rings and $J$ is an ideal of $B$ such that $J \cap A = \mathfrak{m}$ is maximal, then $J$ is maximal.
Indeed, in this case the pushout $A/\mathfrak{m} \subseteq B/J$ is an epimorphism from a field, so it is a surjection.  Thus $B/J$ is a field and $J$ is a maximal ideal [Stacks Lemma 10.106.7, 10.106.8]
Edit: flatness obviously has nothing to do with this property. Consider $k \subseteq k[x]$. Every ideal contained in $xk[x]$ contracts to $0$.
Edit again Also for any field $k$, the finite product $\prod k$ is separable over $k$, and there will be non-maximal ideals which contract to $0$ in $k$.


TITLE: Evaluating $\frac{1}{\sigma\sqrt{2\pi}}\int_{h=K}^{\infty}he^{\frac{-(h-\mu)^2}{2\sigma^2}}dh$
QUESTION [0 upvotes]: Is there an analytical way to evaluate the above? (Basically evaluating the expectation of a normally distributed random variable over a specific range of values).
I've tried the following substitution, which hasn't really simplified the problem much:
$$y=\frac{-(h-\mu)^2}{2\sigma^2} \leftrightarrow \sqrt{-2\sigma^2y} +\mu = h $$
$$\frac{dy}{dh}=\frac{\mu-h}{\sigma^2} \leftrightarrow dh=\frac{dy\sigma^2}{\mu-h}=\frac{dy\sigma^2}{-\sqrt{-2\sigma^2y}}$$
So:
$$\frac{1}{\sigma\sqrt{2\pi}}\int_{h=K}^{\infty}he^{\frac{-(h-\mu)^2}{2\sigma^2}}dh=\frac{1}{\sigma\sqrt{2\pi}}\int_{y=\frac{-(K-\mu)^2}{2\sigma^2}}^{\infty}(\sqrt{-2\sigma^2y} +\mu)\frac{\sigma^2e^{y}}{-\sqrt{-2\sigma^2y}}dy=\\=\frac{1}{\sigma\sqrt{2\pi}}\int_{y=\frac{-(K-\mu)^2}{2\sigma^2}}^{\infty}-\sigma^2e^y-\frac{\mu\sigma^2e^y}{\sqrt{-2\sigma^2y}}dy$$
To be clear, $K$, $\mu$ and $\sigma$ are constants.

REPLY [1 votes]: $$I=\frac{1}{\sigma\sqrt{2\pi}}\int h\,e^{\frac{-(h-\mu)^2}{2\sigma^2}}dh$$
Let
$$\frac{(h-\mu)^2}{2\sigma^2}=t^2\implies h=\mu +\sqrt{2} \sigma  t\implies dh=\sqrt{2} \sigma \,d t$$
$$I=\frac{1}{\sigma\sqrt{2\pi}}\Bigg[\mu\int e^{-t^2}\,dt+\sqrt{2} \sigma\int t \,e^{-t^2} \,dt \Bigg]$$ Thid first one is trivial and the secon even more if you write
$$\int t \,e^{-t^2} \,dt=\frac 12 \int  \,e^{-t^2} \,d(t^2)$$


TITLE: What is this restricted sum of multinomial coefficients?
QUESTION [5 upvotes]: It is relatively easy to show that
$$
\sum_{a_1 + \cdots + a_k=\ell} \binom{\ell}{a_1,\ldots,a_k} = k^\ell
$$
where $\binom{\ell}{a_1, \ldots, a_k} = \frac{\ell!}{a_1!\cdots a_k!}$. What can be said if we want to compute the restricted sum
$$
s(\ell,k) = \sum_{a_1 + \cdots + a_k=\ell} \binom{\ell}{a_1,\ldots,a_k}
$$
where we now restrict the summation to those $a_k$ which are odd? At the least, of course, we need that $\ell \geq k$ and that $\ell \equiv k \pmod 2$. Is this sum known in the literature?
The simplest case of $s(2k,2) = 2^{2k-1}$ can be easily verified, but I believe that this is an anomoly based on the fact that these are (secretly) binomial coefficients.
This arises in computing the coefficients of the power series of $\big(\sin(x)\big)^k$.

REPLY [0 votes]: Another way to approach the original problem is to recall the formula:
$$\cos(y)^k = \frac{1}{2^k} \sum_{j=0}^k \binom{k}{j}\cos((k-2j)y).$$
Plugging in $y=\frac{\pi}{2} - x$ would give an expansion for $\sin(x)^k$.
I suspect eventually it would lead to the same formula that I gave in the previous answer.


TITLE: Intuition about Taking an Integral
QUESTION [4 upvotes]: My hope is to personally develop some further intuition for taking an integral (measuring the area under a curve). Consider a normal distribution and I need the area under the curve from $a$ to $b$. I know from calculus that the answer is given by:
$$P(a\le X \le b)  = \int_{a}^{b} f(x)dx = \int_{a}^{b}\frac{1}{\sigma\sqrt{2\pi}}e^{−(y−\mu)^2/ 2\sigma^2} dx$$
My class instructor then draws a normal curve, indicates $a$ and $b$ on the horizontal axis (number line) and draws a line up from each point $a, b$ to the density function, connects the two crossing points and showing a square asks us, "How do we get the area of a square?" (Answer: base times height.)
It is then shown that the area of the square underestimates the area under the curve and then to get a better approximation the squares are redrawn as two rectangles and then four rectangles and then eight rectangles and this process shows that the area of the (smaller and smaller width) rectangles approximates the area under the curve better and better.
Next the instructor said that the "$f(x)$" part can be thought of as the height of the rectangle and the "$dx$" part can be thought of as the base (width) of the rectangle and that we want the base to be really small, in fact, infinitely small. The instructor then says something like, "Taking an integral or measuring the are under a curve is like summing the areas of rectangles with infinitely small width."
My questions:

Are there other intuitive explanations of what is happening when we take an integral out there and would you please provide them?
How would a pure mathematician explain an integral?
Would the explanations (intuitive and mathematical) be fully consistent?

Multiple explanations or points of view would be appreciated.

REPLY [1 votes]: One intuition (perhaps idiosyncratic) I have about integration comes from motion. Suppose we know how fast someone is going over a range of times; in that case we can work out how far they went. Intuitively, you could say that you take a lot of estimates of velocity $times$ distance at different times and add them up. But mathematically what you're doing is integrating the speed to get the distance.
One could also go the other way: If the speed itself is changing, then we can use the acceleration (the rate of change of speed) to find how much the velocity changes in a given time interval.
The way I like to explain this to intro. physics students: Integral calculus is a machine for turning information at earlier times (where they were, how fast they were moving) into information at future times. It takes the acceleration and spits out the velocity and position.


TITLE: Alternative classical explanation of the Stern-Gerlach Experiment?
QUESTION [13 upvotes]: Many questions have been asked on this site about the Stern-Gerlach experiment, but as far as I can tell this one hasn't. Does the following classical explanation of the SG experiment work?
Model electrons as a finite-sized hollow sphere of rotating charge $e$. Immediately after entering the SG device, the dipole moment of the electron quickly reorients itself to align with the magnetic field of the device. This is what I would expect to happen if a small bar magnet were placed in a region of high magnetic field gradient. Suppose this happens before the electron has traveled 1% of the distance of the device. Then, for the remaining 99% of the distance in the SG device, the electron is completely oriented either "spin-up" or "spin-down," so the binary "all-or-nothing" measurement is naturally predicted by this classical picture.
This would also work to explain sending the beam through multiple differently oriented SG devices, since the previous spin orientation of the electron is completely altered (very quickly) each time the electron enters a new device.
EDIT:
I don't think I was clear enough about the overall point of the question, since a few people have now brought up the fact that the spherical electron model has issues. I'm aware of that, but not really concerned with the specific electron structure model, so much as why some classical model wouldn't work to describe the binary output beam behavior (which knzhou gave a very nice answer to).
Perhaps a better hypothetical classical model would be: A classical point-particle with intrinsic angular momentum / magnetic dipole moment, the correct gyromagnetic ratio (supposing this could be a tunable classical parameter for point-particles), and some "braking mechanism" that allows it to quickly align with a magnetic field and stay aligned.
I think this question matters because the SG experiment is often used as a pedagogical example of quantum mechanics in introductory courses. When I first learned QM, I remember being confused about why this example was supposed to be so convincing, since it seemed that there could exist classical explanations of it.

REPLY [8 votes]: First, in the Stern-Gerlach experiment, a beam of silver atoms was used, and not a beam of electrons. Secondly, the interpretation of data at that time (1922) based on the classical equations of motion. It is assumed that the silver atom has a magnetic moment on which the force acts
$$\vec {F}=\nabla (\vec {\mu}.\vec {B})……(1)$$
The role of quantum mechanics is reduced to the statement that the magnetic moment in equation (1) is quantized in proportion to the angular momentum or spin. In this form, the theory of the scattering of atoms in a non-uniform magnetic field was used to solve practical problems related to the determination of the magnetic moment of atoms using the Stern-Gerlach method down to the present time. As it is known, Stern and Gerlach obtained the following figure of silver atoms (on the left without a magnetic field, on the right in a magnetic field)

The question is, can we get the right figure using equation (1) with $\mu =\pm \mu_B$? I simulated the scattering of silver atoms in a magnetic field with a gradient as in the Stern-Gerlach experiment. All parameters of the gap and velocity of atoms were as in experiment. The result is shown in Fig. 2, where a) magnetic field lines and gap projection (red rectangle); b)magnetic field gradient (solid line) and experimental data (points) from Stern and Gerlach; c) atomic scattering pattern in a magnetic field; d) the same without a magnetic field. Comparing the scattering figures in Figs. 1 and 2, we find that Bohr’s hypothesis about quantizing the magnetic moment with projection $\pm\mu _B$ to the direction of the magnetic field is confirmed.

A similar result can be obtained without this hypothesis, simply using the Schrödinger–Pauli equation:
$$i\hbar \frac {\partial \psi}{\partial t}=-\frac {\hbar ^2}{2m}\nabla^2\psi+\mu _B(\vec {B}.\vec {\sigma })\psi $$
$\vec {\sigma }=(\sigma _1,\sigma _2, \sigma _3)$ there is a Pauli matrix. Figure 3 shows the scatter pattern in the quantum model.

Update 1. Data shown above have been taken from several papers and books including
W . Gerlach, O . Stern . Der experimentelle Nachweis des magnetischen Moments des Silberatoms // Zeitschrift fur Physik, 1922, Volume 8, Issue 1, pp 110 - 111.
W. Gerlach,O. Stern. Der experimentelle Nachweis der Richtungsquantelung im Magnetfeld, Zeitschrift fur Physik 9 (1922) 349-352.
The code for Mathematica shown below can be used to plot Figures as follows
Clear[p, \[Theta], \[Phi], q]
ge = .5; g = 0; L0 = .035; Wy =
 0.0008/L0; Wz = .00003/L0; nz0 = 6; eps1 = 0; eps =
 Pi/10; mB = -9.274078*10^(-24);
mAg = 107.868*1.6605655*10^(-27); kB = 1.380662*10^(-23); Tov =
 1300 + 273.15;
v0 = Sqrt[
   3.5*kB*Tov/
     mAg];(* data taken from W.Gerlach,O.Stern.Der experimentelle Nachweis des magnetischen Moments des Silberatoms//Zeitschrift fur
Physik,1922,Volume 8,Issue 1,pp 110-111*)

t1 = 1; t0 = L0/v0;

h = 1.0545887*10^(-34);
\[Omega] = mB/h;

y0 = Wz;
z0 = Wy;

f[t_] := (1 - Sign[t - t1])/2;
(*Magnetic field data taken from W.Gerlach,O.Stern. Der experimentelle Nachweis der Richtungsquantelung im Magnetfeld, Zeitschrift fur Physik 9 (1922) 349-352 *)
Bsh = {{.00015, 23.6}, {.00020, 17.3}, {.0003, 13.5}, {.0004, 11.2}};
By[y_, z_, y0_,
   z0_] := -(z + z0) (1/((y - y0)^2 + (z + z0)^2) -
     1/((y + y0)^2 + (z + z0)^2));
Bz[y_, z_, y0_,
   z0_] := (y - y0)/((y - y0)^2 + (z + z0)^2) - (y +
      y0)/((y + y0)^2 + (z + z0)^2);
Byy[y_, z_, y0_,
   z0_] := -(z + z0) (-((2 (y - y0))/((y - y0)^2 + (z + z0)^2)^2) + (
     2 (y + y0))/((y + y0)^2 + (z + z0)^2)^2);
Byz[y_, z_, y0_, z0_] := -1/((y - y0)^2 + (z + z0)^2) +
   1/((y + y0)^2 + (z + z0)^2) - (z +
      z0) (-((2 (z + z0))/((y - y0)^2 + (z + z0)^2)^2) + (
      2 (z + z0))/((y + y0)^2 + (z + z0)^2)^2);
Bzy[y_, z_, y0_,
   z0_] := -((2 (y - y0)^2)/((y - y0)^2 + (z + z0)^2)^2) +
   1/((y - y0)^2 + (z + z0)^2) + (
   2 (y + y0)^2)/((y + y0)^2 + (z + z0)^2)^2 -
   1/((y + y0)^2 + (z + z0)^2);
Bzz[y_, z_, y0_,
   z0_] := -((2 (y - y0) (z + z0))/((y - y0)^2 + (z + z0)^2)^2) + (
   2 (y + y0) (z + z0))/((y + y0)^2 + (z + z0)^2)^2;

Visualization of magnetic field and gradient
Show[{StreamDensityPlot[{Bz[y, z, y0*L0, z0*L0],
    By[y, z, y0*L0, z0*L0]}, {z, -.0005, .0005}, {y, -0.0005, .0005},
   FrameLabel -> {"z", "y"}],
  Graphics[{Opacity[.6], Red,
    Rectangle[{-z0*L0 + 21*Wz*L0 - Wz*L0/2, -Wy*L0/2}, {-z0*L0 +
       21*Wz*L0 + Wz*L0/2, Wy*L0/2}]}]}]

Show[{Plot[
   23.6*Bzz[0, z, y0*L0, z0*L0]/
     Bzz[0, .00015, y0*L0, z0*L0], {z, .00015, .0005},
   AxesLabel -> {"z, m", "dBz/dz,T/cm"}], ListPlot[Bsh]}]

Visualization of silver deposition
k = ge*mB*L0/(mAg*v0^2); k1 = k*23.6*100/Bzz[0, .00015/L0, y0, z0];
eq = {Mx'[t] ==
    f[t]*g*(Bz[y[t], z[t], y0, z0] My[t] -
       By[y[t], z[t], y0, z0] Mz[t]),
   My'[t] == f[t]*g*(-Bz[y[t], z[t], y0, z0] Mx[t]),
   Mz'[t] == f[t]*g*(By[y[t], z[t], y0, z0] Mx[t]),
   Mx[0] == Cos[\[Theta]], My[0] == Sin[\[Theta]]*Cos[\[Phi]],
   Mz[0] == Sin[\[Theta]]*Sin[\[Phi]], x''[t] == 0,
   y''[t] == (1 + .0*(y[t]/y0)^2)*f[t]*
     k1*(My[t]*Byy[y[t], z[t], y0, z0] +
       Mz[t]*Byz[y[t], z[t], y0, z0]),
   z''[t] ==
    f[t]*k1*(My[t]*Bzy[y[t], z[t], y0, z0] +
       Mz[t]*Bzz[y[t], z[t], y0, z0]), x'[0] == 1, x[0] == 0,
   y'[0] == 0, y[0] == p, z'[0] == 0, z[0] == -z0 + 21*Wz + q};
pfuny = ParametricNDSolveValue[eq,
  y[1], {t, 0, 1}, {p, \[Theta], \[Phi], q}]
pfunz = ParametricNDSolveValue[eq,
  z[1], {t, 0, 1}, {p, \[Theta], \[Phi], q}]
Show[{ParametricPlot[{Sum[
      pfunz[p, Pi/2 + eps1*j, Pi/2 + eps*j, q]*L0, {j, -nz0,
       nz0}]/(2*nz0 + 1),
    Sum[pfuny[p, Pi/2 + eps1*j, Pi/2 + eps*j, q]*L0, {j, -nz0,
       nz0}]/(2*nz0 + 1)}, { q, -Wz/2, Wz/2}, {p, -Wy/2, Wy/2},
   PlotRange -> All, Mesh -> All],
  ParametricPlot[{Sum[
      pfunz[p, Pi/2 + eps1*j, -Pi/2 + eps*j, q]*L0, {j, -nz0,
       nz0}]/(2*nz0 + 1),
    Sum[pfuny[p, Pi/2 + eps1*j, -Pi/2 + eps*j, q]*L0, {j, -nz0,
       nz0}]/(2*nz0 + 1)}, { q, -Wz/2, Wz/2}, {p, -Wy/2, Wy/2},
   PlotRange -> All, Mesh -> None]}]

REPLY [2 votes]: There are semiclassical equations of motion that fully explain the Stern-Gerlach experiment, see e. g. Section 5 of Gat, Lein & Teufel, Annales Henri Poincaré 15, 1967 (2014). It is important, though, that in this approach it is not the individual trajectories that matter, but averages of an ensemble of initial spins (which are obtained from a generalized Wigner transform of the quantum spin state). And this is how quantum mechanics comes into play, because only states from quantum mechanics give you a consistent interpretation.


TITLE: How to compute $\sqrt{i + 1}$
QUESTION [18 upvotes]: Possible Duplicate:
How do I get the square root of a complex number?

I'm currently playing with complex numbers and I realized that I don't understand how to compute $\sqrt{i + 1}$. My math program, sage, returns
$$1.09868411346781 + 0.455089860562227*i$$
How does sage compute that number? I don't even see how one could rewrite $\sqrt{i + 1}$ in a number of the form $a+bi$.

REPLY [9 votes]: Hint $\ $ Applying my Simple Denesting Rule and rationalizing denominators yields
$$\rm \sqrt{1 + {\it i}\,}\, =\, \sqrt{\alpha}+ {\it i}\,\sqrt{-\alpha'}\quad for\quad \alpha,\alpha' \,=\, \frac{1\pm\sqrt{2}}2$$
Indeed, squaring it yields $\rm\,\ \alpha+\alpha'\! + 2 \sqrt{-\alpha\alpha'}\:{\it i}\: =\, 1 + {\it i}$


TITLE: Calculus Problem [Calculus I]
QUESTION [1 upvotes]: The sand is falling on a conical pile of sand at a rate of $12\,\text{m}^2 / \text{min},$ so that the diameter of the base of the pile is always $3/2$ of the height. Find the speed at which the height increases when the pile is $2$ meters.
So, I don't even know where to start, I don't know what to do; the problem seems more of a physics problem but it is from a Final Calculus Exam. A hint would be nice.
I don't know if it is important or not but this is the second part of the exercise, while the first part was to find the volume of a cone using an integral.

REPLY [2 votes]: Note: Your post says that sand is falling on a conical pile at $12\text{m}^2/\text{min}$, which doesn't make much sense–how can an area fall onto a pile? Perhaps the problem asked for $12\text{m}^3/\text{min}$. If that's not the case and the area of the base is increasing by $12\text{m}^2/\text{min}$, try and relate area and height as I do in this answer.
This is a related rates problem. First, write down everything you know:
$$d = \frac 32 h \quad V = \frac 13 \pi r^2h \quad \frac{\mathrm dV}{\mathrm dt} = 12\text{m}^3/\text{min}$$
The goal of the exercise is to find $\frac{\mathrm dh}{\mathrm dt}$. We can do this by relating $V$ and $h$. Realize that $12\text{m}^2/\text{min}$ represents the change in volume over time. Since we know the radius is one-half the diameter, and the diameter is $3/2$ the height, we can relate them as such, rewriting purely in terms of $h$:
$$d = \frac 32 h \implies r = \frac 34 h$$
$$V = \frac 13 \pi r^2h \implies V = \frac 13 \pi\left(\frac 34h\right)^2h \implies V = \frac 3{16} \pi h^3$$
Now differentiate and equate:
$${\mathrm dV\over \mathrm dt} = {\mathrm d\over \mathrm dt}\left(\frac 3{16} \pi h^3\right)\implies 12 = \frac 9{16}\pi h^2{\mathrm dh\over \mathrm dt}$$
Now isolate $\frac{\mathrm dh}{\mathrm dt}$ to solve. Since you are trying to find $\frac{\mathrm dh}{\mathrm dt}$ when $h = 2\text{m}$, plug in $2$ for $h$.

REPLY [0 votes]: First, write down an equation that describes the relationship between variables in your problem. In this case, the variables can be reduced to volume and height of the cone.
$$V=\frac{1}{3}Ah=\frac{1}{3}\pi r^2h=(\frac{1}{3}\pi\frac{9}{16})h^3$$
Take derivative of the equation above with respect to $t$. Since you know $\frac{dV}{dt}=12$, you can plug that in to find $\frac{dh}{dt}$.


TITLE: Can you use a wormhole to travel through space not time?
QUESTION [4 upvotes]: I want to know if you could theoretically travel from your house to work via a wormhole but stay in the present day...without changing time. Kind of like teleportation but harnessing the energy of a black hole or wormhole. My background is chemistry not physics so I'd prefer a mathematical explanation. Thanks.

REPLY [2 votes]: I believe that space cannot be isolated from time once matter enters the wormhole. Time is bound to the third dimension, so time would enter from the same point of matter (the end assumes the nature of the entry, compromising the wormhole's integrity); kept open I believe it would behave as a tube as long as the wormhole (similar to last, post but less specific). I thought about having a wormhole inside of a wormhole to keep the integrity of the outer tube, but you are still compromising the inner tube and ignoring any effect from the outer tube. I believe that anything that enters physically brings space/time with itself by definition: either it doesn't enter, or it doesn't exit.


TITLE: Number of spanning trees of a labeled graph
QUESTION [3 upvotes]: This labeled graph is given, I need to find the number of its spanning trees.

The number of spanning trees of the following graph is 3

and the number of spanning trees of this is 8

So as a result the number of spanning trees of the graph is $3^2 \times 8^3 = 4608$ while it is not the correct answer.

REPLY [5 votes]: Your reasoning looks correct. And, according to Sage, 4608 is indeed the number of spanning trees.