\appendix
\part{Appendix}
\label{part:appendix}

\chapter{Syntax and options}

\section{Robust statistics (robstat)}
\label{sec:syntax:robstat}                                                      \todo{This section will be replaced.
                                                                                The plan is to collect the different
                                                                                tools in new command \stcmd{robstat}}

\subsection{Classical estimators}

Classical estimators are readily available in Stata via the \texttt{summarize}
command using the \texttt{detail} option.

\subsection{Quantile-based estimators}

Quantile based estimators are not readily available in Stata but can easily be
calculated using the \texttt{centile} command. For example, for a statistical
series $x$, we compute:

\begin{description}
\item the \emph{median} $Q_{0.5;n}$ by
\end{description}

\texttt{centile x, centile(50)}

\texttt{local med=r(c\_1)}

\begin{description}
\item the \emph{corrected interquartile range} $\stsc{IQR}_c$ by
\end{description}

\texttt{centile x, centile(25 75)}

\texttt{local iqr=(r(c\_2)-r(c\_1))*0.7413}

\begin{description}
\item the Yule and Kendall skewness coefficient $\stsc{SK}_{0.25;n}$ by
\end{description}

\texttt{centile x, centile(25 50 75)}

\texttt{local sk=(r(c\_1)+r(c\_3)-2*r(c\_2))/(r(c\_2)-r(c\_1))}

\begin{description}
\item the quantile tail weight measures $\stsc{LQW}_{0.25;n}$ and
$\stsc{RQW}_{0.25;n}$ by
\end{description}

\texttt{centile body, centile(12.5 25 37.5 62.5 75 87.5)}

\texttt{local lqw=-(r(c\_1)+r(c\_3)-2*r(c\_2))/(r(c\_3)-r(c\_1))}

\texttt{local rqw=(r(c\_4)+r(c\_6)-2*r(c\_5))/(r(c\_6)-r(c\_4))}

\subsection{Pairwise-based estimators}

As explained in the previous sections, the location, scale, skewness and tails
heaviness estimators based on pairwise combinations or comparisons of the
observations are particularly interesting because they perform better than the
classical or quantile-based estimators, namely in terms of robustness. But
they require at first sight a heavy computation time of an order of $n^2$.
Fortunately, as explained in \citet{croux:rousseeuw:1992}, an efficient
algorithm proposed by \citet{johnson:mizoguchi:1978} allows to substantially reduce the computation time to an order of
$n\log n$ and, hence, allows to use these robust estimators even in very large
datasets. This algorithm has been programmed in Stata (cf.\
\citealp{gelade:verardi:vermandele:2015}) and is involved in the Stata
computation of the pairwise-based estimators.

For these pairwise-based estimators, the Stata commands are \texttt{hl} (for
the Hodges-Lehman location estimator $\stsc{HL}_n$), \texttt{qn} (for the
Rousseeuw and Croux $Q_n$ estimator), \texttt{medcouple} (for Brys'
medcouple $\stsc{MC}_n$, left medcouple $\stsc{LMC}_n$ and right
medcouple $\stsc{RMC}_n$).\ The corresponding syntaxes are:

\underline{\textbf{Location}}

\medskip

\textbf{Title}

hl -- Hodges and Lehman (1963) robust measure of location

\smallskip

\textbf{Syntax}

hl varname [if] [in]

\bigskip

\underline{\textbf{Dispersion}}

\medskip

\textbf{Title}

qn -- Rousseeuw and Croux (1993) robust measure of dispersion

\smallskip

\textbf{Syntax}

qn varname [if] [in]

\bigskip

\underline{\textbf{Skewness and heavyness of the tails}}

\medskip

\textbf{Title}

medcouple -- medcouple measure of asymmetry and heaviness of the tails

\smallskip

\textbf{Syntax}

medcouple varname [if] [in] [, lmc rmc nomc]

\bigskip

----------------------------------------------------------------------------------

\textbf{options description}

----------------------------------------------------------------------------------

\underline{Main} \smallskip

\texttt{lmc} specifies to calculate the medcouple only for those informations
smaller than the median. This is an indicator of the heaviness of the left tail.

\texttt{rmc} Specifies to calculate the medcouple only for those informations
larger than the median. This is an indicator of the heaviness of the right tail.

\texttt{nomc} Specifies not to calculate the global medcouple. This is for
instance useful when one is only interested in the heaviness of the tails.

\subsection{Normality tests}

The Stata command \textquotedblleft\texttt{robjb} \textit{varname} [if]
[in]\textquotedblright\ has been created to apply these robust tests of
normality. This command implements the test considering both skewness and
heaviness of tails by default. Two mutually exclusive options are available:
\texttt{skewness} and \texttt{kurtosis}. If the former is used, a test based
exclusively on the skewness is performed while if the latter is called, a test
based exclusively on the heaviness of the tails is performed.

\subsection{Boxplot}

DESCRIBE\ HERE\ THE\ COMMAND, FOR\ THE\ MOMENT\ WE\ HAVE

\bigskip

\textbf{Title}

box\_out - Boxplot for skewed and/or heavy-tailed distributions

\textbf{Syntax}

