text:
# Spherical polar coordinates

Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
Citable Version  [?]

This editable Main Article is under development and subject to a disclaimer.
CC Image
Spherical polar coordinates

In mathematics and physics, spherical polar coordinates (also known as spherical coordinates) form a coordinate system for the three-dimensional real space ${\displaystyle \scriptstyle \mathbb {R} ^{3}}$. Three numbers, two angles and a length specify any point in ${\displaystyle \scriptstyle \mathbb {R} ^{3}}$. The two angles specify the position on the surface of a sphere and the length gives the radius of the sphere.

Spherical polar coordinates are useful in cases where there is (approximate) spherical symmetry, in interactions or in boundary conditions (or in both). In such cases spherical polar coordinates often allow the separation of variables simplifying the solution of partial differential equations and the evaluation of three-dimensional integrals.

The practice of specifying locations on earth using latitude, longitude and altitude is a version of spherical polar coordinates.

## Definition

Let x, y, z be Cartesian coordinates of a vector ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ in ${\displaystyle \scriptstyle \mathbb {R} ^{3}}$, that is,

${\displaystyle {\vec {\mathbf {r} }}=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z}){\begin{pmatrix}x\\y\\z\\\end{pmatrix}}\equiv x\,{\vec {\mathbf {e} }}_{x}+y\,{\vec {\mathbf {e} }}_{y}+z\,{\vec {\mathbf {e} }}_{z},}$

where ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z}}$ are unit vectors along the x, y, and z axis, respectively. The x, y, and z axes are orthogonal and so are the unit vectors along them.

The length r of the vector ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ is one of the three numbers necessary to give the position of the vector in three-dimensional space. By applying twice the theorem of Pythagoras we find that r2 = x2 + y2 + z2.

Let θ be the colatitude angle (see the figure) of the vector ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$. In the usual system to describe a position on Earth, latitude has its zero at the equator, while the colatitude angle, introduced here, has its zero at the "North Pole". That is, the angle θ is zero when ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ is along the positive z-axis. The sum of latitude and colatitude of a point is 900; these angles being complementary explains the name of the latter. The colatitude angle is also called polar or zenith angle in the literature.

The angle φ gives the angle with the x-axis of the projection ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}'}$ of ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ on the x-y plane. The angle φ is the longitude angle (also known as the azimuth angle).

Note that the projection ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}'}$ has length r sinθ. The length of the projection of ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}'}$ on the x and y axis is therefore r sinθcosφ and r sinθsinφ, respectively. In summary, the spherical polar coordinates r, θ, and φ of ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ are related to its Cartesian coordinates by

{\displaystyle {\begin{aligned}x&=r\sin \theta \cos \phi \\y&=r\sin \theta \sin \phi \\z&=r\cos \theta \end{aligned}}}

Given a spherical polar triplet (r, θ, φ) the corresponding Cartesian coordinates are readily obtained by application of these defining equations.

The figure makes clear that 00 ≤ φ ≤ 3600, 00 ≤ θ ≤ 1800, and r > 0. The coordinate surfaces are:

1. r constant, all θ and φ: surface of sphere.
2. θ constant, all r and φ: surface of a cone.
3. φ constant, all r and θ: plane.

The computation of spherical polar coordinates from Cartesian coordinates is somewhat more difficult than the converse, due to the fact that the spherical polar coordinate system has singularities, also known as points of indeterminacy. The first such point is immediately clear: if r = 0, we have a zero vector (a point in the origin). Then θ and φ are undetermined, that is to say, any values for these two parameters will give the correct result x = y = z = 0. Compare this to the case that one of the Cartesian coordinates is zero, say x = 0, then the other two coordinates are still determined (they fix a point in the yz-plane). Two other points of indeterminacy are the "North" and the "South Pole", θ = 00 and θ = 1800, respectively (while r ≠ 0). On both poles the longitudinal angle φ is undetermined.

So, when going from Cartesian coordinates to spherical polar coordinates, one has to watch for the singularities, especially when the transformation is performed by a computer program. Given x, y and z, the consecutive steps are

{\displaystyle {\begin{aligned}r&={\sqrt {x^{2}+y^{2}+z^{2}}}\\\theta &=\arccos(z/r),\quad r\neq 0\\r'&=r\sin \theta ={\sqrt {x^{2}+y^{2}}}\\\phi &={\begin{cases}\arccos(x/r')&\quad {\hbox{if}}\quad y\geq 0,\quad r'\neq 0\\360^{0}-\arccos(x/r')&\quad {\hbox{if}}\quad y<0,\quad r'\neq 0\\\end{cases}}\end{aligned}}}

### Latitude, longitude, and altitude

Locations on earth are often specified using latitude, longitude and altitude. These values correspond to the spherical polar coordinates introduced in this article, with some differences, however.

Latitude λ is conventionally measured as angles north and south of the equator, with latitudes north of the equator taken as positive, and south taken as negative. Values of latitude are always within the range −90° to +90°. This corresponds to the polar angle measured from the z-axis, except that latitude is measured from the equator (the x-y-plane). The angles θ and λ are complementary, i.e., their sum is 90°.

The geographical coordinate longitude φg (the suffix g is added to distinguish it from the polar coordinate φ) is measured as angles east and west of the prime meridian, an arbitrary great circle passing through the z-axis. Longitude is measured as the angular distance in the closest direction from the prime meridian, or, alternatively, as a positive angle to the east (counterclockwise when looking from the North Pole towards the center of the earth) and negative to the west. Longitude is always within the range −180° to +180°.

Altitude is measured from the surface— called mean sea level—of a hypothetical spheroid, or other datum, and corresponds to the polar coordinate r, with the radius of the earth subtracted. Since the earth is not a perfect sphere, neither its center nor its radius are defined in a unique manner, but for the sake of argument we ignore this and introduce rearth as the fictive radius of the earth.

Conversion from latitude λ, longitude φg, and altitude h to spherical polar coordinates is as follows:

{\displaystyle {\begin{aligned}r&=h+r_{\mathrm {earth} }{\mbox{ (approximate)}}\\\theta &=90^{\circ }-\lambda \\\phi &={\begin{cases}\phi _{\mathrm {g} }&{\mbox{if }}\phi _{\textrm {g}}{\mbox{ is positive (east)}}\\\phi _{\mathrm {g} }+360^{\circ }&{\mbox{if }}\phi _{\textrm {g}}{\mbox{ is negative (west)}}.\end{cases}}\end{aligned}}}

#### Examples

${\displaystyle \lambda =40.7^{\circ }\quad {\hbox{and}}\quad \phi _{\mathrm {g} }=-74.017^{\circ }}$
so that the polar coordinates of New York city are
${\displaystyle \theta =49.3^{\circ }\quad {\hbox{and}}\quad \phi =285.983^{\circ }}$
• Melbourne is at 37° 49' S, 144° 58' E, this means
${\displaystyle \lambda =-37.817^{\circ }\quad {\hbox{and}}\quad \phi _{\mathrm {g} }=144.967^{\circ }}$
so that the polar coordinates of Melbourne are
${\displaystyle \theta =127.817^{\circ }\quad {\hbox{and}}\quad \phi =144.967^{\circ }}$

## Other convention

