CONTEXT
Let us consider a bit of the Universe in which we draw spheres
(see a high resolution image here). Astronomers have shown that the density within these spheres could be predicted quite accurately: here is the measured (in red) and predicted (in green) distribution of the density within $50^3$ such spheres at half the age of the Universe: .
Our next purpose is to extend the theory to concentric two or more shells.
In practice, in order to estimate the mildly nonlinear cosmic density of the Universe within concentric shells, I need to find perturbatively the Legendre Transform of a function of two variables in a singular regime (see below).
$$\phi(\lambda_1,\lambda_2)={\rm LT}(\psi(\rho_1,\rho_2))\equiv \sup_{\rho_1,\rho_2}\left[\lambda_1 \rho_1+\lambda_2 \rho_2-\psi(\rho_1,\rho_2)\right]$$
which in turns involves inverting the system $$\partial_\rho \psi =\lambda \quad \quad \quad (1) $$ for $\rho_1,\rho_2$ , and integrating for $\phi(\lambda_1,\lambda_2)$ the system $$ \quad \partial_\lambda \phi =\rho \,. \quad \quad (2) $$ This can in principle be done perturbatively. In my context, it needs to be done in the regime where ${\rm det}| \partial^2_\rho \psi|=0$. I.e. I am interested in Taylor expanding the Legendre transform of $\psi$ near a point (chosen to be zero for simplicity) where one of the eigenvalues of $\partial^2_\rho \psi$ is zero. In physical terms it corresponds to the rare event tail of the density of the Universe in these shells, if you care to know!
ATEMPT
Following this question I know how to do invert (1) for $\rho(\lambda)$ in 1D (one shell) for the regular
nn = 3;
ρofλr = InverseSeries[Series[ψ'[ρ], {ρ, 0,nn}]] /. ρ -> λ /. ψ'[0] -> 0 /.
Derivative[n_][ψ][0] :> Subscript[ψ, n] // Normal
(note the division by ψ''[0]
)
and the singular case (for which ψ''[0]=0
)
nn = 3;
ρofλs = InverseSeries[Series[ψ'[ρ], {ρ, 0,nn}]/. ψ''[0]-> 0] /. ρ -> λ /. ψ'[0] -> 0 /.
Derivative[n_][ψ][0] :> Subscript[ψ, n] // Normal
note the square root. It is clear from this expansion that the Legendre
transform, ϕ[λ]
will have a very different algebraic form in the singular case
compared to the regular case.
ϕ[λ_]=Integrate[ρofλ,λ]
But this is not enough for concentric shells: I need to be able to carry out such Legendre transform when one coordinate is singular.
SOLUTION to first order and for the regular case only
The following works for the regular case only. Let us expand the first system
nn=1;
eqn = Thread[{λ1, λ2} ==
Series[{Derivative[1, 0][ψ][ ρ1, ρ2],
Derivative[0, 1][ψ][ ρ1, ρ2]}, { ρ1, 0,
nn}, { ρ2, 0, nn}]] // Normal;
and reoder it in power of ϵ
eqn2 = eqn /.
Derivative[i_, j_][ψ][0,
0] -> ϵ^(i + j - 1) Derivative[i, j][ψ][0, 0] //
Series[#, {ϵ, 0, 1}] & // Simplify;
Solve for ρ1,ρ2
sol = Solve[Normal[eqn2], { ρ1, ρ2}][[1]] /.
Derivative[n_, p_][ψ][__] :> Subscript[ψ, n, p] //
FullSimplify;
We can then integrate the system (2):
eqn3 = {D[ϕ[λ1, λ2], λ1] == ρ1,D[ϕ[λ1, λ2], λ2] == ρ2} /. sol
ϕ[λ1, λ2]/. DSolve[eqn3,ϕ[λ1, λ2], {λ1, λ2}][[1, 1]] // Apart
But this is not good enough because I am interested in a singular expansion,
i.e. near a point where the Jacobian $\partial^2 \psi \partial \rho_i \partial \rho_j$
has zero determinant! (when the above first order solution becomes singular
because ψ02 ψ20 -ψ11^2 =0
)
QUESTION
I am interested in doing this in 2D (or 3D...) for the singular case, i.e. when the Jacobian $\partial^2_\rho \psi$ has one null eigenvalue.
The main difficulty is that InverseSeries
does not work for series of two variables.
The gist of the problem is the following: assuming x1
, x2
y1
and y2
are small,
how does one invert pertubatively
y1= x1+ x1^2 + x2^2 + x1 x2 + x2^3...
y2= x2^2 + x1^2 +x1 x2 + x1^3 +...
in order to write
x1= y1+...
x2= sqrt(y2)+...
This might sound like a technical question, but the core of the problem is
fairly general: how does one InverseSeries
of multiple variables and multiple equations? in Mathematica. Any suggestions would be very welcome!
Series
it says that when dealing with multivariable series, it "successively finds series expansions with respect to x, then y, etc." So if you want to invert this process, maybe you could attack it by usingInverseSeries
one variable at a time. $\endgroup$