box\_out varname [if] [in] [, out(varname) bdp(\#) perc(\#) nograph]

\underline{\textbf{Description}}

box\_out Creates the boxplot for skewed and/or heavy-tailed distributions

----------------------------------------------------------------------------------

\textbf{options description}

----------------------------------------------------------------------------------

\underline{Main} \smallskip

\texttt{out(varname)} Identifies the new variable to be created to identify
individuals outside the fence defined by the whiskers

\texttt{bdp(integer)} Sets the desired Break-down point (in \%). It is 10\% by default

\texttt{perc(real)} Sets the desired percentage of points outside the whiskers
in case of uncontaminated data.

\texttt{nograph} Suppresses the graph

box\_out saves the following in e():

\texttt{e(g) }Estimated skewness parameter of the underlying Tukey g and h distribution

\texttt{e(h)} Estimated elongation parameter of the underlying Tukey g and h distribution

\texttt{e(upperW)} Value of the upper whisker

\texttt{e(lowerW)} Value of the lower whisker

\section{Robust linear regression (robreg)}
\label{sec:syntax:robreg}

\stcmd{robreg} provides a number of robust estimators for linear
regression models. The syntax of \stcmd{robreg} is:

\begin{stsyntax}
    robreg
    \stit{estimator}
    \depvar\
    \optindepvars\
    \optif\
    \optin\
    %\optweight\
    \optional{, \stit{options}}
\end{stsyntax}

\noindent
where \stit{estimator} is one of the following:

\hangpara
    \stcmd{mm} to fit the efficient high breakdown \stsc{MM} estimator proposed
    by \citet{yohai:1987}. On the first stage, a high breakdown \stsc{S}
    estimator is applied to estimate the residual scale and derive starting
    values for the coefficients vector. On the second stage, an efficient
    bisquare \stsc{M} estimator is applied to obtain the final coefficient
    estimates.

\hangpara
    \stcmd{gm} \alert{to be implemented}

\hangpara
    \stcmd{m} to fit regression \stcmd{M} estimators \citep{huber73} using
    iteratively reweighted least squares (\stsc{IRWLS}).

\hangpara
    \stcmd{s} to fit the high breakdown \stcmd{S} estimator introduced by
    \citet{rousseeuw:yohai:1984} using the fast algorithm by
    \cite{salibian:yohai:2006} with a nonsingular subsampling refinement as
    proposed by \citet{Koller:2012}.

\hangpara
    \stcmd{lms}, \stcmd{lqs}, or \stcmd{lts} to fit the least median of squares
    (\stsc{LMS}), the least quantile of squares (\stsc{LQS}; a generalization
    of \stsc{LMS}), or the least trimmed squares (\stsc{LTS}) estimator,
    respectively \citep{rousseeuw:leroy:1987}. Estimation is carried out using
    simple resampling without local improvement (e.g.\
    \citealp[197]{rousseeuw:leroy:1987}). Computation of standard errors is not
    supported for \stcmd{lms}, \stcmd{lqs}, and \stcmd{lts}.

\noindent \stcmd{robreg} without arguments replays the previous results; see
\uref{20.3 Replaying prior results}. \stcmd{robreg} saves its results in
\stcmd{e()}, so that post estimation commands can be applied; see \uref{20
Estimation and postestimation commands}. Type \stcmd{ereturn list} to list the
\stcmd{e()}-returns after estimation; see \pref{ereturn}.

\subsection{Options for robreg mm}

\subsubsection{Main}

\hangpara
    \stcmd{\underbar{eff}iciency(\num)} sets the gaussian efficiency of the \stsc{MM}
    estimator (i.e., the asymptotic relative efficiency compared to the
    \stsc{LS} or \stsc{ML} estimator in case of i.i.d.\ normal errors). The
    efficiency is determined by appropriate choice of the tuning constant for
    the bisquare \stsc{M} estimator in the second stage of the \stsc{MM}
    algorithm. \num\ must be between 0.1 and 99.9. The default for the
    \stsc{MM} estimator is \stcmd{efficiency(85)}, as suggested by
    \citet[144]{maronna:etal:2006}.

\hangpara
    \stcmd{bp(\num)} sets the breakdown point of the \stsc{MM} estimator. The
    breakdown point is determined by appropriate choice of the tuning constant
    for the \stsc{S} estimator in the first stage of the \stsc{MM} algorithm.
    \num\ must be between 1 and 50. The default is \stcmd{bp(50)}.

\hangpara
    \stcmd{\underbar{haus}man} performs a generalized Hausman test of the \stsc{MM}
    estimate against the \stsc{S} estimate. A significant Hausman test
    indicates that the \stsc{MM} estimate significantly deviates from the
    \stsc{S} estimate.

\subsubsection{Biweight M estimate}

\hangpara
    \stcmd{k(\num)} specifies the tuning constant for the bisquare \stsc{M}
    estimator in the second stage of the \stsc{MM} algorithm. \stcmd{k()} not
    allowed if \stcmd{efficiency()} is specified.

\hangpara
    \stcmd{\underbar{tol}erance(\num)} specifies the tolerance for the weights of the
    \stsc{IRWLS} algorithm used to fit the bisquare \stsc{M} estimator. When
    the maximum absolute change in the weights from one iteration to the next
    is less than or equal to \stcmd{tolerance()}, the convergence criterion is
    satisfied. The default is \stcmd{tolerance(1e-6)}.

\hangpara
    \stcmd{\underbar{iter}ate(\num)} specifies the maximum number of iterations for the
    IRWLS algorithm used to fit the bisquare \stsc{M} estimator. If convergence
    is not reached within \stcmd{iterate()} iterations, the algorithm stops and
    returns error. The default is \stcmd{iterate(16000)} or as set by
    \stcmd{set maxiter} (see \rref{maximize}).

\hangpara
    \stcmd{relax} causes the \stsc{IRWLS} algorithm to return the current
    results instead of returning error if convergence is not reached.

\hangpara
    \stcmd{\dunderbar{g}enerate(\stit{newvar})} stores the final weights of the
    \stsc{IRWLS} algorithm in variable \stit{newvar}.

\hangpara
    \stcmd{\underbar{re}place} permits \stcmd{robreg} to overwrite existing variables.

\subsubsection{Initial S estimate}

\hangpara
    \stcmd{\underbar{n}samp(\num)} specifies the number of trial samples for the search
    algorithm of the \stsc{S} estimator in the first stage of the \stsc{MM}
    algorithm. The default value is determined according to formula
    $
    \lceil \ln(\alpha) / \ln(1 - (1 - \varepsilon)^p) \rceil
    $
    within a range of 50 to 10000, where $p$ is the number of coefficients in
    the model and $\alpha = 0.01$ and $\varepsilon = 0.2$ (see
    \citealp{salibian:yohai:2006} for a justification of the formula). The
    default values for $\alpha$ and $\varepsilon$ can be changed via
    \stcmd{sopts()} (see below).

\hangpara
    \stcmd{\underbar{s}opts(\stit{options})} specifies additional options to be passed
    through to the \stsc{S} estimator. See the section on options for
    \stcmd{robreg s} below.

\hangpara
    \stcmd{save(\stit{name})} saves the results of the \stsc{S} estimator under
    \stit{name} using \stcmd{estimates store} (see \rref{estimates}).

\subsubsection{Standard errors}

\hangpara
    \stcmd{vce(\underbar{nor}obust)} causes standard errors to be computed
    using traditional formulas assuming constant error variance. The default
    is to compute robust standard errors as suggested by \citet{Croux:2003}
    (using formula $\stsc{Avar}_1$; the traditional formula is equivalent to
    $\stsc{Avar}_{2s}$).

\hangpara
    \stcmd{\underbar{nor}obust} is a synonym for \stcmd{vce(norobust)}

\subsubsection{Reporting}

\hangpara
    \stcmd{\underbar{l}evel(\num)} specifies the level for confidence intervals. The
    default is \stcmd{level(95)} or as set by \stcmd{set level} (see
    \rref{level}).

\hangpara
    \stcmd{first} causes the first stage \stsc{S} estimate to be displayed.

\hangpara
    \stcmd{\underbar{nodot}s} suppresses the progress dots of the \stsc{S} estimator
    search algorithm.

\hangpara
    \stcmd{\underbar{lo}g} displays the iteration log of the second stage \stsc{IRWLS}
    algorithm.

\hangpara
    \stit{display\_options} are various display options; see \rref{estimation
    options}.

\subsection{Options for robreg gm}

\alert{To be completed.}

\subsection{Options for robreg m}

\subsubsection{Main}

\hangpara
    \stcmd{\underbar{h}uber} causes the Huber objective function to be used
    (monotone \stsc{M} estimator). This is the default.

\hangpara
    \stcmd{\underbar{bi}weight} causes the biweight or bisquare objective function to be
    used (redescending \stsc{M} estimator). \stcmd{bisquare} is a synonym for
    \stcmd{biweight}. The solution of a redescending \stsc{M} estimator may
    depend on the starting values.

\hangpara
    \stcmd{\underbar{eff}iciency(\num)} sets the gaussian efficiency (i.e.\ the asymptotic
    relative efficiency compared to the \stsc{LS} or \stsc{ML} estimator in
    case of i.i.d.\ normal errors) by appropriate choice of the tuning
    constant. \num\ must be between 63.7 and 99.9 for \stcmd{huber} and between
    0.1 and 99.9 for \stcmd{biweight}. The default is \stcmd{efficiency(95)}.

\hangpara
    \stcmd{k(\num)} specifies the tuning constant. \stcmd{k()} not allowed if
    \stcmd{efficiency()} is specified.

\subsubsection{IRWLS algorithm}

\hangpara
    \stcmd{\underbar{tol}erance(\num)} specifies the tolerance for the weights of the
    \stsc{IRWLS} algorithm. When the maximum absolute change in the weights
    from one iteration to the next is less than or equal to
    \stcmd{tolerance()}, the convergence criterion is satisfied. The default is
    \stcmd{tolerance(1e-6)}.

\hangpara
    \stcmd{\underbar{iter}ate(\num)} specifies the maximum number of iterations for the
    \stsc{IRWLS} algorithm. If convergence is not reached within
    \stcmd{iterate()} iterations, the algorithm stops and returns error. The
    default is \stcmd{iterate(16000)} or as set by \stcmd{set maxiter} (see
    \rref{maximize}).

\hangpara
    \stcmd{relax} causes the \stsc{IRWLS} algorithm to return the current results
    instead of returning error if convergence is not reached. For example,
    to fit a one-step \stsc{M} estimate specify \stcmd{relax} together with
    \stcmd{iterate(1)}.

\hangpara
    \stcmd{\dunderbar{g}enerate(\stit{newvar})} stores the final weights of the
    \stsc{IRWLS} algorithm in variable \stit{newvar}.

\hangpara
    \stcmd{\underbar{re}place} permits \stcmd{robreg} to overwrite existing variables.

\subsubsection{Initial estimate}

\hangpara
    \stcmd{init(\textit{arg})} determines the choice of the initial estimate
    that provides the starting values for the \stsc{IRWLS} algorithm.
    \stit{arg} may be \stcmd{lav} for the \stsc{LAV} estimator (a.k.a.\ median
    regression; fitted using \stcmd{qreg}, see \rref{qreg}), \stcmd{ols} for
    the least squares estimator (fitted using \stcmd{regress}, see
    \rref{regress}), \stit{name} for an estimation set stored under
    \stit{name}, or \stcmd{.} for the currently active estimation results. The
    default is \stcmd{init(lav)}.

\hangpara
    \stcmd{save(\stit{name})} saves initial \stcmd{lav} or \stcmd{ols} estimate
    under \stit{name} using \stcmd{estimates store} (see \rref{estimates}).

\subsubsection{Scale estimate}

\hangpara
    \stcmd{\underbar{s}cale(\num)} provides a preliminary value for the residual scale
    that will be held constant. The default is to use the normalized median of
    the $(n-p)$ largest absolute residuals from the initial fit, where $n$ is
    the sample size and $p$ is the number of coefficients, as an estimate of
    the residual scale (\stsc{MADN}).

\hangpara
    \stcmd{\dunderbar{update}scale} causes the \stsc{MADN} scale estimate to be updated in
    each iteration of the \stsc{IRWLS} algorithm. \stcmd{updatescale} has no
    effect if \stcmd{scale()} is specified.

\hangpara
    \stcmd{\underbar{cen}ter} causes the \stsc{MADN} scale estimate to be computed based
    on median centered residuals. \stcmd{center} has no effect if
    \stcmd{scale()} is specified.

\subsubsection{Standard errors}

\hangpara
    \stcmd{vce(\underbar{nor}obust)} causes standard errors to be computed
    using traditional formulas assuming constant error variance. The default
    is to compute robust standard errors as suggested by \citet{Croux:2003}
    (using formula $\stsc{Avar}_1$; the traditional formula is equivalent to
    $\stsc{Avar}_{2s}$).

\hangpara
    \stcmd{vce(pv)} causes traditional standard errors to be computed using the
    pseudo-values approach \citep{street.etal.AmStat.1988}. \stcmd{vce(pv)} is
    equivalent to \stcmd{vce(norobust)} but includes some small sample
    correction.

\hangpara
    \stcmd{\underbar{nor}obust} is a synonym for \stcmd{vce(norobust)}

\hangpara
    \stcmd{nose} skips the computation of standard errors.

\subsubsection{Reporting}

\hangpara
    \stcmd{\underbar{l}evel(\num)} specifies the level for confidence intervals. The
    default is \stcmd{level(95)} or as set by \stcmd{set level} (see
    \rref{level}).

\hangpara
    \stcmd{first} causes the initial estimate to be displayed.

\hangpara
    \stcmd{\underbar{lo}g} displays the iteration log of the second stage \stsc{IRWLS}
    algorithm.

\hangpara
    \stit{display\_options} are various display options; see \rref{estimation
    options}.

\subsection{Options for robreg s}

\subsubsection{Main}

\hangpara
    \stcmd{bp(\num)} sets the breakdown point by appropriate choice of the
    tuning constant (this also determines the gaussian efficiency). \num\
    must be between 1 and 50. The default is \stcmd{bp(50)}.

\hangpara
    \stcmd{k(\num)} specifies the tuning constant. \stcmd{k()} not allowed if
    \stcmd{bp()} is specified.

\hangpara
    \stcmd{\underbar{haus}man} performs a generalized Hausman test of the least squares
    estimate against the \stsc{S} estimate. A significant Hausman test
    indicates that the least squares estimate significantly deviates from the
    \stsc{S} estimate.

\subsubsection{Resampling algorithm}

\hangpara
    \stcmd{\underbar{c}ategorical(\stit{varlist})} specifies the variables to be treated
    as categorical. The default is to detect and treat all dummy variables as
    categorical. If \stcmd{categorical()} is specified, the detection of dummy
    variables is deactivated and only the variables identified by
    \stcmd{categorical()} are treated as categorical. Variables from
    \stcmd{categorical()} that are not found in \stit{indepvars} will be
    automatically added to the end of \stit{indepvars}. \stcmd{categorical()}
    may contain factor variables; see \uref{11.4.3 Factor variables}.
    \alert{I changed the default behavior, if I remember right. Needs to be updated.}

\hangpara
    \stcmd{\underbar{noc}ategorical} treats all variables as continuous.

\hangpara
    \stcmd{\dunderbar{nonsing}ular} use nonsingular subsampling \alert{needs to be completed;
    nonsingular should be default}

\hangpara
    \stcmd{\underbar{n}samp(\num)} specifies the number of trial samples for the search
    algorithm. The default value is determined according to formula
    $
    \lceil \ln(\alpha) / \ln(1 - (1 - \varepsilon)^p) \rceil
    $
    within a range of 50 to 10000, where $p$ is the number of coefficients in
    the model and $\alpha$ and $\varepsilon$ are set by \stcmd{alpha()} and
    \stcmd{epsilon()} (see \citealp{salibian:yohai:2006} for a justification of
    the formula).

\hangpara
    \stcmd{alpha(\num)} specifies the maximum admissible risk of drawing a set
    of samples of which none is free of outliers. This is a parameter in the
    formula for the computation of the required number samples (see above). The
    default is \stcmd{alpha(0.01)} (i.e.\ 1 percent). \stcmd{alpha()} has no
    effect if \stcmd{nsamp()} is specified.

\hangpara
    \stcmd{\dunderbar{eps}ilon(\num)} specifies the assumed maximum fraction of
    contaminated data. This is a parameter in the formula for the computation
    of the required number samples (see above). The default is
    \stcmd{epsilon(0.2)} (i.e.\ 20 percent). \stcmd{epsilon()} has no effect if
    \stcmd{nsamp()} is specified.

\hangpara
    \stcmd{\underbar{nk}eep(\num)} specifies the number of best candidates to be
    kept for final refinement. The default is \stcmd{nkeep(2)}.

\hangpara
    \stcmd{\dunderbar{rstep}s(\num)} specifies the number of local improvement steps
    applied to the candidates. The default is \stcmd{rsteps(1)}.

\hangpara
    \stcmd{\underbar{stol}erance(\num)} specifies the tolerance for the scale estimate of
    the candidates. When the absolute relative change in the scale from one
    iteration to the next is less than or equal to \stcmd{stolerance()}, the
    convergence criterion is satisfied. The default is \stcmd{stolerance(1e-6)}.

\hangpara
    \stcmd{\underbar{siter}ate(\num)} specifies the maximum number of iterations for the
    scale estimate of the candidates. If convergence is not reached within
    \stcmd{siterate()} iterations, the algorithm stops and returns error. The
    default is \stcmd{siterate(16000)} or as set by \stcmd{set maxiter} (see
    \rref{maximize}).

\hangpara
    \stcmd{\underbar{tol}erance(\num)} specifies the tolerance for the coefficients in the
    refinement \stsc{IRWLS} algorithm. When the maximum relative change in the
    coefficient vector from one iteration to the next is less than or equal to
    \stcmd{tolerance()}, the convergence criterion is satisfied. The default is
    \stcmd{tolerance(1e-6)}.

\hangpara
    \stcmd{\underbar{iter}ate(\num)} specifies the maximum number of iterations for the
    refinement \stsc{IRWLS} algorithm. If convergence is not reached within
    \stcmd{iterate()} iterations, the algorithm stops and returns error. The
    default is \stcmd{iterate(16000)} or as set by \stcmd{set maxiter} (see
    \rref{maximize}).

\hangpara
    \stcmd{\dunderbar{sstep}s(\num)} specifies the number of approximation steps for the
    scale estimate within each \stsc{RWLS} iteration. The default is
    \stcmd{ssteps(1)}.

\hangpara
    \stcmd{\dunderbar{srstep}s(\num)} n of iterations for p-subset scale; default: until
    convergence \alert{revise!}

\hangpara
    \stcmd{\underbar{ceff}iciency(\num)} efficiency of M for catvars; default
    \stcmd{cefficiency(95)} \alert{revise!}

\hangpara
    \stcmd{ck(\num)} k of M for catvars; not allowed with \stcmd{cefficiency()}
    \alert{revise!}

\hangpara
    \stcmd{\dunderbar{cstep}s(\num)} approx. steps for catvar M within p-subset; default
    \stcmd{cstep(0)} \alert{revise!}

\hangpara
    \stcmd{\underbar{noxr}esid} do not residualize continuous variables \alert{revise!}

\hangpara
    \stcmd{\dunderbar{fstep}s(\num)} approx. iteration in final backfit rounds; default:
    until convergence \alert{revise!}

\hangpara
    \stcmd{\underbar{nback}fit(\num)} n of final backfit rounds; default: 20
    \alert{revise!}

\hangpara
    \stcmd{\underbar{nobr}eak} do not exit final backfitting if scale increases
    \alert{revise!}

\hangpara
    \stcmd{\dunderbar{g}enerate(\stit{newvar})} stores the final \stsc{IRWLS} weights from
    the best solution in variable \stit{newvar}.

\hangpara
    \stcmd{\underbar{re}place} permits \stcmd{robreg} to overwrite existing variables.

\subsubsection{Standard errors}

\hangpara
    \stcmd{vce(\underbar{nor}obust)} causes standard errors to be computed using
    traditional formulas assuming constant error variance. The default is to
    compute robust standard errors as suggested by \citet{Croux:2003} (using
    formula $\stsc{Avar}_1$; the traditional formula is equivalent to
    $\stsc{Avar}_{2s}$).

\hangpara
    \stcmd{\underbar{nor}obust} is a synonym for \stcmd{vce(norobust)}

\hangpara
    \stcmd{nose} skips the computation of standard errors.

\subsubsection{Reporting}

\hangpara
    \stcmd{\underbar{l}evel(\num)} specifies the level for confidence intervals. The
    default is \stcmd{level(95)} or as set by \stcmd{set level} (see
    \rref{level}).

\hangpara
    \stcmd{\underbar{nodot}s} suppresses the progress dots of the search algorithm.

\hangpara
    \stit{display\_options} are various display options; see \rref{estimation
    options}.

\subsection{Options for robreg lms, robreg lqs, and robreg lts}

\subsubsection{Main}

\hangpara
    \stcmd{bp(\num)} sets the breakdown point, where \num\ may be in $(0,0.5]$. \stcmd{bp()}
    determines the $h$ parameter for the \stsc{LQS} and \stsc{LTS} estimators as
    $
    h = \lfloor(1-\num) \cdot n\rfloor + \lfloor\num \cdot (p + 1)\rfloor
    $
    where $n$ is the sample size and $p$ is the number of coefficients. The
    default is \stcmd{bp(0.5)}. \stcmd{bp()} is not allowed with
    \stcmd{robreg lms}.

\subsubsection{Resampling algorithm}

\hangpara
    \stcmd{\underbar{n}samp(\num)} specifies the number of trial samples for the search
    algorithm. The default value is determined according to formula
    $
    \lceil \ln(\alpha) / \ln(1 - (1 - \varepsilon)^p) \rceil
    $
    within a range of 50 to 10000, where $p$ is the number of coefficients in
    the model and $\alpha$ and $\varepsilon$ are set by \stcmd{alpha()} and
    \stcmd{epsilon()}.

\hangpara
    \stcmd{alpha(\num)} specifies the maximum admissible risk of drawing a set
    of samples of which none is free of outliers. This is a parameter in the
    formula for the computation of the required number samples (see above). The
    default is \stcmd{alpha(0.01)} (i.e.\ 1 percent). \stcmd{alpha()} has no
    effect if \stcmd{nsamp()} is specified.

\hangpara
    \stcmd{\dunderbar{eps}ilon(\num)} specifies the assumed maximum fraction of
    contaminated data. This is a parameter in the formula for the computation
    of the required number samples (see above). The default is
    \stcmd{epsilon(0.2)} (i.e.\ 20 percent). \stcmd{epsilon()} has no effect if
    \stcmd{nsamp()} is specified.

\hangpara
    \stcmd{\dunderbar{g}enerate(\stit{newvar})} stores a variable \stit{newvar} that marks the
    minimizing trial sample.

\hangpara
    \stcmd{\underbar{re}place} permits \stcmd{robreg} to overwrite existing variables.

\subsubsection{Reporting}

\hangpara
    \stcmd{\underbar{nodot}s} suppresses the progress dots of the search algorithm.

\hangpara
    \stit{display\_options} are various display options; see \rref{estimation
    options}.

\section{Robust logistics regression (roblogit)}
\label{sec:syntax:roblogit}

\section{Robust multivariate statistics (robmv)}
\label{sec:syntax:robmv}


\section{Optoelectronic coupling}

The non-interacting system displays valley selective optical excitations.
Light of a particular polarization only couples to one valley.
Since the superconducting state is
a coherent condensate admixing the two valleys,
we address whether pair-breaking displays similar valley selectivity.
In particular, we explore whether or not the two quasiparticles generated
by circularly polarized light, with total energy larger than
$Δ + Δ_{\vK}$, occupy opposite valleys,
with one in the conduction band and the other in the valence band.

The optical excitations arise from the Berry curvature,
which acts as an effective angular momentum.
The electromagnetic potential $\vc{A}$,
with polarization vector $\vc{ϵ}$,
is introduced using minimal coupling,
$H_{τ {\s}}^{ν ν'} \ofK
→ H_{τ {\s}}^{ν ν'} \of{\vK + e \vc{A}}$,
where, in the dipole approximation,
$\vc{A} = 2 \re{\vc{ϵ} A_0 e^{- i ω t}}$.
This yields a perturbed Hamiltonian
$H → H + H^A$, where
$H^A = H' e^{- i ω t} + H'^† e^{i ω t}$,
with
\begin{equation}
  H'
  = ∑_{\vK, τ, {\s}}
    H'_τ
    {d^-_{τ {\s}}}^† \ofK
    d^+_{τ {\s}} \ofK
  - ∑_{\vK, τ, {\s}}
    H'_{-τ}
    {d^+_{τ {\s}}}^† \ofK
    d^-_{τ {\s}} \ofK,
\end{equation}
and
$H'_τ
= a t e A_0
\left( τ \vc{\hat{x}} + i \vc{\hat{y}} \right) · \vc{ϵ}$.
The transition rate is proportional to the modulus-squared
of the optical matrix elements,
$\vc{P}_{τ {\s}}^{n n'} \ofK$,
defined by
\begin{equation}
  H^A
  = ∑_{\substack{\vK, τ, {\s} \\ n, n'}}
    \frac{e A_0}{m_0}
    \vc{ϵ} · \vc{P}_{τ {\s}}^{n n'} \ofK
    {c_{τ {\s}}^n}^† \ofK
    c_{τ {\s}}^{n'} \ofK.
\end{equation}
For circularly polarized light, in the absence of superconductivity,
$\vc{ϵ}_± = \left( \vc{\hat{x}} ± i \vc{\hat{y}} \right) / \sqrt{2}$ and
\begin{equation}
  \label{eq:optical}
  \vc{ϵ}_± · \vc{P}_{τ {\s}}^{+ -} \of{\vK}
  = ∓ τ \sqrt{2} a t m_0
    e^{± i ϕ}
    \sin^2 {\frac{\fnTheta{∓ τ}}{2}}.
\end{equation}
See \cref{s:appendix:optical} for a full derivation.

The transition rate matrix elements
for optical excitations from the BCS ground state
are given by \cref{eq:optical}
multiplied by a coherence factor $\sin {β_{\vK}}$.
Since $\fnTheta{-} - \fnTheta{+} = τ π$,
switching either the valley or polarization transforms
$\sin → \cos$ in \cref{eq:optical}, giving matrix elements
$\abs{P_±} = \abs{\vc{ϵ}_± · \vc{P}_{++}^{+ -} \ofK \sin {β_{\vK}}}$
corresponding to matching ($P_+$) or mismatching ($P_-$)
polarization-valley indexes.
For a given valley, a chosen polarization of light couples more strongly
than the other, as is evident comparing $\abs{P_+}^2$ to $\abs{P_-}^2$
and shown in \cref{fig:optical}.
For incident light with energy $Δ + \abs{λ_{\vK}}$,
right circularly polarized light ($+$) has a higher probability
of promoting a quasiparticle to the right conduction band,
as reflected in the larger matrix element $\abs{P_+}^2 ≫ \abs{P_-}^2$.
As depicted in \cref{fig:optical-excitation},
the partner of the Cooper pair is in the valence band in the opposite valley.
The other valley has the opposite dependence on polarization.

This key new result opens the door for valley control of excitations
from a coherent ground state.
For example, the two quasiparticles have the same charge and Berry curvature
(see below).
In the presence of an electric filed,
they both acquire the same transverse anomalous velocity.
Thus, in contrast to the response in the normal state,
an anomalous Hall effect is anticipated
with no accompanying spin current.

\begin{figure}[b]
  \includegraphics[width=\columnwidth]{figures/optical-transitions-bcs}
  \caption{%
    Optical transition rate matrix elements
    $\left| P_± \right|^2$
    in the superconducting phase
    as a function of the ratio of the quasiparticle energy
    $λ_{\vK}$ to the superconducting gap $Δ_{\vK}$.
    Material parameters for \ce{MoSe2}, \ce{WS2}, and \ce{WSe2}
    are given in~\cite{PhysRevLett.108.196802}
    and a gap of $Δ_{\vK} = \SI{7.5}{\milli\electronvolt}$
    is chosen for illustrative purposes.
    The order-of-magnitude contrast between
    $\left|P_+\right|^2$ and $\left|P_-\right|^2$
    causes the optical-valley selectivity.
  }\label{fig:optical}
\end{figure}

\begin{figure}
  \includegraphics[width=\columnwidth]{figures/bcs-excitation}
  \caption{%
    Pair-breaking by right circularly polarized light
    leads to an electron in the conduction band of the right valley
    and a partner in the valence band of the left valley.
    The valleys interchange for left circularly polarized light.
  }\label{fig:optical-excitation}
\end{figure}


\chapter{solutions/magnetostatics}
\begin{abox}
	Practice set 1 solutions/magnetostatics
	\end{abox}
\begin{enumerate}
\begin{minipage}{\textwidth}
	\item The magnetic field at a distance $R$ from a long straight wire carrying a steady current $I$ is proportional to
	\exyear{NET 2012}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $I R$
	\task[\textbf{B.}] $I / R^{2}$
	\task[\textbf{C.}]$I^{2} / R^{2}$
	\task[\textbf{D.}]$I / R$
\end{tasks}
\begin{answer}
	The correct option is \textbf{(d)}
\end{answer}
\begin{minipage}{\textwidth}
	\item The vector potential $\vec{A}$ due to a magnetic moment $\vec{m}$ at a point $\vec{r}$ is given by $\vec{A}=\frac{\vec{m} \times \vec{r}}{r^{3}}$.
	If $\vec{m}$ is directed along the positive $z$-axis, the $x$ - component of the magnetic field, at the point $\vec{r}$, is
	\exyear{NET 2011}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{3 m y z}{r^{5}}$
	\task[\textbf{B.}] $-\frac{3 m x y}{r^{5}}$
	\task[\textbf{C.}]$\frac{3 m x z}{r^{5}}$
	\task[\textbf{D.}]$\frac{3 m\left(z^{2}-x y\right)}{r^{5}}$
\end{tasks}
\begin{answer}
	\begin{align*}
	\vec{m}&=m \hat{z}\\
	 \text { and }\\
	 \vec{B}&=\vec{\nabla} \times \vec{A}=\frac{m}{r^{3}}(2 \cos \theta \hat{r}+\sin \theta \hat{\theta})=\frac{1}{r^{3}}[3(\vec{m} \cdot \hat{r}) \hat{r}-\vec{m}] \\
 \vec{B}&=\frac{1}{r^{3}}\left[3 m \hat{z} \cdot\left(\frac{x \hat{x}+y \hat{y}+z \hat{z}}{r}\right) \frac{\vec{r}}{r}-m \hat{z}\right] \\
   B_{x}&=\frac{3 m x z}{r^{5}}
	\end{align*}
\end{answer}
\begin{minipage}{\textwidth}
	\item An infinite solenoid with its axis of symmetry along the $z$-direction carries a steady current $I$.
	The vector potential $\vec{A}$ at a distance $R$ from the axis
	\exyear{NET 2012}
	\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=3cm]{NET1}
	\end{figure}
\end{minipage}
\begin{tasks}(1)
	\task[\textbf{A.}]is constant inside and varies as $R$ outside the solenoid
	\task[\textbf{B.}] varies as $R$ inside and is constant outside the solenoid
	\task[\textbf{C.}]varies as $\frac{1}{R}$ inside and as $R$ outside the solenoid
	\task[\textbf{D.}]varies as $R$ inside and as $\frac{1}{R}$ outside the solenoid
\end{tasks}
\begin{answer}
	The correct option is \textbf{(d)}
\end{answer}
\begin{minipage}{\textwidth}
	\item The force between two long and parallel wires carrying currents $I_{1}$ and $I_{2}$ and separated by a distance $D$ is proportional to
	\exyear{NET 2013}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $I_{1} I_{2} / D$
	\task[\textbf{B.}]$\left(I_{1}+I_{2}\right) / D$
	\task[\textbf{C.}]$\left(I_{1} I_{2} / D\right)^{2}$
	\task[\textbf{D.}]$I_{1} I_{2} / D^{2}$
\end{tasks}
\begin{answer}
	The correct option is \textbf{(a)}
\end{answer}
\begin{minipage}{\textwidth}
	\item A time-dependent current $\vec{I}(t)=K t \hat{z}$ (where $K$ is a constant) is switched on at $t=0$ in an infinite current-carrying wire. The magnetic vector potential at a perpendicular distance $a$ from the wire is given (for time $t>a / c$ ) by
	\exyear{NET 2014}
\end{minipage}
\begin{tasks}(1)
	\task[\textbf{A.}] $\hat{z} \frac{\mu_{0} K}{4 \pi c} \int_{-\sqrt{c^{2} t^{2}-a^{2}}}^{\sqrt{c^{2} t^{2}-a^{2}}} d z \frac{c t-\sqrt{a^{2}+z^{2}}}{\left(a^{2}+z^{2}\right)^{1 / 2}}$
	\task[\textbf{B.}] $\hat{z} \frac{\mu_{0} K}{4 \pi} \int_{-c t}^{c t} d z \frac{t}{\left(a^{2}+z^{2}\right)^{1 / 2}}$
	\task[\textbf{C.}] $\hat{z} \frac{\mu_{0} K}{4 \pi c} \int_{-c t}^{c t} d z \frac{c t-\sqrt{a^{2}+z^{2}}}{\left(a^{2}+z^{2}\right)^{1 / 2}}$
	\task[\textbf{D.}] $\hat{z} \frac{\mu_{0} K}{4 \pi} \int_{-\sqrt{c^{2} t^{2}-a^{2}}}^{\sqrt{c^{2} t^{2}-a^{2}}} d z \frac{t}{\left(a^{2}+z^{2}\right)^{1 / 2}}$
\end{tasks}
\begin{answer}
	\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20211011(26)-crop}
	\end{figure}
	 \begin{align*}
	\vec{A} &=\hat{z} \frac{\mu_{0}}{4 \pi} \int_{-\infty}^{\infty} \frac{I\left(t_{r}\right)}{R} d z=\hat{z} \frac{\mu_{0}}{4 \pi} \int_{-\infty}^{\infty} \frac{K(t-R / c)}{R} d z \\
	\Rightarrow \vec{A} &=\hat{z} \frac{\mu_{0} K}{4 \pi c} \int_{-\sqrt{c^{2} t^{2}-a^{2}}}^{\sqrt{c^{2} t^{2}-a^{2}}} d z \frac{c t-\sqrt{a^{2}+z^{2}}}{\left(a^{2}+z^{2}\right)^{1 / 2}}
	\end{align*}
\end{answer}
\begin{minipage}{\textwidth}
	\item A charged particle moves in a helical path under the influence of a constant magnetic field. The initial velocity is such that the component along the magnetic field is twice the component in the plane normal to the magnetic field.
	The ratio $\ell / R$ of the pitch $\ell$ to the radius $R$ of the helical path is
	\exyear{NET 2014}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\pi / 2$
	\task[\textbf{B.}]$4 \pi$
	\task[\textbf{C.}]$2 \pi$
	\task[\textbf{D.}]$\pi$
\end{tasks}
\begin{answer}
	$v_{\|}=2 v_{\perp}$\\
	Pitch of the helix $l=v_{\|} T=v_{\|} \frac{2 \pi R}{v_{\perp}}=2 v_{\perp} \frac{2 \pi R}{v_{\perp}}=4 \pi R \Rightarrow \frac{l}{R}=4 \pi$
\end{answer}
\begin{minipage}{\textwidth}
	\item A proton moves with a speed of $300 \mathrm{~m} / \mathrm{s}$ in a circular orbit in the $x y$-plan in a magnetic field 1 tesla along the positive $z$-direction. When an electric field of $1 \mathrm{~V} / \mathrm{m}$ is applied along the positive $y$-direction, the center of the circular orbit
	\exyear{NET 2014}
\end{minipage}
\begin{tasks}(1)
	\task[\textbf{A.}] remains stationary
	\task[\textbf{B.}]moves at $1 \mathrm{~m} / \mathrm{s}$ along the negative $x$-direction
	\task[\textbf{C.}]moves at $1 \mathrm{~m} / \mathrm{s}$ along the positive $z$ - direction
	\task[\textbf{D.}] moves at $1 \mathrm{~m} / \mathrm{s}$ along the positive $x$ - direction
\end{tasks}
\begin{answer}
	Change particle will deflect in $+x$-direction with $v=\frac{E}{B}=\frac{1}{1}=1 \mathrm{~m} / \mathrm{s} .$\\
	The correct option is \textbf{(d)}
\end{answer}
\begin{minipage}{\textwidth}
	\item Given a uniform magnetic field $B=B_{0} \hat{k}$ (where $B_{0}$ is a constant), a possible choice for the magnetic vector potential $A$ is
	\exyear{NET 2015}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $B_{0} y \hat{i}$
	\task[\textbf{B.}] $-B_{0} y \hat{i}$
	\task[\textbf{C.}] $B_{0}(x \hat{j}+y \hat{i})$
	\task[\textbf{D.}]$B_{0}(x \hat{i}+y \hat{j})$
\end{tasks}
\begin{answer}
	(a) $\vec{\nabla} \times \vec{A}=-B_{0} \hat{k}$\\
	(b) $\vec{\nabla} \times \vec{A}=B_{0} \hat{k}$\\
	(c) $\vec{\nabla} \times \vec{A}=0$\\
	(d) $\vec{\nabla} \times \vec{A}=0$\\
	The correct option is \textbf{(b)}
\end{answer}
\begin{minipage}{\textwidth}
	\item A small magnetic needle is kept at $(0,0)$ with its moment along the $x$-axis. Another small magnetic needle is at the point $(1,1)$ and is free to rotate in the $x y$ - plane. In equilibrium the angle $\theta$ between their magnetic moments is such that
	\exyear{NET 2015}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\tan \theta=\frac{1}{3}$
	\task[\textbf{B.}]$\tan \theta=0$
	\task[\textbf{C.}]$\tan \theta=3$
	\task[\textbf{D.}]$\tan \theta=1$
\end{tasks}
\begin{answer}
	\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=6cm]{diagram-20211011(38)-crop}
	\end{figure}
	\begin{align*}
	&U=\frac{\mu_{0}}{4 \pi r^{3}}\left[\vec{m}_{1} \cdot \vec{m}_{2}-3\left(\vec{m}_{1} \cdot \hat{r}\right)\left(\vec{m}_{2} \cdot \hat{r}\right)\right]\\
	&U=\frac{\mu_{0} m_{1} m_{2}}{4 \pi r^{3}}\left[\cos \theta-3 \cos 45^{0} \cos \left(\theta-45^{0}\right)\right]
	\intertext{For stable position energy is minimum i.e.}
	&\frac{\partial U}{\partial \theta}=0 \Rightarrow \frac{\mu_{0} m_{1} m_{2}}{4 \pi r^{3}}\left[-\sin \theta+\frac{3}{\sqrt{2}} \sin \left(\theta-45^{\circ}\right)\right]=0 \\
	&\Rightarrow \sin \theta=\frac{3}{\sqrt{2}}\left(\frac{\sin \theta}{\sqrt{2}}-\frac{\cos \theta}{\sqrt{2}}\right) \Rightarrow \tan \theta=3
	\end{align*}
	The correct option \textbf{(c)}
\end{answer}
\begin{minipage}{\textwidth}
	\item A dipole of moment $\vec{p}$, oscillating at frequency $\omega$, radiates spherical waves. The vector potential at large distance is\\
	$$\vec{A}(\vec{r})=\frac{\mu_{0}}{4 \pi} i \omega \frac{e^{i k r}}{r} \vec{p}$$
	$\text { To order }\left(\frac{1}{r}\right) \text { the magnetic field } \vec{B} \text { at a point } \vec{r}=r \hat{n} \text { is }$
	\exyear{NET 2015}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $-\frac{\mu_{0}}{4 \pi} \frac{\omega^{2}}{C}(\hat{n} \cdot \vec{p}) \hat{n} \frac{e^{i k r}}{r}$
	\task[\textbf{B.}]$-\frac{\mu_{0}}{4 \pi} \frac{\omega^{2}}{C}(\hat{n} \times \vec{p}) \frac{e^{i k r}}{r}$
	\task[\textbf{C.}]$-\frac{\mu_{0}}{4 \pi} \omega^{2} k(\hat{n} \cdot \vec{p}) \vec{p} \frac{e^{i k r}}{r}$
	\task[\textbf{D.}]$-\frac{\pi_{0}}{4 \pi} \frac{\omega^{2}}{C} \vec{p} \frac{e^{i k r}}{r}$
\end{tasks}
\begin{answer}
	Let $\vec{p}=p \hat{z}$, then $\vec{B}$ must be in $\hat{\phi}$ direction.\\
	Check $\hat{n} \times \vec{p}=\hat{r} \times \hat{z}=\hat{\phi}$.\\
	The correct option is (b).
\end{answer}
\begin{minipage}{\textwidth}
	\item A loop of radius $a$, carrying a current $I$, is placed in a uniform magnetic field $B$. If the normal to the loop is denoted by $\hat{n}$, the force $\vec{F}$ and the torque $\vec{T}$ on the loop are
	\exyear{NET 2015}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\vec{F}=0$ and $\vec{T}=\pi a^{2} I \hat{\mathrm{n}} \times B$
	\task[\textbf{B.}]$\vec{F}=\frac{\mu_{0}}{4 \pi} \vec{I} \times \vec{B}$
	\task[\textbf{C.}]$\vec{F}=\frac{\mu_{0}}{4 \pi} \vec{I} \times \vec{B}$ and $\vec{T}=I \hat{\mathrm{n}} \times \vec{B}$
	\task[\textbf{D.}]$\vec{F}=0$ and $\vec{T}=\frac{1}{\mu_{0} \varepsilon_{0}} I \vec{B}$
\end{tasks}
\begin{answer}
	In uniform field $\vec{F}=0$
	Torque $\vec{T}=\vec{m} \times \vec{B}=\pi a^{2}$ In $\times \vec{B}$\\
	The correct option is \textbf{(a)}
\end{answer}
\begin{minipage}{\textwidth}
	\item A conducting circular disc of radius $r$ and resistivity $\rho$ rotates with an angular velocity $\omega$ in a magnetic field $B$ perpendicular to it. A voltmeter is connected as shown in the figure below. Assuming its internal resistance to be infinite, the reading on the voltmeter
	\exyear{NET 2016}
	\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20211011(46)-crop}
	\end{figure}
\end{minipage}
\begin{tasks}(1)
	\task[\textbf{A.}] depends on $\omega, B, r$ and $\rho$
	\task[\textbf{B.}]depends on $\omega, B$ and $r$ but not on $\rho$
	\task[\textbf{C.}]is zero because the flux through the loop is not changing
	\task[\textbf{D.}]is zero because a current the flows in the direction of $B$
\end{tasks}
\begin{answer}
	Force experienced by charge is
	$$
	\vec{F}=q(\vec{v} \times \vec{B}) \text { and } v=r \omega
	$$
\end{answer}
\begin{minipage}{\textwidth}
	\item A set of $N$ concentric circular loops of wire, each carrying a steady current $I$ in the same direction, is arranged in a plane. The radius of the first loop is $r_{1}=a$ and the radius of the $n^{\text {th }}$ loop is given by $r_{n}=n r_{n-1}$. The magnitude $B$ of the magnetic field at the centre of the circles in the limit $N \rightarrow \infty$, is
	\exyear{NET 2016}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\mu_{0} I\left(e^{2}-1\right) / 4 \pi a$
	\task[\textbf{B.}]$\mu_{0} I(e-1) / \pi a$
	\task[\textbf{C.}]$\mu_{0} I\left(e^{2}-1\right) / 8 a$
	\task[\textbf{D.}]$\mu_{0} I(e-1) / 2 a$
\end{tasks}
\begin{answer}
	\begin{align*}
	&B=\frac{\mu_{0} I}{2}\left(\frac{1}{r_{1}}+\frac{1}{r_{2}}+\frac{1}{r_{3}}+\ldots \ldots . \frac{1}{r_{n}}\right)\\
	&r_{1}=a \\
	&r_{n}=n r_{n-1} \\
	&r_{1}=r_{0}=a, r_{2}=2 r_{1}=2 a, r_{3}=3 r_{2}=3.2 a \text { and } r_{4}=4 r_{3}=4.3 .2 a \\
	&\Rightarrow B=\frac{\mu_{0} I}{2 a}\left(1+\frac{1}{2}+\frac{1}{3.2}+\frac{1}{4.3 .2}+\ldots \ldots\right) \\
	&B=\frac{\mu_{0} I}{2 a}\left(\sum_{n=1}^{N} \frac{1}{\lfloor n}\right) \\
	&e^{x}=\sum_{n=0}^{\infty} \frac{x^{n}}{\lfloor n} \Rightarrow e=\sum_{n=0}^{\infty} \frac{1}{\lfloor n}=1+\sum_{n=1}^{\infty} \frac{1}{\lfloor n} \Rightarrow \sum_{n=1}^{\infty} \frac{1}{\lfloor n}=e-1 \\
	&\lim _{N \rightarrow \infty}\left(\sum_{n=l}^{N} \frac{1}{n}\right)=e-1 \Rightarrow B=\frac{\mu_{0} I}{2 a}(e-1)
	\end{align*}
	THe correct option is \textbf{(d)}
\end{answer}
\begin{minipage}{\textwidth}
	\item A constant current $I$ is flowing in a piece of wire that is bent into a loop as shown in the figure.\\
	\begin{figure}[H]
		\centering
		\includegraphics[height=5cm,width=7cm]{diagram-20211011(54)-crop}
	\end{figure}
	$\text { The magnitude of the magnetic field at the point } O \text { is }$
	\exyear{NET 2017}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{\mu_{0} I}{4 \pi \sqrt{5}} \ln \left(\frac{a}{b}\right)$
	\task[\textbf{B.}]$\frac{\mu_{0} I}{4 \pi \sqrt{5}}\left(\frac{1}{a}-\frac{1}{b}\right)$
	\task[\textbf{C.}]$\frac{\mu_{0} I}{4 \pi \sqrt{5}}\left(\frac{1}{a}\right)$
	\task[\textbf{D.}]$\frac{\mu_{0} I}{4 \pi \sqrt{5}}\left(\frac{1}{b}\right)$
\end{tasks}
\begin{answer}
	\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20211011(55)-crop}
	\end{figure}
	\begin{align*}
	\vec{B}&=\frac{\mu_{0} I}{4 \pi d}\left(\sin \theta_{2}-\sin \theta_{1}\right) \hat{\phi}\\
	\intertext{Magnetic field due to left and right segment of 2a}
	B_{2 a}&=\frac{\mu_{0} I}{4 \pi a}\left(\frac{2 a}{\sqrt{5 a}}\right) \otimes\\
	\intertext{Field due to upper segment of $2 a$}
	&=\frac{\mu_{0} I}{4 \pi(2 a)} \times\left(\frac{a}{\sqrt{5} a}+\frac{a}{\sqrt{5} a}\right)\\
	\text{Net field}\\
	B_{2 a}&=2 \times \frac{\mu_{0} I}{4 \pi a} \times \frac{2}{\sqrt{5}}+\frac{\mu_{0} I}{4 \pi a} \times \frac{1}{\sqrt{5}}\\
	B_{2 a}&=\frac{\mu_{0} I}{4 \pi a} \sqrt{5} \otimes(\text { inward })\\
	\text{similarly,} B_{2 b}&=\frac{\mu_{0} I}{4 \pi b} \sqrt{5} \odot \text{(outward)}\\
\text{	Net field}\\
 B&=B_{2 a}-B_{2 b}=\frac{\mu_{0} I}{4 \pi} \sqrt{5}\left(\frac{1}{a}-\frac{1}{b}\right)\\
	\end{align*}
	The correct option is \textbf{(b)}
\end{answer}
\begin{minipage}{\textwidth}
	\item A circular current carrying loop of radius $a$ carries a steady current. A constant electric charge is kept at the centre of the loop. The electric and magnetic fields, $\vec{E}$ and $\vec{B}$ respectively, at a distance $d$ vertically above the centre of the loop satisfy
	\exyear{NET 2017}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\vec{E} \perp \vec{B}$
	\task[\textbf{B.}] $\vec{E}=0$
	\task[\textbf{C.}]$\vec{\nabla}(\vec{E} \cdot \vec{B})=0$
	\task[\textbf{D.}]$\vec{\nabla} \cdot(\vec{E} \times \vec{B})=0$
\end{tasks}
\begin{answer}
	$\vec{E} \times \vec{B}=0 \Rightarrow \vec{\nabla} \cdot(\vec{E} \times \vec{B})=0$\\
	The correct option is \textbf{(c)}
\end{answer}
\begin{minipage}{\textwidth}
	\item \text { The loop shown in the figure below carries a steady current } I \\
	\begin{figure}[H]
		\centering
		\includegraphics[height=4cm,width=5cm]{diagram-20211011(11)-crop}
	\end{figure}
	$\text { The magnitude of the magnetic field at the point } O \text { is }$
	\exyear{NET 2018}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{\mu_{0} I}{2 a}$
	\task[\textbf{B.}]$\frac{\mu_{0} I}{6 a}$
	\task[\textbf{C.}]$\frac{\mu_{0} I}{4 a}$
	\task[\textbf{D.}]$\frac{\mu_{0} I}{3 a}$
\end{tasks}
\begin{answer}
	\begin{align*}
	& B_{a}=\frac{1}{2} \frac{\mu_{0} I}{2 a} \odot,\\
	& B_{3 a}=\frac{1}{2} \frac{\mu_{0} I}{2(3 a)} \otimes \\
	&B=B_{a}-B_{3 a}=\frac{\mu_{0} I}{4 a}\left(1-\frac{1}{3}\right)=\frac{\mu_{0} I}{6 a}
	\end{align*}
	THe correct option is \textbf{(b)}
\end{answer}
\begin{minipage}{\textwidth}
	\item Two current-carrying circular loops, each of radius $R$, are placed perpendicular to each other, as shown in the figure.

	The loop in the $x y$ - plane carries a current $I_{0}$ while that in the $x z$-plane carries a current $2 I_{0}$. The resulting magnetic field $\vec{B}$ at the origin is
	\exyear{NET 2018 dec}
	\begin{figure}[H]
		\centering
		\includegraphics[height=3cm,width=5cm]{diagram-20211011(12)-crop}
	\end{figure}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{\mu_{0} l_{0}}{2 R}[2 \hat{j}+\hat{k}]$
	\task[\textbf{B.}]$\frac{\mu_{0} l_{0}}{2 R}[2 \hat{j}-\hat{k}]$
	\task[\textbf{C.}]$\frac{\mu_{0} l_{0}}{2 R}[-2 \hat{j}+\hat{k}]$
	\task[\textbf{D.}]$\frac{\mu_{0} l_{0}}{2 R}[-2 \hat{j}-\hat{k}]$
\end{tasks}
\begin{answer}
	\begin{align*}
	\intertext{Field due to loop in $x y$ plane is}
	\vec{B}_{1}&=\frac{\mu_{0} I_{0}}{2 R} \hat{z}\\
	\intertext{Field due to loop in $x z$ plane is}
	\vec{B}_{2}&=\frac{\mu_{0}\left(2 I_{0}\right)}{2 R}(-\hat{y})\\
	\text{Resultant field}\\
	 \vec{B}&=\vec{B}_{1}+\vec{B}_{2}=\frac{\mu_{0} I_{0}}{2 R}(-2 \hat{y}+\hat{z})
	\end{align*}
	The correct option is \textbf{(c)}
\end{answer}
\end{enumerate}
\newpage
\begin{abox}
	Practice set 2 solutions
	\end{abox}
\begin{enumerate}
	\begin{minipage}{\textwidth}
		\item Two magnetic dipoles of magnitude $m$ each are placed in a plane as shown in figure The energy of interaction is given by
		\exyear{GATE 2010}
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=5cm]{diagram-20210817(13)-crop}
			\caption{}
			\label{}
		\end{figure}
	\end{minipage}
	\begin{tasks}(1)
		\task[\textbf{A.}] Zero
		\task[\textbf{B.}]$\frac{\mu_{0} m^{2}}{4 \pi d^{3}}$
		\task[\textbf{C.}]$\frac{3 \mu_{0} m^{2}}{2 \pi d^{3}}$
		\task[\textbf{D.}]$-\frac{3 \mu_{0} m^{2}}{8 \pi d^{3}}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		U&=\frac{\mu_{0}}{4 \pi r^{3}}\left[\vec{m}_{1} \cdot \bar{m}_{2}-3\left(\vec{m}_{1} \cdot \hat{r}\right)\left(\vec{m}_{2} \cdot \hat{r}\right)\right] \\
		\text { Since } \vec{m}_{1} \perp \vec{m}_{2} &\Rightarrow \vec{m}_{1} \cdot \vec{m}_{2}=0\\
		 U&=\frac{\mu_{0}}{4 \pi d^{3}}\left[-3 \times m \cos 45^{0} \times m \cos 45^{0}\right] \\
		\Rightarrow U&=-\frac{3 \mu_{0} m^{2}}{8 \pi d^{3}}
		\end{align*}
		The correct option is \textbf{(d)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item If a force $\vec{F}$ is derivable from a potential function $V(r)$, where $r$ is the distance from the origin of the coordinate system, it follows that
		\exyear{GATE 2011}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}]$\vec{\nabla} \times \vec{F}=0$
		\task[\textbf{B.}]$\vec{\nabla} \cdot \vec{F}=0$
		\task[\textbf{C.}]$\vec{\nabla} V=0$
		\task[\textbf{D.}]$\nabla^{2} V=0$
	\end{tasks}
	\begin{answer}
		The correct option is \textbf{(a)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A uniform surface current is flowing in the positive $y$-direction over an infinite sheet lying in $x-y$ plane. The direction of the magnetic field is
		\exyear{GATE 2011}
	\end{minipage}
	\begin{tasks}(1)
		\task[\textbf{A.}]along $\hat{i}$ for $z>0$ and along $-\hat{i}$ for $z<0$
		\task[\textbf{B.}]along $\hat{k}$ for $z>0$ and along $-\hat{k}$ for $z<0$
		\task[\textbf{C.}]along $-\hat{i}$ for $z>0$ and along $\hat{i}$ for $z<0$
		\task[\textbf{D.}]along $-\hat{k}$ for $z>0$ and along $\hat{k}$ for $z<0$
	\end{tasks}
	\begin{answer}
		The correct option is \textbf{(a)}
	\end{answer}
\begin{minipage}{\textwidth}
	\item A magnetic dipole of dipole moment $\vec{m}$ is placed in a non-uniform magnetic field $\vec{B} .$ If the position vector of the dipole is $\vec{r}$, the torque acting on the dipole about the origin is
	\exyear{GATE 2011}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\vec{r} \times(\vec{m} \times \vec{B})$
	\task[\textbf{B.}]$\vec{r} \times \vec{\nabla}(\vec{m} \cdot \vec{B})$
	\task[\textbf{C.}]$\vec{m} \times \vec{B}$
	\task[\textbf{D.}]$\vec{m} \times \vec{B}+\vec{r} \times \nabla(\vec{m} \cdot \vec{B})$
\end{tasks}
\begin{answer}
	The correct option is \textbf{(c)}
\end{answer}
	\begin{minipage}{\textwidth}
		\item Which of the following expressions for a vector potential $\vec{A} \underline{\text { DOES NOT }}$ represent a uniform magnetic field of magnitude $B_{0}$ along the $z$-direction?
		\exyear{GATE 2011}
	\end{minipage}
	\begin{tasks}(1)
		\task[\textbf{A.}] $\vec{A}=\left(0, B_{0} x, 0\right)$
		\task[\textbf{B.}]$\vec{A}=\left(-B_{0} y, 0,0\right)$
		\task[\textbf{C.}]$\vec{A}=\left(\frac{B_{0} x}{2}, \frac{B_{0} y}{2}, 0\right)$
		\task[\textbf{D.}] $\vec{A}=\left(-\frac{B_{0} y}{2}, \frac{B_{0} x}{2}, 0\right)$
	\end{tasks}
	\begin{answer}
		$\vec{B} \neq \vec{\nabla} \times \vec{A}$\\
		The correct option is \textbf{(c)}
	\end{answer}

	\begin{minipage}{\textwidth}
		\item In a constant magnetic field of $0.6$ Tesla along the $\mathrm{z}$ direction, find the value of the path integral $\oint \vec{A} \cdot \overrightarrow{d l}$ in the units of (Tesla $m^{2}$ ) on a square loop of side length $(1 / \sqrt{2})$ meters. The normal to the loop makes an angle of $60^{\circ}$ to the z-axis, as shown in the figure.\\
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=5cm]{diagram-20210817(19)-crop-crop}
		\end{figure}
		The answer should be up to two decimal places.
		\exyear{GATE}
	\end{minipage}
	\begin{answer}
		$$\oint \vec{A} \cdot \overrightarrow{d l}=\int_{S}(\vec{\nabla} \times \vec{A}) d \vec{a}=\int_{S} \vec{B} \cdot d \vec{a}=B A \cos 60^{0}=0.6 \times\left(\frac{1}{\sqrt{2}}\right)^{2} \times \frac{1}{2}=0.15 T . m^{2}$$
	\end{answer}
	\begin{minipage}{\textwidth}
		\item The value of the magnetic field required to maintain non-relativistic protons of energy $1 \mathrm{MeV}$ in a circular orbit of radius $100 \mathrm{~mm}$ is Tesla
		\exyear{GATE 2014}
	\end{minipage}
	\begin{answer}
	\begin{align*}
	E&=\frac{q^{2} B^{2} R^{2}}{2 m_{p}} \Rightarrow 1.6 \times 10^{-13}=\frac{\left(1.6 \times 10^{-19}\right)^{2} B^{2}(0.1)^{2}}{2\left(1.67 \times 10^{-27}\right)}\\
	\Rightarrow B^{2}&=\frac{1.6 \times 10^{-13} \times 2\left(1.67 \times 10^{-27}\right)}{\left(1.6 \times 10^{-19}\right)^{2}(0.1)^{2}} \\
	\Rightarrow B^{2}&=\frac{10^{-13} \times 2\left(1.67 \times 10^{-27}\right)}{\left(1.6 \times 10^{-38}\right)(0.01)}=\frac{3.34 \times 10^{-40}}{1.6 \times 10^{-40}}=2.08\\
	\Rightarrow B&=\sqrt{2.08} \text { Tesla }=1.44 \text { Tesla }
	\end{align*}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item Given that the magnetic flux through the closed loop $P Q R S P$ is $\phi$. If $\int_{P}^{R} \vec{A} \cdot \vec{d} l=\phi_{1}$ along $P Q R$, the value of $\int^{R} \vec{A} \cdot \vec{d} l$ along $P S R$ is
		\exyear{GATE 2015}
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=5cm]{diagram-20210818(2)-crop}
		\end{figure}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}](a) $\phi-\phi_{1}$
		\task[\textbf{B.}] $\phi_{1}-\phi$
		\task[\textbf{C.}]$-\phi_{1}$
		\task[\textbf{D.}] $\phi_{1}$
	\end{tasks}
	\begin{answer}
		$$\phi=\int_{s} \vec{B} \cdot d \vec{a}=\oint \vec{A} \cdot d \vec{l}=\int_{P}^{R} \vec{A} \cdot d \vec{l}+\int_{R}^{P} \vec{A} \cdot d \vec{l} \Rightarrow \phi=\phi_{1}-\int_{P}^{R} \vec{A} \cdot d \vec{l} \Rightarrow \int_{P}^{R} \vec{A} \cdot d \vec{l}=\phi_{1}-\phi$$
		The correct option is \textbf{(b)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item Which of the following magnetic vector potentials gives rise to a uniform magnetic field $B_{0} \hat{k} ?$
		\exyear{GATE 2016}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $B_{0} z \hat{k}$
		\task[\textbf{B.}]$-B_{0} x \hat{j}$
		\task[\textbf{C.}]$\frac{B_{0}}{2}(-y \hat{i}+x \hat{j})$
		\task[\textbf{D.}]$\frac{B_{0}}{2}(y \hat{i}+x \hat{j})$
	\end{tasks}
	\begin{answer}
		(a) $\vec{\nabla} \times \vec{A}=0$\\
		(b) $\vec{\nabla} \times \vec{A}=-B_{0} \hat{k}$\\
		(c) $\vec{\nabla} \times \vec{A}=B_{0} \hat{k}$\\
		(d) $\vec{\nabla} \times \vec{A}=0$\\
		The correct option is \textbf{(c)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item The magnitude of the magnetic dipole moment associated with a square shaped loop carrying a steady current $I$ is $m$. If this loop is changed to a circular shape with the same current $I$ passing through it, the magnetic dipole moment becomes $\frac{p m}{\pi} .$ The value of $p$ is
		\exyear{GATE 2016}
	\end{minipage}
	\begin{answer}
		Magnetic dipole moment associated with a square shaped loop (let side is $a$ ) carrying a steady current $I$ is $m=I a^{2}$.

		Magnetic dipole moment associated with a circular shaped loop (let radius is $r$ ) carrying a steady current $I$ is $m^{\prime}=I \pi r^{2}$.
		Here $4 a=2 \pi r \Rightarrow r=\frac{2 a}{\pi} \Rightarrow m^{\prime}=I \pi r^{2}=I \pi\left(\frac{2 a}{\pi}\right)^{2}=\frac{4 I a^{2}}{\pi}=\frac{4 m}{\pi}$
	\end{answer}
	\begin{minipage}{\textwidth}
		\item An infinite solenoid carries a time varying current $I(t)=A t^{2}$, with $A \neq 0 .$ The axis of the solenoid is along the $\hat{z}$ direction. $\hat{r}$ and $\hat{\theta}$ are the usual radial and polar directions in cylindrical polar coordinates. $\vec{B}=B_{r} \hat{r}+B_{\theta} \hat{\theta}+B_{z} \hat{z}$ is the magnetic field at a point outside the solenoid. Which one of the following statements is true?
		\exyear{GATE 2017}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $B_{r}=0, B_{\theta}=0, B_{z}=0$
		\task[\textbf{B.}]$B_{r} \neq 0, B_{\theta} \neq 0, B_{z}=0$
		\task[\textbf{C.}] $B_{r} \neq 0, B_{\theta} \neq 0, B_{z} \neq 0$
		\task[\textbf{D.}] $B_{r}=0, B_{\theta}=0, B_{z} \neq 0$
	\end{tasks}
	\begin{answer}
		The correct option is \textbf{(d)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item An infinitely long straight wire is carrying a steady current $I$. The ratio of magnetic energy density at distance $r_{1}$ to that at $r_{2}\left(=2 r_{1}\right)$ from the wire is
		\exyear{GATE 2018}
	\end{minipage}
	\begin{answer}
		$$ u_{B}=\frac{B^{2}}{2 \mu_{0}} \propto \frac{1}{r^{2}} \Rightarrow \frac{u_{B 1}}{u_{B 2}}=\frac{r_{2}^{2}}{r_{1}^{2}}=\frac{\left(2 r_{1}\right)}{r_{1}^{2}}=4$$
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A constant and uniform magnetic field $\vec{B}=B_{0} \hat{k}$ pervades all space. Which one of the following is the correct choice for the vector potential in Coulomb gauge?
		\exyear{GATE 2018}
	\end{minipage}
	\begin{tasks}(1)
		\task[\textbf{A.}] $-B_{0}(x+y) \hat{i}$
		\task[\textbf{B.}]$B_{0}(x+y) \hat{j}$
		\task[\textbf{C.}] $B_{0} x \hat{j}$
		\task[\textbf{D.}]$-\frac{1}{2} B_{0}(x \hat{i}-y \hat{j})$
	\end{tasks}
	\begin{answer}
		Check option (c),
		$$
		\vec{\nabla} \cdot \vec{A}=0, \vec{B}=\vec{\nabla} \times \vec{A}=B_{0} \hat{k}
		$$
		The correct option is \textbf{(c)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item  A solid cylinder of radius $R$ has total charge $Q$ distributed uniformly over its volume. It is rotating about its axis with angular speed $\omega$. The magnitude of the total magnetic moment of the cylinder is
		\exyear{GATE 2019}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}](a) $Q R^{2} \omega$
		\task[\textbf{B.}]$\frac{1}{2} Q R^{2} \omega$
		\task[\textbf{C.}]$\frac{1}{4} Q R^{2} \omega$
		\task[\textbf{D.}]$\frac{1}{8} Q R^{2} \omega$
	\end{tasks}
	\begin{answer}
\begin{align*}
	\intertext{	Magnetic moment due to disc}
\mu&=\frac{\pi \sigma \omega R^{4}}{4}\\
\text{	Due to cylinder}\\
 d \mu&=\frac{\pi \omega R^{4}}{4}(\rho d z) \quad(\sigma \rightarrow \rho d z)\\
\mu&=\frac{\pi \omega R^{4}}{4} \int_{0}^{L} \frac{Q}{\pi R^{2} L} d z=\frac{Q \omega R^{4}}{4}
\end{align*}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item An infinitely long wire parallel to the $x$-axis is kept at $z=d$ and carries a current $I$ in the positive $x$ direction above a superconductor filling the region $z \leq 0$ (see figure). The magnetic field $\vec{B}$ inside the superconductor is zero so that the field just outside the superconductor is parallel to its surface. The magnetic field due to this configuration at a point $(x, y, z>0)$ is
		\exyear{GATE 2019}
		\begin{figure}[H]
			\centering
			\includegraphics[height=5cm,width=5cm]{diagram-20210818(14)-crop-crop}
			\caption{}
			\label{}
		\end{figure}
	\end{minipage}
	\begin{tasks}(1)
		\task[\textbf{A.}]$\left(\frac{\mu_{0} I}{2 \pi}\right) \frac{-(z-d) \hat{j}+y \hat{k}}{\left[y^{2}+(z-d)^{2}\right]}$
		\task[\textbf{B.}]$\left(\frac{\mu_{0} I}{2 \pi}\right)\left[\frac{-(z-d) \hat{j}+y \hat{k}}{y^{2}+(z-d)^{2}}+\frac{(z+d) \hat{j}-y \hat{k}}{y^{2}+(z+d)^{2}}\right]$
		\task[\textbf{C.}]$\text { (c) }\left(\frac{\mu_{0} I}{2 \pi}\right)\left[\frac{-(z-d) \hat{j}+y \hat{k}}{y^{2}+(z-d)^{2}}-\frac{(z+d) \hat{j}-y \hat{k}}{y^{2}+(z+d)^{2}}\right]$
		\task[\textbf{D.}]$\text { (d) }\left(\frac{\mu_{0} I}{2 \pi}\right)\left[\frac{y \hat{j}+(z-d) \hat{k}}{y^{2}+(z-d)^{2}}+\frac{y \hat{j}-(z+d) \hat{k}}{y^{2}+(z+d)^{2}}\right]$
	\end{tasks}
	\begin{answer}
		$\text { Verify that } \vec{B}=0, \text { when } d=0$\\
		The correct option is \textbf{(b)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item The vector potential inside a long solenoid with $n$ turns per unit length and carrying current $I$, written in cylindrical coordinates is $\vec{A}(s, \phi, z)=\frac{\mu_{0} n I}{2} s \hat{\phi}$. If the term $\frac{\mu_{0} n I}{2} s(\alpha \cos \phi \hat{\phi}+\beta \sin \phi \hat{s})$, where $\alpha \neq 0, \beta \neq 0$ is added to $\vec{A}(S, \phi, z)$, the magnetic field remains the same if
		\exyear{GATE 2019}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}]$\alpha=\beta$
		\task[\textbf{B.}]$\alpha=-\beta$
		\task[\textbf{C.}]$\alpha=2 \beta$
		\task[\textbf{D.}]$\alpha=\frac{\beta}{2}$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		&\text { Solution: } \vec{B}=\vec{\nabla} \times \vec{A}=\frac{1}{r}\left|\begin{array}{ccc}
		\hat{r} & r \hat{\phi} & \hat{z} \\
		\frac{\partial}{\partial r} & \frac{\partial}{\partial \phi} & \frac{\partial}{\partial z} \\
		A_{r} & r A_{\phi} & 0
		\end{array}\right|=\mu_{0} n I \hat{z} \\
		&\vec{B}^{\prime}=\vec{\nabla} \times \vec{A}^{\prime}=\frac{1}{r}\left|\begin{array}{ccc}
		\hat{r} & r \hat{\phi} & \hat{z} \\
		\frac{\partial}{\partial r} & \frac{\partial}{\partial \phi} & \frac{\partial}{\partial z} \\
		A_{r} & r A_{\phi} & 0
		\end{array}\right|=\mu_{0} n I\left[(\alpha \cos \phi+1)-\frac{\beta \cos \phi}{2}\right] \hat{z} \\
		&\text { Equate } \vec{B}^{\prime}=\vec{B} \Rightarrow\left[(\alpha \cos \phi+1)-\frac{\beta \cos \phi}{2}\right]=\mu_{0} n I \\
		&\Rightarrow \alpha \cos \phi=\frac{\beta}{2} \cos \phi \Rightarrow \alpha=\frac{\beta}{2}
		\end{align*}
		The correct option is \textbf{(d)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A magnetic field $\vec{B}=B_{0}(\hat{i}+2 \hat{j}-4 \hat{k})$ exists at point. If a test charge moving with a velocity, $\vec{v}=v_{0}(3 \hat{i}-\hat{j}+2 \hat{k})$ experiences no force at a certain point, the electric field at that point in SI units is
		\exyear{JEST 2012}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\vec{E}=-v_{0} B_{0}(3 \hat{i}-2 \hat{j}-4 \hat{k})$
		\task[\textbf{B.}]$\vec{E}=-v_{0} B_{0}(\hat{i}+\hat{j}+7 \hat{k})$
		\task[\textbf{C.}]$\vec{E}=v_{0} B_{0}(14 \hat{j}+7 \hat{k})$
		\task[\textbf{D.}]$\vec{E}=-v_{0} B_{0}(14 \hat{j}+7 \hat{k})$
	\end{tasks}
	\begin{answer}
		 \begin{align*}
		\vec{F} &=q[\vec{E}+\vec{v} \times \vec{B}]=0 \Rightarrow \vec{E}=-(\vec{v} \times \vec{B}) \\
		\Rightarrow \vec{E} &=-v_{0} B_{0}\{(4-4) \hat{i}+(2+12) \hat{j}+(6+1) \hat{k}\}\\
		&=-v_{0} B_{0}(14 \hat{j}+7 \hat{k})
		\end{align*}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A small magnet is dropped down a long vertical copper tube in a uniform gravitational field. After a long time, the magnet
		\exyear{JEST 2012}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] attains a constant velocity
		\task[\textbf{B.}] moves with a constant acceleration
		\task[\textbf{C.}] moves with a constant deceleration
		\task[\textbf{D.}]executes simple harmonic motion
	\end{tasks}
	\begin{answer}
		The correct option is \textbf{(a)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A thin uniform ring carrying charge $Q$ and mass $M$ rotates about its axis. What is the gyromagnetic ratio (defined as ratio of magnetic dipole moment to the angular momentum) of this ring?
		\exyear{JEST 2013}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\frac{Q}{2 \pi M}$
		\task[\textbf{B.}]$\frac{Q}{M}$
		\task[\textbf{C.}]$\frac{Q}{2 M}$
		\task[\textbf{D.}]$\frac{Q}{\pi M}$
	\end{tasks}
	\begin{answer}
		Magnetic dipole moment $M^{\prime}=I A=\frac{Q}{T} \pi r^{2} \Rightarrow \frac{Q}{2 \pi T} \times 2 \pi \times \pi r^{2}=\frac{Q \omega r^{2}}{2}$\\
		Angular momentum $J=M r^{2} \omega \Rightarrow \frac{M^{\prime}}{J}=\frac{Q}{2 M}$
	\end{answer}
	\begin{minipage}{\textwidth}
		\item The electric and magnetic field caused by an accelerated charged particle are found to scale as $E \propto r^{-n}$ and $B \propto r^{-m}$ at large distances. What are the value of $n$ and $m$ ?
		\exyear{JEST 2013}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $n=1, m=2$
		\task[\textbf{B.}] $n=2, m=1$
		\task[\textbf{C.}]$n=1, m=1$
		\task[\textbf{D.}]$n=2, m=2$
	\end{tasks}
	\begin{answer}
	\begin{align*}
		\intertext{For large distance}
	F&=\frac{q a \sin \theta}{r}\\
	, B&=\frac{q a \sin \theta}{r}\\
	\Rightarrow E &\propto \frac{1}{r},\\
	B &\propto \frac{1}{r} \\
	\text{So} \quad m&=n=1
	\end{align*}
		The correct option is \textbf{(c)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A system of two circular co-axial coils carrying equal currents $I$ along same direction having equal radius $R$ and separated by a distance $R$ (as shown in the figure below). The magnitude of magnetic field at the midpoint $P$ is given by
		\exyear{JEST 2014}
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=5cm]{diagram-20210809(7)-crop}
			\caption{}
			\label{}
		\end{figure}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}](a) $\frac{\mu_{0} I}{2 \sqrt{2} R}$
		\task[\textbf{B.}]$\frac{4 \mu_{0} I}{5 \sqrt{5} R}$
		\task[\textbf{C.}]$\frac{8 \mu_{0} I}{5 \sqrt{5} R}$
		\task[\textbf{D.}] 0
	\end{tasks}
	\begin{answer}
		\begin{align*}
		\because B&=\frac{\mu_{0} I R^{2}}{2\left(R^{2}+d^{2}\right)^{\frac{3}{2}}}\\ B_{1}&=\frac{\mu_{0} I R^{2}}{2\left(R^{2}+\frac{R^{2}}{4}\right)^{\frac{3}{2}}}\\
		B_{2}&=\frac{\mu_{0} I R^{2}}{2\left(R^{2}+\frac{R^{2}}{4}\right)^{\frac{3}{2}}} \because d=\frac{R}{2} \\
		B&=B_{1}+B_{2}\\
		&=\frac{\mu_{0} I \times 2}{2 R\left(\frac{5}{4}\right)^{\frac{3}{2}}}\\
		B&=\frac{\mu_{0} I 4^{\frac{3}{2}}}{R \quad 5^{\frac{3}{2}}}=\frac{8 \mu_{0} I}{5 \sqrt{5} R}
		\end{align*}
		The correct option is \textbf{(c)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A charged particle is released at time $t=0$, from the origin in the presence of uniform static electric and magnetic fields given by $E=E_{0} \hat{y}$ and $B=B_{0} \hat{z}$ respectively. Which of the following statements is true for $t>0$ ?
		\exyear{JEST 2015}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] The particle moves along the $x$-axis.
		\task[\textbf{B.}]The particle moves in a circular orbit.
		\task[\textbf{C.}]The particle moves in the $(x, y)$ plane.
		\task[\textbf{D.}] Particle moves in the $(y, z)$ plane
	\end{tasks}
	\begin{answer}
		In a cycloid charged particle will be always confined in a plane perpendicular to B.\\
		The correct option is \textbf{(c)}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item The strength of magnetic field at the center of a regular hexagon with sides of length $a$ carrying a steady current $I$ is:
		\exyear{JEST 2016}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\frac{\mu_{0} I}{\sqrt{3} \pi a}$
		\task[\textbf{B.}]$\frac{\sqrt{6} \mu_{0} I}{\pi a}$
		\task[\textbf{C.}]$\frac{3 \mu_{0} I}{\pi a}$
		\task[\textbf{D.}]$\frac{\sqrt{3} \mu_{0} I}{\pi a}$
	\end{tasks}
	\begin{answer}
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=6cm]{jest 3-crop}
		\end{figure}
		\begin{align*}
		d&=a \cos 30^{\circ}=\frac{\sqrt{3}}{2} a \\
		\because B&=\frac{\mu_{0} I}{4 \pi d}\left(\sin \theta_{2}-\sin \theta_{1}\right) \\
		\Rightarrow B_{1}&=\frac{\mu_{0} I}{4 \pi d} 2 \sin 30^{\circ}=\frac{\mu_{0} I}{4 \pi \frac{\sqrt{3}}{2} a} 2 \sin 30^{\circ}=\frac{\mu_{0} I}{2 \sqrt{3} \pi a} \\
		\Rightarrow B&=6 B_{1}=6 \times \frac{\mu_{0} I}{2 \sqrt{3} \pi a}=\frac{3 \mu_{0} I}{\sqrt{3} \pi a}=\frac{\sqrt{3} \mu_{0} I}{\pi a}
		\end{align*}
	\end{answer}
	\begin{minipage}{\textwidth}
		\item A wire with uniform line charge density $\lambda$ per unit length carries a current $I$ as shown in the figure. Take the permittivity and permeability of the medium to be $\varepsilon_{0}=\mu_{0}=1 . \mathrm{A}$ particle of charge $q$ is at a distance $r$ and is travelling along a trajectory parallel to the wire. What is the speed of the charge?
		\exyear{JEST 2019}
		\begin{figure}[H]
			\centering
			\includegraphics[height=4cm,width=6cm]{jest-crop}
		\end{figure}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\frac{\lambda}{I}$
		\task[\textbf{B.}]$\frac{\lambda}{2 I}$
		\task[\textbf{C.}]$\frac{\lambda}{3 I}$
		\task[\textbf{D.}]$\frac{4 \lambda}{I}$
	\end{tasks}
	\begin{answer}
		\begin{figure}[H]
			\centering
			\includegraphics[height=3cm,width=5cm]{jest2-crop(1)}
		\end{figure}
	\begin{align*}
		E&=\frac{\lambda}{2 \pi \varepsilon_{0} r} \text { and } B=\frac{\mu_{0} I}{2 \pi r}\\
	\intertext{Net force on  $q$ is zero i.e.}
	\vec{F}&=0\\
	\Rightarrow q[\vec{E}+(\vec{v} \times \vec{B})]&=0\\
	E&=v B \Rightarrow \frac{\lambda}{2 \pi \varepsilon_{0} r}=v \frac{\mu_{0} I}{2 \pi r} \Rightarrow v=\frac{\lambda}{I} \quad \because \varepsilon_{0}=\mu_{0}=1
	\end{align*}