The notational convention introduced above (θ for the colatitude angle, φ for the azimuth angle) is used universally in physics. It is in accordance with advice of the International Standards Organization (ISO 31-11, which, however, advises the use of ρ instead of r ). In mathematics—especially in the older and the European literature—the convention is very widespread, too. To quote a few prestiguous mathematical books that apply it: Abramowitz and Stegun[1] (p. 332), Whittaker and Watson[2] (p. 391), Courant and Hilbert[3] (p.195), and Kline[4] (p. 527). Until the 1960s this convention was used universally, also in mathematical textbooks, see e.g. the 1959 edition of Spiegel[5] (p. 138).

Somewhere in the 1960s it became custom in American mathematical textbooks to use a notation in which φ and θ are interchanged, see e.g. Kay[6] (p. 24) and Apostol[7] (p. 419). This was done in order to not confuse students by changing the meaning of the Greek letter θ in the transition from 2D to 3D polar coordinates, as can be gathered from the following quotation of Eric Weisstein:

In this work, following the mathematics convention, the symbols for the radial, azimuth, and zenith coordinates are taken as r, θ, and φ, respectively. Note that this definition provides a logical extension of the usual polar coordinates notation, with θ remaining the angle in the xy-plane and φ becoming the angle out of that plane. The sole exception to this convention in this work is in spherical harmonics, where the convention used in the physics literature is retained (resulting, it is hoped, in a bit less confusion than a foolish rigorous consistency might engender).

In more advanced treatises—also American—on spherical functions the old convention remains in use, see e.g. Miller[8] (p. 164). The swapping of θ and φ can only be called unfortunate, because it meant a break with the huge existing mathematics and physics literature covering more than a century, and since there exists an obvious pedagogical alternative, namely, calling the angle, which appears in the 2D polar coordinates, φ instead of θ.

The notation, in which the angle between the vector r and the z-axis is φ, is followed by the Maple algebraic program package and also by the numerical package Matlab. (Matlab also redefines the zero of φ to be on the equator, which makes φ a latitude angle). The Mathematica package follows the convention that has θ as the angle between the vector and the z-axis.

## Unit vectors

CC Image
Unit vectors. ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{r}}$ is perpendicular to the surface of the sphere, while ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{\theta }}$ and ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{\phi }}$ are tangent to the surface.

We will define algebraically the orthogonal set (a coordinate frame) of spherical polar unit vectors depicted in the figure on the right. In doing this, we first wish to point out that the spherical polar angles can be seen as two of the three Euler angles that describe any rotation of ${\displaystyle \scriptstyle \mathbb {R} ^{3}}$.

Indeed, start with a vector along the z-axis, rotate it around the z-axis over an angle φ. Perform the same rotation on the x, y, z coordinate frame. This rotates the x- and y-axis over a positive angle φ. The y-axis goes to the y'-axis. Rotate then the vector and the new frame over an angle θ around the y'-axis. The vector that was initially on the z-axis is now a vector with spherical polar angles θ and φ with respect to the original (unrotated) frame. Expressed in equation form this reads,

{\displaystyle {\begin{aligned}{\vec {\mathbf {r} }}&=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z}){\begin{pmatrix}r\cos \phi \sin \theta \\r\sin \phi \sin \theta \\r\cos \theta \\\end{pmatrix}}\\&=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z})\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ){\begin{pmatrix}0\\0\\r\\\end{pmatrix}},\end{aligned}}}

where the two rotation matrices are defined by

${\displaystyle \mathbb {R} _{z}(\phi )\equiv {\begin{pmatrix}\cos \phi &-\sin \phi &0\\\sin \phi &\cos \phi &0\\0&0&1\\\end{pmatrix}},\qquad \mathbb {R} _{y}(\theta )\equiv {\begin{pmatrix}\cos \theta &0&\sin \theta \\0&1&0\\-\sin \theta &0&\cos \theta \\\end{pmatrix}}.}$

By direct matrix multiplication the matrix expression for the spherical polar coordinates of ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ is easily verified—it could have been postulated without reference to Euler rotations and proved by verification.

We now introduce the coordinate frame depicted in the figure on the right:

{\displaystyle {\begin{aligned}{\vec {\mathbf {r} }}&=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z})\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ){\begin{pmatrix}0\\0\\r\\\end{pmatrix}}\equiv ({\vec {\mathbf {e} }}_{\theta },\,{\vec {\mathbf {e} }}_{\phi },\,{\vec {\mathbf {e} }}_{r}){\begin{pmatrix}0\\0\\r\\\end{pmatrix}}.\end{aligned}}}

That is, the new frame, depicted in the figure, is related to the old frame along the x-, y-, and z-axes by rotation,

${\displaystyle ({\vec {\mathbf {e} }}_{\theta },\,{\vec {\mathbf {e} }}_{\phi },\,{\vec {\mathbf {e} }}_{r})\equiv ({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z})\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ).}$

Written out:

{\displaystyle {\begin{aligned}{\vec {\mathbf {e} }}_{\theta }&={\vec {\mathbf {e} }}_{x}\cos \phi \cos \theta +{\vec {\mathbf {e} }}_{y}\sin \phi \cos \theta -\sin \theta {\vec {\mathbf {e} }}_{z}\\{\vec {\mathbf {e} }}_{\phi }&=-{\vec {\mathbf {e} }}_{x}\sin \phi +{\vec {\mathbf {e} }}_{y}\cos \phi \\{\vec {\mathbf {e} }}_{r}&={\vec {\mathbf {e} }}_{x}\cos \phi \sin \theta +{\vec {\mathbf {e} }}_{y}\sin \phi \sin \theta +\cos \theta {\vec {\mathbf {e} }}_{z}.\\\end{aligned}}}

Inverting this set of equations is very easy, since rotation matrices are orthogonal, that is, their inverse is equal to their transpose.

Apparently ${\displaystyle \scriptstyle {\vec {\mathbf {r} }}}$ is along ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{r}}$. Since the two rotation matrices are orthogonal (have orthonormal rows and columns), the new frame is orthogonal. Since the two rotation matrices have unit determinant (are proper rotations), the new frame is right-handed.

Recall, parenthetically, that free parallel vectors of equal length have the same coordinate triplet with respect to a given coordinate frame. Or, equivalently, coordinate frames may be freely translated in a parallel manner. That is, the frame in the figure could have been drawn equally well with its origin in the crossing of the x-, y-, and z-axes, which, however, would have obscured the fact that ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{\phi }}$ and ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{\theta }}$ are tangent to the surface of the sphere.

## Metric tensor

In curvilinear coordinates q i the metric tensor (with elements g ij ) defines the square of an infinitesimal distance,

${\displaystyle ds^{2}\equiv \sum _{i=1}^{3}g_{ij}dq^{i}dq^{j}.}$

The Cartesian metric tensor is the identity matrix and hence in Cartesian coordinates,

${\displaystyle ds^{2}=dx^{2}+dy^{2}+dz^{2}=(dx\,dy\,dz){\begin{pmatrix}dx\\dy\\dz\end{pmatrix}}.}$

Consider the following expressions between differentials, obtained by application of the chain rule,

{\displaystyle {\begin{aligned}dx=&{\frac {\partial x}{\partial \theta }}d\theta +{\frac {\partial x}{\partial \phi }}d\phi +{\frac {\partial x}{\partial r}}dr\\dy=&{\frac {\partial y}{\partial \theta }}d\theta +{\frac {\partial y}{\partial \phi }}d\phi +{\frac {\partial y}{\partial r}}dr\\dz=&{\frac {\partial z}{\partial \theta }}d\theta +{\frac {\partial z}{\partial \phi }}d\phi +{\frac {\partial z}{\partial r}}dr.\\\end{aligned}}}

In matrix form,

