TITLE: Deriving $\|Du\|_{L^\infty(U)}\le C(\|Du\|_{L^\infty(\partial U)}+\|u\|_{L^\infty(\partial U)})$ with $u$ being the smooth solution to an elliptic PDE
QUESTION [3 upvotes]: Let $u$ be a smooth solution of the uniformly elliptic equation $Lu=-\sum_{i,j=1}^n a^{ij}(x)u_{x_i x_j}$ in $U$. Assume that the coefficients have bounded derivatives.
Set $v:=|Du|^2+\lambda u^2$ and show that $$Lv \le 0 \quad \text{in }U$$ if $\lambda$ is large enough. Deduce $$\|Du\|_{L^\infty(U)}\le C(\|Du\|_{L^\infty(\partial U)}+\|u\|_{L^\infty(\partial U)}).$$

This is PDE Evans, 2nd edition: Chapter 6, Exercise 8.
I believe I was able to show $Lv \le 0$ for large enough $\lambda$ already. Specifically, given $v$, we obtain $$v_{x_i x_j} = 2[(Du_{x_j}\cdot Du_{x_i}+Du \cdot Du_{x_i x_j})+(\lambda u_{x_j}u_{x_i}+\lambda uu_{x_i x_j})],$$ which means, for large enough $\lambda$, $$Lv=-2\sum_{i,j=1}^n a^{ij}(x) Du_{x_j}\cdot Du_{x_i}-2\lambda\sum_{i,j=1}^n a^{ij}(x)  u_{x_j} u_{x_i} \le 0.$$
But how can I get started on deriving the estimate $$\|Du\|_{L^\infty(U)}\le C(\|Du\|_{L^\infty(\partial U)}+\|u\|_{L^\infty(\partial U)})$$
Any hints on this part would be helpful.

REPLY [2 votes]: I believe this can indeed be handled by the maximum principle.  Since $Lu,Lv\leq0$, it tells us that
$$\max_{\partial U}u=\max_{\overline{U}}u\quad\text{and}\quad\max_{\partial U}v=\max_{\overline{U}}v.$$
It helps considerably to rewrite this in terms of the infinity norm and the definition of $v$, which reads
$$\left\|u^2\right\|_{L^\infty(\partial U)}=\left\|u^2\right\|_{L^\infty(U)}\quad\text{and}\quad\left\||Du|^2+\lambda u^2\right\|_{L^\infty(\partial U)}=\left\||Du|^2+\lambda u^2\right\|_{L^\infty(U)}.$$
Applying the triangle inequality to both sides of the right equation gives
$$\left\||Du|^2\right\|_{L^\infty(\partial U)}+\left\|\lambda u^2\right\|_{L^\infty(\partial U)}\geq\left\||Du|^2\right\|_{L^\infty(U)}-\left\|\lambda u^2\right\|_{L^\infty(U)}$$
So we can then add $\lambda$ times the left equation to this, which gives
$$\left\||Du|^2\right\|_{L^\infty(\partial U)}+2\left\|\lambda u^2\right\|_{L^\infty(\partial U)}\geq\left\||Du|^2\right\|_{L^\infty(U)}$$
We can then add the appropriate terms to the left side (which are all positive, of course) to allow us to complete the square.  Taking square roots then gives exactly the desired estimate.


TITLE: what is inverse limit in this polynomial ring?
QUESTION [5 upvotes]: $F$ is a set,  $A$ and $B$ and finite subsets of $F$, $k$ is a commutative ring, if $A$ is a subset of $B$, considering the canonical map  $k[B] \to k[A]$, that is mapping all elements of $B-A$ to zero. for example $k[x_1,x_2]\to k[x_1]$, it means mapping $x_2$ to zero, and mapping $x_1$ to itself.
what is inverse limit $\varprojlim (k[B] \to k[A]) $ in  Ring category? here, $A \subset B$ and both are finite sets of $F$.
what is inverse limit $\varprojlim (k[B] \to k[A]) $ in Graded Ring category?
here, $A \subset B$ and both are finite sets of $F$.
I think when $F$ is a finite set, the answer to these two questions is $k[F]$.
If $F$ is an infinite set, what are the answers and why?
I think for graded ring case, the answer should be $\bigoplus A_d$, here $A_d$ should be formal k-linear combinations of the degree $d$ monomials in the generators $x_a$, here $a\in F$. I do not know how to prove it is an inverse limit.
for ungraded ring case, I think the answer should be formal series of the form $\sum_{d\geq 0} x_d$, here $x_d \in A_d$, but I am not sure.
Please tell me which step you think is unclear, if you want to close my question.

REPLY [1 votes]: I'm going to have $f_{AB}$ denote the map $k[B]\to k[A]$ that you defined above.
If $F$ is any set, even if it is infinite, we can still define the ring of polynomials $k[F]$ in the variables $x_\alpha$ for $\alpha\in F$. Similarly, we can define the ring of formal power series in these variables which I will denote $k[[F]]$ (which I think is the same as the ring you predicted for the ungraded case).
For the ungraded case, let $R$ denote the subring of $k[[F]]$ where elements satisfy that for each finite subset $A\subseteq F$, the number of monomials that contain only variables $x_\alpha$ for $\alpha\in A$ with a nonzero coefficient is finite. That is, there are finitely many monomials of the form $\prod_{\alpha\in A} x_{\alpha}^{c_\alpha}$ with non-zero coefficient. Let $\pi_A$ then be the projection from $R$ onto $k[A]$ (which is well defined by the construction of $R$).
To show that $R$ together with the projections is the inverse limit we do the following:
First, check that for each finite $A\subseteq B\subseteq F$ where $A$ and $B$ are finite, $\pi_A=f_{AB}\circ \pi_B$
Next, show that the universal property holds. Suppose $Y$ is another ring and for each finite $A\subseteq F$, $\psi_A:Y\to k[A]$ is a ring homomorphism such that for each $A\subseteq B\subseteq F$ ($A$,$B$ finite), $\psi_A=f_{AB}\circ \psi_B$. We want to show that for each such $(Y,\psi_A)$ there exists a unique $u:Y\to R$ such that $\psi_A=\pi_A\circ u$ for each $A$.
To show uniqueness, take some element $y\in Y$ and use the condition that for each $A$, $\psi_A=\pi_A\circ u$ to determine what the coefficients of $u(y)$ must be.
For existence, show that the map you defined above satisfies the condition (Make sure to show that the coefficients gives an element of R).
Notice that in the case where F is finite, $R=k[F]$
For the case of the graded ring category, I think your prediction (which is equivalent to the subring of $k[[F]]$ where each element has the degrees of the monomial terms uniformly bounded) works. To show this, you use the same method to prove it, only this time you will need to work with the gradings.