The correct option is \textbf{(a)}
	\end{answer}
\end{enumerate}


\documentclass[12pt]{article}
\input{physics1}
\begin{document}

\section*{NYU Physics I---Problem Set 10}

Due Thursday 2018 November 15 at the beginning of lecture.

\paragraph{\problemname~\theproblem:}\refstepcounter{problem}%
\textsl{(a)}~A car of mass $M$ is moving at speed $v$ in the $x$
direction. Its center of mass is a height $h$ above the ground.  What
is the angular momentum of the car with respect to a reference point
\emph{on the ground}?

\textsl{(b)}~If this same car is accelerating at acceleration $a$
in the $x$ direction, then its angular momentum is changing with time,
right? If so, there must be a net torque on the car? What must be
the magnitude of that net torque? Again, answer this with respect
to a reference point \emph{on the ground}.

\paragraph{\problemname~\theproblem:}\refstepcounter{problem}%
\textsl{(a)}~A figure skater spins in place on frictionless ice at
angular speed $\omega_i$ with her hands outstretched.  She has a total
moment of inertia $I_i$.  As the skater draws her hands into her body,
her moment of inertia decreases to $I_f=I_i/2$.  Does her kinetic
energy $K$ increase, decrease, or stay the same?  If it increases,
where does the energy come from?  If it decreases, where does the
energy go to?  \emph{Explain all your answers concisely but clearly:
What is conserved? That is, think in terms of conserved quantities.}