${\displaystyle {\begin{pmatrix}dx\\dy\\dz\\\end{pmatrix}}=\mathbb {J} {\begin{pmatrix}d\theta \\d\phi \\dr\\\end{pmatrix}},\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (1)}$

with the Jacobi matrix having the following form,

${\displaystyle \mathbb {J} \equiv {\begin{pmatrix}{\frac {\partial x}{\partial \theta }}&{\frac {\partial x}{\partial \phi }}&{\frac {\partial x}{\partial r}}\\{\frac {\partial y}{\partial \theta }}&{\frac {\partial y}{\partial \phi }}&{\frac {\partial y}{\partial r}}\\{\frac {\partial z}{\partial \theta }}&{\frac {\partial z}{\partial \phi }}&{\frac {\partial z}{\partial r}}\\\end{pmatrix}}={\begin{pmatrix}r\cos \phi \cos \theta &-r\sin \phi \sin \theta &\cos \phi \sin \theta \\r\sin \phi \cos \theta &r\cos \phi \sin \theta &\sin \phi \sin \theta \\-r\sin \theta &0&\cos \theta \\\end{pmatrix}},}$

where the matrix on the right-hand side is obtained by performing the partial derivations. By inspection it follows that

${\displaystyle \mathbb {J} =\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ){\begin{pmatrix}r&0&0\\0&r\sin \theta &0\\0&0&1\\\end{pmatrix}}.\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (2)}$

The columns of ${\displaystyle \scriptstyle \mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta )}$ are orthogonal vectors that are normalized to unity. Hence the columns of the Jacobi matrix, which are proportional to the columns of ${\displaystyle \scriptstyle \mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta )}$, are orthogonal, but not normalized. The inverses of the normalization factors are on the diagonal of the matrix on the right of the expression. These inverse normalization factors are known as scale factors or Lamé factors. Usually they are denoted by h. Hence the spherical polar scale factors are

${\displaystyle h_{\theta }=r,\qquad h_{\phi }=r\sin \theta ,\qquad h_{r}=1.}$

The infinitesimal distance squared can be written as follows

${\displaystyle ds^{2}=(dx\,dy\,dz){\begin{pmatrix}dx\\dy\\dz\end{pmatrix}}=(d\theta \,d\phi \,dr){\begin{pmatrix}r^{2}&0&0\\0&r^{2}\sin ^{2}\theta &0\\0&0&1\\\end{pmatrix}}{\begin{pmatrix}d\theta \\d\phi \\dr\end{pmatrix}}}$

where we used that the rotation matrices are orthogonal (matrix times its transpose gives the identity matrix), so that

${\displaystyle \mathbb {J} ^{T}\mathbb {J} =\left[\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ){\begin{pmatrix}r&0&0\\0&r\sin \theta &0\\0&0&1\\\end{pmatrix}}\right]^{T}\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ){\begin{pmatrix}r&0&0\\0&r\sin \theta &0\\0&0&1\\\end{pmatrix}}={\begin{pmatrix}r^{2}&0&0\\0&r^{2}\sin ^{2}\theta &0\\0&0&1\\\end{pmatrix}}.}$

The rightmost matrix being the metric tensor associated with spherical polar coordinates, we find

${\displaystyle ds^{2}=r^{2}d\theta ^{2}+r^{2}\sin ^{2}\theta d\phi ^{2}+dr^{2}\,.}$

The fact that the metric tensor is diagonal is expressed by stating that the spherical polar coordinate system is orthogonal. We see that the metric tensor has the squares of the respective scale factors on the diagonal.

## Infinitesimal surface and volume element

An infinitesimal surface element spanned by two coordinates is equal to the square root of the corresponding 2 × 2 minor (subdeterminant) of the metric tensor times the infinitesimal coordinates,

${\displaystyle dA^{(ik)}={\sqrt {g_{ii}g_{kk}-g_{ik}^{2}}}\,dq^{i}dq^{k}.}$

For spherical polar coordinates it follows that

{\displaystyle {\begin{aligned}dA^{(\theta \phi )}&=r^{2}\sin \theta \,d\theta d\phi \\dA^{(r\theta )}&=r\,drd\theta \\dA^{(\phi r)}&=r\sin \theta d\phi dr\\\end{aligned}}}

As an example we compute the area of the surface of a sphere with radius r,

${\displaystyle A=\int _{0}^{\pi }\int _{0}^{2\pi }r^{2}\sin \theta \,d\theta d\phi =4\pi r^{2}.}$

The weight appearing in the infinitesimal volume element dV is the Jacobian (the determinant of the Jacobi matrix, which is the square root of the determinant of the metric tensor),

${\displaystyle \det {\big [}\mathbb {J} {\big ]}=\det {\big [}\mathbb {R} _{z}(\phi ){\big ]}\,\det {\big [}\mathbb {R} _{y}(\theta ){\big ]}\,r^{2}\sin \theta =r^{2}\sin \theta ,}$

where we used that the determinant of a diagonal matrix is the product of its diagonal elements and the fact that the determinants of proper rotation matrices are unity. Because hr = 1, it so happens that the weight of the volume element is equal to the weight of the surface element perpendicular to r.

As an example of the use of dV, the volume V of a sphere with radius R is,

${\displaystyle V=\int _{0}^{R}\int _{0}^{\pi }\int _{0}^{2\pi }r^{2}\sin \theta \,drd\theta d\phi ={\frac {4}{3}}\pi R^{3}.}$

## Velocity

We will express the velocity of a particle in spherical polar coordinates. In Cartesian coordinates velocity is the vector

${\displaystyle {\vec {\mathbf {v} }}=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z}){\begin{pmatrix}{\dot {x}}\\{\dot {y}}\\{\dot {z}}\\\end{pmatrix}}\qquad {\hbox{with}}\qquad {\dot {x}}\equiv {\frac {dx}{dt}},}$

and similarly the time derivatives of y, z , θ, φ, and r are given in Newton's fluxion (dot) notation. The following two equations follow from Eqs. (1) and (2), respectively,

{\displaystyle {\begin{aligned}{\vec {\mathbf {v} }}=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z})\mathbb {J} {\begin{pmatrix}{\dot {\theta }}\\{\dot {\phi }}\\{\dot {r}}\\\end{pmatrix}}=({\vec {\mathbf {e} }}_{x},\,{\vec {\mathbf {e} }}_{y},\,{\vec {\mathbf {e} }}_{z})\mathbb {R} _{z}(\phi )\mathbb {R} _{y}(\theta ){\begin{pmatrix}r&0&0\\0&r\sin \theta &0\\0&0&1\\\end{pmatrix}}{\begin{pmatrix}{\dot {\theta }}\\{\dot {\phi }}\\{\dot {r}}\\\end{pmatrix}}.\end{aligned}}}

Recalling that the unit spherical polar vectors are obtained by this rotation, we find

${\displaystyle {\vec {\mathbf {v} }}=({\vec {\mathbf {e} }}_{\theta },\,{\vec {\mathbf {e} }}_{\phi },\,{\vec {\mathbf {e} }}_{r}){\begin{pmatrix}r&0&0\\0&r\sin \theta &0\\0&0&1\\\end{pmatrix}}{\begin{pmatrix}{\dot {\theta }}\\{\dot {\phi }}\\{\dot {r}}\\\end{pmatrix}}}$,

so that the velocity expressed in spherical polar coordinates becomes

${\displaystyle {\vec {\mathbf {v} }}={\vec {\mathbf {e} }}_{\theta }\,r{\dot {\theta }}+{\vec {\mathbf {e} }}_{\phi }\,r\sin \theta {\dot {\phi }}+{\vec {\mathbf {e} }}_{r}\,{\dot {r}}.}$