TITLE: If $R$ is an etale extension of $\mathbb Z$, then $R = \mathbb Z^n$?
QUESTION [10 upvotes]: Related question.
Let $A$ be a ring, and let $B$ be an $A$-algebra which is projective and finite as an $A$-module.  Then the trace $B \rightarrow A$ can be defined.  Let's say that $B$ is separable over $A$ if the trace induces an isomorphism of $A$-modules $B \rightarrow \operatorname{Hom}_A(B,A)$.  For the purposes of this question, let's say that $B$ is an etale $A$-algebra if it is finite, projective, and separable.
Is it true that every etale $\mathbb Z$-algebra is of the form $\mathbb Z^n$?  This is stated in these notes, example 1.1.13(ii).
It does not seem so easy to prove.  If this is true, then combined with the much easier result, "if $L/K$ is an unramified extension of number fields, then $\mathcal O_L$ is an etale $\mathcal O_K$-algebra," we would obtain an algebraic proof that there are no nontrivial unramified extensions of $\mathbb Q$.  I had thought that the only known proofs of this result relied on Minkowski's bound for the discriminant.  Perhaps any proof that etale $\mathbb Z$-algebras are of the form $\mathbb Z^n$ must rely on this fact.

REPLY [4 votes]: Let $X$ be a normal integral scheme. Then $\pi_1^\mathrm{et}(X)$ is isomorphic to $\mathrm{Gal}(K(X)^\mathrm{un}/K(X))$, where $K(X)^\mathrm{un}$ is the compositum of all finite extensions $F$ of $K(X)$ (in a fixed algebraic closure of $K(X)$) for which $X$ is unramified in $F$. Applying this to $X = \mathrm{Spec}(\mathbf{Z})$, it follows the result you are asking about is equivalent to Minkowski's theorem (that there are no nontrivial unramified extensions of $\mathbf{Q}$).


TITLE: How to tell whether a point is to the right or left side of a line
QUESTION [1 upvotes]: I have a line equation in the form ax+by+c=0 and a point p(x,y).How can I determine on which side of the line the point is located?

REPLY [1 votes]: I am assuming you are asking whether the point lies to the left or to the right of a line. Let us take a point Q on the line with coordinates (x1,y) where y is the same coordinate as the point P whose position you want to find out. In other words, P and Q lie on the same horizontal line with Q on the line we know. The x coordinate of the point Q can be calculated by satisfying it in the line given. It gives x1=-(by+c)/a. And, we are done. If the point P lies to the right of the line, then x>x1(you can check easily), or the other case holds.this is 100% correct.


TITLE: Number of numbers $ 0 \leq n \leq 10,000,000$ such that the sum of the digits is at most $34$
QUESTION [8 upvotes]: Calculate how many natural numbers $n$ where $ 0\leq n \leq 10,000,000$ such that the sum of their digits is AT MOST $34$

And I said the following:

We have 8 digits in numbers between $0$ and $10,000,000$. For the first digit there can be only $0$ or $1$. For all rest digits we have all possibilties $[0,...,9]$. So let us do a generating function: $F(x) = (1+x)(1+x+x^2+...+x^9)^7$. We are searching for the coefficients of $1$ and $x$ and $...$ and $x^{34}$. But that is like searching for the coefficient of $x^{34}$ in the generating function $G(x) = (1+x+x^2+...)(1+x)(1+x+x^2+...+x^9)^7$

But how do I continue from there? How can I know the coefficient of $x^{34}$ in $G(x)$?

REPLY [4 votes]: In comments you have correctly reduced the question to determining the coefficient of $x^{34}$ in $(1-x^{10})^7(1-x)^{-8}$. We can reduce modulo $x^{35}$, in which case the first factor becomes $1-\binom71x^{10}+\binom72x^{20}-\binom73x^{30}=1-7x^{10}+21x^{20}-35x^{30}$. Then it suffices to determine in the factor $(1-x)^{-8}$ the terms of degree $34-10k$ for $k=0,1,2,3$, which can be seen to be repectively $\binom{-8}{34}(-x)^{34}=\binom{41}7x^{34}=22481940x^{34}$, $\binom{-8}{24}(-x)^{24}=\binom{31}7x^{24}=2629575x^{24}$, $\binom{21}7x^{14}=116280x^{14}$, and $\binom{11}7x^4=330x^4$. Utlimately I find the coefficient
$$
  22{,}481{,}940x-7\times2{,}629{,}575+21*116{,}280-35*330=6{,}505{,}245.
$$
Just a sanity check: that's more than half of all numbers $n<10^7$; indeed the average sum of $7$ digits is $7\times4.5=31.5$, so it is more likely the sum is at most $34$ than the contrary. The final outcome of course is $6{,}505{,}245+1=6{,}505{,}246$.


TITLE: show that $f = c$ a.e.
QUESTION [1 upvotes]: Let $f \in L_{loc}^1 (\mathbb{R}) $ such that $ \int_{\mathbb{R}} f(x) \phi ' (x) dx = 0$, for every $\phi \in C_c ^{\infty}( \mathbb{R}) $. Show that there exist a $c \in \mathbb{R}$ such that  $f(x) = c$ a.e.
What I did is:
Assume that $f \in C^ {\infty} $. Therefore, for every $a,b \in \mathbb{R}$, $ 0=\int _a ^b ff' = 1/2 (f(b)^2-f(a)^2)$. Considering that $f$ is continuous, we can conclude that $f(a)  = f(b)$.
but i couldn't prove the general case. Any clue?

