text:
# Characterization of bounded geometry - Reference-request

I already asked this question at stackexchange three days ago. Since I got no answer, I want to try mathoverflow now. I hope that you can help.

I'm looking for a proof of an equivalence that can e.g. be found in a paper by Shubin 'Spectral theory of elliptic operators on non-compact manifolds' (Appendix A.1.1 below Def. 1.1).

It's about manifolds of bounded geometry, where bounded geometry means here: positive injectivity radius and the curvature tensor and all its covariant derivatives are bounded.

In the paper of Shubin it is written that there are the following equivalent characterizations: (Let $(M,g)$ always have positive injectivity radius.)

(i) $(M,g)$ is of bounded geometry.

(ii) Let $r>0$ be smaller than the injectivity radius. For any $x,x′\in M$ let $y$ (resp. $y′$) be geodesic normal coordinates around $x$ (resp. $x′$) with an r-ball as domain. If the balls of radius $r$ around $x$ and $x′$ have a nonempty intersection, then the transition function $y^{−1}\circ y$ and all its derivatives are uniformly bounded (where uniformly means here independent of $x$ and $x′$).

I know that (i) is equivalent to the following: (iii) Let $g^\alpha_{ij}$ be the representation of the metric coefficienst on a ball of radius $r$ around $x_\alpha$ with respect to geodesic normal coordinates. Then $g^\alpha_{ij}$ and all its derivatives are uniformly bounded (where uniformly means independent on $\alpha$).