Note parenthetically that

${\displaystyle {\vec {\mathbf {v} }}\cdot {\vec {\mathbf {v} }}={\Big (}{\frac {ds}{dt}}{\Big )}^{2}=r^{2}{\dot {\theta }}^{2}+r^{2}\sin ^{2}\theta {\dot {\phi }}^{2}+{\dot {r}}^{2}.}$

which becomes upon multiplication by dt2 the expression for ds2 given above.

## Differential operators

In vector analysis a number of differential operators expressed in curvilinear coordinates play an important role. They are the gradient, the divergence, the curl, and the Laplace operator. It is possible to derive general expressions for these operators that are valid in any coordinate system and are based on the metric tensor associated with the coordinate system. In the case of orthogonal systems (diagonal metric tensors) only the square roots of the diagonal elements (the scale factors) appear in the expressions. Since these general relations exist, we will not give derivations for the special case of spherical polar coordinates, but depart from the general expressions.

Above we derived the following scale factors for the spherical polar coordinates,

${\displaystyle h_{r}=1,\qquad h_{\theta }=r,\qquad h_{\phi }=r\sin \theta }$

and we showed that the unit vectors ${\displaystyle \scriptstyle {\vec {\mathbf {e} }}_{\theta },\,{\vec {\mathbf {e} }}_{\phi },\,{\vec {\mathbf {e} }}_{r}}$ are obtained by two rotations of a Cartesian system.

The gradient of a scalar function Φ is,

${\displaystyle \nabla \Phi ={\frac {\partial \Phi }{\partial r}}{\vec {\mathbf {e} }}_{r}+{\frac {1}{r}}{\frac {\partial \Phi }{\partial \theta }}{\vec {\mathbf {e} }}_{\theta }+{\frac {1}{r\sin \theta }}{\frac {\partial \Phi }{\partial \phi }}{\vec {\mathbf {e} }}_{\phi }.}$

If the vector function A is,

${\displaystyle \mathbf {A} =A_{r}{\vec {\mathbf {e} }}_{r}+A_{\theta }{\vec {\mathbf {e} }}_{\theta }+A_{\phi }{\vec {\mathbf {e} }}_{\phi }.}$

then its divergence is,

{\displaystyle {\begin{aligned}\nabla \cdot \mathbf {A} &={\frac {1}{r^{2}\sin \theta }}\left[{\frac {\partial r^{2}\sin \theta A_{r}}{\partial r}}+{\frac {\partial r\sin \theta A_{\theta }}{\partial \theta }}+{\frac {\partial rA_{\phi }}{\partial \phi }}\right]\\&={\frac {2}{r}}A_{r}+{\frac {\partial A_{r}}{\partial r}}+{\frac {\cos \theta }{r\sin \theta }}A_{\theta }+{\frac {1}{r}}{\frac {A_{\theta }}{\partial \theta }}+{\frac {1}{r\sin \theta }}{\frac {\partial A_{\phi }}{\partial \phi }},\end{aligned}}}

and its curl is given by

{\displaystyle {\begin{aligned}\nabla \times \mathbf {A} &={\frac {1}{r^{2}\sin \theta }}\left({\frac {\partial }{\partial \theta }}(r\sin \theta A_{\phi })-{\frac {\partial }{\partial \phi }}(rA_{\theta })\right){\vec {\mathbf {e} }}_{r}\\&\quad +{\frac {1}{r\sin \theta }}\left({\frac {\partial }{\partial \phi }}A_{r}-{\frac {\partial }{\partial r}}(r\sin \theta A_{\phi })\right){\vec {\mathbf {e} }}_{\theta }\\&\quad +{\frac {1}{r}}\left({\frac {\partial }{\partial r}}(rA_{\theta })-{\frac {\partial }{\partial \theta }}A_{r}\right){\vec {\mathbf {e} }}_{\phi }.\end{aligned}}}

This is often written as

${\displaystyle \nabla \times \mathbf {A} ={\frac {1}{r^{2}\sin \theta }}{\begin{vmatrix}{\vec {\mathbf {e} }}_{r}&r{\vec {\mathbf {e} }}_{\theta }&r\sin \theta {\vec {\mathbf {e} }}_{\phi }\\{\frac {\partial }{\partial r}}&{\frac {\partial }{\partial \theta }}&{\frac {\partial }{\partial \phi }}\\A_{r}&rA_{\theta }&r\sin \theta A_{\phi }\\\end{vmatrix}},}$

where it is understood that the determinant is computed by developing along the first row and then along the second row.

The Laplace operator of the scalar function Φ is,

${\displaystyle \nabla ^{2}\Phi ={\frac {1}{r^{2}}}\left[{\frac {\partial }{\partial r}}r^{2}{\frac {\partial \Phi }{\partial r}}+{\frac {1}{\sin \theta }}{\frac {\partial }{\partial \theta }}\sin \theta {\frac {\partial \Phi }{\partial \theta }}+{\frac {1}{\sin ^{2}\theta }}{\frac {\partial ^{2}\Phi }{\partial \phi ^{2}}}\right].}$

Note that

${\displaystyle {\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}r^{2}{\frac {\partial \Phi }{\partial r}}={\frac {1}{r}}{\frac {\partial ^{2}r\Phi }{\partial r^{2}}}.}$

## References

1. M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions, Dover, New York (1965)
2. E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, Cambridge UP, Cambridge UK (1965).
3. R. Courant and D. Hilbert, Methoden der mathematischen Physik I, Springer Verlag, Berlin (1968).
4. M. Kline, Mathematical Thought from Ancient to Modern Times, Oxford UP, New York (1972)
5. M. R. Spiegel, Vector Analysis, Schaum Publishing Company, New York (1959).
6. D. C. Kay, Tensor Calculus, Schaum's outline series, McGraw-Hill, New York (1988)

format: plain


text:
# Tag Info

11

The way MFCC's are always used is by feeding them into the classifier. This can be done on a frame-by-frame basis (12x1 vector), or by concatenating (12xN) - same as a spectrogram. Thus for DTW, you must perform the classification by calculating the distance between 12D vectors. It's a Dynamic Time Warping, so the difference must be calculated between ...

8

Why is each window/frame overlapping? Windowing is a means to stationarize signals. Inside a small enough window, you can expect that the properties of the signal chunk do not vary too fast. And you now can use tools well-suited to stationary signals, like Fourier-based techniques. You can imagine non-overlapping rectangular windows, each defining a frame....

8

The i-vectors and x-vectors share the ability to represent speech utterance in a compact way (as a vector of fixed size, regardless of length of the utterance). The extraction algorithms of i-vectors and x-vector are quite different. The x-vector concept is newer and the name of the method is similar to "i-vector" to suggests that this representation can be ...

7

Yes, it's possible to analyse sound the way ears do. For example, you could compute the DFT of a signal continuously using several Goertzel filters. $$y_k[n] = e^{j2\pi k/N} y_k[n-1] + x[n]$$ where $k= 0,1,\ldots, N-1$, so that $y_0$ is the DC or zero frequency term. Of course, this is an unstable filter, so some resetting or forgetting factor is ...

6