REPLY [3 votes]: Suppose that
$$
\int_{\mathbb{R}}f(x)\phi'(x)\,\mathrm{d}x=0\tag{1}
$$
for all $\phi\in C_c^\infty$. Then consider the functions
$$
\psi_{a,\lambda}(x)=\left\{\begin{array}{}
0&\text{for $x\lt a$}\\
\frac{x-a}\lambda&\text{for $x\in[a,a+\lambda]$}\\
1&\text{for $x\gt a+\lambda$}\tag{2}
\end{array}\right.
$$
By approximating $\psi_{a,\lambda}-\psi_{b,\mu}$ as close as we want (in $L^\infty$) by $\phi\in C_c^\infty$, we get that
$$
\int_{\mathbb{R}}f(x)\phi'(x)\,\mathrm{d}x\tag{3}
$$
approximates
$$
\frac1\lambda\int_a^{a+\lambda}f(x)\,\mathrm{d}x-\frac1\mu\int_b^{b+\mu}f(x)\,\mathrm{d}x\tag{4}
$$
Since $(3)$ is $0$, we get that $(4)$ must be as well. This means that
$$
\frac1\lambda\int_a^{a+\lambda}f(x)\,\mathrm{d}x=\frac1\mu\int_b^{b+\mu}f(x)\,\mathrm{d}x\tag{5}
$$
Since almost every point is a Lebesgue point of a locally integrable function, $(5)$ means that
$$
f(a)=\int_0^1f(x)\,\mathrm{d}x\tag{6}
$$
for almost all $a\in\mathbb{R}$.


TITLE: Only once differentiable
QUESTION [12 upvotes]: Is there any example of a real function that is one-time-only differentiable, meaning there is $f'(x)$, but no $f''(x)$? I haven't been able to find any example... Of course it would be preferred if f had a closed-form expression and if it wasn't an integral.
Answers on the proposed as duplicate are not quite my case, because in the other post the answer proposed does have a second derivative, just not at 0. I would like the second derivative to exist at no point.

REPLY [23 votes]: Consider the Weierstrass function (https://en.wikipedia.org/wiki/Weierstrass_function); call that $f$. Define
$$
F(x) = \int_0^x f(t) ~dt
$$
Then $F$ is once differentiable everywhere, but twice differentiable nowhere.
I know that this includes an integral, but to be honest, it's hard to avoid that, at least if you want the derivative of your function to not only exist, but be continuous. (It doesn't have to be continuous, but writing down a function where it isn't is probably even messier...and I'm certainly not going to attempt it.)
Any function that's continuously-differentiable everywhere is expressible as an integral. And the integrand in that case, for any function that's everywhere not-twice-differentiable, must be a function that's continuous everywhere but differentiable nowhere ... and the Weierstrass function is the classic example of such a function.
Indeed, if you look carefully at that function's construction, you'll see why it's so tough to create such a thing, and recognize that this is pretty much "the easy case", believe it or not.
Small addendum
Looking back at the definition of the W-function, it's written as a series...which we can integrate term by term. So I guess my revised answer is
this, using the Weierstrass function with $a = 9/10$ and $b = 7$, and eliminating an irrelevant factor of $\pi$:
Let
$$
G(x) = \sum_{n=0}^\infty \frac{9^n}{10^n 7^n} \sin(7^n \pi x)
$$
Then $G$ is continuous and everywhere differentiable, but nowhere twice-differentiable.
Of course, proving that $G$ is once-but-not-twice differentiable is still pretty tough ... but at least you've got a concrete answer to your question. If you read Spivak's Calculus, you can work through a very nice exposition of the Weierstrass function in one of the later chapters, and you'll be able to do the requisite proof when you're finished with that chapter.
Final Informal Remarks
Why isn't there a "simple expression" for such a function, without integrals, or infinite sums? Well, a "simple expression" (in my mind) has only finitely many operations (addition, subtraction, composition, etc.), and the building blocks we like to use are generally continuous and non-constant, and mostly (aside from $x \mapsto |x|$) differentiable.  So while you can get a function that's not differentiable at a countable set of points via something like $x \mapsto |\sin(x)|$, in general such "simple expressions" will be non-differentiable on a tiny set. I suppose that with the right tools and energy you could formulate some kind of proof that finite combinations of a particular set of "basic" functions lead to non-differentiability on at most a set of measure zero. Of course, once you allow "cases" functions (like the characteristic function of the rationals), things can get far worse...but if you're hoping for a "formula" like the ones in algebra I, you're probably not going to find an everywhere-nondifferentiable function among them.

REPLY [12 votes]: I don't think there is a really simple counterexample if you want that $f''$ exists nowhere. The Weierstraß function is a continuous function that is nowhere differentiable. Its antiderivative satisfies the desired conditions.
There are simpler examples for functions that are once differentiable, but don't have a second derivative at a single point. One such function is $f(x) = x \cdot |x|$, whose derivative $f'(x) = 2|x|$ is not differentiable at $0$.


TITLE: Differential system on the torus 2
QUESTION [2 upvotes]: I've got the following question related to my previous post and I was suggested to write a new question, so there you are.
The question is the following: prove that if $f$ is smooth, periodic and with zero average, then the solution to the system on $\mathbb T^2$
$$\begin{cases}\frac{\partial}{\partial y}u'-\frac{\partial}{\partial x}v'=0,\\\\ \frac{\partial}{\partial x} u'+\frac{\partial}{\partial y}v'=f(x,y),\end{cases}$$
satisfies
$$\int_{0}^{2\pi}\int_0^{2\pi}\left(-\cos (y)u'(x,y)+\sin(x)v'(x,y)\right)\mathrm dx\mathrm dy=0.$$
I tried to apply similar techniques to those explained to me in the other question, however it seems that in this case I am not supposed to solve the system explicitly. In particular I cannot see where the condition on the zero mean of $f$ comes into play. Can anybody help me?
Many thanks
Guido

REPLY [2 votes]: It seems to follow if you multiply the first equation by $\cos x + \sin y$ and integrate by parts.


TITLE: Second price auction, page 82-84 of Osborne's An Introduction to Game Theory
QUESTION [2 upvotes]: Consider the second price auction defined and discussed on pages 82-84 of Osborne's An Introduction to Game Theory $($pages 80-82 here in this online draft version of the textbook: Martin J. Osborne, An Introduction to Game Theory$)$. Since a bid equal to his valuation weakly dominates all his other bids, the second price auction game form is straightforward. I am confused as to why this can't be regarded as 1. dictorial, and  2. a counterexample to Gibbard's Theoren.

REPLY [2 votes]: The second price auction is not dictatorial, because the outcome is not dependent on a single bidder's report. Although single price auction is strategy-proof $($because the game form is straightforward$)$, has more than three alternatives, and is not dictatorial as we have shown above, it is not a counterexample to Gibbard-Satterthwaite. In Gibbard-Satterthwaite, it is $($perhaps tacitly$)$ assumed that individuals are allowed to have any preference over the set of alternatives. This is not the case in second price auction.
To see this, let us explicitly write down what the possible set of alternatives are in second price auction. With $n$ bidders, the outcome is expressed in terms of $(x_i,\, p_i)_{i=1}^n$ where $x_i = 1$ denotes that the object is allocated to $i$ and $p_i$ denotes the payment $i$ makes. We have $\sum_i x_i \le 1$, $x_i = \{0,\,1\}$, and $p_i \ge 0$. In second price auction, bidder $i$ can only express her preference by submitting report $r_i \in \mathfrak{R}_+$. The report confines the preference of bidder $i$ to something that says $``$I like winning, given that payment $p_i$ is less than $r_i$. I also want to pay less given the allocation of the good.$"$ This is a strict subset of all the possible preferences over alternatives.


TITLE: Prove that $ \lim_{N\to \infty} \sum_{n=1}^N \frac{1}{\phi(n)} $ exists or does not exist
QUESTION [2 upvotes]: Prove that the limit exists or does not exist:
$$ \lim_{N\to \infty} \sum_{n=1}^N \frac{1}{\phi(n)}, $$
where $\phi(n)$ is the Euler Totient function.
The ratio test was inconclusive.
I'm fairly sure the p-series test says this series diverges because $p=1$ but then again in this case I'm not sure how to deal with a function in the place where $n$ normally is.

REPLY [3 votes]: A way of proof is the following:
$\dfrac{1}{p-1}\gt \dfrac1p$ and $\phi(p)=p-1$ then $$\sum_{n=1}^N \dfrac{1}{\phi(n)}\gt\sum_{p\text { prime}}^N \dfrac{1}{\phi(p)}\gt\sum_{{p\text { prime}}}^N \dfrac{1}{p}\to \infty$$ (because of the Euler's proof of the infinity of primes).


TITLE: Find an eigenvector of M corresponding to eigenvalue k
QUESTION [0 upvotes]: It is given that $M - kI$=
 \begin{bmatrix}a_{11}&a_{12}\\1&\pi\end{bmatrix}
And I know that for $M$ (which is 2 x 2 matrix), there are two unique eigenvalues such that one of them is $k$.
FYI, I don't have any other info on $a_{11}$ and $a_{12}$.
Thanks!

REPLY [0 votes]: Hint: Since $k$ is an eigenvalue of $M$, $M - kI$ is singular. So that, we have $a_{12} = a_{11}\pi$ and $a_{11}$ is arbitrary. Now, can you find an eigenvector?

REPLY [0 votes]: Hint If $k$ is an eigenvalue, the rows of $M-kI$ are linearly dependent. Since $M-kI$ is a $2 \times 2$ matrix, this means they are proportional.
Alternate solution Let $v\begin{bmatrix} a \\ b \end{bmatrix}$ be the corresponding eigenvector. Then
$$\begin{bmatrix}a_{11}&a_{12}\\1& \pi \end{bmatrix}\begin{bmatrix} a \\ b \end{bmatrix}=(M-kI)v=Mv-kV=0$$
Therefore,
$$a_{11}a+a_{12}b=0 \\
a + \pi b=0 $$
Just solve the second equation.


TITLE: How does the Carnot Cycle work?
QUESTION [4 upvotes]: I am learning the Carnot cycle, which consists of four transformations for a fluid.
In the first two transformations the volume of the fluid expands, generating work.
This happens in two steps:

First, we approach a hot source and the gas expands and work is generated (okay, temperature increases and fluid wants to expand → the generated work comes 100% from the consumed heat, because the internal energy did not change during the isothermal process)
Then we remove the hot source and the gas is supposed to keep expanding (Question A: Not really sure how the gas keeps expanding after we remove the hot source. If no heat source is close, it seems logic to expect that the expansion will just stop. Why would it want to continue? Expansion means work done. Since there is no heat flow, the gas would be losing internal energy. Why would the gas want to lose internal energy to create work?).

In the second two transformations the volume of the fluid decreases.
This happens in two steps:

First, we approach a cold source, so the fluid naturally flushes some heat away to the cold source and hence decreases its temperature and hence decreases its volume. (That is quite reasonable).
Finally, the fluid keeps compressing, automatically increasing its temperature and pressure, coming back to state number 1 (Question B: How can expect the fluid to keep being compressed automatically? Being this an adiabatic process and an increase in temperature, this means work must be done on the system. Who is doing this work?).

1 and 3 are based on putting a thermal source close to the fluid so nature will do what it does, according to the second law.
But 2 and 4 seem like magic to me, since I don't understand what goes on behind the scenes.
There is a similar question but I still don't get it. Thought it was better to create a new question, rather than commenting on an old one. Also, this way I can expose my complete point of view on the case.
I would also like to understand how this relates to the efficiency of the carnot cycle.
Which comes from something like:
$$\dfrac{GeneratedWork}{GivenEnergy}=\dfrac{HeatIn-HeatOut}{HeatIn}$$
This is understandable but then it goes on like:
$$\dfrac{HeatIn-HeatOut}{HeatIn} = 1 - \dfrac{T_{cold}}{T_{hot}}$$
There are two confusions with this:
Question C.
How is it possible to mix heat and temperature in such an easy way?
This is almost like saying that heat = temperature.
Also, I understood heat is never absolute, but a variation. While temperature is actually an absolute measure.
Question D.
If 4 actually requires external work for the compression, how come is this applied work not reflected in the efficiency? (maybe it is, but I do not see it)
UPDATE:
This video is very helpful: https://youtu.be/d6eJ8mccvu0&t=939

REPLY [6 votes]: The typical depiction of the Carnot Cycle is with the use of a closed cylinder containing an ideal gas fitted with a piston with a shaft that extends outside the cylinder to interact with the surroundings. In the following I will refer to the fluid as an ideal gas.

First, we approach a hot source (okay, temperature increases and fluid
  wants to expand)

The first process is reversible isothermal (constant temperature) expansion. The temperature does not increase. For an ideal gas that means the product of the pressure and volume is constant. As the volume expands the pressure resisting the expansion  by the surroundings must proportionately decrease. The work done in the expansion exactly equals the heat added and the change in internal energy is zero. By the first law $\Delta U=Q-W$. Since $\Delta U=0$, we have $Q=W$ and $Q=T_{HOT}\Delta S$ where $\Delta S$ is the change in entropy.

Then we remove the hot source (Question A: Not really sure how the
  fluid keeps expanding after we remove the hot source. If no heat
  source is close, it seems logic to expect that the expansion will just
  stop.).

The second process is a reversible adiabatic (no heat transfer) process. The answer to question A is the gas keeps expanding because the external pressure is gradually intentionally reduced to allow the expansion to continue. Since $Q=0$ the work done in the expansion is at the expense of the internal energy, $\Delta U=- W$. Note that $W$ is considered positive when the gas does work on the surroundings (expands).

First, we approach a cold source, so the fluid naturally flushes some
  heat away to the cold source and hence decreases it's temperature and
  hence decreases its volume.

The third process is a reversible isothermal (constant temperature) compression. This is the same as the first process in reverse. In this case surroundings does work on the gas equal to the heat transfer out of the out of the gas to the surroundings.

Finally, the fluid keeps compressing, automatically increasing its
  temperature and pressure, coming back to state number 1 (Question B:
  How can expect the fluid to keep being compressed automatically?).

The fourth and final process is a reversible adiabatic compression. It is the same as the second process only in reverse such that work is done on the gas by the surroundings as opposed to the gas doing work on the surroundings. The answer to question B is the gas is not compressed "automatically". An external agent in the surroundings exerts pressure slightly greater than the gas pressure in order to compress the gas.

But 2 and 4 seem like magic to me, since I don't understand what goes
  on behind the scenes.

Think about the cycle being performed by a piston and cylinder with the piston shaft connected to something outside the cylinder. Basically, what goes on behind the scenes, which is outside the cylinder, is an external agent (the surroundings) is either exerting a pressure on the gas slightly greater than the pressure of the gas in order to compress the gas (process 4) or exerts a pressure slightly less than the pressure of the gas allowing it to expand (process 2). It is important to note that the positive work done by the gas in process 2 exactly equals the  negative  work done on the gas in process 4, so the net work done for the two processes is zero.
For processes 1 and 3 the pressure exerted by the external agent also accommodates the expansion or compression of the gas. But in these cases it does so in such a way that the temperature of the gas remains constant.

Question C.
How is it possible to mix heat and temperature in such an easy way?
This is almost like saying that heat = temperature.

In equating the efficiency on the left with the relationship of temperatures on the right you are leaving out the important in between steps.
The net work generated is
$$W_{net}=Q_{IN}-Q_{OUT}$$
This equates energy terms. Then for the two isothermal processes, where $\Delta S$ is the change in entropy, we have the following:
$$Q_{IN}=T_{HOT}\Delta S$$
$$Q_{OUT}=T_{COLD}\Delta S$$
Efficiency is give by
$$ϒ=\frac{Q_{IN}-Q_{OUT}}{Q_{IN}}$$
Substituting we have
$$ϒ=\frac{T_{HOT}\Delta S-T_{COLD}\Delta S}{T_{HOT}\Delta S}$$
Which simplifies to
$$ϒ=1-\frac{T_{COLD}}{T_{HOT}}$$

Question D.
If 4 actually requires external work for the compression, how come is
  this applied work not reflected in the efficiency? (maybe it is, but I
  do not see it)

As indicated above, the adiabatic compression work done on the gas in process 4 exactly equals the adiabatic expansion work done by the gas in process 2. That means they cancel out and are not part of the efficiency calculation.
Hope this helps.


TITLE: How to reconcile Godel's theorem with the completeness of the Predicate Calculus?
QUESTION [4 upvotes]: In Mendelson's Introduction to Mathematical Logic, the proof of Godel's Theorem for S (his axiomatic arithmetic) goes via proving that a sentence that can be interpreted as "This statement has no proof in S" cannot be proved either false or true in S, if S is consistent.
According to the completeness of the Predicate Calculus, any logically valid wf of a theory K is a theorem of K. The statement I interpret as "This statement has no proof in S" cannot be proved either false or true, so I presume that there are models of arithmetic (or rather of axiom system S) in which it is false, and models in which it is true. Is this correct?
A model of arithmetic in which it is true seems sane enough. Are there models of S in which a proof of  what is interpreted as "This statement has no proof in S" turns up as some sort of non-standard number, or have I got completely confused? I have a vision in my mind of a non-standard number encoding "1 is not a proof of S. 2 is not a proof of S. 3 is not a proof of S...." or in some other way satisfying the equation that asserts that X is a proof of Y, if not the mathematician posing the equation :-)

REPLY [4 votes]: A model of arithmetic in which the G"odel sentence "I am unprovable" is false is necessarily a non-standard model.  It contains an infinite element which satisfies, in the model, the formula expressing the property of being a proof of the G"odel sentence --- a formula that is not satisfied by any standard natural number (not even in a non-standard model).


text:
\subsection{Numerical illustration}\label{sec:numerical aalen}

We now present a numerical experiment to  highlight the impact of  an empirical prior distribution for finite sample sizes $n$, in the case of an inhomogeneous Poisson process.   Let $(W_{i})_{i= 1 \dots N(T)}$ be  the  observed points of the process $N$ over $[0,T]$, $N(T)$ being the observed number of jumps over $[0,T]$. We recall that the intensity function has the form $n \lambda_0(t) = n M_{\lambda_0} \overline{\lambda_0}(t)  $ ($n$ being known) where $\int_{0}^T \overline{\lambda}(t)dt=1$. \\

\noindent The estimations of $M_{\lambda_0}$ and $\overline{\lambda_0}$ can be done separately, given the factorisation in \eqref{loglik:aalen}. Provided the use of a Gamma prior distribution on $M_{\lambda_0}$ ($M_{\lambda_0} \sim \Gamma(a_M,b_M)$),   we have
$$M_{\lambda_0} |N \sim \Gamma(a_M+N(T),  b_M + n). $$
The non-parametric Bayesian estimation of $\overline{\lambda}$ is more involved. However in the case of Dirichlet process mixtures of uniforms as a prior model on $\bar \lambda$ we can use the same algorithms as those considered for density estimation. In this Section we restrict ourselves to the case where the base measure in the Dirichlet process is the second possibility in \eqref{base:mono}, namely $G_{\gamma} =_{\mathcal{D}} \left[\frac{1}{T} + \frac{1}{ \Gamma(a,\gamma)}\right]^{-1}$. It satisfies the assumptions of Theorem \ref{cor:EB} and also presents computational advantages.
Hence, three hyperparameters are involved in this prior, namely $A$ the mass of the Dirichlet process, $a$ and $\gamma$.   The hyperparameter $A$ strongly conditions the number of classes in the posterior distribution of $\overline{\lambda}$. In order  to mitigate its  influence on  the posterior,  we propose to consider a hierarchical approach and set a Gamma prior distribution on $A$: $A \sim \Gamma(a_A, b_A)$. In the absence of additional information, we set $a_A = b_A = 1/10$, corresponding to a weakly informative prior. Theorem \ref{cor:EB} applies for any $a>1$. We arbitrarily set $a= 2$, the influence of $a$ is not studied in this paper.
We compare three strategies for the determination of $\gamma$ in our simulation study.
\begin{enumerate}
 \item[] \emph{Strategy 1: Empirical Bayes -}
We propose the following empirical estimator:
\begin{equation}\label{eq:formula gamma emp}
\widehat{\gamma}_n = \Psi^{-1} \left[\overline{W}_{N(T)} \right]
\end{equation}
which comes from the following equality:
  \begin{eqnarray*}
 \mathbb{E}\left[\overline{W}_{N(T)} | N(T)\right]  = \mathbb{E}\left[  \left. \frac{1}{N(T)} \sum_{i=1}^{N(T)} W_i \;  \right\rvert N(T) \right]
 &=&  \int_{0}^T t\int_{\theta}  \frac{1}{\theta} \ind_{[0, \theta]}(t)dG_{\gamma}(\theta) \; dt
 \\

& =& \frac{\gamma^a}{2\Gamma(a)}  \int_{\frac{1}{T}}^{\infty}   \frac{ e^{-\gamma/(\nu-\frac{1}{T})}}{(\nu-\frac{1}{T})^{(a+1)}}      \frac{1}{\nu}  d\nu  := \Psi(\gamma)
 \end{eqnarray*}
\item[] \emph{Strategy 2:   Fixed $\gamma$ -} In order to avoid the empirical prior, one can fix $\gamma=\gamma_0$. In order to study the impact of a bad choice of $\gamma$ on the behaviour of the posterior distribution, we propose to choose $\gamma_0$  far from a well calibrated  value for $\gamma$, which would be
$\gamma^* =   \Psi^{-1}(E_{theo})$ with   $E_{theo} = \mathbb{E}\left[W | N(T)\right]$. Since,  in the simulation study, we know the true $\lambda_0$, $\gamma^*$ can be computed  and  we consider
\begin{equation}\label{eq:formula gamma 0}
\gamma_0 = \rho  \cdot  \Psi^{-1}(E_{theo}), \quad \mbox{ where } \quad E_{theo} = \int_0^T t \overline{\lambda}(t) dt, \quad \rho \in \{ 0.01, 30, 100\}
 \end{equation}

  \item[] \emph{Strategy 3: Hierarchical Bayes -} We consider a hierarchical prior on $\gamma$ given by:
 $$  \gamma \sim \Gamma(a_\gamma, b_\gamma)$$
In order to make a fair comparison with the empirical posterior, we center the prior distribution on $\widehat{\gamma}$.  Besides, in the simulation study, we set two different hierarchical hyperparameters $(a_{\gamma},b_{\gamma})$, corresponding to two  prior variances. More precisely,
$(a_{\gamma},b_{\gamma})$ are such that   the prior expectation is equal to $ \widehat{\gamma}$ and the prior variance is $ \sigma_{\gamma}^2$, the values of $\sigma_{\gamma}$ being specified in Table \ref{tab:num_comput_times}.
 \end{enumerate}

\noindent Samples from the posterior distribution of $(\overline{\lambda}, A, \gamma)| \Nb$  are generated  using a Gibbs algorithm, decomposed into two or three steps:
$$[1] \quad  \overline{\lambda} | A, \gamma, \Nb \quad \quad [2] \quad    A | \overline{\lambda}, \gamma, \Nb   \quad\quad [3] ^\dagger  \quad \gamma | A, \overline{\lambda}, \Nb,  $$
step $ [3]^\dagger$ only existing  if  a fully Bayesian strategy is adopted on the hyperparameter $\gamma$ (strategy 3).

 We use the algorithm developed by \cite{fall2012} whose details are given in  Appendix  \ref{sec:details algo}.

\noindent The various strategies for calibrating the hyperparameter $\gamma$ are tested on $3$ different intensity functions (non null over $[0,T]$, with $T=8$):
\begin{eqnarray*}
 \lambda_{0,1}(t) &=&  \left[ 4 \; \ind_{[0,3]}(t) + 2\; \ind_{[3,8]}(t) \right] \\
\lambda_{0,2}(t) &=& e^{-0.4 t}\\
\lambda_{0,3}(t) &=&\left[ \cos^{-1}\Phi(t)\ind_{[0,3]}(t)  - ( \frac{1}{6} \cos^{-1}\Phi(3) t - \frac{3}{2} \cos^{-1}\Phi(3)) \ind_{[3,8]}(t) \right]
 \end{eqnarray*}
 where $\Phi$ is the probability function of the standard normal distribution.
 For each intensity $\lambda_{0,1}$, $\lambda_{0,2}$ and $\lambda_{0,3}$,  we simulate $3$ datasets corresponding to $n=500, 1000,2000$ respectively.  The histograms of the 9 datasets  with the true corresponding normalized intensities  $\overline{\lambda_{0,i}}$ are plotted on Figure \ref{fig:data aalen}.   In the following we denote by $\mathbf{D}^i_{n}$ the dataset associated with $n$ and intensity $ \lambda_{0,i}$.
 \begin{figure}[htpb]
 \begin{center}
  \includegraphics[width = \linewidth]{plot_new/figure_data_intens1.pdf}\\
 \includegraphics[width = \linewidth]{plot_new/figure_data_intens2.pdf}\\
  \includegraphics[width = \linewidth]{plot_new/figure_data_intens3.pdf}\\
 \end{center}
   \caption{\emph{Simulation study on the Poisson process}: simulated data from intensity  $n\lambda_{0,1}$  (first line), $n \lambda_{0,2}$ (second line), $n \lambda_{0,3}$  (third line), with $n=500$ (first column), $n=1000$ (second column), $n=2000$ (third column). }
\label{fig:data aalen}
\end{figure}
 For each dataset, we adopt the 3 exposed strategies to calibrate $\gamma$.  The posterior distributions are sampled
 using $30000$ iterations of which are removed a burn-in period of $15000$ iterations.

To compare the three  different strategies  used to calibrate $\gamma$, several criteria are taken into account: tuning of the hyperparameters,  quality of the estimation, convergence of the MCMC, computational time. In terms of tuning effort on $\gamma$, the empirical Bayes  (strategy 1) together with the fixed $\gamma$ approach are comparable and significantly simpler than the hierarchical one, which increases the space to be explored by the MCMC algorithm and consequently slows down its convergence. Moreover,  setting an hyper-prior distribution on $\gamma$ requires to choose the parameters of this additional distribution ($a_{\gamma}$  and $b_{\gamma}$) and thus postpone the problem, even though these second order hyperparameters are supposed to be less influential.

 In our particular example, computational time, for a fixed number of iterations here equal to $N_{iter} = 30000$, turned out to be also a key point. Indeed,  the simulation of the $\bar \lambda$  conditionally to the other variables involves an  accept-reject (AR) step.
 For some particular values of $\gamma$ (small values of $\gamma$), we observe that the acceptance rate of the AR step can be dramatically low, automatically inflating the execution time of the algorithm, this phenomenon occurring randomly. The computational times (CpT) are summarized in  Table \ref{tab:num_comput_times}, which also provides for each of the $9$ datasets   the number of points  ($N_T$), the   $\hat{\gamma}$ computed using formula (\ref{eq:formula gamma emp}) and to be compared with the targeted value $\Psi^{-1}(E_{theo})$, the perturbation factor $\rho$ used in the fixed $\gamma$ strategy and the standard deviation of the prior  distribution of $\gamma$ $\sigma_{\gamma}$ (the prior mean being $\hat{\gamma}$) used in the two hierarchical approaches. The second hierarchical prior distribution (last columns of Table \ref{tab:num_comput_times})  corresponds to a prior distribution more concentrated around the empirical value  $\hat{\gamma}$. \\
 \noindent On Figure \ref{fig:estim1} (respectively \ref{fig:estim2} and \ref{fig:estim3}), we plot for each strategy and each dataset the posterior median of $\overline{\lambda}_1$ (respectively $\overline{\lambda}_2$ and $\overline{\lambda}_3$)  together with a   pointwise credible interval using the $0.1$\% and $0.9$\% empirical quantiles obtained from the posterior simulation. Table \ref{tab:dist} gives the distances between the estimated normalized intensities $\widehat{\overline{\lambda}}_i$ and the true $\overline{\lambda}_i$, for each dataset and each prior setting.

\noindent  On $\lambda_{0,1}$ (which a simple 2-steps function), the 4 strategies lead to the same quality of estimation (in term of losses / distances between the functions of interest).  In this case, it is thus interesting to have a look at the computational time in Table \ref{tab:num_comput_times}. We notice that for a small $\gamma_0$ or for a diffuse prior distribution on $\gamma$ (so possibly generating small values of $\gamma$) the computational time explodes. In practice, this phenomenon can be so critical that the user may have to stop the execution and re-launch the algorithm. Moreover, interestingly the  posterior mean of the number of non empty components in the mixture (computed  over the last 10000 iterations)  is equal in the case  $n= 500$ to $4.21$ in the empirical strategy, $11.42$ when $\gamma$ is fixed arbitrarily,  $6.98$ under the hierarchical large  prior and $3.77$ with the narrow hierarchical prior.  In this case choosing a small value of $\gamma$ leads to a posterior distribution on mixtures with too many non empty components.  This phenomena tends to disappear when $n$  increases.

 For $\lambda_{0,2}$ and $\lambda_{0,3}$, a bad choice of $\gamma$ - here $\gamma$  too large in strategy 2 - or a not enough informative prior on $\gamma$ (hierarchical prior with large variance)  has a significant negative impact on the behavior of the posterior distribution. Contrariwise, the  medians of the empirical and the informative hierarchical posterior distribution of $\lambda$ have similar losses, as seen in Table  \ref{tab:dist}.

\begin{table}
\centering
\begin{tabular}{|ccc||cc|cc|cc|cc|}
\hline
&&& \multicolumn{2}{c|}{Empirical} & \multicolumn{2}{c|}{$\gamma$ fixed } &\multicolumn{2}{c|}{Hierarchical}& \multicolumn{2}{c|}{Hierarchical 2} \\
&&$N_T$&$\widehat{\gamma}$&CpT& $\rho   \Psi^{-1}(E_{theo})$ & CpT & $\sigma_{\gamma}$ & CpT&$\sigma_{\gamma}$ & CpT\\
\hline
\multirow{3}{*}{$\lambda_{0,1}$} & $D^1_{500}$ &499 &0.0386 & 523.57 &\multirow{3}{*}{$0.01\times  0.0323$} & \underline{2085.03} &\multirow{3}{*}{ 0.005} & \underline{12051.22} & \multirow{3}{*}{ 0.001}  & 447.75 \\
& $D^1_{1000}$   & 1036 & 0.0372 & 783.53 &  & \underline{1009.58} & & 791.28 &  & 773.33 \\
 &$D^1_{2000}$   & 2007 & 0.0372 & 1457.40 & & 1561.64 & & 1477.50 & & 1456.03 \\
 \hline
\multirow{3}{*}{$\lambda_{0,2}$} & $D^2_{500}$ & 505& 0.6605 & 1021.73 &\multirow{3}{*}{$100  \times   0.6667$}  & 1022.59 &\multirow{3}{*}{0.1} & 663.54 & \multirow{3}{*}{0.01}  & 1047.42 \\
 &$D^2_{1000}$  & 978 & 0.6857 & 1873.05 & & 1416.40 & & 1207.07 &  & 2018.89 \\
 &$D^2_{2000}$  & 2034 & 0.6827 & 4849.80 &  & 2236.02 && 2533.62 &  & 4644.55 \\
 \hline
  \multirow{3}{*}{$\lambda_{0,3}$} & $D^3_{500}$&483 & 0.4094 & 782.19 &  \multirow{3}{*}{$30 \times   0.4302$}  & 822.12 & \multirow{3}{*}{0.1}  & 788.14 & \multirow{3}{*}{0.01}  & 788.00 \\
  &$D^3_{1000}$& 1058 & 0.4398 & 1610.47 & & 2012.96 & & 1559.17 &  & 1494.75 \\
 &$D^3_{2000}$ & 2055 & 0.4677 & 3546.57 & & \underline{9256.71} &  & 3179.96 & & 2770.83 \\
   \hline
\end{tabular}
\caption{Values of $\gamma$ (or  the hyperparameters of its prior distribution)
 and computational time required for the Gibbs algorithm with $30000$ iterations. $N_T$: number of observations for each dataset $D^i_{n}$.  CpT: Computational Time. $\sigma_{\gamma}$: standard deviation of the prior distribution on $\gamma$}
\label{tab:num_comput_times}
\end{table}

\bigskip

\begin{table}
\centering
\begin{tabular}{|cc| lll | lll | lll | }
\hline
&& \multicolumn{3}{c|}{$\lambda_{0,1}$} & \multicolumn{3}{c|}{$\lambda_{0,2}$}  & \multicolumn{3}{c|}{$\lambda_{0,3}$} \\
&&$D^1_{500}$ & $D^1_{1000}$ &$D^1_{2000}$ &$D^2_{500}$ & $D^2_{1000}$& $D^2_{2000}$& $D^3_{500}$ &$D^3_{1000}$ & $D^3_{2000}$ \\
\hline

\multirow{4}{*}{$d_{L_1}$} &  Empir& 0.0246 & 0.0238 & 0.0207 & 0.0921$^*$ & 0.0817$^*$ & 0.0549$^*$ & 0.1382 & 0.0596 & 0.0606 \\
& Fixed  & 0.0161 & 0.0219 & 0.0211 & 0.5381 & 0.7221 & 0.6356 & 0.3114 & 0.2852 & 0.2885 \\
&Hierar & 0.0132 & 0.0233 & 0.0317 & 0.1082 & 0.1280 & 0.0969 & 0.2154 & 0.1378 & 0.1405 \\
& Hiera 2 & 0.0191 & 0.0240 & 0.0208 & 0.0925$^*$ & 0.0815$^*$ & 0.055$^*$2 & 0.1383 & 0.0607 & 0.0724 \\
\hline
\multirow{4}{*}{$d_{L_2}$} &  Empir& 0.0014 & 0.0006 & 0.0006 & 0.0010 & 0.0010 & 0.0008 & 0.0008 & 0.0005 & 0.0006 \\
& Fixed & 0.0014 & 0.0006 & 0.0006 & 0.0251 & 0.0376 & 0.0378 & 0.0084 & 0.0095 & 0.0104 \\
&Hierar   & 0.0005 & 0.0006 & 0.0020 & 0.0033 & 0.0050 & 0.0034 & 0.0066 & 0.0070 & 0.0072 \\
& Hiera 2 & 0.0009 & 0.0006 & 0.0006 & 0.0011 & 0.0011 & 0.0009 & 0.0009 & 0.0005 & 0.0013 \\
\hline
\multirow{4}{*}{$\| \cdot \|_{\infty}$}  &Empir & 0.0909 & 0.0909 & 0.0909 & 0.1828 & 0.1369 & 0.0833 & 0.1421 & 0.0462 & 0.0428 \\
  & Fixed &  0.0909 & 0.0909 & 0.0909 & 0.3261 & 0.5022 & 0.4271 & 0.1707 & 0.1818 & 0.2020 \\
 &Hierar & 0.0909 & 0.0909 & 0.0909 & 0.2330 & 0.2007 & 0.1389 & 0.2154 & 0.1000 & 0.1190 \\
  &Hierar2 & 0.0909 & 0.0909 & 0.0909 & 0.1886 & 0.1413 & 0.0835 & 0.1515 & 0.0513 & 0.0555 \\
\hline
\end{tabular}
\caption{Distances between the estimated   and the true density  for all datasets  and all strategies. Distance $L_1$ in horizontal block one, distance $L_2$ in horizontal  block two, distance $\|\cdot \|_{\infty}$ in horizontal  block three.    }
\label{tab:dist}
\end{table}

\begin{figure}
\centering
\begin{tabular}{ccc}
$D^1_{500}$ & $D^1_{1000}$& $D^1_{2000}$ \\
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d1_empir.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d2_empir.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d3_empir.pdf} \\\includegraphics[width=0.33\textwidth]{plot_new/intens1_d1_fixe.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d2_fixe.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d3_fixe.pdf} \\
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d1_hierar.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d2_hierar.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d3_hierar.pdf} \\
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d1_hierar2.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d2_hierar2.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens1_d3_hierar2.pdf}
\end{tabular}
\caption{Estimation of $\overline{\lambda}_1$ from $D_{500}^1$ (first column), $D_{1000}^1$ (second column) and $D_{2000}^1$ (third column) using the four strategies: empirical prior (line 1), fixed $\gamma$ (line 2), hierarchical empirical prior (line 3), concentrated hierarchical empirical prior (line 4) . True density (plain line), estimation (dashed line) and confidence band (dotted lines)     }
\label{fig:estim1}
\end{figure}