I can see that (iii) implies (ii) (by looking at the geodesic flow and using Gronwall's inequality). But I have no idea how to get the converse. Is there any reference for the proof? I'm grateful for any idea for the proof as well.

-
Have a look at: MR2343536 (2008i:58001) Eichhorn, Jürgen Global analysis on open manifolds. Nova Science Publishers, Inc., New York, 2007. x+644 pp. I do not have my copy at hand, so I cannot check whether a proof is there. Since the whole book uses bounded geometry, it might be there. –  Peter Michor Nov 19 '12 at 10:04
I have to check, don't have time now, if the statement you want is actually in there, but a lot of these type of theorems are proven in the PhD thesis of Jaap Eldering arxiv.org/pdf/1204.1310v2.pdf . See for example Lemma 2.6 –  Thomas Rot Nov 19 '12 at 12:33
Indeed to confirm what @Thomas Rot said: the converse statement is not in my PhD thesis. I don't know of another place where you might find a citable reference. –  Jaap Eldering Nov 19 '12 at 22:38

Suppose that all transitions between normal coordinates have uniformly bounded derivatives within some radius $r$. For every point $p$ we have a unit radial vector field $V=V(p)$ whose derivatives are uniformly bounded at distances between, say $r/10$ and $r$ from $p$. (This holds in normal coordinates centered at $p$ and hence in normal coordinates centered at any nearby point.)
Now fix a point $q\in M$ and arrange points $p_k$, $k=1,\dots,\frac{n(n+1)}2$, where $n=\dim M$, so that the distances from $q$ to $p_k$ equal $r/2$ and the corresponding vector fields $V_k=V(p_k)$ at $q$ are generic in the sense that the symmetric tensors $V_k\otimes V_k$ are linearly independent. Then the same holds at every point in a neighborhood of $q$. Actually the points $p_k$ should have some prescribed coordinates in normal coordinate system centered at $q$, then all subsequent estimates are uniform.
We have a system of equations $g(V_k,V_k)=1$, $k=1,\dots,\frac{n(n+1)}2$. At every point near $q$ this is a nondegenerate linear system on the components of the metric tensor $g$. Hence it uniquely determines $g$ via some explicit formulae in terms of $V_k$. Since the derivatives of $V_k$ are uniformly bounded, so are the derivatives of the metric tensor.


text:
# Change of basis

A linear combination of one basis of vectors (purple) obtains new vectors (red). If they are linearly independent, these form a new basis. The linear combinations relating the first basis to the other extend to a linear transformation, called the change of basis.
A vector represented by two different bases (purple and red arrows).

In mathematics, an ordered basis of a vector space of finite dimension n allows representing uniquely any element of the vector space by a coordinate vector, which is a sequence of n scalars called coordinates. If two different bases are considered, the coordinate vector that represents a vector v on one basis is, in general, different from the coordinate vector that represents v on the other basis. A change of basis consists of converting every assertion expressed in terms of coordinates relative to one basis into an assertion expressed in terms of coordinates relative to the other basis.[1][2][3]

Such a conversion results from the change-of-basis formula which expresses the coordinates relative to one basis in terms of coordinates relative to the other basis. Using matrices, this formula can be written

${\displaystyle \mathbf {x} _{\mathrm {old} }=A\,\mathbf {x} _{\mathrm {new} },}$

where "old" and "new" refer respectively to the firstly defined basis and the other basis, ${\displaystyle \mathbf {x} _{\mathrm {old} }}$ and ${\displaystyle \mathbf {x} _{\mathrm {new} }}$ are the column vectors of the coordinates of the same vector on the two bases, and ${\displaystyle A}$ is the change-of-basis matrix (also called transition matrix), which is the matrix whose columns are the coordinate vectors of the new basis vectors on the old basis.

This article deals mainly with finite-dimensional vector spaces. However, many of the principles are also valid for infinite-dimensional vector spaces.

## Change of basis formula

Let ${\displaystyle B_{\mathrm {old} }=(v_{1},\ldots ,v_{n})}$ be a basis of a finite-dimensional vector space V over a field F.[a]

For j = 1, ..., n, one can define a vector wj by its coordinates ${\displaystyle a_{i,j}}$ over ${\displaystyle B_{\mathrm {old} }\colon }$

${\displaystyle w_{j}=\sum _{i=1}^{n}a_{i,j}v_{i}.}$

Let

${\displaystyle A=\left(a_{i,j}\right)_{i,j}}$

be the matrix whose jth column is formed by the coordinates of wj. (Here and in what follows, the index i refers always to the rows of A and the ${\displaystyle v_{i},}$ while the index j refers always to the columns of A and the ${\displaystyle w_{j};}$ such a convention is useful for avoiding errors in explicit computations.)

Setting ${\displaystyle B_{\mathrm {new} }=(w_{1},\ldots ,w_{n}),}$ one has that ${\displaystyle B_{\mathrm {new} }}$ is a basis of V if and only if the matrix A is invertible, or equivalently if it has a nonzero determinant. In this case, A is said to be the change-of-basis matrix from the basis ${\displaystyle B_{\mathrm {old} }}$ to the basis ${\displaystyle B_{\mathrm {new} }.}$

Given a vector ${\displaystyle z\in V,}$ let ${\displaystyle (x_{1},\ldots ,x_{n})}$ its coordinates over ${\displaystyle B_{\mathrm {old} },}$ and ${\displaystyle (y_{1},\ldots ,y_{n})}$ its coordinates over ${\displaystyle B_{\mathrm {new} };}$ that is

${\displaystyle z=\sum _{i=1}^{n}x_{i}v_{i}=\sum _{j=1}^{n}y_{j}w_{j}.}$

(One could take the same summation index for the two sums, but choosing systematically the indexes i for the old basis and j for the new one makes clearer the formulas that follows, and helps avoiding errors in proofs and explicit computations.)

The change-of-basis formula expresses the coordinates over the old basis in term of the coordinates over the new basis. With above notation, it is

${\displaystyle x_{i}=\sum _{j=1}^{n}a_{i,j}y_{j}\qquad {\text{for }}i=1,\ldots ,n.}$

In terms of matrices, the change of basis formula is

${\displaystyle \mathbf {x} =A\,\mathbf {y} ,}$

where ${\displaystyle \mathbf {x} }$ and ${\displaystyle \mathbf {y} }$ are the column matrices of the coordinates of z over ${\displaystyle B_{\mathrm {old} }}$ and ${\displaystyle B_{\mathrm {new} },}$ respectively.

Proof: Using the above definition of the change-of basis matrix, one has

{\displaystyle {\begin{aligned}z&=\sum _{j=1}^{n}y_{j}w_{j}\\&=\sum _{j=1}^{n}\left(y_{j}\sum _{i=1}^{n}a_{i,j}v_{i}\right)\\&=\sum _{i=1}^{n}\left(\sum _{j=1}^{n}a_{i,j}y_{j}\right)v_{i}.\end{aligned}}}

As ${\displaystyle z=\textstyle \sum _{i=1}^{n}x_{i}v_{i},}$ the change-of-basis formula results from the uniqueness of the decomposition of a vector over a basis.

## Example

Let consider the Euclidean vector space ${\displaystyle \mathbb {R} ^{2}.}$ Its standard basis consists of the vectors ${\displaystyle v_{1}=(1,0)}$ and ${\displaystyle v_{2}=(0,1).}$ If one rotate them by an angle of t, one gets a new basis formed by ${\displaystyle w_{1}=(\cos t,\sin t)}$ and ${\displaystyle w_{2}=(-\sin t,\cos t).}$

So, the change-of-basis matrix is ${\displaystyle {\begin{bmatrix}\cos t&-\sin t\\\sin t&\cos t\end{bmatrix}}.}$

The change-of-basis formula asserts that, if ${\displaystyle y_{1},y_{2}}$ are the new coordinates of a vector ${\displaystyle (x_{1},x_{2}),}$ then one has

${\displaystyle {\begin{bmatrix}x_{1}\\x_{2}\end{bmatrix}}={\begin{bmatrix}\cos t&-\sin t\\\sin t&\cos t\end{bmatrix}}\,{\begin{bmatrix}y_{1}\\y_{2}\end{bmatrix}}.}$

That is,

${\displaystyle x_{1}=y_{1}\cos t-y_{2}\sin t\qquad {\text{and}}\qquad x_{2}=y_{1}\sin t+y_{2}\cos t.}$

This may be verified by writing

{\displaystyle {\begin{aligned}x_{1}v_{1}+x_{2}v_{2}&=(y_{1}\cos t-y_{2}\sin t)v_{1}+(y_{1}\sin t+y_{2}\cos t)v_{2}\\&=y_{1}(\cos(t)v_{1}+\sin(t)v_{2})+y_{2}(-\sin(t)v_{1}+\cos(t)v_{2})\\&=y_{1}w_{1}+y_{2}w_{2}.\end{aligned}}}

## In terms of linear maps

Normally, a matrix represents a linear map, and the product of a matrix and a column matrix represents the function application of the corresponding linear map to the vector whose coordinates form the column matrix. The change-of-basis formula is a specific case of this general principle, although this is not immediately clear from its definition and proof.

When one says that a matrix represents a linear map, one refers implicitly to bases of implied vector spaces, and to the fact that the choice of a basis induces an isomorphism between a vector space and Fn, where F is the field of scalars. When only one basis is considered for each vector space, it is worth to leave this isomorphism implicit, and to work up to an isomorphism. As several bases of the same vector space are considered here, a more accurate wording is required.

Let F be a field, the set ${\displaystyle F^{n}}$ of the n-tuples is a K-vector space whose addition and scalar multiplication are defined component-wise. Its standard basis is the basis that has as its ith element the tuple with all components equal to 0 except the ith that is 1.

A basis ${\displaystyle B=(v_{1},\ldots ,v_{n})}$ of a F-vector space V defines a linear isomorphism ${\displaystyle \phi \colon F^{n}\to V}$ by

${\displaystyle \phi (x_{1},\ldots ,x_{n})=\sum _{i=1}^{n}x_{i}v_{i}.}$

Conversely, such a linear isomorphism defines a basis, which is the image by ${\displaystyle \phi }$ of the standard basis of ${\displaystyle F^{n}.}$

Let ${\displaystyle B_{\mathrm {old} }=(v_{1},\ldots ,v_{n})}$ be the "old basis" of a change of basis, and ${\displaystyle \phi _{\mathrm {old} }}$ the associated isomorphism. Given a change-of basis matrix A, let consider it as the matrix of an endomorphism ${\displaystyle \psi _{A}}$ of ${\displaystyle F^{n}.}$ Finally, let define

${\displaystyle \phi _{\mathrm {new} }=\phi _{\mathrm {old} }\circ \psi _{A}}$

(where ${\displaystyle \circ }$ denotes function composition), and

${\displaystyle B_{\mathrm {new} }=\phi _{\mathrm {new} }(\phi _{\mathrm {old} }^{-1}(B_{\mathrm {old} })).}$

A straightforward verification, allows showing that this definition of ${\displaystyle B_{\mathrm {new} }}$ is the same as that of the preceding section.

Now, by composing the equation ${\displaystyle \phi _{\mathrm {new} }=\phi _{\mathrm {old} }\circ \psi _{A}}$ with ${\displaystyle \phi _{\mathrm {old} }^{-1}}$ on the left and ${\displaystyle \phi _{\mathrm {new} }^{-1}}$ on the right, one gets

${\displaystyle \phi _{\mathrm {old} }^{-1}=\psi _{A}\circ \phi _{\mathrm {new} }^{-1}.}$

It follows that, for ${\displaystyle v\in V,}$ one has

${\displaystyle \phi _{\mathrm {old} }^{-1}(v)=\psi _{A}(\phi _{\mathrm {new} }^{-1}(v)),}$

which is the change-of-basis formula expressed in terms of linear maps instead of coordinates.

## Function defined on a vector space

A function that has a vector space as its domain is commonly specified as a multivariate function whose variables are the coordinates on some basis of the vector on which the function is applied.

When the basis is changed, the expression of the function is changed. This change can be computed by substituting the "old" coordinates for their expressions in terms of the "new" coordinates. More precisely, if f(x) is the expression of the function in terms of the old coordinates, and if x = Ay is the change-of-base formula, then f(Ay) is the expression of the same function in terms of the new coordinates.

The fact that the change-of-basis formula expresses the old coordinates in terms of the new one may seem unnatural, but appears as useful, as no matrix inversion is needed here.

As the change-of-basis formula involves only linear functions, many function properties are kept by a change of basis. This allows defining these properties as properties of functions of a variable vector that are not related to any specific basis. So, a function whose domain is a vector space or a subset of it is

if the multivariate function that represents it on some basis—and thus on every basis—has the same property.

This is specially useful in the theory of manifolds, as this allows extending the concepts of continuous, differentiable, smooth and analytic functions to functions that are defined on a manifold.

## Linear maps

Let consider a linear map T: WV from a vector space W of dimension n to a vector space V of dimension m. It is represented on "old" bases of V and W by a m×n matrix M. A change of bases is defined by an m×m change-of-basis matrix P for V, and an m×m change-of-basis matrix Q for W.

On the "new" bases, the matrix of T is

${\displaystyle P^{-1}MQ.}$

This is a straightforward consequence of the change-of-basis formula.

## Endomorphisms

Endomorphisms, are linear maps from a vector space V to itself. For a change of basis, the formula of the preceding section applies, with the same change-of-basis matrix on both sides if the formula. That is, if M is the square matrix of an endomorphism of V over an "old" basis, and P is a change-of-basis matrix, then the matrix of the endomorphism on the "new" basis is

${\displaystyle P^{-1}MP.}$

As every invertible matrix can be used as a change-of-basis matrix, this implies that two matrices are similar if and only they represent the same endomorphism on two different bases.

## Bilinear forms

A bilinear form on a vector space V over a field F is a function V × V → F which is linear in both arguments. That is, B : V × V → F is bilinear if the maps ${\displaystyle v\mapsto B(v,w)}$ and ${\displaystyle v\mapsto B(w,v)}$ are linear for every fixed ${\displaystyle w\in V.}$

The matrix B of a bilinear form B on a basis ${\displaystyle (v_{1},\ldots ,v_{n})}$ (the "old" basis in what follows) is the matrix whose entry of the ith row and jth column is B(i, j). It follows that if v and w are the column matrices of the coordinates of two vectors v and w, one has

${\displaystyle B(v,w)=\mathbf {v} ^{\mathsf {T}}\mathbf {B} \mathbf {w} ,}$

where ${\displaystyle \mathbf {v} ^{\mathsf {T}}}$ denotes the transpose of the matrix v.

If P is a change of basis matrix, then a straightforward computation shows that the matrix of the bilinear form on the new basis is

${\displaystyle P^{\mathsf {T}}\mathbf {B} P.}$

A symmetric bilinear form is a bilinear form B such that ${\displaystyle B(v,w)=B(w,v)}$ for every v and w in V. It follows that the matrix of B on any basis is symmetric. This implies that the property of being a symmetric matrix must be kept by the above change-of-base formula. One can also check this by noting that the transpose of a matrix product is the product of the transposes computed in the reverse order. In particular,

${\displaystyle (P^{\mathsf {T}}\mathbf {B} P)^{\mathsf {T}}=P^{\mathsf {T}}\mathbf {B} ^{\mathsf {T}}P,}$

and the two members of this equation equal ${\displaystyle P^{\mathsf {T}}\mathbf {B} P}$ if the matrix B is symmetric.

If the characteristic of the ground field F is not two, then for every symmetric bilinear form there is a basis for which the matrix is diagonal. Moreover, the resulting nonzero entries on the diagonal are defined up to the multiplication by a square. So, if the ground field is the field ${\displaystyle \mathbb {R} }$ of the real numbers, these nonzero entries can be chosen to be either 1 or –1. Sylvester's law of inertia is a theorem that asserts that the numbers of 1 and of –1 depends only on the bilinear form, and not of the change of basis.

Symmetric bilinear forms over the reals are often encountered in geometry and physics, typically in the study of quadrics and of the inertia of a rigid body. In these cases, orthonormal bases are specially useful; this means that one generally prefer to restrict changes of basis to those that have an orthogonal change-of-base matrix, that is, a matrix such that ${\displaystyle P^{\mathsf {T}}=P^{-1}.}$ Such matrices have the fundamental property that the change-of-base formula is the same for a symmetric bilinear form and the endomorphism that is represented by the same symmetric matrix. Spectral theorem asserts that, given such a symmetric matrix, there is an orthogonal change of basis such that the resulting matrix (of both the bilinear form and the endomorphism) is a diagonal matrix with the eigenvalues of the initial matrix on the diagonal. It follows that, over the reals, if the matrix of an endomorphism is symmetric, then it is diagonalizable.

## Notes

1. ^ Although a basis is formally a set, the tuple notation is convenient here, since the indexing by the first positive integers makes the basis an ordered basis.

## References

1. ^ Anton (1987, pp. 221–237)
2. ^ Beauregard & Fraleigh (1973, pp. 240–243)
3. ^ Nering (1970, pp. 50–52)

## Bibliography

• Anton, Howard (1987), Elementary Linear Algebra (5th ed.), New York: Wiley, ISBN 0-471-84819-0
• Beauregard, Raymond A.; Fraleigh, John B. (1973), A First Course In Linear Algebra: with Optional Introduction to Groups, Rings, and Fields, Boston: Houghton Mifflin Company, ISBN 0-395-14017-X
• Nering, Evar D. (1970), Linear Algebra and Matrix Theory (2nd ed.), New York: Wiley, LCCN 76091646

format: plain


text:
# Terrain¶

Panda3D also provides classes for terrain generation. Those classes take a height field image, and generate visible geometry from the provided height field.

If you work with very large terrains, the renderer may not be able to handle such a great amount of triangles. To solve that issue, Panda3D provides LOD (Level of Detail), this means that it will generate the terrain at high quality near the focal point (which is usually the camera), but will provide lower quality terrain - that is, less triangles - because those far away parts are not as much visible as the closer parts.

Panda3D provides three classes for terrain generation and LOD handling:

• The HeightfieldTesselator. This class can take a grayscale height field image and generate a terrain. It uses a linear LOD system, and, of course, because when the camera moves away from the focal point, the terrain needs to be regenerated to ‘focus’ on the new focal point. On extremely large terrains, this might lead to complications, because regenerating the entire terrain takes time, and the player might experience some lag when it is regenerated. That is why this class is not very suitable for extremely large terrains.

• The GeoMipTerrain. This algorithm takes a height field and also converts it into geometry, but it splits the terrain up in smaller chunks, so when the focal point changes, not all chunks have to be regenerated. This is to prevent lagging when the focal point moves. For smaller terrains, however, you might not need such extensive terrain calculations, and use the HeightfieldTesselator instead.

• The ShaderTerrainMesh. This algorithm relies on a shader to deform the terrain on the GPU, making it more efficient at the expense of requiring newer hardware. A usage example for this class is included in the sample programs.

The GeoMipTerrain also provides a way to generate terrain bruteforce, that means without LOD and at full quality.

Various other terrain generators have been contributed by the community:


text:
# KX_CharacterWrapper(PyObjectPlus)¶

base class — PyObjectPlus

class bge.types.KX_CharacterWrapper(PyObjectPlus)

A wrapper to expose character physics options.

onGround

Whether or not the character is on the ground. (read-only)

Type

boolean

gravity

The gravity vector used for the character.

Type

Vector((x, y, z))

fallSpeed

The character falling speed.

Type

float

maxJumps

The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc.

Type

int in [0, 255], default 1

jumpCount

The current jump count. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump.

Type

int

jumpSpeed

The character jumping speed.

Type

float

walkDirection

The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.

Type

Vector((x, y, z))

jump()

The character jumps based on it’s jump speed.

setVelocity(velocity, time, local=False)

Sets the character’s linear velocity for a given period.

This method sets character’s velocity through it’s center of mass during a period.

Parameters
• velocity (3D Vector) – Linear velocity vector.

• time (float) – Period while applying linear velocity.

• local (boolean) –

• False: you get the “global” velocity ie: relative to world orientation.

• True: you get the “local” velocity ie: relative to object orientation.

reset()

Resets the character velocity and walk direction.


text:
# Rust function to read the first line of a file, strip leading hashes and whitespace

I’m writing a Rust function for getting a title based on the first line of a file.

The files are written in Markdown, and the first line should be a heading that starts with one or more hashes, followed by some text. Examples:

# This is a top-level heading
## This is a second-level heading
#### Let's jump straight to the fourth-level heading

I want to throw away the leading hashes, discard any leading/trailing whitespace, and return the remaining string. Example outputs:

"This is a top-level heading"
"Let's jump straight to the fourth-level heading"

Assume that, for now, I’m not worried about edge cases like a first line that’s only whitespace and hashes, or a file whose first line is pathologically long.

This is the program I’ve written to do it:

use std::fs;
use std::path::PathBuf;

/// Get the title of a Markdown file.
///
/// Reads the first line of a Markdown file, strips any hashes and
/// leading/trailing whitespace, and returns the title.
fn title_string(path: PathBuf) -> String {

// Read the first line of the file into title.
let file = match fs::File::open(&path) {
Ok(file) => file,
Err(_) => panic!("Unable to read title from {:?}", &path),
};
let mut first_line = String::new();

// Where do the leading hashes stop?
let mut last_hash = 0;
for (idx, c) in first_line.chars().enumerate() {
if c != '#' {
last_hash = idx;
break
}
}

// Trim the leading hashes and any whitespace
let first_line: String = first_line.drain(last_hash..).collect();
let first_line = String::from(first_line.trim());

first_line
}

fn main() {
let title = title_string(PathBuf::from("./example.md"));
println!("The title is '{}'", title);
}

I’m fairly new to Rust, and I’m sure I’m doing stuff that isn’t as optimal or idiomatic as it could be. Particular questions:

• Is this idiomatic Rust?
• Is there a better way to strip leading characters from a string? I looked in the documentation for std::string::String and couldn’t see anything. The String::from() feels a bit inefficient.
• Is there anything unsafe that could easily crash (the panic! aside)?

1. Clippy returns a helpful suggestion:

warning: returning the result of a let binding from a block.
Consider returning the expression directly.
#[warn(let_and_return)] on by default
|>
|>     first_line
|>     ^^^^^^^^^^
note: this expression can be directly returned
|>
|>     let first_line = String::from(first_line.trim());
|>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2. Don't ignore Results by using let _ =! You should always return them or use expect or unwrap.

3. The loop could be simplified by using take_while:

let last_hash = first_line.chars().take_while(|&c| c == '#').count();

4. However, treating one character as one byte is a bad idea because strings are UTF-8 encoded. UTF-8 is a variable-length encoding. You can use char_indices instead.

5. It's slightly more efficient to take a slice of the string, instead of drain and collect here. It avoids one extra allocation.

6. Change your function to accept any type that implements BufRead; this will allow you to write easier unit tests.

7. Actually add those unit tests!

8. There's no need to create a PathBuf, you aren't pushing path components on. You could just make a &Path, but most functions accept any type that can be converted to a Path (AsRef<Path>). &str implements that.

9. There's no need to take a reference to something being passed to println! or panic!. These macros automatically take a reference.

use std::fs;
use std::io::prelude::*;

/// Get the title of a Markdown file.
///
/// Reads the first line of a Markdown file, strips any hashes and
/// leading/trailing whitespace, and returns the title.
fn title_string<R>(mut rdr: R) -> String
{
let mut first_line = String::new();

// Where do the leading hashes stop?
let last_hash = first_line
.char_indices()
.skip_while(|&(_, c)| c == '#')
.next()
.map_or(0, |(idx, _)| idx);

// Trim the leading hashes and any whitespace
first_line[last_hash..].trim().into()
}

/// Read the first line of the file into title.
fn main() {
let path = "./example.md";

let file = match fs::File::open(path) {
Ok(file) => file,
Err(_) => panic!("Unable to read title from {}", path),
};

let title = title_string(buffer);

println!("The title is '{}'", title);
}

#[cfg(test)]
mod test {
use super::title_string;

#[test]
assert_eq!(title_string(b"# This is a top-level heading".as_ref()),
}

#[test]
assert_eq!(title_string(b"## This is a second-level heading".as_ref()),
}

#[test]
assert_eq!(title_string(b"#### Let's jump straight to the fourth-level heading".as_ref()),
"Let's jump straight to the fourth-level heading");
}
}

