text:
# Canonical ensemble

Canonical ensemble

A canonical ensemble in statistical mechanics is a statistical ensemble representing a probability distribution of microscopic states of the system. The probability distribution is characterised by the proportion "pi" of members of the ensemble which exhibit a measurable macroscopic state "i", where the proportion of microscopic states for each macroscopic state "i" is given by the Boltzmann distribution,

:$p_i = frac\left\{1\right\}\left\{Z\right\}e^\left\{- E_i/\left(kT\right)\right\} = e^\left\{-\left(E_i -A\right)/\left(kT\right)\right\}$

where "E""i" is the energy of state "i". It can be shown that this is the distribution which is most likely, if each system in the ensemble can exchange energy with a heat bath, or alternatively with a large number of similar systems. Equivalently, it is the distribution which has maximum entropy for a given average energy <"E"i>.

It is also referred to as an NVT ensemble: the number of particles ("N"), the volume ("V"), of each system in the ensemble are the same, and the ensemble has a well defined temperature ("T"), given by the temperature of the heat bath with which it would be in equilibrium.

The quantity "k" is Boltzmann's constant, which relates the units of temperature to units of energy. It may be suppressed by expressing the absolute temperature using thermodynamic beta, .

The quantities "A" and "Z" are constants for a particular ensemble, which ensure that $Sigma p_i$ is normalised to 1. "Z" is therefore given by

:.

This is called the partition function of the canonical ensemble. Specifying this dependence of "Z" on the energies "E"i conveys the same mathematical information as specifying the form of "p"i above.

The canonical ensemble (and its partition function) is widely used as a tool to calculate thermodynamic quantites of a system under a fixed temperature. This article derives some basic elements of the canonical ensemble. Other related thermodynamic formulas are given in the partition function article. When viewed in a more general setting, the canonical ensemble is known as the Gibbs measure, where, because it has the Markov property of statistical independence, it occurs in many settings outside of the field of physics.

Deriving the Boltzmann factor from ensemble theory

Let $E_i,$ be the energy of the microstate $i,$ and suppose there are $n_i,$ members of the ensemble residing in this state. Further we assume the total number of systems in the ensemble, $mathcal\left\{N\right\},$, and the total energy of all systems of the ensemble, $mathcal\left\{E\right\},$, are fixed, i.e.,

:$mathcal\left\{N\right\}= sum_i n_i , ,$

:$mathcal\left\{E\right\}= sum_i n_i E_i ,.$

Since systems in the ensemble are distinguishable, for each set $\left\{n_i\right\} ,$, the number of ways of shuffling systems is equal to

:$W \left(\left\{n_i\right\}\right) = mathcal\left\{N\right\}!/ prod_\left\{i\right\} n_i! , .$

So for a given $\left\{n_i\right\},$, there are $W\left(\left\{n_i\right\}\right),$ rearrangements that specify the same state of the ensemble.

The most probable distribution is the one that maximizes $W \left(\left\{n_i\right\}\right),$. The probability for any other distribution to occur is extremely small in the limit $mathcal\left\{N\right\} ightarrow infty ,$.To determine this distribution, one should maximize $W \left(\left\{n_i\right\}\right),$ with respect to the $n_i,$'s, under two constraints specified above. This can be done by using two Lagrange multipliers $alpha ,$ and . (The assumption that $mathcal\left\{N\right\} ightarrow infty ,$ would be invoked in such calculation, which allows one to apply Stirling's approximation.) The result is

:.

This distribution is called the canonical distribution. To determine $alpha ,$ and , it is useful to introduce the partition function as a sum over microscopic states

:

Comparing with thermodynamic formulae, it can be shown that , is related to the absolute temperature $T,$ as, . Moreover the expression

:

is identified as the Helmholtz free energy $F$. A derivation is given here. Consequently, from the partition function we can obtain the average thermodynamic quantities for the ensemble. For example, the average energy among members of the ensemble is

:.

This relation can be used to determine . $alpha,$ is determined from

:.

A derivation from heat-bath viewpoint

Define the following:

* S - the system of interest
* S′ - the heat reservoir in which S resides; S is small compared to S′
* S* - the system consisting of S and S′ combined together
* "m" - an indexing variable which labels all the available energy states of the system S
* "E"m - the energy of the state corresponding to the index m for the system S
* "E"′ - the energy associated with the heat bath
* "E"* - the energy associated with S*
* "Ω"′("E") - denotes the number of microstates available at a particular energy E for the heat reservoir.

It is assumed that the system S and the reservoir S′ are in thermal equilibrium. The objective is to calculate the set of probabilities "p""m" that S is in a particular energy state "E""m".

Suppose S is in a microstate indexed by "m". From the above definitions, the total energy of the system S* is given by