\begin{figure}
\centering
\begin{tabular}{ccc}
$D^2_{500}$ & $D^2_{1000}$& $D^2_{2000}$ \\
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d1_empir.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d2_empir.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d3_empir.pdf} \\\includegraphics[width=0.33\textwidth]{plot_new/intens2_d1_fixe.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d2_fixe.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d3_fixe.pdf} \\
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d1_hierar.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d2_hierar.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d3_hierar.pdf} \\
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d1_hierar2.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d2_hierar2.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens2_d3_hierar2.pdf}
\end{tabular}
\caption{Estimation of $\overline{\lambda}_2$ from $D_{500}^2$ (first column), $D_{1000}^2$ (second column) and $D_{2000}^2$ (third column) using the four strategies: empirical prior (line 1), fixe $\gamma$ (line 2), hierarchical empirical prior (line 3), concentrated hierarchical empirical prior (line 4) . True density (plain line), estimation (dashed line) and confidence band (dotted lines)     }
\label{fig:estim2}
\end{figure}

\begin{figure}
\centering
\begin{tabular}{ccc}
$D^3_{500}$ & $D^3_{1000}$& $D^3_{2000}$ \\
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d1_empir.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d2_empir.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d3_empir.pdf} \\\includegraphics[width=0.33\textwidth]{plot_new/intens3_d1_fixe.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d2_fixe.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d3_fixe.pdf} \\
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d1_hierar.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d2_hierar.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d3_hierar.pdf} \\
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d1_hierar2.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d2_hierar2.pdf} &
\includegraphics[width=0.33\textwidth]{plot_new/intens3_d3_hierar2.pdf}
\end{tabular}
\caption{Estimation of $\overline{\lambda}_3$ from $D_{500}^3$ (first column), $D_{1000}^3$ (second column) and $D_{2000}^3$ (third column) using the four strategies: empirical prior (line 1), fixe $\gamma$ (line 2), hierarchical empirical prior (line 3), concentrated hierarchical empirical prior (line 4) . True density (plain line), estimation (dashed line) and confidence band (dotted lines)     }
\label{fig:estim3}
\end{figure}