\textsl{(b)}~Now estimate the moments of inertia: $I_i$ of an ice
skater with her hands outstretched, and $I_f$ of an ice skater with
her hands drawn in.  Is the factor of 2 used in part \textsl{(a)}
reasonable?

\paragraph{\problemname~\theproblem:}\refstepcounter{problem}\label{cue}%
\textsl{(a)}~Immediately after being hit, at $t=0$, a cue ball of mass
$M$ and radius $R$ slides along the felt at speed $v_i$, not rotating
at all.  As time goes on, the ball slows down (because of friction)
and, at the same time, starts to spin.  Draw a free-body diagram for
the cue ball.  At what time $t_\mathrm{r}$ does the ball get to the
situation of ``rolling without slipping''?  Assume that there is a
coefficient $\mu$ of sliding friction. You will have to look up (or
compute) the moment of inertia $I$ for a uniform sphere.

\textsl{(b)}~Plot $v(t)$ and $R\,\omega(t)$ vs $t$ on a single plot.
\emph{Note that the two things I have asked you to plot have the same
dimensions.}  Clearly label $t_\mathrm{r}$ on your diagram.

\paragraph{\problemname~\theproblem:}\refstepcounter{problem}%
\textsl{(a)}~A hockey puck (a uniform disk of mass $m$, radius $r$,
and thickness $t$), slides without friction on ice with initial speed
$v_0$.  It strikes an identical puck tangentially, as shown in the
figure, and sticks to it.  The second puck is initially at rest and
also can slide without friction.  What is the final (linear) velocity
(speed $v$ and direction) of the stuck-together pucks?  What is the
moment of inertia $I_f$ and final angular speed of rotation $\omega$
of the system around its center of mass?  What fraction of the initial
kinetic energy (if any) is lost; \textit{ie,} what is $[K_i-K_f]/K_i$?
\\ \rule{0.25\textwidth}{0pt}
\resizebox{0.50\textwidth}{!}{\includegraphics{tangpucks.eps}}
\\

\emph{Draw a clear diagram with a clearly labeled reference point used
to compute the angular momentum; recall that any angular momentum
calculation is with respect to your chosen origin.}

\textsl{(b)}~If the pucks had hit dead-on, the stuck-together pucks,
after the collision, would not be rotating.  Which of your answers
($v$, $\omega$, and $[K_i-K_f]/K_i$) will be different in this case?
If the fractional loss in kinetic energy is different, explain where
the difference in energy went.

\paragraph{Extra Problem (will not be graded for credit):}%
In \problemname~\ref{cue}, between the initial hit of the cue ball by the cue (that is, when the
cue ball wasn't rotating at all) and the end of the cue ball
slide (that is, when the cue ball switches to rolling without
slipping), how much rotational kinetic energy ($I\,\omega^2 / 2$) was
created? How much linear kinetic energy ($m\,v^2 / 2$) was lost? How
much heat was generated? This extra problem refers to the pool problem
above.

\end{document}