:$E^ast = E\text{'} + E_m ,$

Notice "E"* is constant, since the combined system S* is taken to be isolated.

Now, arguably the key step in the derivation is that "the probability of "S" being in the m-th state, $; p_m$, is proportional to the corresponding number of microstates available to the reservoir when "S" is in the m-th state". Therefore,

:$p_m = C\text{'}Omega\text{'}\left(E\text{'}\right) ,$

for some constant $; C\text{'}$. Taking the logarithm gives

:$ln p_m = ln C\text{'} + ln Omega\text{'} \left(E\text{'}\right) = ln C\text{'} + ln Omega\text{'} \left(E^* - E_m\right) ,$

Since "E""m" is small compared to "E"*, a Taylor series expansion can be performed on the latter logarithm around the energy "E"*. A good approximation can be obtained by keeping the first two terms of the Taylor series expansion:

:$ln Omega\text{'}\left(E\text{'}\right) = sum_\left\{k=0\right\}^infty frac\left\{\left(E\text{'} - E^ast \right)^k \right\}\left\{k!\right\} frac\left\{d^k ln Omega\text{'} \left(E^ast\right)\right\}\left\{dE\text{'}^k\right\} approx ln Omega\text{'}\left(E^ast\right) - frac\left\{d\right\}\left\{dE\text{'}\right\} ln Omega\text{'}\left(E^ast\right) E_m$

The following quantity is a constant which is traditionally denoted by "β", known as the thermodynamic beta.

:

Finally,:

Exponentiating this expression gives:

The factor in front of the exponential can be treated as a normalization constant "C", where:$C = C\text{'} Omega\text{'}\left(E^ast\right) ,$

From this:

Normalization to recover the partition function

Since probabilities must sum to 1, it must be the case that

:

where $Z$ is known as the Partition function for the canonical ensemble.

Note on derivation

As mentioned above, the derivation hinges on recognizing that the probability of the system being in a particular state is proportional to the corresponding multiplicities of the reservoir (the same can be said for the grand canonical ensemble). As long as one makes that observation, it is flexible as how one might proceed. In the derivation given, the logarithm is taken, then a linear approximation based on physical arguments is used. Alternatively, one can apply the thermodynamic identity for differential entropy:

:$d S = \left\{1 over T\right\} \left(d U + P d V - mu d N\right)$

and obtain the same result. See the article on Maxwell-Boltzmann statistics where this approach is employed.

The canonical ensemble is also called the Gibbs ensemble, in honor of J.W. Gibbs, widely regarded with Boltzmann as being one of the two fathers of statistical mechanics. In his definitive original book "Elementary Principles in Statistical Mechanics", Gibbs viewed an ensemble as a list of the allowed states of the system (each state appearing once and only once in the list) and the associated statistical weights. The states do not interact with each other, or with a reservoir, until Gibbs treats what happens when two complete ensembles at two different temperatures are allowed to interact weakly (Gibbs, pp 160). Gibbs writes that "...the distribution in phase..." (the phase space density in modern language) "... [is] called canonical... [if] the index of probability" (the logarithm of the statistical weight of the phase space density) "...is a linear function of the energy..." (Gibbs, Ch. 4). In Gibbs' formulation, this requirement (his equation 91, in modern notation

:$P = e^\left\{frac\left\{E-A\right\}\left\{kT\right\} \right\} ,$

is taken to "define" the canonical ensemble and to "be" the fundamental postulate. Gibbs does show that a large collection of interacting microcanonical systems approaches the canonical ensemble, but this is part of his demonstration (Gibbs, pp 169-183) that the principle of equal a priori probabilities, therefore the microcanonical ensemble, are inferior to the canonical ensemble as an axiomatization of statistical mechanics, at every point where the two treatments differ.

Gibbs original formulation is still standard in modern mathematically rigorous treatments of statistical mechanics, where the canonical ensemble is defined as the probability measure:$e^\left\{ \left\{E - A over kT\right\} \right\} dp , dq$with "p" and "q" being the canonical coordinates.

Characteristic state function

The characteristic state function of the canonical ensemble is the Helmholtz free energy function, as the following relationship holds:

:

Quantum mechanical systems

By applying the canonical partition function, one can easily obtain the corresponding results for a canonical ensemble of quantum mechanical systems. A quantum mechanical ensemble in general is described by a density matrix. Suppose the Hamiltonian "H" of interest is a self adjoint operator with only discrete spectrum. The energy levels $\left\{ E_n \right\}$ are then the eigenvalues of "H", corresponding to eigenvector $| psi _n angle$. From the same considerations as in the classical case, the probability that a system from the ensemble will be in state $| psi _n angle$ is , for some constant $C$. So the ensemble is described by the density matrix

:

(Technical note: a density matrix must be trace-class, therefore we have also assumed that the sequence of energy eigenvalues diverges sufficiently fast.) A density operator is assumed to have trace 1, so

:

, which means

:

"Q" is the quantum-mechanical version of the canonical partition function. Putting "C" back into the equation for ρ gives

:

By the assumption that the energy eigenvalues diverge, the Hamiltonian "H" is an unbounded operator, therefore we have invoked the Borel functional calculus to exponentiate the Hamiltonian "H". Alternatively, in non-rigorous fashion, one can consider that to be the exponential power series.

Notice the quantity

:

is the quantum mechanical counterpart of the canonical partition function, being the normalization factor for the mixed state of interest.

The density operator ρ obtained above therefore describes the (mixed) state of a canonical ensemble of quantum mechanical systems. As with any density operator, if "A" is a physical observable, then its expected value is

:$langle A angle = operatorname\left\{Tr\right\}\left( ho A \right).$

Relations with other ensembles

A generalization of this is the grand canonical ensemble, in which the systems may share particles as well as energy. By contrast, in the microcanonical ensemble, the energy of each individual system is fixed.

ee also

References

* [http://www.iop.org/EJ/article/0295-5075/54/4/475/6545.html The Ornstein-Zernike equation in the canonical ensemble]

* [http://stp.clarku.edu/notes/ Draft Chapters of Thermal and Statistical Physics Textbook]

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• canonical ensemble — ▪ physics       in physics, a functional relationship for a system of particles that is useful for calculating the overall statistical and thermodynamic behaviour of the system without explicit reference to the detailed behaviour of particles.… …   Universalium

• canonical ensemble — kanoninis ansamblis statusas T sritis fizika atitikmenys: angl. canonical assembly; canonical ensemble vok. kanonisches Ensemble, n rus. канонический ансамбль, m pranc. ensemble canonique, m …   Fizikos terminų žodynas

• Grand canonical ensemble — In statistical mechanics, the grand canonical ensemble is a statistical ensemble (a large collection of identically prepared systems), where each system is in equilibrium with an external reservoir with respect to both particle and energy… …   Wikipedia

• grand canonical ensemble — didysis kanoninis ansamblis statusas T sritis fizika atitikmenys: angl. grand canonical ensemble vok. große Gibbssche Gesamtheit, f; große kanonische Gesamtheit, f; großes kanonisches Ensemble, n rus. большой канонический ансамбль, m pranc.… …   Fizikos terminų žodynas

• Canonical — is an adjective derived from . Canon comes from the Greek word kanon , rule (perhaps originally from kanna reed , cognate to cane ), and is used in various meanings. Basic, canonic, canonical : reduced to the simplest and most significant form… …   Wikipedia

• canonical assembly — kanoninis ansamblis statusas T sritis fizika atitikmenys: angl. canonical assembly; canonical ensemble vok. kanonisches Ensemble, n rus. канонический ансамбль, m pranc. ensemble canonique, m …   Fizikos terminų žodynas

• ensemble canonique — kanoninis ansamblis statusas T sritis fizika atitikmenys: angl. canonical assembly; canonical ensemble vok. kanonisches Ensemble, n rus. канонический ансамбль, m pranc. ensemble canonique, m …   Fizikos terminų žodynas

• Ensemble average — In statistical mechanics, the ensemble average is defined as the mean of a quantity that is a function of the micro state of a system (the ensemble of possible states), according to the distribution of the system on its micro states in this… …   Wikipedia

• Canonical probability distribution — In thermal physics, the canonical probability distribution is a statistical function which equates to the Boltzmann factor divided by the partition function. The function was introduced by Willard Gibbs in his 1901 Elementary Principles in… …   Wikipedia

• ensemble grand-canonique — didysis kanoninis ansamblis statusas T sritis fizika atitikmenys: angl. grand canonical ensemble vok. große Gibbssche Gesamtheit, f; große kanonische Gesamtheit, f; großes kanonisches Ensemble, n rus. большой канонический ансамбль, m pranc.… …   Fizikos terminų žodynas


text:
# Why does $\int_{C_M}{e^{iz}-1\over z}dz=0$ where $C_M$ goes through $0$?

I read an example evalutating $$\int_{-\infty}^\infty {\sin x \over x}dx$$ and the author defines a closed curve $$C_M$$ which is chaining $$\Gamma_M:Me^{it}, t\in[0,\pi]$$ with $$[-M,M]$$.

He writes:

According to Cauchy's theorem, $$\int _{C_M}{e^{iz}-1\over z} dz=0$$ since the integrand has no poles.

(Let $$g$$ be that integrand). I don't understand this equation: Cauchy Theorem demands $$f$$ to be analytic in an open region $$D$$ which contains $$C_M$$. But there's not such a region since $$C_M$$ goes throug $$0$$, but $$g$$ is not analytic in $$0$$. I would like for an explanation, thanks!

• The singularity $z=0$ is removable, not a pole. – user10354138 May 21 at 17:47
• I know 2 theorems by Cauchy in that context: The first demands analiticity of $f$ in an open region $D$ and the other one is the residue theorem. Do you know which one of Cauchy's theorems they mean? – J. Doe May 21 at 17:52
• Alternatively, replace $C_R$ by a loop $C_R'$ that is the same as $C_R$, but that very close to $0$ does an arc around $0$ to leave it outside $C_R'$. On $C_R'$ you can apply Cauchy's theorem as you know it, and the difference between $\int_{C_R}$ and $\int_{C_R'}$ is the integral on a very little loop. Observe that $\frac{e^{iz}-1}{z}$ is bounded near $0$, therefore the integral on a very small loop near zero tends to zero with the length of the loop. Therefore $0=\int_{C_R'}$ and tends to $\int_{C_R}$ as the little loop closes. Therefore $\int_{C_R}=0$. – logarithm May 21 at 17:53

We see that $$g(z) = \sum_{n=1}^\infty {1 \over n!} \alpha^n z^{n-1}$$ is entire and that $${e^{\alpha z} -1 \over z} = g(z)$$ for all $$z \neq 0$$.

format: plain


text:
# glmx

0th

Percentile

##### Generalized Linear Models with Extra Parameters

Estimation of generalized linear models with extra parameters, e.g., parametric links, or families with additional parameters (such as negative binomial).

Keywords
regression
##### Usage
glmx(formula, data, subset, na.action, weights, offset, family = negative.binomial, xlink = "log", control = glmx.control(...), model = TRUE, y = TRUE, x = FALSE, ...)
glmx.fit(x, y, weights = NULL, offset = NULL, family = negative.binomial, xlink = "log", control = glmx.control())
##### Arguments
formula
symbolic description of the model.
data, subset, na.action
arguments controlling formula processing via model.frame.
weights
optional numeric vector of case weights.
offset
optional numeric vector(s) with an a priori known component to be included in the linear predictor.
family
function that returns a "family" object, i.e., family(x) needs to be a "family" object when x is the numeric vector of extra parameters (by default assumed to be 1-dimensional).
link object or a character that can be passed to make.link. It should link the extra parameters to real parameters.
control
a list of control arguments as returned by glmx.control.
model, y, x
logicals. If TRUE the corresponding components of the fit (model frame, response, model matrix) are returned. For glmx.fit, x should be a numeric regressor matrix and y should be the response vector.
...
control arguments.
##### Details

The function glmx is a convenience interface that estimates generalized linear models (GLMs) with extra parameters. Examples would be binary response models with parametric link functions or count regression using a negative binomial family (which has one additional parameter). Hence, glmx needs a family argument which is a family-generating function depending on one numeric argument for the extra parameters. Then, either profile-likelihood methods can be used for optimizing the extra parameters or all parameters can be optimized jointly. If the generated family contains a list element loglik.extra for the derivative of the log-likelihood with respect to the extra parameters (i.e., score/gradient contributions), then this is used in the optimization process. This should be a function(y, mu, extra) depending on the observed response y, the estimated mean mu, and the extra parameters.

##### Value

glmx returns an object of class "glmx", i.e., a list with components as follows. glmx.fit returns an unclassed list with components up to converged.
coefficients
a list with elements "glm" and "extra" containing the coefficients from the respective models,
residuals
a vector of deviance residuals,
fitted.values
a vector of fitted means,
optim
list of optim outputs for maximizing the "profile" and "full" log-likelihood, respectively,
weights
the weights used (if any),
offset
the list of offset vectors used (if any),
n
number of observations,
nobs
number of observations with non-zero weights,
df
number of estimated parameters,
loglik
log-likelihood of the fitted model,
dispersion
estimate of the dispersion parameter (if any),
vcov
covariance matrix of all parameters in the model,
family
a list with elements "glm" and "extra" where the former contains the "family" object at the optimal extra parameters and the latter the family-generating function,
the link object for the extra parameters,
control
control options used,
converged
logical indicating successful convergence of optim,
call
the original function call,
formula
the formula,
terms
the terms object for the model,
levels
the levels of the categorical regressors,
contrasts
the contrasts corresponding to levels,
model
the full model frame (if model = TRUE),
y
the response vector (if y = TRUE),
x
the model matrix (if x = TRUE).

glmx.control, hetglm

• glmx
• glmx.fit
• coef.glmx
• formula.glmx
• logLik.glmx
• nobs.glmx
• print.glmx
• summary.glmx
• vcov.glmx
• predict.glmx
##### Examples
## artificial data from geometric regression
set.seed(1)
d <- data.frame(x = runif(200, -1, 1))
d$y <- rnbinom(200, mu = exp(0 + 3 * d$x), size = 1)

### negative binomial regression ###

## negative binomial regression via glmx
if(require("MASS")) {
m_nb1 <- glmx(y ~ x, data = d,
family = negative.binomial, xlink = "log", xstart = 0)
summary(m_nb1)

## negative binomial regression via MASS::glm.nb
m_nb2 <- glm.nb(y ~ x, data = d)
summary(m_nb2)

## comparison
if(require("lmtest")) {
logLik(m_nb1)
logLik(m_nb2)
coeftest(m_nb1)
coeftest(m_nb2)
exp(coef(m_nb1, model = "extra"))
m_nb2$theta exp(coef(m_nb1, model = "extra")) * sqrt(vcov(m_nb1, model = "extra")) m_nb2$SE.theta
}}

## if the score (or gradient) contribution of the extra parameters
## is supplied, then estimation can be speeded up:
negbin <- function(theta) {
fam <- negative.binomial(theta)
fam\$loglik.extra <- function(y, mu, theta) digamma(y + theta) - digamma(theta) +
log(theta) + 1 - log(mu + theta) - (y + theta)/(mu + theta)
fam
}
m_nb3 <- glmx(y ~ x, data = d,
family = negbin, xlink = "log", xstart = 0, profile = FALSE)
all.equal(coef(m_nb1), coef(m_nb3))

### censored negative binomial hurdle regression (0 vs. > 0) ###

## negative binomial zero hurdle part via glmx
nbbin <- function(theta) binomial(link = nblogit(theta))
m_hnb1 <- glmx(factor(y > 0) ~ x, data = d,
family = nbbin, xlink = "log", xstart = 0)
summary(m_hnb1)

## negative binomial hurdle regression via pscl::hurdle
## (see only zero hurdle part)
if(require("pscl")) {
m_hnb2 <- hurdle(y ~ x, data = d, dist = "negbin", zero.dist = "negbin")
summary(m_hnb2)
}

Documentation reproduced from package glmx, version 0.1-1, License: GPL-2 | GPL-3

### Community examples

Looks like there are no examples yet.


text:
## CCO '08 P2 - King & Weber

View as PDF

Points: 20 (partial)
Time limit: 2.0s
Memory limit: 512M

Problem type
##### 2008 Canadian Computing Competition, Day 1

It is easy to get lost in Kitchener-Waterloo. Many streets that are mostly parallel actually intersect, sometimes multiple times. The best-known example is King and Weber Streets. Other examples include Westmount and Fischer-Hallman, University and Erb, and Queen and Highland.

Navigation is easier in cities that respect the "Manhattan Assumption": all streets are straight lines in a Euclidean plane, and any two streets are either parallel or perpendicular to each other. Visitors to Manhattan are cautioned that even Manhattan itself does not fully satisfy this assumption.

The input to your program will be a sequence of observations followed by a sequence of queries for a particular city. An observation asserts either that two streets are parallel, or that they intersect. A query asks whether two streets are parallel, or whether they intersect, provided the city satisfies the Manhattan Assumption.

#### Input Specification

The first line of input contains two integers and . Each of the following lines contains an observation. Each observation consists of three words separated by spaces: the two street names, and either the word parallel or the word intersect. Each street name is a sequence of no more than uppercase or lowercase letters. The observations are followed by queries, each on a separate line. A query consists of two street names separated by a space.

#### Output Specification

If it is impossible for the city to conform to both the Manhattan Assumption and the specified observations, output a single line containing the word Waterloo. Otherwise, output lines containing the answers to the queries. Each answer should be one of the following three words: parallel, intersect, unknown. If the two streets queried are parallel in every city satisfying the given observations and the Manhattan Assumption, the output should be parallel. If they are perpendicular in every such city, the output should be intersect. If they are parallel in some such city and perpendicular in another such city, the output should be unknown.

#### Sample Input

3 3
fourthstreet fifthstreet parallel
fifthstreet sixthstreet parallel
fourthavenue fifthstreet intersect
sixthstreet fourthstreet
sixthstreet fourthavenue
sixthstreet King

#### Sample Output

parallel
intersect
unknown

#### Sample Input 2

2 1
King Weber parallel
King Weber intersect
King Weber

#### Sample Output 2

Waterloo


text:
Inverse Trig Derivative Problem about ArcSin

• Nov 8th 2012, 08:51 AM
Jason76
Inverse Trig Derivative Problem about ArcSin
Find the Derivative

$y = 2 \arcsin \sqrt{1 - 2x}$

using the formula for derivative of arcsin:

$\frac{d}{dx}\sin^{-1}$

and

$u = (\frac{1}{\sqrt{1 - u^{2}}})(\frac{du}{dx})$

Step 1.

$y = 2[\frac{1}{\sqrt{1-(\sqrt{1-2x})^{2}}}] [\frac{1}{2}(1-2x)^{-1/2}](-2)$

Step 2:

Can't understand how they get from here (below this sentence) to the answer.

$y = (\frac{1}{\sqrt{1-1+2x}})(\frac{1}{\sqrt{1-2x}})(-2)$

$y = \frac{-2}{\sqrt{2x - 4x^{2}}}$
• Nov 8th 2012, 09:02 AM
fkf
Re: Inverse Trig Derivative Problem about ArcSin
Multiplying sqrt(a)*sqrt(b) = sqrt(a*b)

In this case we have the denominator
sqrt(1-1+2x)*sqrt(1-2x) = sqrt(2x)*sqrt(1-2x) = sqrt((2x)*(1-2x)) = sqrt(2x-4x^2)
• Nov 8th 2012, 09:05 AM
topsquark
Re: Inverse Trig Derivative Problem about ArcSin
Quote:

Originally Posted by Jason76
Can't understand how they get from here (below this sentence) to the answer.

$y = (\frac{1}{\sqrt{1-1+2x}})(\frac{1}{\sqrt{1-2x}})(-2)$

$y = \frac{-2}{\sqrt{2x - 4x^{2}}}$

The notation in equation 3 was a little confusing, but no matter. It's clear what you meant.

Note:
$\sqrt{a} \cdot \sqrt{b} = \sqrt{a}{b}$

Here we have a = 2x and b = 1 - 2x. Can you finish now?

-Dan

Ya beat me fkf!
• Nov 8th 2012, 02:41 PM
Jason76
Re: Inverse Trig Derivative Problem about ArcSin
Quote:

Originally Posted by topsquark
The notation in equation 3 was a little confusing, but no matter. It's clear what you meant.

Note:
$\sqrt{a} \cdot \sqrt{b} = \sqrt{a}{b}$

Here we have a = 2x and b = 1 - 2x. Can you finish now?

-Dan

Ya beat me fkf!

Yes, thanks a lot. But I'm wondering, this was an example of one number inside of a radical being multiplied by two numbers in another radical. However, what if there were two numbers in one radical being multiplied by two in another (and similar patterns)?
• Nov 8th 2012, 03:52 PM
topsquark
Re: Inverse Trig Derivative Problem about ArcSin
Quote:

Originally Posted by Jason76
Yes, thanks a lot. But I'm wondering, this was an example of one number inside of a radical being multiplied by two numbers in another radical. However, what if there were two numbers in one radical being multiplied by two in another (and similar patterns)?

If I am reading this correctly you are looking for $\sqrt{cd} \cdot \sqrt{ef} = \sqrt{cdef}$.

It's similar to the equation I posted earlier. Just let a = cd and b = ed.


text:
# How to prove “zigzag comb” is contractible (Hatcher ex. 0.6(b))

I am doing a self-study in algebraic topology and have a question about Hatcher's Ex.0.6(b) and contractibility on p18. There have been several other posts concerning why the "zigzag comb" (space Y) is not deformation retractable, and that part is very clear to me. But my question concerns why it IS contractible.

Some of the proofs I have seen use the fact that each "bristle" can be retracted to the heavy zigzag line (Z), and then Z can be contracted to a point. But that is not the definition of contractible, and seems to require that we tear the structure.

By definition, we must show that Y is nullhomotopic, i.e., that the identity map of Y is homotopic to a constant map. I can't see how we do this since all maps have to be continuous, as required in the definitions of homotopic and homotopy. So why don't we run into exactly the same problem that prevented the space from deformation retracting?

My question is similar to articles 495856 and 166648, but answers to both of those questions seemed to deal with an infinite number of copies of the triangular comb starting at the origin. This gives us a "starting point" for the contraction, and I see how the shape would contract in that case. But that is not Hatcher's problem.

Hatcher's problem involves combs extending infinitely in both directions. Thus, it appears to me that we have a problem "getting started" with any contraction algorithm without making tears.

In other words, my confusion concerns how we start the process when there are no ends to the combs where we can get the contraction process started.

• Possible duplicate of exercise 6 chapter 0 Hatcher – Najib Idrissi Dec 19 '15 at 10:48
• I have edited my question to explain why it was not answered by earlier posts (see last three paragraphs). – PossumP Dec 19 '15 at 21:35
• Sorry to say, but you misunderstood the problem (and it is indeed a duplicate, they are dealing with a comb that extends indefinitely in both directions), and the answer you propose is incorrect. – Najib Idrissi Dec 20 '15 at 7:31
• @Najib, what is the "answer" you are refering to that is incorrect? (My proposed answer below, or Balarka's answer below?) – PossumP Dec 20 '15 at 16:52
• The answer that you, user54301, wrote below. – Najib Idrissi Dec 20 '15 at 19:46

If $Y$ is the space above, one can define a homotopy $f_t : Y \to Y$ between $f_0 = \text{id}$ and $f_1$, the constant map, as described here. For any $a \in Y$, define path $\sigma_a : [0, \infty) \to Y$ with $\sigma_a(0) = a$ which goes down the bristles $a$ is in, and then moves along $Z$ to the right. Thus, define $f_t(x) = \sigma_x(t)$.
You can imagine this as moving to the right, and as you move, contracting the bristles as you head off to right. So you're not contracting all the space to $Z$ at once and then moving off to right by $Z$, but you're doing both simultaneously. This way, continuity is not destroyed.


text:
# Homework 6

Please answer the following questions in complete sentences in a typed, clearly prepared manuscript and submit the solution by the due date on Blackboard (Monday, October 23rd, 2017, around 4-5 am)

## Problem 0: Homework checklist

• Please identify anyone, whether or not they are in the class, with whom you discussed your homework. This problem is worth 1 point, but on a multiplicative scale.

• Make sure you have included your source-code and prepared your solution according to the most recent Piazza note on homework submissions.

## Problem 1: Direct Methods for Tridiagonal systems

In class, we said the definition of a sparse matrix was one with enough zeros to take advantage of it. In this problem, we'll show how to take advantage of tridiagonal structure in a matrix.

Let $\mA$ be a symmetric, tridiagonal, positive definite matrix:

1. Let $\mA_{n-1}$ is the $n-1 \times n-1$ leading principal minor of $\mA$. Suppose you are given the Choleksy factorization of $\mA_{n-1} = \mL_{n-1} \mL_{n-1}^T$. Determine the structure of $\mL_{n-1}$ (hint, $\mL_{n-1} \mL_{n-1}^T$ must be tridiagonal!).

2. Now, show how to compute the Cholesky factorization of $\mA = \mL \mL^T$ from $\mL_{n-1}$ in a constant number of operations.

3. Use the result of the first two parts to write down an algorithm that computes the Cholesky factorization of $\mA$ in a linear amount of work (starting from scratch!)

## Problem 2: Sparse matrices in Julia

If you wish to use another language, please see me

In this problem, we'll return to our favorite linear system, Poisson's equation. (I told you that we'd see a lot of this system.)

We'll assume that the boundary conditions are zero everywhere. Consequently, we'll use the form of the system where we have removed all rows that are set to zero. Some of you did this already, so you may have an easier time on this question.
For the $N=4$ case, we have: where $U(i,j) = u(x_i,y_j)$ and $F(i,j) = h^2 f(x_i,y_j)$.

1. You can change an entry of a sparse matrix in Julia with $A[i,j] = v$. Write a Julia routine to create the matrix above for a general $N$ by changing each element one at a time.
A = spzeros((N-1)*(N-1),(N-1)*(N-1)); # this creates an all-zero sparse matrix
<fill in the rest>

1. As shown in class, another way to create a sparse matrix is to use the coordinate form. Create the arrays I,J,andV for the matrix above. Hint there are $(N-1)^2 + 4(N-1)(N-2)$ non-zeros. Use this information to initialize the arrays I,J, and V. Write a routine to create the matrix above for a general $N$ using the coordinate form
nz = (N-1)^2 + 4*(N-1)*(N-2);
I = zeros(nz);
J = zeros(nz);
V = zeros(nz);
<fill in the rest>
A = sparse(i,j,v,(N-1)*(N-1),(N-1)*(N-1));

1. Which way is faster? Try creating matrices with $N = 10, 50, 100, 500$.

2. Let $f(x,y) = 1$. Is solving the linear system using backslash faster or slower with a sparse matrix? Does it depend on the value of $N$? Investigate and report.

3. Again let $f(x,y) = 1$. Implement the Jacobi method for this problem. You should start from the iterate $\vx\itn{0} = \vb$, so start with the guess of the right hand side. How many iterations does it take to converge to a relative residual of $10^{-4}$? Use the same values of $N$ from part 3.

4. Does the number of iterations of your Jacobi solver depend on the the right hand side? Try comparing $f(x,y) = 1$, $f(x,y) = -1$, $f(x,y) = -(x-0.5)^2 - (y-0.5)^2$, $f(x,y) = \sin(100x)\cos(100y)$. Use the same values of $N$ from part 3.

## Problem 3: Fun with sparse matrices

In Julia, calling y = A*x on a sparse matrix A, calls a special function to perform this multiplication faster. To generate a sparse random matrix in julia, you can call A = sprand(M,N,d) where M and N are the dimensions of A, and d is the density of A. 1. Generate a random sparse matrix A and transform it to dense matrix B. Use a dense vector x of suitable dimensions and compute A*x and B*x. Vary M, N, and d and report performance changes.

1. Generate a random square sparse matrix A, and a dense vector x of suitable dimension and compute A*x and A'*x. Is one faster than the other? Vary the dimensions and the density and report your results. Provide an analysis of your results.

2. Write a sparse matrix vector routine where both, the matrix and the vector are sparse. You can generate a sparse vector in Julia using x = sprand(N,d), where N is the dimension and d is the density. Test your method and report performance results.

function spmatvec{T,F}(A::SparseMatrixCSC{T,Int64},x::SparseVector{F,Int64})
y = <fill in>
for j = <fill in>
for k = A.colptr[j]:(A.colptr[j+1]-1)
<fill in>
end
end
return y
end


text:
# What is the derivative of this function -1/(sin(x))^2?

Dec 3, 2016

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 \cot x {\csc}^{2} x$

#### Explanation:

This function can be written as $y = - {\left(\sin x\right)}^{-} 2$.

We let $y = - {u}^{-} 2$ and $u = \sin x$. Through the power rule and basic differentiation rules, we obtain $\frac{\mathrm{dy}}{\mathrm{du}} = - 2 \left(- 1\right) {u}^{-} 3 = \frac{2}{u} ^ 3$ and $\frac{\mathrm{du}}{\mathrm{dx}} = - \cos x$.

Recall that the chain rule for derivatives of composite functions states that $\textcolor{red}{\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{du}} \times \frac{\mathrm{du}}{\mathrm{dx}}}$.

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{2}{u} ^ 3 \times \cos x$

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{2 \cos x}{\sin x} ^ 3$

By the identities $\cot x = \frac{1}{\tan} x$ and $\csc x = \frac{1}{\sin} x$, we can simplify the derivative.

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 \cot x {\csc}^{2} x$

Hopefully this helps!


text:
# How does the bootstrapping capacitor in this diagram operate

I am curious to know how the bootstrap capacitor Cbst in the following example charges up to Vcc + Vin?

According to my understanding, during the clock input which turns the low side mosfet ON, the Cbst is charged at Vcc via Dbst, during the next clock the low side mosfet turns off and the high side mosfet begins turning ON through Vcc via the emitter of the NPN buffer. This allows the drain voltage to reach the source of the mosfet which simultaneously passes through Cbst via the NPN buffer to the mosfet gate. When this happens the stored Vcc inside Cbst comes in series with the instantaneous mosfet source voltage, and together they execute the Vcc + Vin for turning ON the high side mosfet.

A brief clarification on this will be greatly appreciated!

• You got it! The only clarification I would make is that the top N-FET doesn't really care about the absolute voltage of the gate in order to turn on or off. It only cares about Vgs (voltage difference between gate and source). Because CBst is directly connected at the source of the FET, just think of the VCC stored in CBst being applied to the Vgs of the FET when the NPN turns on. – joribama Apr 19 at 5:53
• Thanks for your reply, suppose the drain voltage is 110V, and Vcc = 12V, then what happens? Definitely the mosfet will not conduct the 110V with 12V Vgs alone! – Swagatam Majumdar Apr 19 at 6:03
• Vg would be ~122V (after the FET turns on), but Vgs (Vg-Vs) would still be ~12V. The gate driving circuit sits on top of Vs. The level shifter circuit may become a little tricky in this case. Does it make sense? – joribama Apr 19 at 6:37
• Yes I know it would be 122V, but how does that take place, how the 110 and 12 get in series, that's my question? – Swagatam Majumdar Apr 19 at 8:20
• Right before the top FET turns on, Vs will be in some sort of transient, so the capacitor top voltage will be whatever the transient voltage is plus 12V. When the NPN turns on, the 12 V on CBst is applied directly to Vgs of the FET, which turns on as a consequence. Right after the top FET turns on it acts like a closed switch, therefore Vs=Vd=Vin=110V. Because CBst sits on top of Vs, the voltage at the positive side of CBst will be 110V+12V=122V. I hope it makes sense now. – joribama Apr 19 at 9:01

$$\V_B\$$, is the boost voltage required for dual N-channel half-bridge switches. The high output side, (HO) Nch FET needs a gate voltage higher than Vdd to activate RdsOn. It generates this voltage from a charge pump using the LO side PWM high-frequency pulses. THe Cboot cap AC couples this signal then is cathode clamped to Vdd such that the pulses now ride above Vdd. Internal to the IC, they are then rectified by an internal diode Anode and small internal capacitance to create HO +ve pulses.


text:
## Additional Detail on Present and Future Values

This section gives more detail on computing present and future values. It shows you how to compute more complex problems involving future and present values when there are multiple compounding periods and when the time duration of those problems are longer or are less than one year.

### Calculating Values for Different Durations of Compounding Periods

Finding the Effective Annual Rate (EAR) accounts for compounding during the year, and is easily adjusted to different period durations.

#### LEARNING OBJECTIVE

• Calculate the present and future value of something that has different compounding periods

#### KEY TAKEAWAYS

##### Key Points
• The units of the period (e.g. one year) must be the same as the units in the interest rate (e.g. 7% per year).
• When interest compounds more than once a year, the effective interest rate (EAR) is different from the nominal interest rate.
• The equation in skips the step of solving for EAR, and is directly usable to find the present or future value of a sum.

##### Key Terms
• Present value: Also known as present discounted value, is the value on a given date of a payment or series of payments made at other times. If the payments are in the future, they are discounted to reflect the time value of money and other factors such as investment risk. If they are in the past, their value is correspondingly enhanced to reflect that those payments have been (or could have been) earning interest in the intervening time. Present value calculations are widely used in business and economics to provide a means to compare cash flows at different times on a meaningful "like to like" basis.
• Future Value: The value of an asset at a specific date. It measures the nominal future sum of money that a given sum of money is "worth" at a specified time in the future, assuming a certain interest rate, or more generally, rate of return, it is the present value multiplied by the accumulation function.

Sometimes, the units of the number of periods does not match the units in the interest rate. For example, the interest rate could be 12% compounded monthly, but one period is one year. Since the units have to be consistent to find the $PV$ or $FV$, you could change one period to one month. But suppose you want to convert the interest rate into an annual rate. Since interest generally compounds, it is not as simple as multiplying 1% by 12 (1% compounded each month). This atom will discuss how to handle different compounding periods.

#### Effective Annual Rate

The effective annual rate (EAR) is a measurement of how much interest actually accrues per year if it compounds more than once per year. The EAR can be found through the formula in where i is the nominal interest rate and n is the number of times the interest compounds per year. Once the EAR is solved, that becomes the interest rate that is used in any of the capitalization or discounting formulas.

$r=e^{i}-1$

EAR with Continuous Compounding: The effective rate when interest compounds continuously.

$r=(1+i / n)^{n}-1$

Calculating the effective annual rate: The effective annual rate for interest that compounds more than once per year.

For example, if there is 8% interest that compounds quarterly, you plug .08 in for i and 4 in for n. That calculates an EAR of .0824 or 8.24%. You can think of it as 2% interest accruing every quarter, but since the interest compounds, the amount of interest that actually accrues is slightly more than 8%. If you wanted to find the FV of a sum of money, you would have to use 8.24% not 8%.

#### Solving for Present and Future Values with Different Compounding Periods

Solving for the EAR and then using that number as the effective interest rate in present and future value ($PV$/$FV$) calculations is demonstrated here. Luckily, it's possible to incorporate compounding periods into the standard time-value of money formula. The equation in is the same as the formulas we have used before, except with different notation. In this equation, $A(t)$ corresponds to $FV$, $A0$ corresponds to Present Value, $r$ is the nominal interest rate, $n$ is the number of compounding periods per year, and $t$ is the number of years.

$A(t)=A_{0}\left(1+\frac{r}{n}\right)^{\lfloor n t\rfloor}$

FV Periodic Compounding: Finding the $FV$ ($A(t)$) given the $PV (Ao)$, nominal interest rate ($r$), number of compounding periods per year ($n$), and number of years ($t$).

The equation follows the same logic as the standard formula. $r/n$ is simply the nominal interest per compounding period, and $nt$ represents the total number of compounding periods.

#### Solving for n

The last tricky part of using these formulas is figuring out how many periods there are. If $PV$, $FV$, and the interest rate are known, solving for the number of periods can be tricky because n is in the exponent. It makes solving for $n$ manually messy. shows an easy way to solve for n. Remember that the units are important: the units on $n$ must be consistent with the units of the interest rate ($i$).

$n=\frac{\log (F V)-\log (P V)}{\log (1+i)}$

Solving for $n$: This formula allows you to figure out how many periods are needed to achieve a certain future value, given a present value and an interest rate.


text:
# Millmans Theory

Discussion in 'Homework Help' started by Ndjs, Mar 17, 2013.

1. ### Ndjs Thread Starter New Member

Sep 26, 2012
18
0
Hi Guys,

I am trying to find the voltage across R3 using millmans theory.

Any help would be great please see the attachment.

I am stuck on the next step.

• ###### maths.jpg
File size:
54.4 KB
Views:
19
Last edited: Mar 17, 2013
2. ### WBahn Moderator

Mar 31, 2012
22,614
6,729
It would appear that the next step is to solve for V.

What is it that it causing you concern?

3. ### Ndjs Thread Starter New Member

Sep 26, 2012
18
0
The maths side of things I am not sure how to get V by itself.

4. ### WBahn Moderator

Mar 31, 2012
22,614
6,729
Just do the same things to both sides of the equation to get V into the numerator on just one side of the equation.

You've built yourself a sufficiently complicated equation that you would be well advised to track your units carefully to catch mistakes you make. Also, in the stacked fraction you want to make it clear what is in the numerator and what is in the denominator because 1/(a/b) is NOT the same as (1/a)/b since division is not associative.

$
V = \frac{9983.3A}{41.6S+\frac{1}{ \left( \frac{V}{400A} \right) }}
$

The "S" is Siemens, which has units of 1/Ω or A/V and is a measure of conductance.

So the first step is to get rid of the stacked fraction. Try multiplying the numerator and denominator (of just the stacked fraction) by the multiplicative inverse of the denominator.

5. ### Ndjs Thread Starter New Member

Sep 26, 2012
18
0
Still stuck on how to get it.

6. ### WBahn Moderator

Mar 31, 2012
22,614
6,729
Well, make your best attempt to do what I suggested and we'll get that corrected and take it from there.


text:
# keeping the last line of one paragraph with the first line of the next paragraph or list in a \raggedbottom context

I often introduce new text with the last line of a paragraph, terminated by a colon. Perhaps the text before and after is ordinary text (between pages 1 and 2 in the example), or the text thereafter is a list (between pages 3 and 4 in the example), or the first paragraph is within a list with the next one being in a nested list (between pages 5 and 6 in the example). I would like to keep the last line of the first paragraph with the subsequent paragraph because that last line is often of an introductory nature. How can I do this? (I know about \Needspace, but I don't know how to use it for a solution here.)

I believe this question makes most sense in a \raggedbottom-context; this is also where I need this resolved. Here is an example:

\documentclass{memoir}
\usepackage{lipsum}
\raggedbottom

\begin{document}

\lipsum[1-4]
Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text:

Some filler text. Some filler text.

\newpage

\lipsum[1-4]
Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text:

\begin{itemize}
\item Some text.
\item Some text.
\item Some text.
\end{itemize}

\newpage

\begin{itemize}
\item \lipsum[1-4]
\item Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Now a nested list:
\begin{itemize}
\item Some text.
\item Some text.
\item Some text.
\end{itemize}
\end{itemize}

\end{document}

Here I would specifically like the last lines of pages 1, 3, and 5 kept together with the first lines of pages 2, 4, and 6, respectively. \nopagebreak works in the first case, but not in the two list cases.

-
Having the blank line before the itemize is a markup error, if the preceding text ends with : then the list is part of the same sentence so part of the same paragraph, LaTeX goes to a lot of effort to distinguish in-paragraph lists from end or start of paragraph lists –  David Carlisle Jan 22 '13 at 10:15
the blank line problem is also a markup error before a math display, with the same unwanted result. –  barbara beeton Jan 22 '13 at 15:50
@barbarabeeton Yes it's actually much worse before a (primitive tex) math display as you get a blank paragraph in that case (an hbox just containing indentation and parfillskip glue) rather than just different vertical glue –  David Carlisle Jan 23 '13 at 0:43

Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text:
\widowpenalty=-5000 \nopagebreak
\begin{itemize}
\item Some text.
\item Some text.
\item Some text.
\end{itemize}

pushes

Some filler text:

To the top of page 4. The negative widow penalty encourages rather than discourages a break before the last line of the partial paragraph and the \nopagebreak stops it breaking before the list.

-
If I insert \widowpenalty=-5000 between pages 3/4 (at the place you suggest), it remains active for the pagebreak between 5/6 as well. Is this good? Then I might as well set it once, in the preamble, or are there any adverse effects to beware of? –  Lover of Structure Jan 23 '13 at 0:34
oops no best to set it back again it encourages the last line of a paragraph to be widowed (pushed over to the next page) which isn't usually what you want. You could use {\widowpenalty=-5000 \nopagebreak\par} except as I noted above that defeats latex list code checking for an in-par list, so probably best to set it back after (both) \begin{itemize} and \end{itemize} –  David Carlisle Jan 23 '13 at 0:42
Actually, {\widowpenalty=-5000 \nopagebreak\par} seems like the perfect solution for my case, because if I don't want to use "keep together" functionality, I just don't use this (and use an empty line in before the list instead). Correct me if I'm wrong. I'll try it out a little later and will report back. –  Lover of Structure Jan 23 '13 at 2:16
latex puts on more vertical space (above and below) usually if there is a par before the list (\partopsep) see \documentclass[twocolumn]{article} \raggedbottom \begin{document} \hrule a \begin{enumerate}\item b\end{enumerate} c \hrule \pagebreak \hrule a \begin{enumerate}\item b\end{enumerate} c \hrule \end{document} –  David Carlisle Jan 23 '13 at 2:38
Oh in that case I don't want the \par. So I basically need \widowpenalty=-5000 \nopagebreak before and then \widowpenalty=previousvalue both after \begin{itemize} and \end{itemize}, correct? Is there a trivial way of storing previousvalue just before \widowpenalty=-5000 \nopagebreak? Then I'll just define macros for both <save \widowpenalty somehow in previousvalue> \widowpenalty=-5000 \nopagebreak and \widowpenalty=previousvalue. –  Lover of Structure Jan 23 '13 at 7:04


text:
# Vacuum energy for Yang-Mills fields in $R^d\times S^1$: One-loop, two-loop, and beyond

Authors
Type
Published Article
Publication Date
Mar 01, 2018
Submission Date
Mar 01, 2018
Identifiers
DOI: 10.1007/BF01483877
Source
arXiv
The vacuum energy is calculated for Yang-Mills (YM) system defined in $D$ dimensional space-time of $S^1\times R^d$ ($D=d+1$), where the possibility of the YM fields to acquire the vacuum expectation values on $S^1$ is taken into account. The vacuum energy has already been obtained to the order of one-loop in many people. Here we calculate the vacuum energy in $D$ dimensions to two-loop order. With an intention to reach higher loops, an approximation method is proposed, which is especially effective in higher dimensions. By this method, we can treat the higher-loop contributions of YM interactions as easily as we treat one-loop effect. As a check, we show reproduction of the two-loop contribution ($D$-dependence of the coefficient as well as the functional form) when the coupling constant is small. This approximation method is useful not only for the Kaluza-Klein theories but also for the finite temperature-density system (as a quark-gluon plasma).


text:
Question

# Photon of frequency $\nu$ has a momentum associated with it. If c is the velocity of light, then the momentum is:\begin{align} & A.\dfrac{\nu }{c} \\ & B.h\nu c \\ & C.\dfrac{h\nu }{{{c}^{2}}} \\ & D.\dfrac{h\nu }{c} \\ \end{align}

Verified
130.8k+ views
Hint: The momentum of a photon is very much related to its energy. As we know, the energy of a photon is proportional to its frequency, then the momentum of a photon is in relation with its wavelength. Even though photons are not having mass, they are possessing momentum.

First of all let us discuss the momentum of a photon in detail. The momentum of a photon, p, is calculated in kilogram meters per second, which is equal to Planck's constant, h, divided by the de Broglie wavelength of the light, lambda, calculated in meters. The equation can be written as,
$P=\dfrac{h}{\lambda }$
Particles possess momentum as well as energy. Even though photons have no mass, there has been proof that EM radiation possesses momentum. It is now a well-established concept that photons do have momentum. Particles are carrying momentum as well as energy. Clearly, photons carry momentum in the direction of their motion itself which is away from the sun and some of this momentum is being changed to dust particles in collisions.
We know that,
$P=\dfrac{h}{\lambda }$
In which $\lambda$ is the wavelength.
And also we know that,
$\lambda =\dfrac{c}{\nu }$
Where $c$ is the velocity of light, $\nu$ is frequency of photon.
Substituting this in the above equation will give,
$P=\dfrac{h\nu }{c}$
Therefore the correct answer is option D.

Note: The photons of the light which is reflected from a metal or a dielectric mirror are similar to the incident ones, apart from the varied propagation direction. The loss of light in the metal includes that some fraction of the photons are lost, while the energy of each reflected photon is completely preserved.


text:
# Sunday inaugurations

I promise this blog isn’t going to be all calendars, all the time, but I saw a NY Times story yesterday about President Obama’s private swearing-in ceremony in the White House.

The official swearing-in of Mr. Obama, 51, was just the seventh time in history that a president was sworn in privately before the public ceremony, and the first since President Ronald Reagan’s second inauguration. Each instance since 1821 occurred because the constitutionally mandated date for the inauguration fell on a Sunday.

How could I resist the challenge of figuring out all the Sunday inaugurations?

Being in a Lispy state of mind after my last post, I first wrote a couple of functions using Dershowitz and Reingold’s code from their Calendrical Calculations book. But since this problem didn’t involve any conversions between calendars, I decided to rewrite it in Python using the datetime module. And then I extended it to show the day of the week for all the inaugurations and give a count for each one. Here’s the code:

python:
1:  #!/usr/bin/python
2:
3:  from datetime import date
4:
5:  dow = "Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split()
6:
7:  def inaugurationDay(year):
8:    if year % 4 == 1:
9:      if year > 1933:
10:        return date(year, 1, 20)
11:      elif year > 1789:
12:        return date(year, 3, 4)
13:      elif year == 1789:
14:        return date(year, 4, 30)
15:    return None
16:
17:  def inaugurationWeekday(year):
18:    try:
19:      return inaugurationDay(year).weekday()
20:    except AttributeError:
21:      return None
22:
23:  inaugurations = []
24:  for d in range(7):
25:    inaugurations.append([])
26:
27:  for y in range(1789, 2014, 4):
28:    idow = inaugurationWeekday(y)
29:    print "%d: %s" % (y, dow[idow])
30:    inaugurations[idow].append(y)
31:
32:  print
33:
34:  for d in range(7):
35:    print "Inaugurations on %s (%d)" % (dow[d], len(inaugurations[d]))
36:    print ", ".join(str(x) for x in inaugurations[d])
37:    print

The key function is inaugurationDay, which required a little investigation. I knew that inaugurations used to be in March, and that Franklin Roosevelt’s first in 1933 was still on that schedule.1 A quick review of the Wikipedia page on presidential inaugurations showed that

• George Washington’s first inauguration was on April 30, 1789. March inaugurations started after that.
• The March date for inaugurations was the 4th.
• The 1933 inauguration was the last one in March.

You can see those facts incorporated into inaugurationDay. If you accidentally give it a year in which there was no inauguration, it returns None; otherwise it returns the date in Python’s datetime.date format.

The inaugurationWeekday function builds on inaugurationDay to return an integer representing the day of the week. Monday = 1, Tuesday = 2, etc.

Lines 23-25 create a blank list of lists that will collect all the inaugurations, organized by (there must be a better way). Lines 27-30 walk through history, filling that list of lists and printing out the inauguration days of the week as it goes. Lines 34-37 then print out a summary.

Here’s the output:

1789: Thursday
1793: Monday
1797: Saturday
1801: Wednesday
1805: Monday
1809: Saturday
1813: Thursday
1817: Tuesday
1821: Sunday
1825: Friday
1829: Wednesday
1833: Monday
1837: Saturday
1841: Thursday
1845: Tuesday
1849: Sunday
1853: Friday
1857: Wednesday
1861: Monday
1865: Saturday
1869: Thursday
1873: Tuesday
1877: Sunday
1881: Friday
1885: Wednesday
1889: Monday
1893: Saturday
1897: Thursday
1901: Monday
1905: Saturday
1909: Thursday
1913: Tuesday
1917: Sunday
1921: Friday
1925: Wednesday
1929: Monday
1933: Saturday
1937: Wednesday
1941: Monday
1945: Saturday
1949: Thursday
1953: Tuesday
1957: Sunday
1961: Friday
1965: Wednesday
1969: Monday
1973: Saturday
1977: Thursday
1981: Tuesday
1985: Sunday
1989: Friday
1993: Wednesday
1997: Monday
2001: Saturday
2005: Thursday
2009: Tuesday
2013: Sunday

Inaugurations on Monday (10)
1793, 1805, 1833, 1861, 1889, 1901, 1929, 1941, 1969, 1997

Inaugurations on Tuesday (7)
1817, 1845, 1873, 1913, 1953, 1981, 2009

Inaugurations on Wednesday (8)
1801, 1829, 1857, 1885, 1925, 1937, 1965, 1993

Inaugurations on Thursday (9)
1789, 1813, 1841, 1869, 1897, 1909, 1949, 1977, 2005

Inaugurations on Friday (6)
1825, 1853, 1881, 1921, 1961, 1989

Inaugurations on Saturday (10)
1797, 1809, 1837, 1865, 1893, 1905, 1933, 1945, 1973, 2001

Inaugurations on Sunday (7)
1821, 1849, 1877, 1917, 1957, 1985, 2013

Sundays have been on the rare side (Friday has fewer inaugurations but will catch up in 2017). You might think that the days of the week should be more nearly equal, but two things have worked against that:

1. The change from March to January.
2. The lack of leap years in 1800 and 1900.

If you start at 1801 and go forward, you see a pattern that repeats throughout the 19th century: Wednesday, Monday, Saturday, Thursday, Tuesday, Sunday, Friday. This 28-year repetition follows the usual 28-year repetition of the calendar (you could, for example, use a 1985 wall calendar this year and it would match perfectly). But skipping a leap year, which we do in century years that aren’t multiples of 400, messes up that pattern and disrupts the even distribution of inauguration days.

The switch from March 4 to January 20 was a similar disruption. These dates are 43 days apart in non-leap years, which caused the Saturday in 1933 to be followed by a Wednesday instead of a Thursday in 1937. Thursday, Tuesday, Sunday, and Friday each got screwed out of one appearance. They apparently did a poor job of lobbying when the 20th Amendment was up for ratification.

OK, that’s it for calendars for a while. You can tell your friends it’s safe to come back.

1. In The Glory and the Dream, William Manchester devotes a chapter to the country’s unraveling at the bottom of the Depression as it waited out the long lame duck end of the Hoover administration. It stuck with me.


text:
• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 fake id(x) for better 2sinh method. tommy1729 Ultimate Fellow Posts: 1,699 Threads: 373 Joined: Feb 2009 05/20/2014, 12:27 PM For improving the 2sinh method so that it works for all bases > eta and other improvements I consider : 2sinh(fake id(x)) fake id(x) behaves like e/2 x for small x, like x for large real and like 0 for large imaginary part. SO what is the best fake id(x) ? Remember we only want a single fixpoint (2sinh(fake id(x))=x) for any base. maybe id(x) = exp(fakelog(x)) ... Thinking... regards tommy1729 tommy1729 Ultimate Fellow Posts: 1,699 Threads: 373 Joined: Feb 2009 06/04/2014, 10:14 PM There is a problem with this particular type of fake function. Although it may be fixed as stated in post 1 it seems a big problem. Perhaps the biggest problem of " fake function theory ". id(x) as desired in post nr 1 : " fake id(x) behaves like e/2 x for small x, like x for large real and like 0 for large imaginary part " is in contradiction with the well known Lindelöf theorem. It seems the natural fix is : " fake id(z) behaves like e/2 z for small z and like z for large z " regards tommy1729 tommy1729 Ultimate Fellow Posts: 1,699 Threads: 373 Joined: Feb 2009 06/04/2014, 10:33 PM Hmm this new id(z) also seems in trouble because id(z) -z goes to 0 for large z ... but stays bounded for small z : so id(z) - z is not entire. So maybe use a function that grows like exp(x) near the real line and grows like z otherwise ? Notice if id(z) is not entire , then neither is id(exp(z)) or even id(fakeexp(z)). Hmm. Seems really an issue. regards tommy1729 tommy1729 Ultimate Fellow Posts: 1,699 Threads: 373 Joined: Feb 2009 06/04/2014, 11:10 PM (This post was last modified: 06/04/2014, 11:16 PM by tommy1729.) Wait a sec , it seems carlson's theorem applies here ! id(z) must grow fast enough otherwise id(z) - z is "close" to 0 for integer z , hence to avoid id(z) being flat it seems id(z) must grow fast enough in the imaginary direction. The problem is " close " is not the exact condition of the theorem (exactly 0 is). To make ln(id(z)/z) an entire function this also suggests id(z) is of exp type. Hence I write id(z) = z exp(t(z)) where t(z) is a taylor series. Now id(z)/z IS NEVER ALLOWED TO BE EQUAL TO 1. and exp(t(x)) for real x is a fake id(1) function. Thus t(x) is a fake id(0) function. However saying t(z) = id(z) - z brings us back to the Original problem ... Hmm. This is getting stranger by the sec. Maybe t(z) should be a fake id(0) for reals and a fake exp^[1/2](z) in the upper half plane ( in terms of absolute value ). But that brings us back again to carlson so I guess its better to have f(z) = fake id(0) around the real axis. f(z) = fake exp(z) near the imag axis. I finally see less objections. But what is f(z) ? regards tommy1729 tommy1729 Ultimate Fellow Posts: 1,699 Threads: 373 Joined: Feb 2009 06/04/2014, 11:21 PM (This post was last modified: 06/04/2014, 11:24 PM by tommy1729.) (06/04/2014, 11:10 PM)tommy1729 Wrote: Now id(z)/z IS NEVER ALLOWED TO BE EQUAL TO 1. and exp(t(x)) for real x is a fake id(1) function. This is still a big objection. so exp(t(z)) is not allowed to be 0 nor 1. This violates the little picard theorem. Hmm Seems all theorems of complex analysis are against me ! regards tommy1729 tommy1729 Ultimate Fellow Posts: 1,699 Threads: 373 Joined: Feb 2009 06/05/2014, 08:21 AM A good id(z) has been found ! id(z)/z = 1 sometimes but that is no big problem. id(z) = z * fake(1) on the real line id(z) = z * fake(exp(exp(i z))^O(z)) on the imag line. id(z) is of the type z * f(z i) where f(z i) is similar too $f(z i)=\int_0^\infty \frac{e^{zt i}}{t^t}\mathrm{d}t$ Yes the same function that occured in the fake exp^[1/2] thread. It seems " fake function theory " is developping fast. regards tommy1729 « Next Oldest | Next Newest »

 Possibly Related Threads… Thread Author Replies Views Last Post [MSE] short review/implem. of Andy's method and a next step Gottfried 0 19 09/27/2022, 04:16 PM Last Post: Gottfried Is this the beta method? bo198214 3 225 08/18/2022, 04:18 AM Last Post: JmsNxn Describing the beta method using fractional linear transformations JmsNxn 5 245 08/07/2022, 12:15 PM Last Post: JmsNxn The Etas and Euler Numbers of the 2Sinh Method Catullus 2 226 07/18/2022, 10:01 AM Last Post: Catullus A Limit Involving 2sinh Catullus 0 149 07/17/2022, 06:15 AM Last Post: Catullus Tommy's Gaussian method. tommy1729 34 9,886 06/28/2022, 02:23 PM Last Post: tommy1729 Reviving an old idea with 2sinh. tommy1729 7 490 06/28/2022, 02:14 PM Last Post: tommy1729 The beta method thesis JmsNxn 9 1,509 04/20/2022, 05:32 AM Last Post: Ember Edison Revitalizing an old idea : estimated fake sexp'(x) = F3(x) tommy1729 0 455 02/27/2022, 10:17 PM Last Post: tommy1729 tommy beta method tommy1729 0 650 12/09/2021, 11:48 PM Last Post: tommy1729

Users browsing this thread: 1 Guest(s)


text:
# Moving ship to new destination when already having a velocity?

Feel free to skip to the bottom and see the actual question.

NOTE: Question updated below based on comments

I am trying to make a space game and implement basic movement, unlike most, this is a simulation over time in the likes of Aurora 4x where time can pass by seconds or by days, months, years. I only mention this because my delta and inclusion of ticks would probably raise questions.

Quick Notes:

• Vector2Wide is just the .NET System.Numerics Vector2 that I copied and made it use double instead of float
• I am not using a game library. This is actually drawn in WPF taking my "space" location in AU and converting it to pixels on a canvas.
• Frictionless space
• Ship can accelerate/decelerate in any 2D direction. There's no ship rotation.
• X,Y are cartesian coordinates with the sun being at 0,0
• I am using Kilometers as my distance and acceleration, but I don't think it matters, just mentioning it in case.
• I also simulated it for every second to make sure it wasn't an issue skipping so much time and the results were basically the same with my acceleration value.

Going from a velocity of 0 is fine as shown here where my path properly shows my ship (center of the sun) moving to where I clicked just past Venus.

From here I jump a couple of hours and the ship has velocity from constant acceleration. I then give the ship a new destination and this is where I have thoroughly fried my brain the past couple of days.

The red arrow is the destination the ship is tracking, but my flawed math is sending the crew to their death.

var velocity = _velocity;
var position = SystemPosition;
var mid = VectorMath.Midpoint(position, to);
var distanceToMid = Vector2Wide.Distance(position, mid);
var accelerate = true;
var oldDistanceToTarget = distanceToMid;
var acceleration = MaxAccelerationPowerKms;

var alreadyMoving = _velocity != Vector2Wide.Zero;
var oldAcceleration = new Vector2Wide();
var oldDistanceToMid = Vector2Wide.Distance(position, mid);

for (var i = 0; i < 72; i++)
{
var newDirectionToTarget = Vector2Wide.Normalize(Vector2Wide.Subtract(position, to));
var accelerationDirection = new Vector2Wide(1, 1) * -newDirectionToTarget;
if (i == 0 && alreadyMoving)
accelerationDirection = AccelerationDirection;

if (oldAcceleration == Vector2Wide.Zero)
oldAcceleration = accelerationDirection;

{
var angleInRadians = Math.Atan2(position.Y, position.X) - Math.Atan2(to.Y, to.X);

if (i == 0)
Debug.WriteLine(\$"{i + 1} | {angleInRadians} | {accelerationDirection} | {oldAcceleration - accelerationDirection}");
}

var newPosition = PeekPath(TickConstants.HourTicks, position, ref velocity, accelerationDirection, acceleration);
var newDistanceToMid = Vector2Wide.Distance(newPosition, mid);
var newDistanceToTarget = Vector2Wide.Distance(newPosition, to);

if (newDistanceToMid < oldDistanceToMid)

if (accelerate)
{
if (headingTowardsDestination && newDistanceToMid > oldDistanceToMid)
{
//Debug.WriteLine("Decelerating");
acceleration = -acceleration;
oldDistanceToTarget = newDistanceToTarget;
accelerate = false;
i--;
continue;
}

oldDistanceToMid = newDistanceToMid;
}
else
{
if (headingTowardsDestination && oldDistanceToTarget < newDistanceToTarget)
{
break;
}
}

oldDistanceToTarget = newDistanceToTarget;
position = newPosition;

//if (i % (60*60) == 0)
}

Actual movement code:

Vector2Wide PeekPath(long deltaTicks, Vector2Wide currentPosition, ref Vector2Wide velocity, Vector2Wide accelerationDirection, double acceleration)
{
var seconds = deltaTicks / TickConstants.SecondTicks;
var distanceXKm = CalculateDistance(velocity.X, acceleration * accelerationDirection.X, seconds);
var distanceYKm = CalculateDistance(velocity.Y, acceleration * accelerationDirection.Y, seconds);
velocity += accelerationDirection * (acceleration * seconds);

var spaceDistanceX = distanceXKm / CelestialBody.AuKilometer;
var spaceDistanceY = distanceYKm / CelestialBody.AuKilometer;
return currentPosition + new Vector2Wide(spaceDistanceX, spaceDistanceY);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double CalculateDistance(double velocity, double acceleration, double time)
{
return (velocity * time) + (0.5 * (acceleration * (time * time)));
}

I know the code is horribly flawed, but I don't know how much.

Actual Question

With a velocity and direction change, how do I apply or find the proper directional force to apply to my velocity to reach the destination? The more I deviate the direction, the more skewed/off the path gets. It will also not allow me to set a destination opposite direction, but I think that's my own issue with trying to figure out when to decelerate.

I do hate to ask this, but if you give an actual formula, can you please explain with an example? I sadly just don't have the math skills to know how to read them correctly =/

## Update

Thanks to DMGregory great post, I am much closer. Spaceship acceleration for following waypoints

Red arrow points to the destination. The ship has a positive X velocity and the destination is directly above.

The new problem is that I don't know if I am using the correct vector to use for steering. The other issue is that I now have no idea how I am supposed to properly handle or calculate when/where/angle to decelerate so I can actually get to the destination. The crew are still guinea pigs on a no return mission.

for (var i = 0; i < 72; i++)
{
var time = TickConstants.HourTicks;
var seconds = (double) time / TickConstants.SecondTicks;

// A
var startPosition = position;

// B
var halfwayPointNoAcceleration = startPosition + ((seconds /2) * velocity) / CelestialBody.AuKilometer;

// D
var finalPositionNoVelocity = startPosition + (seconds * velocity) / CelestialBody.AuKilometer;

var dRadiusKm = MaxAccelerationPowerKms * (seconds * seconds / 2);

var radianFromCenterDToTarget = Math.Atan2(target.Y - finalPositionNoVelocity.Y, target.X - finalPositionNoVelocity.X);

// C

var directionToSteeringVector = Vector2Wide.Normalize(Vector2Wide.Subtract(steeringVector, finalPositionNoVelocity));

var accelerationDirection = directionToSteeringVector;

position = PeekPath(TickConstants.HourTicks, position, ref velocity, accelerationDirection, acceleration);

}

{
}

• I find it's useful to conceive of your planned trajectory as a Bezier curve. A quadratic Bezier corresponds to a trajectory with constant acceleration. A cubic Bezier corresponds to a trajectory with linearly-varying acceleration, and makes it easier to control the velocity you have as you arrive at the destination. I develop this technique in Spaceship acceleration for following waypoints and How can I maneuver an AI pirate ship for a sea battle. Mar 9 '21 at 0:48
• @DMGregory Thank you. I will start reading these. They look very helpful. Hopefully my brain can actually comprehend them lol Mar 9 '21 at 1:00
• @DMGregory Thanks a lot for the spaceship article. I think I've implemented properly and have updated my question. Any feedback would be most helpful. Mar 10 '21 at 0:36

You're fixing your time horizon as always taking 1 hour to get to your destination.

var time = TickConstants.HourTicks;
var seconds = (double) time / TickConstants.SecondTicks;

Even if you've already spent 59 minutes flying, you continue re-plotting a new trajectory designed to bring you to the destination after 1 hour of additional flight from here - guaranteeing mathematically that you will never reach your goal.

You've also decided to always steer for a point at the outer limit of what you can accelerate to reach, even if your actual target point is closer/further. (In the general case, our target will not sit exactly on this circle, if it does not take exactly one hour to reach from here at max acceleration)

var steeringVector = FindCoordinateOfVectorRadius(finalPositionNoVelocity, dRadius, radianFromCenterDToTarget);

What we want to do instead (if you choose to go with the quadratic approach from the first link) is plan what time horizon we need to reach this point with a single constant acceleration burn. ie. at what time $$\T^*\$$ does point $$\C\$$ lie exactly on the circle of radius $$\\frac {T^{*2}} 2 a_\text{max}\$$?

This involves solving the quartic equation:

$$||\vec C - \vec D|| = \frac {T^{*2}} 2 a_\text{max}\\ T^{*4} \left(\frac {a_\text{max}^2}2 \right) - T^{*2}v^2 - T^* \left(2 \vec v \cdot (\vec C - \vec A)\right) - \left(\vec C - \vec A\right)^2 = 0$$

I won't go into that here, but you can plug that into the math package of your choice and take the smallest positive real solution as your $$\T^*\$$.

Once you've done that, you can calculate your point $$\\vec D = \vec A + T^* \vec v\$$,

And your acceleration vector is then $$\\vec a = \frac {2 (\vec C - \vec D)} {T^{*2}}\$$

And you can compute points along this path as...

for (int i = 0; i <= 100; i++) {
double time = T * i/100.0;
var positionAtTime = startPosition
+ initialVelocity * time
+ acceleration    * time * time / 2.0;
}

Note that we calculate our trajectory just once, then loop over its points to plot it. We don't plan a new trajectory at every iteration of the loop.

This will give you a trajectory travelling through your target point, but you might build up quite a lot of velocity on your way there. If you want to allow for braking or otherwise controlling your velocity at the destination point, you should use the cubic approach from my second link instead.

• Thank you for the information. I will play around with this after work. In regards to the 1 hour time span, I just did that to test the path. If ran what I had coded for every second, the path was almost identical at render scale. So my logic was definitely flawed. I'll look at this and look at the 2nd link again. Thank you Mar 11 '21 at 21:37

I fail to understand your code because it's early morning here and the code looks quite messy on mobile, but I have one thing that I think might be useful to you to determine where to start to decelerate.
You can find the distance threshold where the ship should start to decelerate to stop at the target position with velocity = 0.

The formula is:

float t = velocity / accel;
float d = velocity * t + accel * (t * t) / 2f;

In the case of linear deceleration when you decrease the velocity over time by simple subtraction:  velocity -= accel, the d will be the distance from the target where you should start to do that.
So, you find the distance from current position to target position, and then check if the distance is less than d, and if it is, you decrease the velocity by the acceleration value.


text:
# Definition:Principle of General Induction/Minimally Closed Class/Basis for the Induction

The step that shows that the propositional function $P$ holds for the distinguished $b \in M$ is called the basis for the induction.