config: arxiv


TITLE: How to solve a nonlinear equation?
QUESTION [2 upvotes]: I'm going to ask my question, explain my problem, show how I thought to solve the problem and where I got stuck, and then re-state my question.
Question: how might I solve this equation:
$$\tag{1} Re_{p}(S)=\frac{S}{1+0.15Re_{p}^{0.687}}$$
for $Re_{p}(S)$?
Explanation of my problem: I am trying to follow a paper, it goes like this:
The settling velocity for a particle falling in a viscous fluid under gravity is
$$\tag{2} v_g=\sqrt{\frac{4}{3} \frac{dg}{C_D} \left(\frac{\rho_p-\rho}{\rho}\right)}$$
where $C_D$ is the drag coefficient, a function of the particle Reynolds number
$$\tag{3} Re_p=\frac{v_g d}{\nu}$$
The correlation for $C_D$ is given as
$$\tag{4} C_D=\frac{24}{Re_p}\left(1+0.15Re_{p}^{0.687}\right)$$
The three equations (2)-(4) can be reduced to a single nonlinear equation with respect to the Reynolds number
$$\tag{5} Re_{p}(S)=\frac{S}{1+0.15Re_{p}^{0.687}}$$
where
$$\tag{6} S=\frac{d^3 g}{18 \nu^2}\left(\frac{\rho_p-\rho}{\rho}\right)$$
The authors of the paper then say the solution of Eqn (5) is shown in the Figure below (as the solid line), which allows one to find the settling velocity
$$\tag{7} v_g=\frac{\nu Re_p(S)}{d}$$
as a function of the settling number $S$.