You should also investigate using a real Markdown parser to avoid nasty pitfalls.

• Thanks, this is really helpful! I’ve incorporated your suggestions, and fixed a bunch of other code at the same time. I’m using Hoedown to parse the Markdown properly – this function is just to give the files some human-readable names. :-) – alexwlchan Jul 16 '16 at 9:15
• @alexwlchan if you already are using a Markdown parser, can't you traverse the parsed file to find the first header and use that? – Shepmaster Jul 16 '16 at 13:47
• Yeah, that’s probably a better way to do it. I started with this function, and added the Markdown parser later – I should probably just scrap this function entirely, and use the parser instead. – alexwlchan Jul 16 '16 at 15:24

While this answer covers most of the points, I noticed it doesn't bring up the very useful method trim_matches and trim_left_matches.

Your main string logic can then be simplified to:

fn trim(string: &str) -> &str {
string.trim_left_matches('#').trim_matches(' ')
}


text:
# Trouble understanding dual tensors

1. Nov 22, 2015

### cwbullivant

1. The problem statement, all variables and given/known data

Using 26.40, show that a pseudovector p and antisymmetric second rank tensor (in three dimensions) A are related by: $${A}_{ij} = {\epsilon}_{ijk}{p}_{k}$$

2. Relevant equations

26.40: $${p}_{i} = \frac{1}{2}{\epsilon}_{ijk}{A}_{jk}$$

3. The attempt at a solution

This isn't a homework question (though it may tread rather close to one). The book I'm working out of is Mathematical Methods for Physics and Engineering by Riley, Hobson, and Bence. I'm having trouble understanding their demonstration of the association of any arbitrary three dimensional second rank antisymmetric tensor with a pseudovector.

The step they use that I'm having trouble with is (the initial contraction and substitution of the kronecker delta identity wasn't a problem):

$${\epsilon}_{ijk}{p}_{k} = \frac{1}{2}({\delta}_{il}{\delta}_{jm} - {\delta}_{im}{\delta}_{jl}){A}_{lm}$$

And then:

$${\epsilon}_{ijk}{p}_{k} = \frac{1}{2}({A}_{ij}-{A}_{ji}) = {A}_{ij}$$

The very last equality I understand, since Aij are the components of an antisymmetric tensor. I don't get exactly what they did with the delta functions though. In attempting to recreate their work, I get to:

$${\epsilon}_{ijk}{p}_{k} = \frac{1}{2}(1-{\delta}_{ij}{\delta}_{ji}){A}_{ij}$$

Which reduces to zero on both sides if i = j, and if i != j:

$${\epsilon}_{ijk}{p}_{k} = \frac{1}{2}{A}_{ij}$$

The step they appear to be taking is:

$${\delta}_{ij}{\delta}_{ji}{A}_{ij} = {A}_{ji}$$

And I can't seem to work out that equality.

2. Nov 22, 2015

### Samy_A

Assuming that the right-hand side expression is summed over l and m, the only $\delta$ terms that survive are those where $i=l, j=m$ (first product of $\delta$'s) and $i=m, j=l$ (second product of $\delta$'s).
So you get: $${\epsilon}_{ijk}{p}_{k} = \frac{1}{2}({\delta}_{ii}{\delta}_{jj}{A}_{ij} - {\delta}_{ii}{\delta}_{jj}{A}_{ji})= \frac{1}{2}({A}_{ij}-{A}_{ji})$$

Last edited: Nov 22, 2015


text:
Contents

## Get your PC back to its best with ASR Pro

• Step 1: Download ASR Pro from the website
• Step 2: Install it on your computer
• Step 3: Run the scan to find any malware or virus that might be lurking in your system
• Download this software now to fix your PC and improve its performance.

If you have a multiple regression estimation standard error on your PC, this article can help you fix it. The regression standard error (S), also known as the specific standard error of the estimate, describes the average distance over which the detected values deviate from the regression firm. Conveniently, it tells you how much the regression model differs from the median when using units of the effect variable.

## How will you calculate the standard error of estimate in regression?

The standard error of the estimate is a measure of the accuracy of the forecasts. The regression line is our own line that minimizes the sum of squares of the prediction (also known as the error of the sum of squares), and the standard error of the analysis is the square root of its standard error.

Andrew F. Siegel, Practical Statistics Endeavour (Seventh Edition), 2016

## What is a standard error of the estimate?

Line standard error is a way to measure the overall accuracy of a regression model’s predictions. Often referred to as σ est, it is calculated as follows: σ house = √Σ(y – ŷ) 8 /n.

The standard error of estimation, denoted here as Se (but often denoted as S in computer printouts), tells you the magnitude of the prediction problems (residuals) for your data set, roughly the same unit as Y well can you predict Y? The answer is: Se higher or lower.16 Since you really want your predictions and predictions to be as accurate as possible, a human would be happy to find a small value for S e. You are most likely interpreting Se as a large standard difference in the sense that if you have a normal distribution for these prediction errors, you are assuming that about two-thirds of the aspects of the data fall within the Se above or below the new regression line. Also, about 95% of some data values should be 2Se and so on. This is highlighted in Fig. 11.2.10 for the product cost example.

Fig. 11.2.10. The estimated standard error Se is roughly how much error you’re making when you apply the predicted Y value (on the least squares line) instead of your current actual Y value. It’s reasonable to expect about two-thirds of the numeric points in Se must lie before or below the least squares line associated with the dataset with a reasonable linear relationship, as such this approach.

The standard error of an estimate can be found using the following formulas:

## Get your PC back to its best with ASR Pro

ASR Pro is the ultimate solution for your PC repair needs! Not only does it swiftly and safely diagnose and repair various Windows issues, but it also increases system performance, optimizes memory, improves security and fine tunes your PC for maximum reliability. So why wait? Get started today!

• Step 1: Download ASR Pro from the website
• Step 2: Install it on your computer
• Step 3: Run the scan to find any malware or virus that might be lurking in your system