First of all there is some serious "cheating" in the MFCC reconstruction experiment you linked to: not only the MFCCs are used, but also the voiced/unvoiced bit and the pitch. MFCC are not speaker independent. In fact, they are used for speaker identification/verification tasks! The speaker "idiosyncracies" are both in their prosody (preserved by this ...

6

Researchers from the Johns Hopkins University have recently released a corpus of music, speech, and noise which, according to them, is suitable for training models for voice activity detection and music/speech discrimination. See https://arxiv.org/pdf/1510.08484.pdf for details.

6

More overlap means you end up with more windows (of a given length) per second of audio. More windows (of a given length) requires more FFTs which requires more MACs or FLOPs which generally requires more processing power. In return, more window overlap provides greater time locality of information (e.g. on average, random transient events are likely ...

6

"Ok Google" is described in many publications by Google Automatic Gain Control and Multi-style Training for Robust Small-Footprint Keyword Spotting with Deep Neural Networks Convolutional Neural Networks for Small-Footprint Keyword Spotting It is based on DNN specifically trained for keyphrase and runs really fast. It does not consume a lot of power even ...

5

What exactly can the vector/observation be? Can it be a relatively simple function, say approximation of the spectral envelope? Or is it usually a vector of R^n? You won't go very far by summarizing the entire spectral envelope of a sound by a single real, so yes, observations are vectors - their dimensionality is in the 10 to 100 components bucket... ...

5

You may think of it as efficient way to apply Dirichlet Window Based interpolation in the Fourier Domain. The advantage of applying the interpolation using Zero Padding in the Time Domain is very simple - it is simpler and more computationally efficient.

4

The standard method to remove stationary noise is spectral subtraction, where the magnitudes of the short-time Fourier transform of the noisy signal are modified based on an SNR estimate in the respective frequency bin. The algorithm by Ephraim and Malah (see this paper) and its variants are used a lot. Note that the basic principle of spectral subtraction ...

4

By performing the windowing with overlap we are artificially increasing our time resolution (larger granularity of features in time). This is especially useful when frame duration is long (bad time resolution, very good frequency resolution), thus yielding kind of extra 'time resolution'. Usually no one is using the rectangular window, but other types such ...

4

It's better to copy first frame and last frame values to extend vector sequence beyond boundaries than to assign 0. This could be implemented just by adjusting indexes: if (index1 < 0) index1 = 0 if (index2 > N - 1) index2 = N - 1 delta = v[index1] - v[index2]

4

I highly doubt that something as complex as recognizing a word can be done directly in the time domain using features as basic as zero-crossing rate.

4

You can take some big speech corpus like TEDLIUM and add the noise you like: http://www-lium.univ-lemans.fr/en/content/ted-lium-corpus The advantage of TEDLIUM is that it's a set of continuous recordings with speech timings, not just a collection of utterances.

4

Dynamic Time Warping is pretty well explained on this site. I'll use some of the diagrams from the PPT on that site to explain. The idea is to divide the signals into segments (frames) and then compare frames sequentially through each signal. As illustrated below, motion from a segment in one signal to the next segment depends on the similarity to the ...

4

A common technique for computing the inverse fft is to invert the imaginary part of the input array, perform a forward fft and then invert the imaginary part of the output array. In the case of the Cepstrum, the input to the ifft is real-valued (due to the absolute value function) and also symmetric. In this case there is no imaginary part on the input to ...

3

The Baum-Welch algorithm uses the EM (Expectation Maximization) algorithm to estimate the model parameters $(T, E, \pi)$, where: $T$: the transition probabilities $E$: the emition probabilities $\pi$: probability distribution on the states Some years ago, I made the following quick-and-dirty implementation (may be fairly broken now), for the discrete ...

3

Assuming that there are no non-linear effects between the sound N source and the microphone (such as AGC), you might try to estimate the impulse response of the channel between the source for sound N and the microphone data. The better estimate you can make of that impulse response, the more of sound N that you can remove. It’s unlikely that the negative ...

3

ImageMagick is a great tool to edit multiple images in the command line. Thanks to your question, I just discovered SoX, or Sound eXchange: SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, ...

3

All recognition tasks (doesn't even have to be speech recognition) are reductions of a very high-dimensional signal (your speech recording's dimension is the number of audio samples!) to a low-dimensional signal. As such, it is generally advisable to transform the input signal through an easy operation to a representation where the dimensionality can be ...

2

This is not aliasing this is not any phenomenon, there are number of birds whose vocal fall in speech range even a frog vocal falls in speech range so essentially a training based speech detection is required to classify whether a given frame is speech or a non speech one such implementation is shown here Speech Discrimination based on multiscale spectro ...

2

The features are the same. You might encounter differences in some of the implementation details (window sizes, number of mel filters, number of extracted coefficients) reported in research papers, but these are not significant.

2

Both speech recognition and speaker recognition require some set of features to distinguish one speaker (or speech section) from another. Suppose you have two speakers $S_1$ and $S_2$ and two words $w_1$ and $w_2$. Let's call $u_{ij}$ the utterance of speaker $i$ of word $j$. Then the MFCC's of the speech are $M(u_{ij})$. One way to pose the speaker ...

2

You should split the signal up into overlapping chunks of 20 to 30 ms. It is certainly valid to take the complex cepstrum on the 4 second signal. But, since the frequency characteristics of speech are constantly varying the complex cepstrum on the 4 second signal will average all of these together and you won't know what happened when. If you take it in each ...

2

Dan Ellis has some neat Matlab scripts that allow you to pull audio features from files . . . http://labrosa.ee.columbia.edu/matlab/ The dynamic time warp might be a good starting point for the task you describe.

2

You can try Prof. Rabiner's slides at http://www.ece.ucsb.edu/Faculty/Rabiner/ece259/ . They also have some matlab code examples which you can try.

2

There is no (known) magic solution, as the sound of the same word from very different speakers are often not actually similar to one another in term of any simple characteristics such as you list (frequency range, intensity range, pitch, etc.) To often, humans can only guess at what word is said from an unknown speaker based on context. And you don't have ...

2

Zero crossing rate is not a good approach indeed, you can use any keyword spotting software to spot for the word, keyword spotting is based on HMM too and statistical hypothesis testing. You can try keyword spotting with CMUSphinx

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# Private Testnet¶

Some developers may want to deploy their own graphene blockchain locally for governance, and speed reasons. This section explains how to prepare the private testnet environment and what steps to take to be a block producing node (witness node).

## How to Set up Private Testnet¶

### 1. Prerequisites¶

If you have not installed BitShares-Core and built yet. Please see Installation Guide. And make sure you have both witness_node and cli_wallet already compiled successfully.

### 2. Create a Testnet Folder¶

Create a new folder (e.g., [Testnet-Home]) in any location you like and copy witness_node and cli_wallet there. The [Testnet-Home] folder will contain all files and folders related to the Testnet.

Open a Command Prompt window and switch the current directory to [Testnet-Home].

### 3. Create a Genesis File for a Private Testnet¶

The genesis.json is the initial state of the network. We create a new genesis json file named my-genesis.json for a Private Testnet in the same folder just created.:

./witness_node --create-genesis-json=my-genesis.json

The my-genesis.json file will be created in the [Testnet-Home] folder. Once this task is done, the witness node will terminate on its own.

Note

witness_node startup will create a witness_node_data_dir as a default data directory (with config.ini). If you want to use a differnt folder name and directory for the data, you have to use --data-dir in a startup command line and set your data directory folder path. Otherwise, the witness_node_data_dir folder will be created and use a default config.ini file to start the witness_node.

### 4. Customization of the Genesis File¶

If you want to customize the network’s initial state, edit my-genesis.json. This allows you to control things such as:

• The accounts that exist at genesis, their names and public keys
• Assets and their initial distribution (including core asset)
• The initial values of chain parameters
• The account / signing keys of the init witnesses (or in fact any account at all).

#### Default Genesis¶

The graphene code base has a default genesis block integrated that has all witnesses, committee members and funds and a single account called nathan available from a single private key:

5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

### 5. Embed Genesis (optional)¶

Once you have genesis.json, you may set a cmake variable like so:

cmake -DGRAPHENE_EGENESIS_JSON="$(pwd)/genesis/my-genesis.json"  and then rebuild. Note, sometimes I’ve had to clean the build and CMake cache variables in order for GRAPHENE_EGENESIS_JSON to take effect: make clean find . -name "CMakeCache.txt" | xargs rm -f find . -name "CMakeFiles" | xargs rm -Rf cmake -DGRAPHENE_EGENESIS_JSON="$(pwd)/genesis/my-genesis.json" .

Deleting caches will reset all cmake variables, so if you have used instructions like build-ubuntu which tells you to set other cmake variables, you will have to add those variables to the cmake line above.

Embedding the genesis copies the entire content of genesis.json into the witness_node binary, and additionally copies the chain ID into the cli_wallet binary. Embedded genesis allows the following simplifications to the subsequent instructions:

• You do not need to specify the genesis.json file on the witness node command line, or in the witness node configuration file.
• You do not need to specify the chain ID on the cli_wallet command line when starting a new wallet.

Embedded genesis is a feature designed to make life easier for consumers of pre-compiled binaries, in exchange for slight, optional complication of the process for producing binaries.

### 6. Create a Data Directory¶

We create a new data directory for our witness.:

./witness_node --data-dir data/my-blockprod --genesis-json my-genesis.json --seed-nodes "[]"   # or

./witness_node --data-dir=data/my-blockprod --genesis-json=my-genesis.json --seed-nodes "[]"

Note:

• The data/my-blockprod directory does not exist, it will be created by the witness node.
• seed-nodes = [] creates a list of empty seed nodes to avoid connecting to default hardcoded seeds.
• Known issue: Missing = sign between input parameter and value. –> This is due to a bug of a boost 1.60. If you compile with boost 1.58, the = sign can be omitted.

The below message means the initialization is complete. It will complete nearly instantaneously with the tiny example genesis, unless you added a ton of balances. Use ctrl-c to close the witness node.

3501235ms th_a main.cpp:165 main] Started witness node on a chain with 0 blocks.
3501235ms th_a main.cpp:166 main] Chain ID is cf307110d029cb882d126bf0488dc4864772f68d9888d86b458d16e6c36aa74b