How I thought to solve the problem and where I got stuck: I thought I might be able to solve for $Re_p(S)$ by rearranging Eqn (1) as so
$$\tag{8} S=Re_p(1+0.15Re_p^{0.687})$$
distributing
$$\tag{9}S=Re_p+0.15Re_p^{1.687}$$
and then procede by performing the "completing the square" method, e.g., dividing through by $0.15$:
$$\tag{10} Re_p^{1.687}+\frac{Re_p}{0.15}=\frac{S}{0.15}$$
and then completing the square by adding $\left(\frac{Re_p}{0.3}\right)^2$ to both sides:
$$\tag{11} Re_p^{1.687}+\frac{Re_p}{0.15}+\left(\frac{Re_p}{0.3}\right)^2=\frac{S}{0.15}+\left(\frac{Re_p}{0.3}\right)^2$$
However, since my first term on the LHS is not to the power of 2 I can't proceed to simplify the LHS.
Back to the question: How did the authors of the paper solve Eqn(1) to produce the solid line in the figure given above?  (Solved for $Re_p(S)$)
(Also, please let me know if my question title is appropriate for the question I am asking)

REPLY [1 votes]: As already said, you need some numerical method to solve the nonlinear equation
$$S=R+k\,R^{\,a}\qquad \text{with}\qquad k=0.15\qquad \text{and}\qquad a=1.687$$ and, as usual, if you want to save iterations, you need a "good" guess for starting.
Playing with inequalities, you know that the solution is somewhere between
$$R_1=\frac S {1+k}\qquad \text{and}\qquad R_2=\left(\frac S {1+k}\right)^{1/a}$$
So, let us take as estimate the geometric mean of these bounds $$R_0=\sqrt{R_1 R_2}=\left(\frac S {1+k}\right)^{\frac{1+a}{2a}}$$
Now, consider that you look for the zero of the function
$$f(R)=R+k\,R^{\,a}-S$$ $$f'(R)=1+a\, k\, R^{\,a-1}$$ Newton iterates will be given by
$$R_{n+1}=R_n-\frac{R_n+k\, R_n^{\,a}-S}{1+a\, k\, R_n^{\,a-1}}$$
For illustration purposes, let us try with $S=10^3$; Newton method will provide the following iterates
$$\left(
\begin{array}{cc}
 n & x_n \\
 0 & 219.186 \\
 1 & 170.109 \\
 2 & 165.981 \\
 3 & 165.950
\end{array}
\right)$$ which is the solution for six significant figures.
For sure, this was for computing a single value. If you want to build the curve, for a second point, use the previous result as estimate. Suppose that we want now $S=1100$; then, the iterates will be
$$\left(
\begin{array}{cc}
 n & x_n \\
 0 & 165.950 \\
 1 & 176.500 \\
 2 & 176.303
\end{array}
\right)$$
For example, using $S=1$, Newton iterates would be
$$\left(
\begin{array}{cc}
 n & x_n \\
 0 & 0.894667 \\
 1 & 0.879285 \\
 2 & 0.879268
\end{array}
\right)$$
Edit
You could do simpler (not to say much better) if you try to inverse the model. Generating $S$ from given $R$ and using least-square method to minimize the sum of squares of relative errors, with a very simplistic model, you could end with
$$R\approx 1.35463\, S^{0.869369}-0.384677\, S$$ which would give pretty good guesses to be used for $R_0$.
For the worked examples, the values generated as estimates are $164.772$, $173.771$ and $0.969949$. Newton method will probably require a couple of iterations for convergence to high accuracy.