• $\begin{array}{ll}{S}_{\mathrm{e}}& =< /mo>{S}_{O}\sqrt{< mrow is="true">\left(1âˆ’{r}^{2}< / mrow>\right)\frac{nâˆ’< mn is="true">1}{nâˆ’2}}\phantom{\rule{0ex}{0ex}}\left(\mathrm{f}\mathrm{o}\mathrm{r}\phantom{\rule{0.5em}{0ex}}{Calculate},& =< /mo>\sqrt{\frac{1}{nâˆ’2}\underset{\mathrm{je}=1}{\overset{n}{âˆ’}}{\left[{O}_{\mathrm{i< /mi>}}âˆ’\left(a+b{X}_{i}\right) \right]}^{2< /mn>}}\phantom{\rule{0ex}{0ex}}< mfenc ed close =""" is="true" open="\left(">\mathrm{f}\mathrm{o}\mathrm{r}\phantom{\rule{0.5em}{0ex}}\mathrm{Interpretation}\right )< /mtable>\end{array}$

The first formula shows how Se is calculated by decreasing SY, usually based on correlation and sample size. In fact, Se will typically be less than SY, since the a+bX line sums up a particular compound and is therefore closer to the Y values than the exact summaries are simpler, < math >< moveraccent="true" is="true">Y¯

. The second formula shows how one can interpret Se whenever the estimated standard deviation of the residuals: squared prediction errors are usually averaged by dividing by (the corresponding number of degrees d escapes when two numbers, a and d have been estimated) , and square root undoes the previous square, giving you the result in the same units as Y.

For paid manufacturing data, the correlation dropped to r = 0. At 869,193, the variance for each cost measure is SY = \$389.6131, and the sample size is typically n = 18. . Thus, the standard error of the estimate is usually

This shows that the actual spend for a typical week was different from the expected purchase price (least squares line) as it was \$198.58. Although least squares forecasting usually takes full advantage of the human relationship between cost and output, these forecasts are far from perfect.

Full text of the chapter

## What does multiple standard error of estimate measure?

What is the value of the furnace for R2? from 0% to +100% inclusive. What does the multiple estimation quality error measure? “Error in inches” or Y prediction variability.

URL: https://www.sciencedirect.com/science/article/pii/B9780128042502000110

## Detect Trends An Ounce In Population Estimates L

William. Thompson, … Charles Gowan, in Monitoring Vertebrate Populations, 1998

### 5.2 COMPONENTS OF VARIABILITY

In this section, we rely on the work of options to plan to draw conclusions from the data when trying to identify trends. Three sources of variation must be considered: sample variation, temporal variation in the process of population dynamics, and spatial variation, which carries population dynamics over space. The last two sources are usually referred to as process alternatives, i.e. H. Changes in client process dynamics due to environmental differences (such as rainfall, temperature, community continuity, weather, or altitude). Methods for separating action plan options from sample options are presented.

At least some population estimates are required to detect a trend that is simply related to population size. For example, if the population size of Mexican owls in Mesa Verde National Park is estimated at 50 pairs in 2001 and only in 10 couples in 1995, at the latest, we should be concerned about the presence of a significant negative trend in the corresponding population in this menstruation. and something must be done to moderate the trend. If we mention that the 1995 estimate was 40,200,000,000,000,000, we may still be worried and less convinced of the need for quick action. Before we can rely on any conclusions such as these estimates, two impression discrepancies need to be evaluated.

Download this software now to fix your PC and improve its performance.


text:
ICHEP 2016 Chicago

3-10 August 2016
Chicago IL USA
US/Central timezone
There is a live webcast for this event.

Sterile neutrino search in the Double Chooz experiment

Aug 6, 2016, 6:00 PM
2h
Riverwalk A/B

Riverwalk A/B

Poster Neutrino Physics

Speaker

Tsunayuki Matsubara (Japan, Tokyo Metropolitan University)

Description

Double Chooz is a reactor antineutrino disappearance experiment located in Chooz, France. By detecting the unique inverse beta decay (IBD) prompt-delayed signal, antineutrinos can be precisely identified. A far detector at a distance of about 1 km is operating since 2011; a near detector of identical design at a distance of about 400 m is operating since the end of 2014. This double-detector with iso-flux configuration can significantly reduce the reactor flux and detection systematics. Beyond the precise measurement of $\theta_{13}$, Double Chooz has a strong sensitivity to so called light sterile neutrinos with the systematic uncertainties of the single detector measurement highly suppressed to per mil levels. Sterile neutrino are neutrino mass states not taking part in weak interactions, but may mix with known neutrino states. This induces additional mixing angles and mass differences. This poster presents the latest results of the search for light sterile neutrinos and the mixing angle $\theta_{14}$.

Primary authors

Ms Denise Hellwig (RWTH Aachen University) Mr Guang Yang (Argonne National Lab/ Illinois Institute of Technology) Dr Pau Novella (CIEMAT) Pietro Chimenti (UFABC) Mr Stefan Schoppmann (RWTH Aachen University) Tsunayuki Matsubara (Japan, Tokyo Metropolitan University)

Presentation materials

There are no materials yet.


text:
# What is an estimator?

It is a statistic (see: ), used to calculate a point estimate.

For instance the function to calculate mean is an estimator.


text:
# revolutions per hour to hertz conversion

Conversion number between revolutions per hour [rph] and hertz [Hz] is 0.00027777777777778. This means, that revolutions per hour is smaller unit than hertz.

### Contents [show][hide]

Switch to reverse conversion:
from hertz to revolutions per hour conversion

### Enter the number in revolutions per hour:

Decimal Fraction Exponential Expression
 [rph]
eg.: 10.12345 or 1.123e5

Result in hertz

?
 precision 0 1 2 3 4 5 6 7 8 9 [info] Decimal: Exponential:

### Calculation process of conversion value

• 1 revolutions per hour = (exactly) ((1/3600)) / (1) = 0.00027777777777778 hertz
• 1 hertz = (exactly) (1) / ((1/3600)) = 3600 revolutions per hour
• ? revolutions per hour × ((1/3600)  ("Hz"/"revolutions per hour")) / (1  ("Hz"/"hertz")) = ? hertz

### High precision conversion

If conversion between revolutions per hour to hertz and hertz to hertz is exactly definied, high precision conversion from revolutions per hour to hertz is enabled.

Decimal places: (0-800)

revolutions per hour
Result in hertz:
?

### revolutions per hour to hertz conversion chart

 Start value: [revolutions per hour] Step size [revolutions per hour] How many lines? (max 100)

visual:
revolutions per hourhertz
00
100.0027777777777778
200.0055555555555556
300.0083333333333333
400.011111111111111
500.013888888888889
600.016666666666667
700.019444444444444
800.022222222222222
900.025
1000.027777777777778
1100.030555555555556
Copy to Excel

## Multiple conversion

Enter numbers in revolutions per hour and click convert button.
One number per line.

Converted numbers in hertz:
Click to select all

## Details about revolutions per hour and hertz units:

Convert Revolutions per hour to other unit:

### revolutions per hour

Definition of revolutions per hour unit: = Hz/3600. The number of cycles or periodically repeating events occurring in one hour. Symbol rph (revolutions per hour), the value is 1/3600 Hertz.

Convert Hertz to other unit:

### hertz

Definition of hertz unit: = 1 Hz. Hertz (Hz) is a derived unit of measure. Written with basic SI units Hz = 1/s or s-1. Frequency (Hertz) tells you how many times a event (cycle, rotation, etc.) takes place within one second.

← Back to Frequency units


text:
lilypond-devel
[Top][All Lists]

## emacs lilypond-mode.el and lilypond-init.el patches to process .lytex fi

 From: josé henrique padovani Subject: emacs lilypond-mode.el and lilypond-init.el patches to process .lytex files with "lilypond-book --pdf"/"pdflatex" Date: Sat, 08 May 2010 11:04:58 -0300 User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; pt-BR; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

```Hi,
```
I have made some changes on my emacs lilypond-mode files to process lytex files as suggested here (http://lilypond.org/doc/v2.13/Documentation/usage-big-page#Invoking-lilypond_002dbook)... directly with: "lilypond-book --pdf file.lytex" and "pdflatex file.tex"
```
```
I'm sending the patches... Please tell me if it is ok (don't know if the shortcuts are ok to other people, for example)
```

```
I would also like to know if it would be possible to have an option, when compiling LilyPond, to change some system specific commands that are in lilypond-mode...
```For example, for OSX:
"xpdf" -> "open"
"timidity" -> "open"
etc..
(OSX's "open" uses the system default app to read pdf/play midi files)

```
I have no idea about how to do it as I am a "newbie" in LilyPond development.. maybe creating a system specific file lilypond-mode-osx.el would be the easier way?
```
Thanks,
josé

```
PS: .lytex extension was added to lilypond-init to load lilypond-mode automatically as (I think) that latex \include can be used to organize files .. and those files with lilypond code need more the ly syntax colorizing than tex colorizing...
```
--

```

bin7XlV4JF81F.bin
Description: application/applefile

lilypond-init.el.patch
Description: Binary data

lilypond-mode.el.patch
Description: Text document


text:
# Tag Info

1

If you have a path on $p-V$ diagram that is $p=F(V)$, then using $$dU=\delta Q-pdV \implies \delta Q=dU+pdV$$ NOTE MINUS SIGN as $pdV$ is work done BY the system. $Q$ is the total heat received by the system (it is negative if system releases heat). Assume we are dealing with an ideal gas with $f$ degrees of freedom per particle ($f=3$ for monatomic gas). ...

1

Air pressure exists because if we place something in a gas, then the molecules/atoms flying around will keep banging into it, and in this way produce a net constant force per unit area. As explained by @Chris2807 in the neat formula $P=n k_{B} T$, this is proportional to how many particles there are (since this is proportional to the amount of "banging" in ...

1

When you put the pot on the stove, the heat from the stove is somehow getting to the pot, which gets hot. The pot and the stove are obviously in contact with each other. Therefore conduction plays a role here. If you have an old pot, with a warped bottom, it will heat up slower, because the contact surface between pot and stove is smaller. When you hold ...

0

To keep a constant pressure, halving the volume would halve the temperature (relative to absolute zero) - but only for a fixed mass of gas. This would be the case if you had a sealed volume and a moving wall, for example. By just adding on another volume, you wouldn't really be applying Charles' Law since you've increased the amount of gas. The temperature ...

1

Here's a simple mental picture to have of a how a burner on a stove heats up water in a pot (which is sitting on the burner). (In what follows, I will use the term "molecules" for both molecules and atoms.) Also, keep in mind that thermal conduction is different than electrical conduction. One (electrical conduction) concerns the flow of charge, so in this ...

2

In some sense yes. Let me explain a little. If we were to take a sealed container of gas and put it into free space far away from other bodies so that the gravitational force on the box is negligible would you agree that there would still be some pressure in the container? If we assume we have an ideal gas then the pressure is simply given by $$P=nk_{B}T$$ ...

3

In general, air pressure in the Earth's atmosphere is hydrostatic pressure, caused by the Earth's gravitational field. If there was no gravity then there wouldn't be any centripetal force and all the air molecules would just float away into space. This is why there is no atmosphere on the moon - because it doesn't have enough gravity to sustain one.

1

In thermodynamics, any well-behaved quantity of matter generally has a temperature (a measure of average internal energy) associated with it. Therefore, the sole addition or removal of matter from a volume is not accompanied by a change in the energy contained in that volume if and only if the matter transferred has zero temperature; transferring matter at ...

0

I was simply confused by the sign convention in the first law of thermodynamics. The most convenient way to write it is $Q=\Delta U + W$ where $W$ is the work done by the system. Hence the answer to my question becomes clear after this.

1

Check out the description of Charles' law on wikipedia. Charles' law relates the temperature and volume of a single body of gas at constant pressure. If you're mixing two bodies of air at different temperatures by punching a hole in the wall between them, you're not changing the volume of a body of gas at constant pressure, you're combining two bodies of ...

0

No, I don't think you have the correct entropy. I think the temperature is incorrect in the numerators, it should be (328 - 313) and (313 - 283).

1

Stoves and other hot objects heat up, but don't burn. Burning is very different. Burning is a chemical reaction. In the example of stoves, they work by conduction.

3

The thermal energy $k_{B} T$ is really referring to the probability of finding a system in a state of energy $E$, given that it is in a surrounding enviroment at temperature $T$. This probability is proportional to $e^{-E/(k_{B} T)}$. Using this you can derive a great many things, including the Boltzmann/Fermi distributions. The proportionality constant is ...

5

Giving the value simply of $k_B T$ is generally more useful, because I can plug that into anything. Sure, I might need to know the ideal gas energy, and multiply by $3/2$. But maybe I need to put it into a partition function, and I just need $k_B T$. Maybe I'm worried about a harmonic oscillator and I just have the two degrees of freedom. The 3/2 is ...

1

Let me clear a few things up first; the latent heat of fusion is the energy required to convert a substance from solid form to a liquid form. Since water is liquid at room temperature, the latent heat of fusion is positive as energy is absorbed to convert ice to water, just as energy is released when water is converted to ice. It sounds counter-intuitive, ...

18

Mammalian sense of smell is in general exquisitely keen: even though we think of ourselves as an animal having a dull smell sense comapared to that of, say, a dog, a pig or a rat, receptors for certain scents are still triggered by molecules counted in the tens. So the outgassing of volatile wood oils from, say, a table, can still be miniscule and well ...

2

Burning the fuel in car produces less heat than just burning the fuel in an open container because in an engine some of the energy produced by combustion goes into doing work on the car. In an open container all the energy appears as heat. However the energy that goes into doing work on the car ends up as heat eventually because the car dissipates the ...

2

But if heat consists of the speed of the molecule (which is an if) then shouldn't there be an Absolute Infinity as well as an Absolute Zero? This question's "if" is not correct. Temperature (not "heat", as we use this word in a specific technical way) consists of the energy, not the speed, of particles. While these two are obviously related, it's ...

1

You state the second law as : The entropy of the universe always increases. In my college textbook it is stated as : Processes in which the entropy of an isolated system would decrease do not occur, or, in every process taking place in an isolated system, the entropy of the system either increases or remains constant.( F.W.Sears an introduction ...

0

There is a point of temperature called Planck temperature where are understanding starts to break down. Advances in quantum gravity will help us understand this incredibly high temperature and its effects on molecules.

0

When you heat up an ionic crystal, the nuclei oscillate more quickly (increase in kinetic energy) and this causes the atoms to become more spaced apart, i.e. the material expands (increase in potential energy). You can see this effect come out of the virial stress.

0

You're basically describing a car radiator. I can't see any reason why you'd need a more sophisticated heat exchanger.

0

The reason why a gas heats up when it is compressed into a smaller space, is because the ambient heat that the gas possessed in its original volume, has now been confined to a smaller volume—same amount of heat but now more concentrated—the temperature goes up. When the vessel storing the newly compressed gas cools off to the ambient temperature of its ...

0

For an ideal gas, we neglect all intermolecular interactions (except for the trivial case of elastic collisions). $\Delta U$ therefore depends purely on the kinetic energies of the particles. The 'decreasing of intermolecular distances' has no role to play here. However, these things are taken care of to some extent by the van der Waals equation Melting is ...

0

If you compress an ideal gas adiabatically, the average kinetic energy of the particles will increase because collisions with the moving piston will increase the kinetic energy of the colliding particle. For an ideal gas, the intermolecular distances have no bearing on the internal energy. More specifically, suppose the piston is moving inwards at velocity ...

2

It would certainly require a material that allows electron release from energies lower than those of the visible spectrum. The energy of a wave is given by E=hf where h is the planck constant (6.63 x 10^-34) and f is the frequency. The wavelengths of IR light range from 0.001 m to 750 x 10^-9 m. (Hyperphysics.com, infrared) Using this knowledge you can get ...

2

Q = mc(t1-t2), Now, m = (density)(volume), Specific heat of water, c(in joule/gramCelsius) = 4.186, Hence, you can find the energy it would require for this conversion. . And the work you do can be a bit more pertaining to your efficiency.

0

You asked: "Does one imply another?" No. Neither implies the other. However, I think there are benefits to first being clear what the ideas are, particularly since I think each idea actually already assumes an arrow of time. In the first case, you start with an arrow of time that only earlier times affect later times, and then end up strengthening that to ...

2

You are sloppy with units, but the result is correct. To go from 25C to 3C is 22 cal/g. When you multiply by 300 g you have cal and your conversion to kJ is correct. Converting to W-hr is silly, but that is the unit of energy, not W/hr. You have 8.3 W-hr you want to remove. That chills the water assuming no new heat is added, so insulate the water. ...

1

This might be better on the engineering SE site but here is some physics to consider: You are right the the heat you need to remove is the mass of water times the temperature difference times the specific heat capacity. Peltier devices and other heat pumps typically have a parameter called a COP - coefficient of performance. This compares their efficiency ...

0

There is a simple way of looking at this. Would a container of gas have a change in temperature if the container was given a different velocity? For your second question, the vibrating membrane acts like a spring pendulum which transfers energy into the surroundings. The membrane does not have a change in temperature until it absorbs the energy back from ...

1

Water forms close to perfect spheres in zero gravity due to it's surface tension. There's a variety of videos of water in the space station. Ice, assuming you start with one of those balls of water, you have to ask first, would it freeze outside in (say, the temperature of the station is dropped below 0 C), or would it freeze inside-out, say you stick a ...

0

Sound will behave just like on earth provided it has a medium to travel through (Astronauts on the ISS can communicate normally; watch some videos)

0

In first place, the temperature is a quantity that measure thermal equilibrium by the zeroth law of thermodynamics. We have the contact with this quantity by with a thermal equilibrium can do. For example, the Celsius units is constructed by define $0°C$ as the volume of mercury in contact with freezing water and $100 °C$ as the volume of mercury in contact ...

0

Since both are at the same temperature, both have the same degree of hotness ie. Temperature, hence similarly cold or hot. The difference is that water and ice both have different enthalpies, Water when converted to ice requires only phase change enthaply(assuming water to be at 273K), the enthalpy of freezing is then, Q(f) = ml

0

First law of thermodynamics is the extension of Law of Conservation of Energy for non-isolated system. There are two forms of first law of thermodynamics(both are actually same): Followed by physicists best suited for dealing with heat-engines: $$\partial E = \partial q - \partial w$$. Here $\partial w$ is the work done by the system. Followed by chemists ...

2

Consider a container containing n moles of an ideal gas. The gas exerts a pressure P on the container and the piston. If P equals the atmospheric pressure, then the piston does not move, as it experiences equal forces from in and out of the container. When you increase the external pressure, the gas in the container is compressed. If the compression of the ...

0

Can anyone help with this derivation? There are $N!$ ways to arrange $N$ different objects, but you don't have $N$ different objects, you have $n_0$ indistinguishable objects in the ground state, $n_1$ indistinguishable objects in the first state, and so on. So that means, from your $N!$ different permutations (assuming all the objects are ...

-1

Amps travel in a straight line and so must travel inside the wire. Volts travel around the amps and usually outside the wire. So amps will generate heat - because of the atoms and valence electrons create degrees of resistance - while volts , generally, will not. But if you use thick enough wire you will not notice the heat increase.

2

The one that absorbs more heat from you will cool you more, and seem colder. But it isn't entirely straightforward. If you pour water in your hand, water will flow to fit you. An ice cube will not make as good contact. Water in contact with you will warm. It can then flow away and be replaced by fresh cold water. Ice doesn't flow On the other hand, Ice ...

3

The filament will be a reasonable approximation to a black body emitter, so it's spectrum will be given by Planck's law: $$B = \frac{2hc^2}{\lambda^5} \frac{1}{e^{\frac{hc}{k\lambda T}} - 1}$$ So just measure the radiance of the light from the filament for a range of wavelengths and do a fit to Planck's law by varying $T$. This will give you an excellent ...

2

You really are asking two questions. First - how do we calculate the temperature: At the typical temperatures of a halogen bulb, the large majority of heat loss is due to thermal radiation (although there is some conductive loss in a halogen bulb as the bulb is not evacuated). Because of this, the most important factor is the "apparent size" of the ...

1

So the first law for an system where we don't have mass flows in or out ( a closed system ), is $\Delta Q + \Delta W = \Delta U$ Where $Q$ is your net heat added, and $W$ is your net work added, and $U$ is your net internal energy change: internal energy being like the sum of all the different kinetic energies of the molecules. This is why when we add ...

0

In your setup with a moving wall the state of the system after heating is not simply the same as the state of the system at the start other than the fact that the wall has moved. In particular the particles in the gas are moving faster, i.e. the gas has a higher internal energy (I am assuming that the other than the heat you added, no other heat transfer ...

3

At constant pressure the volume of an ideal gas is given by Charles' law: $$V \propto T$$ and this law tells us that when the temperature $T$ falls to zero the volume $V$ also becomes zero. But no gas is ideal and real gases show all sorts of non-ideal behaviour. For example real gases liquify then solidify as the temperatue falls. Real gases deviate ...

0

It can be shown that the work done on an object follows the following equation: $$W = \int F\cdot ds = \int P\cdot dv$$ where $F$ is the force that acts upon the object, $ds$ is the distance it acts over, $P$ is the pressure acting on the object, $dv$ is the change in volume of the object, and the dot is the dot product. In thermodynamics, often when we ...

0

What your textbook says is that during the course of your process, the system is in thermodynamic equilibrium with its surroundings if it's reversible. Such a process is just a theoretical concept as such a process would take an infinite amount of time. Real processes(I mean irreversible processes) take place so quickly that it is impossible for it to be in ...

0

The equipartition theorem says that if the system is in contact with thermal reservoir of temperature $T$ and has Hamiltonian description with Hamiltonian being a sum of terms, one of which is quadratic function of some canonical variable $q_c$ ($aq_c^2$, where $a$ is constant), then the expected average value of $aq_c^2$ is $k_B T/2$. This theorem follows ...

0

Entropy is a state function, correct ! But entropy itself depends upon how you got to that state (final state). In thermodynamics Entropy is considered the quality of heat (hotness/coolness) whereas temperature is considered quantity/degree of heat (hotness/coolness). The reversible processes (and adiabatic i.e. no heat exchange) do not mess with the ...

1

I suggest to compare human produced heat with the incident heat of the sun which is around 1 kW/m$^2$. The usual comparison is "the sun delivers more heat in an hour than humans use in a day". While such a comparison may not remain accurate forever, a difference in scale of 7000x suggests that even if humans doubled thei energy consumption every 17 years ...

Top 50 recent answers are included


text:
# Suppose the Platform with the Kid in the Previous Problem is Rotating in Anticlockwise Direction at an Angular Speed ω. - Physics

Sum

Suppose the platform with the kid in the previous problem is rotating in anticlockwise direction at an angular speed ω. The kid starts walking along the rim with a speed $\nu$ relative to the platform also in the anticlockwise direction. Find the new angular speed of the platform.

#### Solution

Let ω' be the angular velocity of platform after the kid starts walking.

Let ω be the angular velocity of the wheel before walking.

When we see the (kid-wheel) system from the initial frame of reference, we can find that the wheel moves with a speed of $\omega$ and the kid with a speed of $\left( \omega' + \frac{\nu}{R} \right),$ after the kid has started walking.

Initial angular momentum of the system = (I + MR2

Angular velocity of the kid after it starts walking = $\left( \omega' + \frac{v}{R} \right)$

External torque is zero; therefore, angular momentum is conserved.

$\Rightarrow \left( I + M R^2 \right)\omega = I\omega' + M R^2 \left( \omega' + \frac{v}{R} \right)$

$\Rightarrow \left( I + M R^2 \right)\omega = I\omega' + M R^2 \left( \omega' + \frac{v}{R} \right)$

$\Rightarrow \left( I + M R^2 \right)\omega - MvR = \left( I + M R^2 \right) \omega'$

$\Rightarrow \omega' = \frac{\left( I + M R^2 \right)\omega - MvR}{\left( I + M R^2 \right)}$

$\Rightarrow \omega' = \omega - \frac{MvR}{I + M R^2}$

Is there an error in this question or solution?

#### APPEARS IN

HC Verma Class 11, 12 Concepts of Physics 1
Chapter 10 Rotational Mechanics
Q 58 | Page 198


text:
My Math Forum Test in a few hours! (fractional exponents)

 Algebra Pre-Algebra and Basic Algebra Math Forum

 January 12th, 2012, 09:52 AM #1 Member   Joined: Dec 2011 Posts: 44 Thanks: 0 Test in a few hours! (fractional exponents) Going over some concepts I'm not fully understanding. This one deals with fractional exponents. Evaluate each, if possible: 1.) -(-32)^3/5 2.) 4th root of ((30pq)^7) -->(the 7 is inside the radical) For 1.), I'm not sure if there is a simple way to reduce it. I tried figuring out and kept running into Newton's Method, which seems kind of relevant, but there has to be an easier way to simplify this. I started doing it this way, which is really long and easy to make a mistake, but it's the only way I can visualize it right now: -5th root of ((-32)^3) I factored the large number and ended up with (2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2) so 2^11, since we're taking the 5th root, I removed 10 of the 2's in the radical, and I was left with: 4 times the 5th root (2). I'm probably way off, I don't know. I can't figure an easier way to do this. For the 2nd problem, I have no idea. It's just too hard for me to simplify doing it this way, if that last way was even correct.
 January 12th, 2012, 10:06 AM #2 Senior Member     Joined: Jul 2010 From: St. Augustine, FL., U.S.A.'s oldest city Posts: 12,211 Thanks: 520 Math Focus: Calculus/ODEs Re: Test in a few hours! (fractional exponents) 1.) $-$$-32$$^{\frac{3}{5}}=-$$(-2)^5$$^{\frac{3}{5}}=-(-2)^3=-(-1)^3(2)^3=2^3=8$ 2.) $\sqrt[4]{$$30pq$$^7}=\sqrt[4]{$$30pq$$^4\cdot$$30pq$$^3}=30pq\sqrt[4]{$$30pq$$^3}$
 January 12th, 2012, 10:12 AM #3 Member   Joined: Dec 2011 Posts: 44 Thanks: 0 Re: Test in a few hours! (fractional exponents) GOT IT! Thank you!!!

 Tags exponents, fractional, hours, test

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post itamaratento Elementary Math 3 October 15th, 2014 11:47 PM WWRtelescoping Complex Analysis 1 February 9th, 2014 10:54 PM Pashaie Math Software 2 January 9th, 2010 03:58 AM andi7 Algebra 3 August 10th, 2009 03:56 PM itamaratento Linear Algebra 2 December 31st, 1969 04:00 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top


text:
### 一些烷氯代烃标准蒸发焓的测定

1. 中国科学院化学研究所
• 收稿日期:1988-04-26 修回日期:1988-11-21 发布日期:1989-10-15
• 通讯作者: 安绪武

### ENTHALPIES OF VAPORIZATION OF SOME MUITICHLORO-ALKANES

An Xuwu; Hu Hui

1. Institute of Chemistry; Academia Sinica; Beijing
• Received:1988-04-26 Revised:1988-11-21 Published:1989-10-15
• Contact: An Xuwu

Abstract:

By using an LKB 8721-3 vaporization calorimeter, the standard enthalpiea of vaporization of some multichloro-alkanes have been determined as the following: 1, 2-dichloroethane, 35.12±0.05; 1,1-dichloroethane, 30.57±0.05; 1,2-dichloropropane, 36.14±0.05; 1,3-dichloropropane, 40.61±0.10; 1,2,3-trichloropropane, 47.75±0.10; 1,4-dichlorobutane, 46.36±0.03; 1,2-dichlorobutane, 40.16±0.12 kJ mol~(-1) respectively.  A linear equation, ΔH_ν~0=21.33+0.1589 t_b, can be used to fit the experimental data of dichloroalkanes, where t_b is the normal boiling point of compounds.  A comparison of the ΔH_v~0 of dichloroalkanes and their molecular structures shows that (1) when a Cl atom on the primary carbon isomerizes onto the secondary carbon, the ΔH_v~0 of the isomer will decrease; (2) when the number of carbon atoms linked between the two chlorine atoms increases, the ΔH_v~0 of the isomer will increase in the order: 2,2-<1,1-<1,2-<1,3-<1,4-≈1,5-dichloroalkanes. This can be considered as a result of the Cl…Cl interaction in the molecules which makes a decrease in the depole moment of C—Cl bonds or in the formal charge on the Cl atoms, and so in the intermolecular electroatatic interaction energy. The decreae in the latter is estimated from the difference between calculated value from the equation, ΔH_v~0 (a,b-Cl_2C_nH_(2n))=ΔH_v~0 (a-ClC_nH_(2n+1))+ΔH_v~0 (b-ClC_nH_(2n+1))-ΔH_v~0 (C_nH_(2n+2)), and experimental result as the following: for 1,1-≈2,2-dichloroalkanes, ~7; 1,2-dichloroalkanes, ~4; 1,3-dichloroalkanes, ~1.5; 1,4-≈1,5-dichloroalkanes, ~0 kJ mol~(-1), respectively.


text:
# Feynman's subscript notation

1. Sep 2, 2013

### ZetaGuy

Whatever happened to Feynman's notation (27.3 of vol 2) for vector differential identities?

Ever since I learned his notation of subscripting nabla with the vector field it acts on to treat nabla as a plain vector, I have been using it to derive all vector identities I need. I only need to resort to indices when homework requires it, but otherwise I use it exclusively.

I see so little mention of this notation that I get the impression that most people do not find it useful. What is your impression?


text:
# Prove

• Sep 9th 2011, 08:00 AM
Punch
Prove
Given that $y=e^{tan^{-1}x}$, show that $(1+x^2)\frac{d^2y}{dx^2}+(2x-1)\frac{dy}{dx}=0$
• Sep 9th 2011, 08:06 AM
Siron
Re: Prove
A possibility is to calculate the first and second derivative of $y$ and substitute them into the equation where necessary.
• Sep 9th 2011, 08:15 AM
Punch
Re: Prove
I tried that, and i found a careless mistake i made. thanks


text:
# Math Help - integral with two parameters

1. ## integral with two parameters

$\int_{0}^{1} \frac{\sin(p \ln x) \cos(q \ln x)}{\ln x} \ dx$ where $p, q >0$

To me this integral is just begging to be written as a triple integral. But I can't think of a way of doing it that will make evaluating the integral any easier.

2. ## Re: integral with two parameters

Originally Posted by Random Variable
$\int_{0}^{1} \frac{\sin(p \ln x) \cos(q \ln x)}{\ln x} \ dx$ where $p, q >0$

To me this integral is just begging to be written as a triple integral. But I can't think of a way of doing it that will make evaluating the integral any easier.
Setting $\ln x = t$ the integral becomes...

$I= \int_{0}^{\infty} \frac{\sin p t \ \cos q t }{t}\ e^{-t}\ dt = \mathcal{L} \{\frac{\sin p t \ \cos q t }{t}\}_{s=1}$ (1)

Now You have to remember that...

$\sin p t\ \cos q t = \frac{1}{2}\ \{\sin (p-q) t + \sin (p+q) t\}$ (2)

... and that...

$\mathcal{L} \{\frac{\sin a t}{t}\} = \int_{s}^{\infty} \frac{a}{a^{2}+ u^{2}}\ du = \tan^{-1} \frac{a}{s}$ (3)

... and, combining (1), (2) and (3) You obtain...

$I= \frac{1}{2}\ \{ \tan^{-1} (p-q) + \tan^{-1} (p+q) \}$ (4)

Kind regards

$\chi$ $\sigma$

3. ## Re: integral with two parameters

I'm pretty sure you meant $t = - \ln x$.

Interestingly, Maple returns the wrong answers for different values of the parameters while Wolfram Alpha returns the correct values. Like for p = 3 and q =2, Maple returns a negative value of $- \frac{1}{2} \arctan \Big( \frac{3}{2} \Big)$ which is clearly absurd when you look at the graph.

4. ## Re: integral with two parameters

Here's another way. Define

$I(p,q) = \int_0^1 \frac{\sin p \ln x \cos q \ln x}{\ln x} dx$

noting that $I(0,q) = 0$. Then make the substitution $u = \ln x$ (as suggested) so

$I = \int_{- \infty}^0 \frac{\sin p u \cos q u \;e^u}{u} du.$

Then

$I_p = \int_{- \infty}^0 \cos p u \cos q u e^u du$.

Now let $\cos pu \cos qu = \frac{1}{2} \cos (p-q)u + \frac{1}{2}\cos (p+q)u$.

Integration by part twice gives

$I_p = \frac{1}{2} \frac{1}{1 + (p-q)^2 } + \frac{1}{2} \frac{1}{1 + (p+q)^2}$

Integrating gives

$I = \frac{1}{2} \tan^{-1} (p-q) + \frac{1}{2} \tan^{-1} (p+q) + F(q)$

Since $I(0,q) = 0$ then $F(q) = 0$ thus giving what chisigma gave.


text:
With a focus on classic notation, you might wonder whether LilyPond is suited for modern music. Fortunately, the answer is a resounding yes.

## “Look ma, no hacks!”

If you generate music with software, publishing it is as easy as writing simple ASCII files. If you do avant-garde music then you will love Lily's flexibility with measures and time signatures. Here is a sample with nested tuplets. The spacing is exactly proportional to the duration of each note. Notes don't have to fill measures, and two notes are only aligned only if they start exactly together.

click for a PDF file.

In any other program, getting this output requires massive ad-hoc fiddling and tweaking. In LilyPond, one simply enters the notes, with their rhythmic structure,

\times 7/9 {
\times 4/6 {
r8 c32[ c c c c c c c] r4
c32[ c32 c16
}
\times 5/4 {
c16 c c] c32[ c32 c16 c] r8
}
}

If you are familiar with the programming language Scheme, you can even compose algorithmically inside LilyPond!

## “Look ma, easy hacks!”

Need anything non-standard? With a small twist, you can use Lily's unlimited flexibility to make Schenker diagrams,

## Graphics editing

If that's not enough, you can always make Lily write an SVG file, and edit the final result in an SVG editor, such as Inkscape

Back to the tour

Other languages: Deutsch, Español, Français, Magyar.


text:
# Why does this circuit have unity gain??

Discussion in 'Homework Help' started by daviddeakin, Oct 8, 2010.

1. ### daviddeakin Thread Starter Active Member

Aug 6, 2009
207
27
(This isn't actually homework, but it seemed like the right forum.

Taking a perfectly ordinary inverting opamp circuit, using equal value resistors, I know the gain will be very close to unity. But why?

The universal feedback equation says:
Closed loop gain = A / (1 + AB)
Where A is the open loop gain and B is the feedback fraction.

But in the circuit above it seems to me that the two resistors form a divider with a B of 0.5, so half of the output is fed back and the gain should be roughly 2, no unity! What am I missing?

Apr 5, 2008
15,522
2,299
3. ### Wendy Moderator

Mar 24, 2008
20,735
2,499
Actually the gain isn't unity, it is -1. It is an inverting amplifier.

The key is the - input is a virtual ground. With the circuit powered up, if you probe the -input with an ohm meter to ground, it will read very close to zero ohms.

4. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
782
The undeclared assumption for the given circuit is that the open loop gain is infinite.

In reality one can write the overall gain as

$A_v=-\frac{K_2 A_{ol}}{(1+K_1 A_{ol})}$

where

$A_{ol}$

is the amplifier open loop gain.

and

$K_1=\frac{R_i}{(R_i+R_f)}$

$K_2=\frac{R_f}{(R_i+R_f)}$

Av=-Rf/Ri as the open loop gain tends to infinity.

5. ### daviddeakin Thread Starter Active Member

Aug 6, 2009
207
27
Ok, something is starting to sink in. With that extra K2 in the numerator, I can see where A=Rf/Ri comes from. I just have to visualise where that K2 comes from in the first place. Evidently the presence of the feedback network inhibits the available open loop gain, even before you consider the feedback itself. Hmm...

6. ### Wendy Moderator

Mar 24, 2008
20,735
2,499
You want to try an simple intellectual exercise, try the following conditions using your schematic. Input is -1V, 0V, and 1V. Remember, the inputs of the op amp (+ input and - input) will be the same voltages due to the negative feedback and the resistors are the same values. What will the output voltage be to make this so?

7. ### daviddeakin Thread Starter Active Member

Aug 6, 2009
207
27
I understand that, but it's a circular argument because you are starting with the assumption that NFB will always force the inputs to achieve the same voltages. That only works if the open-loop gain is extremely high. My question relates more directly to the universal feedback equation- I want to visualize where that K2 in he numerator comes from.

8. ### Georacer Moderator

Nov 25, 2009
5,142
1,266
Use the followin set of equations to get the formula:
$\left{ \begin{array}{l} V_{out}=A_{ol} \cdot (V_+-V_{\small{-}}) \\
I \cdot R_i =V_i - V_{\small{-}} \\
I \cdot R_f = V_{\small{-}} - V_o \\
V_+ = 0 \\ \end{array} \right$

and solve for the transfer function of Vi to Vo.

I did so and found R1-R2 to the denominator of the fraction, opposed to t_n_k who found R1+R2. It's 3 o'clock here and I 'm a couple of beer cans too many for clear thought, so I keep my reservations.

9. ### Wendy Moderator

Mar 24, 2008
20,735
2,499
All op amp circuit have equal inputs, if they don't then the output is saturated one direction or another. If you ever troubleshoot something like this that basic fact (not assumption) will come in handier than formulas.

10. ### Ghar Active Member

Mar 8, 2010
655
72
He is clearly aware of that idea, the problem is that it is an assumption, you just provided an example where they won't be equal.
To actually understand the mechanics of feedback this is an important discussion.

11. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
782
The K2 term is derived here ...

File size:
36.9 KB
Views:
21
12. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
782
The reality is that the open loop gain is extremely high with due consideration given to the gain-bandwidth product constraint.

100dB DC gain with 1MHz (unity gain) bandwidth is respectable for a voltage driven operational amplifier.

Last edited: Oct 10, 2010
13. ### daviddeakin Thread Starter Active Member

Aug 6, 2009
207
27
And suddenly the light dawns- amazing!

I now see how it operates! Rf and Ri can be considered as two superimposed potential dividers (K1 and K2) working in 'opposite directions'. K1 works to attenuate the input voltage and K2 works to attenuate the output voltage (effectively reducing the open loop gain by a factor of K2)!
(That description probably made no sense, but it works visually in my head! )

14. ### Georacer Moderator

Nov 25, 2009
5,142
1,266
I did the caclulations this morning and the result agrees with t_n_k. I made a mistake moving a sign last night.

I wouldn't (and didn't) use superposition for that proof, because it just didn't "feel" right for me, but since it works (me and t_n_k have the same result) it's fine with me.

Studying the finite OpAmp gain can be useful in very high frequency circuitry analysis.

15. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
782
Your disquiet probably stems from a misinformed (& widely taught) belief that superposition cannot be applied to circuits with dependent / controlled sources.

The Electrician corrected this misconception on my part some time back on the AAC forum.

See this paper by a notable advocate [Marshall Leach] of the contrary viewpoint.

http://users.ece.gatech.edu/mleach/papers/superpos.pdf

Last edited: Oct 10, 2010
16. ### Georacer Moderator

Nov 25, 2009
5,142
1,266
I had tracked that particular thread very closely, and had actually saved the link to that pdf. I know that superposition can be applied at circuits with dependent sources. It's just that sometimes I 'm not sure of the selection of equations. Be it habit or university policy, I find myself usually going back to the old Kirchoff's laws to get my set of equations. I guess it has to do with the line of the university that promotes linear equation sets, due to their application to informatics and an inclination of my studies towards robotics and control systems, rather than pure electronics.

In this particular case, I found it a bit "weird" to use two voltage dividers with different refference nodes. I also found it strange that the two voltages had opposite influence on the V- and yet they were added to get the result.


text:
# Normal Distribution

The single most important random variable type is the Normal (aka Gaussian) random variable, parametrized by a mean ($\mu$) and variance ($\sigma^2$), or sometimes equivalently written as mean and variance ($\sigma^2$). If $X$ is a normal variable we write $X \sim N(\mu, \sigma^2)$. The normal is important for many reasons: it is generated from the summation of independent random variables and as a result it occurs often in nature. Many things in the world are not distributed normally but data scientists and computer scientists model them as Normal distributions anyways. Why? Because it is the most entropic (conservative) modelling decision that we can make for a random variable while still matching a particular expectation (average value) and variance (spread).

The Probability Density Function (PDF) for a Normal $X \sim N(\mu, \sigma^2)$ is: \begin{align*} f_X(x) = \frac{1}{\sigma \sqrt{2\pi} } e ^{\frac{-(x-\mu)^2}{2\sigma^2}} \end{align*} Notice the $x$ in the exponent of the PDF function. When $x$ is equal to the mean ($\mu$) then e is raised to the power of $0$ and the PDF is maximized.

By definition a Normal has $\E[X] = \mu$ and $\var(X) = \sigma^2$.

There is no closed form for the integral of the Normal PDF, and as such there is no closed form CDF. However we can use a transformation of any normal to a normal with a precomputed CDF. The result of this mathematical gymnastics is that the CDF for a Normal $X \sim N(\mu, \sigma^2)$ is: \begin{align*} F_X(x) = \Phi\left(\frac{x - \mu}{\sigma}\right) \end{align*}

Where $\Phi$ is a precomputed function that represents that CDF of the Standard Normal.

Normal (aka Gaussian) Random Variable

Notation: $X \sim \N(\mu, \sigma^2)$ A common, naturally occuring distribution. $\mu \in \mathbb{R}$, the mean.$\sigma^2 \in \mathbb{R}$, the variance. $x \in \mathbb{R}$ $$f(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{-\frac{1}{2}\Big(\frac{x-\mu}{\sigma}\Big)^2}$$ \begin{align} F(x) &= \phi(\frac{x-\mu}{\sigma}) && \text{Where \phi is the CDF of the standard normal} \end{align} $\E[X] = \mu$ $\var(X) = \sigma^2$
Parameter $\mu$:
Parameter $\sigma$:

## Linear Transform

If $X$ is a Normal such that $X \sim N(\mu, \sigma^2)$ and $Y$ is a linear transform of $X$ such that $Y = aX + b$ then $Y$ is also a Normal where: \begin{align*} Y \sim N(a\mu + b, a^2\sigma^2) \end{align*}

## Projection to Standard Normal

For any Normal $X$ we can find a linear transform from $X$ to the standard normal $Z \sim N(0, 1)$. Note that $Z$ is the typical notation choice for the standard normal. For any normal, if you subtract the mean ($\mu$) of the normal and divide by the standard deviation ($\sigma$) the result is always the standard normal. We can prove this mathematically. Let $W = \frac{X - \mu}{\sigma}$: \begin{align*} W &= \frac{X -\mu}{\sigma} && \text{ Transform X: Subtract by $\mu$ and diving by $\sigma$} \\ & = \frac{1}{\sigma}X - \frac{\mu}{\sigma} && \text{ Use algebra to rewrite the equation}\\ & = aX + b && \text{ Linear transform where $a = \frac{1}{\mu}$, $b = - \frac{\mu}{\sigma}$ }\\ &\sim N(a\mu + b, a^2\sigma^2) && \text{ The linear transform of a Normal is another Normal}\\ &\sim N(\frac{\mu}{\sigma} - \frac{\mu}{\sigma}, \frac{\sigma^2}{\sigma^2}) && \text{ Substituting values in for $a$ and $b$}\\ &\sim N(0, 1) && \text{ The standard normal} \end{align*}

Using this transform we can express $F_X(x)$, the CDF of $X$, in terms of the known CDF of $Z$, $F_Z(x)$. Since the CDF of $Z$ is so common it gets its own Greek symbol: $\Phi(x)$ \begin{align*} F_X(x) &= P(X \leq x) \\ &= P\left(\frac{X - \mu}{\sigma} \leq \frac{x - \mu}{\sigma}\right) \\ &= P\left(Z \leq \frac{x - \mu}{\sigma}\right)\\ &= \Phi\left(\frac{x - \mu}{\sigma}\right) \end{align*}

The values of $\Phi(x)$ can be looked up in a table. Every modern programming language also has the ability to calculate the CDF of a normal random variable!

Example: Let $X\sim \mathcal{N}(3, 16)$, what is $P(X > 0)$? \begin{align*} P(X > 0) &= P\left(\frac{X-3}{4} > \frac{0-3}{4}\right) = P\left(Z > -\frac{3}{4}\right) = 1 - P\left(Z \leq -\frac{3}{4}\right)\\ &= 1 - \Phi(-\frac{3}{4}) = 1 - (1- \Phi(\frac{3}{4})) = \Phi(\frac{3}{4}) = 0.7734 \end{align*} What is $P(2 < X < 5)$? \begin{align*} P(2 < X < 5) &= P\left(\frac{2 - 3}{4} < \frac{X-3}{4} < \frac{5-3}{4}\right) = P\left(-\frac{1}{4} < Z < \frac{2}{4}\right)\\ &= \Phi(\frac{2}{4})-\Phi(-\frac{1}{4}) = \Phi(\frac{1}{2})-(1 - \Phi(\frac{1}{4})) = 0.2902 \end{align*}

Example: You send voltage of 2 or -2 on a wire to denote 1 or 0. Let $X$ = voltage sent and let $R$ = voltage received. $R = X + Y$, where $Y \sim \mathcal{N}(0, 1)$ is noise. When decoding, if $R \geq 0.5$ we interpret the voltage as 1, else 0. What is $P(\text{error after decoding}|\text{original bit} = 1)$? \begin{align*} P(X + Y < 0.5) &= P(2 + Y < 0.5) \\ &= P(Y < -1.5) \\ &= \Phi(-1.5) \\ &\approx 0.0668 \end{align*}

Example: The 67% rule of a normal within one standard deviation. What is the probability that a normal variable $X \sim \N(\mu, \sigma)$ has a value within one standard deviation of its mean?

\begin{align} \p(\text{Within one }\sigma \text{ of } \mu) &= \p(\mu - \sigma < X < \mu + \sigma) \\ &= \p(X < \mu + \sigma) - \p(X < \mu - \sigma) && \text{Prob of a range} \\ &= \Phi\Big(\frac{(\mu + \sigma)-\mu}{\sigma}\Big) - \Phi\Big(\frac{(\mu - \sigma)-\mu}{\sigma}\Big) && \text{CDF of Normal} \\ &= \Phi\Big(\frac{\sigma}{\sigma}\Big) - \Phi\Big(\frac{- \sigma}{\sigma}\Big) && \text{Cancel \mus} \\ &= \Phi(1) - \Phi(-1) && \text{Cancel \sigmas} \\ &\approx 0.8413 - 0.1587 \approx 0.683 && \text{Plug into \Phi} \end{align} We made no assumption about the value of $\mu$ or the value of $\sigma$ so this will apply to every single normal random variable. Since it uses the Normal CDF this doesn't apply to other types of random variables.


text:
# tf.contrib.learn.KMeansClustering

### class tf.contrib.learn.KMeansClustering

See the guide: Learn (contrib) > Estimators

An Estimator fo rK-Means clustering.

## Child Classes

class LossRelativeChangeHook

## Methods

### __init__(num_clusters, model_dir=None, initial_clusters=clustering_ops.RANDOM_INIT, distance_metric=clustering_ops.SQUARED_EUCLIDEAN_DISTANCE, random_seed=0, use_mini_batch=True, kmeans_plus_plus_num_retries=2, relative_tolerance=None, config=None)

Creates a model for running KMeans training and inference.

#### Args:

• num_clusters: number of clusters to train.
• model_dir: the directory to save the model results and log files.
• initial_clusters: specifies how to initialize the clusters for training. See clustering_ops.kmeans for the possible values.
• distance_metric: the distance metric used for clustering. See clustering_ops.kmeans for the possible values.
• random_seed: Python integer. Seed for PRNG used to initialize centers.
• use_mini_batch: If true, use the mini-batch k-means algorithm. Else assume full batch.
• kmeans_plus_plus_num_retries: For each point that is sampled during kmeans++ initialization, this parameter specifies the number of additional points to draw from the current distribution before selecting the best. If a negative value is specified, a heuristic is used to sample O(log(num_to_sample)) additional points.
• relative_tolerance: A relative tolerance of change in the loss between iterations. Stops learning if the loss changes less than this amount. Note that this may not work correctly if use_mini_batch=True.
• config: See Estimator

### clusters()

Returns cluster centers.

### evaluate(*args, **kwargs)

See Evaluable. (deprecated arguments)

SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01. Instructions for updating: Estimator is decoupled from Scikit Learn interface by moving into separate class SKCompat. Arguments x, y and batch_size are only available in the SKCompat class, Estimator will only accept input_fn. Example conversion: est = Estimator(...) -> est = SKCompat(Estimator(...))

#### Raises:

• ValueError: If at least one of x or y is provided, and at least one of input_fn or feed_fn is provided. Or if metrics is not None or dict.

### export(*args, **kwargs)

Exports inference graph into given dir. (deprecated arguments)

SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-23. Instructions for updating: The signature of the input_fn accepted by export is changing to be consistent with what's used by tf.Learn Estimator's train/evaluate. input_fn (and in most cases, input_feature_key) will become required args, and use_deprecated_input_fn will default to False and be removed altogether.

#### Args:

• export_dir: A string containing a directory to write the exported graph and checkpoints.
• input_fn: If use_deprecated_input_fn is true, then a function that given Tensor of Example strings, parses it into features that are then passed to the model. Otherwise, a function that takes no argument and returns a tuple of (features, labels), where features is a dict of string key to Tensor and labels is a Tensor that's currently not used (and so can be None).
• input_feature_key: Only used if use_deprecated_input_fn is false. String key into the features dict returned by input_fn that corresponds to a the raw Example strings Tensor that the exported model will take as input. Can only be None if you're using a custom signature_fn that does not use the first arg (examples).
• use_deprecated_input_fn: Determines the signature format of input_fn.
• signature_fn: Function that returns a default signature and a named signature map, given Tensor of Example strings, dict of Tensors for features and Tensor or dict of Tensors for predictions.
• prediction_key: The key for a tensor in the predictions dict (output from the model_fn) to use as the predictions input to the signature_fn. Optional. If None, predictions will pass to signature_fn without filtering.
• default_batch_size: Default batch size of the Example placeholder.
• exports_to_keep: Number of exports to keep.

#### Returns:

The string path to the exported directory. NB: this functionality was added ca. 2016/09/25; clients that depend on the return value may need to handle the case where this function returns None because subclasses are not returning a value.

### export_savedmodel(*args, **kwargs)

Exports inference graph as a SavedModel into given dir. (experimental)

THIS FUNCTION IS EXPERIMENTAL. It may change or be removed at any time, and without warning.

#### Args:

• export_dir_base: A string containing a directory to write the exported graph and checkpoints.
• input_fn: A function that takes no argument and returns an InputFnOps.
• default_output_alternative_key: the name of the head to serve when none is specified.
• assets_extra: A dict specifying how to populate the assets.extra directory within the exported SavedModel. Each key should give the destination path (including the filename) relative to the assets.extra directory. The corresponding value gives the full path of the source file to be copied. For example, the simple case of copying a single file without renaming it is specified as {'my_asset_file.txt': '/path/to/my_asset_file.txt'}.
• as_text: whether to write the SavedModel proto in text format.
• exports_to_keep: Number of exports to keep.

#### Returns:

The string path to the exported directory.

#### Raises:

• ValueError: if an unrecognized export_type is requested.

### fit(*args, **kwargs)

See Trainable. (deprecated arguments)

SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01. Instructions for updating: Estimator is decoupled from Scikit Learn interface by moving into separate class SKCompat. Arguments x, y and batch_size are only available in the SKCompat class, Estimator will only accept input_fn. Example conversion: est = Estimator(...) -> est = SKCompat(Estimator(...))

#### Raises:

• ValueError: If x or y are not None while input_fn is not None.
• ValueError: If both steps and max_steps are not None.

### get_params(deep=True)

Get parameters for this estimator.

#### Args:

• deep: boolean, optional

If True, will return the parameters for this estimator and contained subobjects that are estimators.

#### Returns:

params : mapping of string to any Parameter names mapped to their values.

### get_variable_names()

Returns list of all variable names in this model.

List of names.

### get_variable_value(name)

Returns value of the variable given by name.

#### Args:

• name: string, name of the tensor.

#### Returns:

Numpy array - value of the tensor.

### partial_fit(*args, **kwargs)

Incremental fit on a batch of samples. (deprecated arguments)

SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01. Instructions for updating: Estimator is decoupled from Scikit Learn interface by moving into separate class SKCompat. Arguments x, y and batch_size are only available in the SKCompat class, Estimator will only accept input_fn. Example conversion: est = Estimator(...) -> est = SKCompat(Estimator(...))

This method is expected to be called several times consecutively on different or the same chunks of the dataset. This either can implement iterative training or out-of-core/online training.

This is especially useful when the whole dataset is too big to fit in memory at the same time. Or when model is taking long time to converge, and you want to split up training into subparts.

#### Args:

• x: Matrix of shape [n_samples, n_features...]. Can be iterator that returns arrays of features. The training input samples for fitting the model. If set, input_fn must be None.
• y: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be iterator that returns array of labels. The training label values (class labels in classification, real numbers in regression). If set, input_fn must be None.
• input_fn: Input function. If set, x, y, and batch_size must be None.
• steps: Number of steps for which to train model. If None, train forever.
• batch_size: minibatch size to use on the input, defaults to first dimension of x. Must be None if input_fn is provided.
• monitors: List of BaseMonitor subclass instances. Used for callbacks inside the training loop.

#### Returns:

self, for chaining.

#### Raises:

• ValueError: If at least one of x and y is provided, and input_fn is provided.

### predict(*args, **kwargs)

Returns predictions for given features. (deprecated arguments)

SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01. Instructions for updating: Estimator is decoupled from Scikit Learn interface by moving into separate class SKCompat. Arguments x, y and batch_size are only available in the SKCompat class, Estimator will only accept input_fn. Example conversion: est = Estimator(...) -> est = SKCompat(Estimator(...))

#### Args:

• x: Matrix of shape [n_samples, n_features...]. Can be iterator that returns arrays of features. The training input samples for fitting the model. If set, input_fn must be None.
• input_fn: Input function. If set, x and 'batch_size' must be None.
• batch_size: Override default batch size. If set, 'input_fn' must be 'None'.
• outputs: list of str, name of the output to predict. If None, returns all.
• as_iterable: If True, return an iterable which keeps yielding predictions for each example until inputs are exhausted. Note: The inputs must terminate if you want the iterable to terminate (e.g. be sure to pass num_epochs=1 if you are using something like read_batch_features).

#### Returns:

A numpy array of predicted classes or regression values if the constructor's model_fn returns a Tensor for predictions or a dict of numpy arrays if model_fn returns a dict. Returns an iterable of predictions if as_iterable is True.

#### Raises:

• ValueError: If x and input_fn are both provided or both None.

### predict_cluster_idx(input_fn=None)

Yields predicted cluster indices.

### score(input_fn=None, steps=None)

Predict total sum of distances to nearest clusters.

Note that this function is different from the corresponding one in sklearn which returns the negative of the sum of distances.

#### Args:

• input_fn: see predict.
• steps: see predict.

#### Returns:

Total sum of distances to nearest clusters.

### set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The former have parameters of the form <component>__<parameter> so that it's possible to update each component of a nested object.

#### Args:

**params: Parameters.

self

#### Raises:

• ValueError: If params contain invalid names.

### transform(input_fn=None, as_iterable=False)

Transforms each element to distances to cluster centers.

Note that this function is different from the corresponding one in sklearn. For SQUARED_EUCLIDEAN distance metric, sklearn transform returns the EUCLIDEAN distance, while this function returns the SQUARED_EUCLIDEAN distance.

#### Args:

• input_fn: see predict.
• as_iterable: see predict

#### Returns:

Array with same number of rows as x, and num_clusters columns, containing distances to the cluster centers.


text:
# Can we extend an over-determined set of polynomials so that they intersect completely?

For a fixed degree $d>1$, let $\{x^\alpha: |\alpha|=d\}$ be the set of monomials of degree $d$ in the variables $x_1,\ldots, x_n$. View these monomials as $N=\binom{n+d-1}{d-1}>n$ complex polynomials in ${\mathbb{C}}[x_1,\ldots, x_n]$. For each collection $I$ of multi-indices of length $d$, consider the subscheme $\bigcap_{\alpha\in I}\{x^\alpha=0\}$ in affine space $\mathbb{C}^N$. As we let $I$ range over collections of at most $n$ multi-indices, these subschemes are nonempty and distinct from each other, i.e. these intersections have distinct zero sets considering multiplicity.

I'm wondering if we can extend this property to the entire collection. Is it possible to find $N$ polynomials $g_1(x_1,\ldots, x_N),\ldots, g_N(x_1,\ldots, x_N)$ such that

(1) $g_\alpha(x_1,\ldots,x_n,0,\ldots, 0)=x^\alpha$. (i.e. $g_i$ is formed from $x^\alpha$ by adding extra variables)
(2) As we range over arbitrary $I$, the subschemes $\bigcap_{\alpha\in I}\{g_\alpha=0\}$ are non-empty and distinct from each other?

-
Yes. Since you are allowed to use arbitrarily large degrees on the g's, you can choose the coefficients in the gs so that their intersections are distinct. –  J.C. Ottem Dec 18 '10 at 9:04