As a result, you should get two items:

• A directory named data/my-blockprod has been created (initialized) with a file named config.ini located in it.
• The chain ID is now known - it’s displayed in the message above (i.g., Chain ID).

### 7. Set up Witness Configuration¶

Open the [Testnet-Home]/data/my-blockprod/config.ini file and set the following settings, uncommenting them if necessary.

rpc-endpoint = 127.0.0.1:8090
genesis-json = my-genesis.json
enable-stale-production = true

private-key = ["GPH6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]

witness-id = "1.6.1"
witness-id = "1.6.2"
witness-id = "1.6.3"
witness-id = "1.6.4"
witness-id = "1.6.5"
witness-id = "1.6.6"
witness-id = "1.6.7"
witness-id = "1.6.8"
witness-id = "1.6.9"
witness-id = "1.6.10"
witness-id = "1.6.11"

The above list authorizes the witness_node to produce blocks on behalf of the listed witness-ids and specifies the private key needed to sign those blocks. Normally each witness would be on a different node, but for the purpose of this private testnet, we will start out with all witnesses signing blocks on a single node.

### 8. Start Block Production¶

Now run witness_node again:

./witness_node --data-dir data/my-blockprod --enable-stale-production --seed-nodes "[]"

Warning

If you want to use a different folder name and directory for the data, you have to use --data-dir in a startup command line and set your data directory folder path. Otherwise, the witness_node_data_dir folder will be created and used a default config.ini file to start the witness_node!!

Note

• Since this is a testnet, we do not need to specify genesis.json on the command line. We now specify it in the config file.
• The --enable-stale-production flag tells the witness_node to produce on a chain with zero blocks or very old blocks. We specify the --enable-stale-production parameter on the command line as we will not normally need it (although it can also be specified in the config file).
• The empty --seed-nodes is added to avoid connecting to the default seed nodes hardcoded for production.
• Subsequent runs which connect to an existing witness node over the p2p network, or which get blockchain state from an existing data directory, need not have the --enable-stale-production flag.

### 9. Obtain the Chain ID¶

(see #6.when we created a data directory, we also obtained a chain ID.)

The chain ID (i.g., blockchain id) is a hash of the genesis state. All transaction signatures are only valid for a single chain ID. So editing the genesis file will change your chain ID, and make you unable to sync with all existing chains (unless one of them has exactly the same genesis file you do).

For testing purposes, the --dbg-init-key option will allow you to quickly create a new chain against any genesis file, by replacing the witnesses’ block production keys.

Important

Each wallet is specifically associated with a single chain, specified by its chain ID. This is to protect the user from (e.g., unintentionally) using a testnet wallet on the real chain.

The chain ID is printed at witness node startup. It can also be obtained by using the API to query a running witness node with the get_chain_properties API call:

curl --data '{"jsonrpc": "2.0", "method": "get_chain_properties", "params": [], "id": 1}' http://127.0.0.1:11011/rpc && echo

This curl command will return a short JSON object including the chain_id.

### 10. Create a new Wallet¶

We are now ready to connect a new wallet to your Private testnet witness node. You must specify a chain ID and server. Keep your witness node running and in another Command Prompt window run this command (a blank username and password will suffice):

./cli_wallet --wallet-file my-wallet.json
--chain-id cf307110d029cb882d126bf0488dc4864772f68d9888d86b458d16e6c36aa74b
--server-rpc-endpoint ws://127.0.0.1:11011 -u '' -p ''

Note

• Make sure to replace the above chain ID (i.e., blockchain id) cf307110d0...36aa74b with your own chain ID reported by your witness_node. The chain-id passed to the CLI-wallet needs to match the id generated and used by the witness node.
• --server-rpc-endpoint - The port number is how you defined (opened) --rpc-endpoint for the witness_node.

If you get the set_password prompt, it means your wallet has successfully connected to the testnet witness node.

Fist you need to create a new password for your wallet. This password is used to encrypt all the private keys in the wallet. For this example, we will use the password supersecret:

>>> set_password supersecret

In Graphene, balances are contained in accounts. To import an account that exists in the Graphene genesis into your wallet, all you need to know its name and its private key. We will now import into the wallet an account called nathan (a general purpose test account) by using the import_key command:

unlock supersecret
import_key nathan "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"

Note

nathan happens to be the account name defined in the genesis file. If you had edited your my-genesies.json file just after it was created, you could have put a different name there. Also, note that 5KQwrPbwdL...P79zkvFD3 is the private key defined in the config.ini file.

Now we have the private key imported into the wallet but still no funds assocciated with it. Funds are stored in genesis balance objects. These funds can be claimed, with no fee, using the import_balance command:

import_balance nathan ["5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] true

As a result, we have one account (named nathan) imported into the wallet and this account is well funded with BTS as we have claimed the funds stored in the genesis file. You can view this account information and the balance by using the below commands:

get_account nathan
list_account_balances nathan

### 12. Create Another Account¶

We will now create another account (named alpha) so that we can transfer funds back and forth between nathan and alpha.

Creating a new account is always done by using an existing account - we need it because someone (i.e. the registrar) has to fund the registration fee. Also, there is the requirement for the registrar account to have a lifetime member (LTM) status. Therefore we need to upgrade the account nathan to LTM, before we can proceed with creating other accounts.

upgrade_account nathan true
get_account nathan

In the response, next to membership_expiration_date you should see 1969-12-31T23:59:59. If you get 1970-01-01T00:00:00 something is wrong and nathan has not been successfully upgraded.

We can now register an account by using nathan as registrar. But first we need to get hold of the public key for the new account. We do it by using the suggest_brain_key command.

And the resposne should be something similar to this

suggest_brain_key
{
"brain_priv_key": "MYAL SOEVER UNSHARP PHYSIC JOURNEY SHEUGH BEDLAM WLOKA FOOLERY GUAYABA DENTILE RADIATE TIEPIN ARMS FOGYISH COQUET",
"wif_priv_key": "5JDh3XmHK8CDaQSxQZHh5PUV3zwzG68uVcrTfmg9yQ9idNisYnE",
"pub_key": "BTS78CuY47Vds2nfw2t88ckjTaggPkw16tLhcmg4ReVx1WPr1zRL5"
}

We can now register an account. The register_account command allows you to register an account using only a public key:

register_account alpha BTS78CuY47Vds2nfw2t88ckjTaggPkw16tLhcmg4ReVx1WPr1zRL5 BTS78CuY47Vds2nfw2t88ckjTaggPkw16tLhcmg4ReVx1WPr1zRL5 nathan nathan 0 true

> Use a public key pub_key which you just created by suggest_brain_key.

#### Transfer funds between accounts¶

transfer nathan alpha 100000 CORE "here is the cash" true
list_account_balances alpha

The text here is some cash is an arbitrary memo you can attatch to a transfer. If you don’t need it, just use "" instead.

We can now open a new wallet for alpha user:

import_key alpha 5JDh3XmHK8CDaQSxQZHh5PUV3zwzG68uVcrTfmg9yQ9idNisYnE
create_witness alpha "http://www.alpha" true

> Use a private key wif_priv_key which you just created by suggest_brain_key.

The get_private_key command allows us to obtain the WIF private key corresponding to a public key. The private key must already be in the wallet:

get_private_key BTS78CuY47Vds2nfw2t88ckjTaggPkw16tLhcmg4ReVx1WPr1zRL5

> You can try to make sure your suggest_brain_key outputs key pair. You should get the same pair of keys set.

### 13. Create Committee Members¶

create_account_with_brain_key com0 com0 nathan nathan true
create_account_with_brain_key com1 com1 nathan nathan true
create_account_with_brain_key com2 com2 nathan nathan true
create_account_with_brain_key com3 com3 nathan nathan true
create_account_with_brain_key com4 com4 nathan nathan true
create_account_with_brain_key com5 com5 nathan nathan true
create_account_with_brain_key com6 com6 nathan nathan true
transfer nathan com0 100000 CORE "some cash" true
transfer nathan com1 100000 CORE "some cash" true
transfer nathan com2 100000 CORE "some cash" true
transfer nathan com3 100000 CORE "some cash" true
transfer nathan com4 100000 CORE "some cash" true
transfer nathan com5 100000 CORE "some cash" true
transfer nathan com6 100000 CORE "some cash" true
create_committee_member com0 "http://www.com0" true
create_committee_member com1 "http://www.com1" true
create_committee_member com2 "http://www.com2" true
create_committee_member com3 "http://www.com3" true
create_committee_member com4 "http://www.com4" true
create_committee_member com5 "http://www.com5" true
create_committee_member com6 "http://www.com6" true
vote_for_committee_member nathan com0 true true
vote_for_committee_member nathan com1 true true
vote_for_committee_member nathan com2 true true
vote_for_committee_member nathan com3 true true
vote_for_committee_member nathan com4 true true
vote_for_committee_member nathan com5 true true
vote_for_committee_member nathan com6 true true

propose_parameter_change com0 {"block_interval" : 6} true
`


text:
# 2.32 Volcanoes and deep sea hydrothermal vents are both associated with sulfur-rich environments. Mount Etna is...

###### Question:

2.32 Volcanoes and deep sea hydrothermal vents are both associated with sulfur-rich environments. Mount Etna is classed as a continuously degassing volcano and emissions of SO2 and H2S are around 1.5Tgy and 100Ggyi, respectively (Tg = 1012 g; Gg 10 g). (a) Draw Lewis structures for H2S and SO2, ensuring that the octet rule is obeyed by the S and O atoms. Your answer must be consistent with the fact that in SO2, the two sulfur-oxygen bonds are the same length. (b) Are H2S and SO2 polar or non-polar molecules? If polar, draw a diagram to show the direction of the molecular dipole moment. (c) In the troposphere, SO2 reacts with HO radicals. Construct an MO diagram for HO from H and O atoms, and deduce what you can about the bonding y respectively (Tg 10g: in HO

#### Similar Solved Questions

##### Respond to question 1 and either 2 or 3: 1-Describe Erickson’s stage of industry vs inferiority...
Respond to question 1 and either 2 or 3: 1-Describe Erickson’s stage of industry vs inferiority 2-What is the impact of different family types on middle childhood psychosocial development 3-How do peers, TV, and social media influence middle childhood...
##### The instructor gave us the answers. I'm just looking for help on the steps to get...
The instructor gave us the answers. I'm just looking for help on the steps to get to the answer. Will give thumbs up if correct! Thanks! 7. Predict the product when (R)-2-butanol is treated with PBrs, followed by sodium hydroxide (NaOH). (a)XR)-2-butanol bromobutane (d) (5)-2- (b) (8)-2-butanol ...
##### In this lab, we’ll investigate the 802.11 wireless network protocol. Follow the instructions and answers questions...
In this lab, we’ll investigate the 802.11 wireless network protocol. Follow the instructions and answers questions 7 - 10. http://gaia.cs.umass.edu/wireshark-labs/wireshark-traces.zip In this lab, we'll investigate the 802.11 wireless network protocol. Before beginning this lab, you mi...
##### Please include units SLIDING GNOME A force is applied to GNOME a sliding down the plane...
please include units SLIDING GNOME A force is applied to GNOME a sliding down the plane to stop him Weight force, F Inclined plane Velocity, V 0, slope DATA The coefficient of friction mu = 0.3 The initial velocity (in the shown direction) is Vi = 58.6 ft/s stopping distance S = 28.2 feet USER SUPPL...
...
##### USE THE FOLLOWING INFORMATION TO ANSWER THE NEXT (8) QUESTIONS: On August 1, 20x1, Desert, Inc....
USE THE FOLLOWING INFORMATION TO ANSWER THE NEXT (8) QUESTIONS: On August 1, 20x1, Desert, Inc. adopted a plan to discontinue its children’s clothing division, which qualifies as a component of the business according to GAAP.  The disposal of the division was expected to be concluded...
##### Help 602 ww -24V 0000 2H Loo Consider the circuit shown above. At 0.2 seconds after...
help 602 ww -24V 0000 2H Loo Consider the circuit shown above. At 0.2 seconds after the switch is closed, what is the voltage across the resistor? O 1.80 V 1.95 V O 10.8 V O 11.7V 13.2 V...
##### In the summer of 2003 a team of American and Russian scientists synthesized isotopes of element...
In the summer of 2003 a team of American and Russian scientists synthesized isotopes of element 115 by bombarding a target of 243Am with 48Ca. One of the isotopes had a mass number of 288. You can see my attempted answer, but it was wrong. Please help :) Part 3 (1 point) Within about 20 seconds an i...
##### Tion In a survey of 2973 adults, 1424 say they have started paying bills online in...
tion In a survey of 2973 adults, 1424 say they have started paying bills online in the last year Construct a 99% confidence interval for the population proportion Interpret the results A 99% confidence interval for the population proportion is (Round to three decimal places as needed) Interpret your...
##### Kpmg llp served as the external auditor unter during rally being a auditor address "senior management....
kpmg llp served as the external auditor unter during rally being a auditor address "senior management. a. What audit evidence-related problems did DTT encounter du the audit of Longtop? b. Exhibit 6.8 describes external confirmations as generally beine reliable, high quality type of e...


text:
# Why are there so many different “colors” in the line spectra of simple elements?

I understand that atoms emit photons of wavelength $$\lambda$$ when electrons transition to lower orbitals according to the equation $$E = \frac{hc}{\lambda}$$. Based on my understanding, those orbitals have fixed energies, and simple elements like oxygen should have a small number of orbitals. The number of transitions possible, and thus the number of wavelengths, should be quite small. How then is the large numbers of lines on the oxygen line spectrum explained?

The first effect that causes that just follows from oxygen nuclei having a higher charge. Observe the hydrogen spectrum below (by Wikipedia user OrangeDog, CC BY-SA 3.0):

You'll notice that there are a lot of spectral lines out there in the infrared, that exist but that you can't actually see with your eyes. Oxygen has a nucleus with eight times higher charge, so in the Bohr model all the energies are sixty-four times higher (but not in reality because the Bohr model is bad for Oxygen; more on that later), so all those infrared spectral lines are shifted into the visible region of the spectrum, where you can see them.

Another effect is that the lovely hydrogenic spectrum you're familiar with, $$E_n = R hc \frac{Z^2}{n^2}$$, is, like all good things in physics, an approximation. Specifically, it's the approximation that the potential an electron is in is $$U(r) \propto \frac{Ze}{r}$$, .

This works wonderfully when you have one electron, because in that case, the potential really is exactly that; the hydrogenic spectrum is, thankfully, the spectrum we see in hydrogen. It works almost as well when you have one outer electron, because in that case all the inner electrons are in a spherically symmetric configuration. But if you have more than one electron, things start getting thorny.

This is because the potential an electron is really in is $$U_i(r) = -\frac{Ze^2}{4 \pi \epsilon_0 r_i} + \sum_{ij} \frac{e^2}{8 \pi\epsilon_0 r_{ij}}$$; you have the nice coulomb potential from the nucleus, and you have that additional, very displeasing term from the interactions with other electrons. You can't usually just treat that term as small and Taylor expand or what have you, either, because the distance between electrons is about the same as the distance between an electron and a nucleus, and the electron and the nucleus have similar charges.

Approximately, what happens is something called "screening"; electrons end up feeling a small overall charge from the center of the atom, equal to the charge of the nucleus minus the proportion of it that's cancelled out by the other electrons, and you proceed as normal using the adjusted nuclear charge $$Z^* e$$. But this charge isn't a constant; electrons far away from the nucleus are well-screened, and might only experience a charge of $$e$$ (the nuclear charge $$Ze$$, minus the charge of the remaining electrons of $$\left(Z-1\right)e$$), and electrons close to the nucleus aren't screened much, so they feel nearly the full charge $$Ze$$. In between, $$Z^*$$ is a complex nonlinear function that can't be determined analytically.

(There's still a small part of the potential that doesn't depend only on the distance from the nucleus, because screening is just an approximation, but this really is small so you can just Taylor expand it.)

Since electron spend different amounts of time near the nucleus depending on their angular momentum, this means that the energy of an electron is, in generally, a function of $$n$$ and $$\ell$$. Since $$\ell$$ ranges from $$0$$ to $$n-1$$, this means that more complicated atoms have lots more spectral lines.

There are an infinite number of orbitals. Even for simple one-electron Hydrogen, there are an infinite number of energy levels, $$E=-E_0/n^2$$ for $$n=1,2,3,...$$ all the way to infinity.

So there are many possible transitions between energy levels, each corresponding to a spectral frequency. Some transitions have a much higher probability than others, so you see the most likely transitions, not all of them.

Addition: Some transitions are actually forbidden, based on “selection rules”. For example, in the dipole approximation for Hydrogen, the $$\ell$$ quantum number must increase or decrease by 1 in a transition.

• Thanks a lot! Makes more sense now! Would you have a pointer to a resource explaining why some transitions have higher probabilities than other? – Thomas Reynaud Nov 21 '18 at 23:14
• You could take a look at this: farside.ph.utexas.edu/teaching/qmech/Quantum/node110.html. Basically, when the atom transitions between two states, it acts as an oscillating electric dipole. The intensity of the spectral line depends on the matrix element $\langle f|\vec{d}|i\rangle$ of the dipole moment operator $\vec{d}$ between the initial state $i$ and the final state $f$. – G. Smith Nov 21 '18 at 23:27
• The term "forbidden transition" is a bit of a misnomer, since these transitions actually happen. For instance, the 21-cm hyperfine transition of hydrogen is "forbidden", and yet its observation is the basis of a good fraction of radio astronomy. – Kyle Oman Nov 22 '18 at 8:38
• @Kyle It's not too much of a misnomer - it just needs to be prefaced correctly. A better term is dipole-forbidden, which means that the transition cannot happen in the dipole approximation. It might still be possible in quadrupole or higher-order approximations, but those are much weaker and you'll likely need a harder, dedicated experiment (or astronomical amounts of gas) to detect it. Wikipedia has more information. – Emilio Pisanty Nov 23 '18 at 9:47
• (not that you don't know that. But OP could use the information, as might G.Smith.) – Emilio Pisanty Nov 23 '18 at 9:48


text:
yasa.hypno_upsample_to_data¶

yasa.hypno_upsample_to_data(hypno, sf_hypno, data, sf_data=None, verbose=True)[source]

Upsample an hypnogram to a given sampling frequency and fit the resulting hypnogram to corresponding EEG data, such that the hypnogram and EEG data have the exact same number of samples.

New in version 0.1.5.

Parameters
hypnoarray_like

The sleep staging (hypnogram) 1D array.

sf_hypnofloat

The current sampling frequency of the hypnogram, in Hz, e.g.

• 1/30 = 1 value per each 30 seconds of EEG data,

• 1 = 1 value per second of EEG data

dataarray_like or mne.io.BaseRaw

1D or 2D EEG data. Can also be a mne.io.BaseRaw, in which case data and sf_data will be automatically extracted.

sf_datafloat

The sampling frequency of data, in Hz (e.g. 100 Hz, 256 Hz, …). Can be omitted if data is a mne.io.BaseRaw.

verbosebool or str

Verbose level. Default (False) will only print warning and error messages. The logging levels are ‘debug’, ‘info’, ‘warning’, ‘error’, and ‘critical’. For most users the choice is between ‘info’ (or verbose=True) and warning (verbose=False).

Returns
hypnoarray_like

The hypnogram, upsampled to sf_data and cropped/padded to max(data.shape).

Warns
UserWarning

If the upsampled hypno is shorter / longer than max(data.shape) and therefore needs to be padded/cropped respectively. This output can be disabled by passing verbose='ERROR'.