Last modified:  15, July 2021

Perfect fluid collapse in circular symmetry - Static Fluid

Configurations

Packages

Take the notation package to make sure that any subscripted variables are treated as a single variable. 
			Otherwise, you cannot use Clear on it since Clear only works on symbols and subscripted variables are actually functions. E.g. look at (Subscript[x, a]) using FullForm. Also, you will get
			some trouble in solving for subscripted variables using NDSolve and the like since it wants the arguments to be solved for to be symbols.
			DO NOT IF POSSIBLE assign values to subscripted variables, since you will by default not assign a Downvalue to it, but a Ownvalues. The below package will make everything 
			work nonetheless by symbolizing any subscripted variable, but it is a good habit to only use subscripted variables for formal calculations or rules.

Needs["Notation`"]
			Symbolize[ParsedBoxWrapper[SubscriptBox["_","_"]]] (*Possible optional argument: WorkingForm -> TraditionalForm*)
			(*Take the notation package to make sure that any subscripted/superscripted symbols are treated as a single symbol.*)
			Symbolize[ParsedBoxWrapper[SuperscriptBox["_","_"]]]
			Symbolize[ParsedBoxWrapper[SubsuperscriptBox["_","_","_"]]]

Note that the above has some important changes as to how Mathematica views for example (Subscript[V, S]). Try with and without the above. Check with FullForm to see the difference.

The below is for pretty print purposes. Allows to use the function pdConv.

<< "/home/patrick/Documents/Wolfram Mathematica/partial_derivative_output.m"(*Allows for nice output form*)

Keyboard shortcuts

The following allows to auto-replace stuff when you write “tex[” into “TeXForm[StandardForm[]]”, which is what is needed to  output LATEX code of an equation. The StandardForm is needed if using the notation package.

CurrentValue[EvaluationNotebook[],{InputAutoReplacements,"tex"}]:=RowBox[{"TeXForm","[",RowBox[{"StandardForm","\[SelectionPlaceholder]","]"}],"]"}]

Palettes and docked buttons

Below is the full docked buttons code. In the following sections, we explain each part.

Correcting alignment

This docked button will go through the notebook and correctly align all the text.

buttonalignment = With[{styles={"Section","Subsection","Subsubsection"}},ToBoxes@Button["align",Map[Set[CurrentValue[#,{CellMargins,1,1}],
						CurrentValue[PreviousCell[#,CellStyle->styles],{CellMargins,1,1}]]&,Cells[CellStyle->"Text"]]]];

Correctly re-enable evaluation property

This part of the above code creates a docked button that easily allows to deactivate cell evaluation and re - enable it, while keeping the texts, outputs,etc default (not evaluable).  Specifically, “re-enable” in fact just sets properties back to default.

buttonevaluable = ToBoxes@Column[Button[StringForm["Evaluatable -> ``",#], CurrentValue[SelectedCells@InputNotebook[],Evaluatable]=#]&/@{False,Inherited}];

The below code does the same thing, but it creates a palette instead. Kept it for archive purposes.

(*CreatePalette@Column[Button[StringForm["Evaluatable -> ``",#],CurrentValue[SelectedCells@InputNotebook[],Evaluatable]=#]&/@{False,Inherited}]*)

Full docked buttons

Implementation of each part as a docked cell. For adding new features, simply create new data as shown for the above two buttons, i.e. ToBoxes[stuff] and then put it inside the BoxData.
				The next lines should not be touched and their purpose is to make the toolbar expand/collapse upon clicking of the bottom panel.

fullDockedCellsWithCollapseToolbar=Cell[BoxData[{buttonalignment,buttonevaluable}], 
					CellFrameLabelMargins->0,CellFrameLabels->{{None,None},{ButtonBox["",
				ButtonFunction:>Function[With[{pc=ParentCell@EvaluationCell[]},SetOptions[pc,If[CurrentValue[pc,CellSize]===0,{CellSize->Inherited,CellElementSpacings->{},
				CellFrameMargins->Inherited},{CellSize->0,CellElementSpacings->{"CellMinHeight"->0},CellFrameMargins->0}]]]], ImageSize->{Scaled[2],15},Evaluator->Automatic],None}}];
				SetOptions[EvaluationNotebook[],DockedCells->fullDockedCellsWithCollapseToolbar]
				Clear[buttonalignment,buttonevaluable]

Timestamp

This code puts a timestamp at the beginning of the document whenever one saves the notebook.

SetOptions[EvaluationNotebook[],NotebookEventActions:>{{"MenuCommand","Save"}:>Module[{dy,mn,yr},{dy,mn,yr}=
		Map[(LinkWrite[First[$FrontEnd],FrontEnd`Value[#]]; LinkRead[First[$FrontEnd]])&,{"Day","MonthName","Year"}];
			NotebookLocate["LastModified"];
			NotebookWrite[InputNotebook[],Cell[TextData[{"Last modified:  ",dy,", ",mn," ",yr}],"Text",CellTags->"LastModified"]]],PassEventsDown->True}]

Timestamp alternative

The below is a timestamp that instead updates whenever one closes the notebook. This has been made unevaluable as the previous one is usually preferred.

SetOptions[EvaluationNotebook[],NotebookEventActions:>{"WindowClose":>Module[{dy,mn,yr},{dy,mn,yr}=
	   Map[(LinkWrite[First[$FrontEnd],FrontEnd`Value[#]];
     LinkRead[First[$FrontEnd]])&,{"Day","MonthName","Second"}];NotebookLocate["LastModified"];
	     NotebookWrite[InputNotebook[],Cell[TextData[{"Last modified:  ",dy,", ",mn," ",yr}],"Text",CellTags->"LastModified"]]]}]

Option Inspector

We can set the notebook to automatically save upon closing. We however will not do that (made below unevaluatable)!  We keep the code as a basis for possible future use.
			Due to the timestamp code above, this means that a “Save Changes To” windows will always appear.

CurrentValue[$FrontEndSession,"ClosingAutoSave"] = True

DumpSave load

Packages should be loaded before the Load. This is because the saved definitions in .mx file rely on Notation to get the correct output.
			The notebook needs Notation even without loading the .mx file. If no dumpsave exist, the below simply prints this fact and does not do anything else.

Note: The dump-file’s name is assumed to have the very same name for the current notebook, with the extension “.mx” instead of “.nb”.

With[{dumpsaveFilePath = FileNameJoin[{NotebookDirectory[],StringDelete[Last[FileNameSplit[NotebookFileName[]]],".nb"]}] <> ".mx"},
			If[FileExistsQ[dumpsaveFilePath],Get[dumpsaveFilePath],Print["No DumpSave to load"]]]

General set up and functions

Pretty print

pp = {f_[x] -> f, f_[T] -> f, f_[t,r] -> f,f_[τ,x] -> f, f_[y] -> f, 
f_[t,R] -> f, f_[r] -> f, f_[T,y] -> f, f_[T,x] -> f, f_[y] -> f, f_[y,μ] -> f}; (*Stands for "pretty print"*)
<< "/home/patrick/Documents/Wolfram Mathematica/partial_derivative_output.m" (*Allows for nice output form*)

Dimension and coordinate

cc={t,r,θ}; (*x coordinate charts*)
ndim = Length[cc];

Geometric objects

(Subscript[Γ,    bc]^a)

ΓChrUDD[gmetricDD_, coordinates_]:=Module[{i,j,k,l},Simplify[Table[(1/2)Sum[
Inverse[gmetricDD][[i,l]](-D[gmetricDD[[j,k]],coordinates[[l]]]+D[gmetricDD[[l,k]],coordinates[[j]]]+D[gmetricDD[[l,j]],coordinates[[k]]]),
{l,1,Length[coordinates]}], {i,1,Length[coordinates]}, {j,1,Length[coordinates]}, {k,1,Length[coordinates]}]]]

(Subscript[R,    bcd]^a)

riemUDDD[gmetricDD_, coordinates_] := Module[{i,j,k,l,m,n,Γmatrix = ΓChrUDD[gmetricDD, coordinates]},Simplify[Table[
D[Γmatrix[[l,j,k]],coordinates[[i]]]-D[Γmatrix[[l,i,k]],coordinates[[j]]]
+Sum[Γmatrix[[m,j,k]] Γmatrix[[l,i,m]]-Γmatrix[[m,i,k]] Γmatrix[[l,j,m]],
{m,1,Length[coordinates]}], {l,1,Length[coordinates]}, {k,1,Length[coordinates]}, {i,1,Length[coordinates]}, {j,1,Length[coordinates]}]]]

(Subscript[R, ab])

riccDD[gmetricDD_, coordinates_] := Module[{i,j,k,riemann = riemUDDD[gmetricDD, coordinates]},
	Simplify[Table[Sum[riemann[[k,i,k,j]],
	{k,1,Length[coordinates]}],{i,1,Length[coordinates]},{j,1,Length[coordinates]}]]]

R

rscl[gmetricDD_, coordinates_] := Module[{i,j,ricci = riccDD[gmetricDD, coordinates]},
	Simplify[Sum[Inverse[gmetricDD][[i,j]] ricci[[i,j]],
	{i,1,Length[coordinates]},{j,1,Length[coordinates]}]]]

(Subscript[G, ab]) with cosmological constant Λ

einsteinDD[gmetricDD_, coordinates_] := Module[{i,j,ricci = riccDD[gmetricDD, coordinates],rscalar = rscl[gmetricDD, coordinates]},
	Simplify[Table[ricci[[i,j]]-(1/2)gmetricDD[[i,j]] rscalar + Λ gmetricDD[[i,j]],
	{i,1,Length[coordinates]},{j,1,Length[coordinates]}]]]

(Subscript[∇, a])(V^b)

nablaTensorDU[TUp_,gmetricDD_, coordinates_] :=    Module[{i,j,k,Γmatrix = ΓChrUDD[gmetricDD, coordinates]},
	Table[D[TUp[[i]],coordinates[[j]]]+Sum[Γmatrix[[i,j,k]]TUp[[k]],
	{k,1,Length[coordinates]}],{j,1,Length[coordinates]},{i,1,Length[coordinates]}]]

(Subscript[∇, a])(T^bc)

nablaTensorDUU[TUpUp_,gmetricDD_, coordinates_] :=    Module[{i,j,k,l,Γmatrix = ΓChrUDD[gmetricDD, coordinates]},
	Table[D[TUpUp[[i,j]],coordinates[[k]]]+Sum[Γmatrix[[i,k,l]]TUpUp[[l,j]]+Γmatrix[[j,k,l]]TUpUp[[i,l]],
	{l,1,Length[coordinates]}],{k,1,Length[coordinates]},{i,1,Length[coordinates]},{j,1,Length[coordinates]}]]

Geometry and energy

Metric

Defining the metric (Subscript[g, ab]) as well as its inverse (g^ab).

gmetDD=Table[0,{i,1,ndim},{j,1,ndim}];
gmetDD[[1,1]]=-α[t,r]^2;
gmetDD[[2,2]]=a[t,r]^2 R'[r]^2;
gmetDD[[3,3]]=R[r]^2;
TableForm[gmetDD]   /. pp

gmetUU=FullSimplify[Inverse[gmetDD]];

Einstein tensor

The function definition for the basic geometric objects, can be found in General set up and functions.

pdConv[einsteinDD[gmetDD,cc]]

Stress - Energy tensor

We consider perfect fluid (T^ab) = (p + ρ) (U^a)(U^b) + p (g^ab), with equation of state p = γ ρ. We also normalise the fluid velocity (U^a) (Subscript[U, a]) = -1 and express the fluid in terms of the coordinate velocity V =  ((α (U^t))/(a (U^r))).

fluidVelocityU = Table[0,{i,1,ndim}];
fluidVelocityU[[1]] = Ut[t,r];
fluidVelocityU[[2]] = Ur[t,r];

energy = ρ[t,r];
pressureGeneral = p[t,r];
equationOfStateRule = p -> Function[{t,r},Evaluate[κ energy]];
pressure = pressureGeneral /. equationOfStateRule;
Clear[pressureGeneral,equationOfStateRule]

Now we  express the Stress-Energy in terms of U,W just like in the Evans&Coleman paper:

uwVelocityRule = {Ut -> Function[{t,r},W[t,r]/(α[t,r])], Ur -> Function[{t,r},U[t,r]/(a[t,r] R'[r])]};
stressUU =Table[(energy+pressure) fluidVelocityU[[i]] fluidVelocityU[[j]]
			+ pressure gmetUU[[i,j]],{i,1,ndim},{j,1,ndim}]/. uwVelocityRule;

We now express the Stress in terms of velocity V = U/W and make use of velocity renormalization.

pdConv[(stressUU = stressUU /. {U -> Function[{t,r},V[t,r]/(Sqrt[1-V[t,r]^2])],
						 W -> Function[{t,r},1/Sqrt[1-V[t,r]^2]]} //Simplify)] /. pp

(stressDD = Table[Sum[stressUU[[i,j]] gmetDD[[i,k]] gmetDD[[j,l]],
				{i,1,ndim},{j,1,ndim}],{k,1,ndim},{l,1,ndim}]) /. pp;

Check it is trace-free for γ = 1/2.

Sum[stressUU[[i,j]] gmetDD[[i,j]],{i,1,ndim},{j,1,ndim}] //Simplify

EFE and energy conservation

Einstein field equations

MatrixForm[(einsteinFieldEqnDD  = Table[einsteinDD[gmetDD,cc][[i,j]] - 8 Pi stressDD[[i,j]], {i,1,ndim},{j,1,ndim}]//Simplify)] /. pp

Stress - Energy conservation and Bianchi

Stress-Energy

(energyConservationEqnU = With[{nablaTabDUU = nablaTensorDUU[stressUU,gmetDD,cc]},Table[FullSimplify[Sum[nablaTabDUU[[k,k,n]] ,{k,1,ndim}]],{n,1,ndim}]]) /. pp;

Note that naively, we have 5 equations from EFE + 2 equations from energy conservation = 7 equations. On the other hand, we have only 4 variables! 3 equations need to be redundant. 
	From Bianchi, we wish to find equations that are linear combinations of other. Intuitively, it is clear that gθθ is related to gϕϕ by just a sin^2(x). Also, gθθ contains 2nd derivative, and is therefore probably just 	
	some linear combinations (include derivatives) of the other terms, modulo the Bianchi identity. To see more precisely, we will take a tensor (could be Einstein,Energy or even EFE) and write it in the general form 
	we have above. (i.e. we write for the first term just gtt,etc for all non-trivial terms). We will then see how each component is related to one another.

PDE system

metricMatterEqn = {einsteinFieldEqnDD[[1,1]], einsteinFieldEqnDD[[1,2]],einsteinFieldEqnDD[[2,2]], 
				einsteinFieldEqnDD[[3,3]],energyConservationEqnU[[1]], energyConservationEqnU[[2]]};

metricMatterEqnSolRuleatarαrtmp = Simplify[Flatten[Solve[ metricMatterEqn[[1;;3]] == 0,{D[a[t,r],r],D[a[t,r],t],D[α[t,r],r]}]]];
metricMatterEqnSolRuleρtVttmp      = Simplify[Flatten[Solve[ metricMatterEqn[[5;;6]] == 0,{D[ρ[t,r],t],D[V[t,r],t]}]]];
metricMatterEqnSolat                 = Simplify[Factor[D[a[t,r],t] /. metricMatterEqnSolRuleatarαrtmp]];
metricMatterEqnSolar                 = Simplify[Factor[D[a[t,r],r] /. metricMatterEqnSolRuleatarαrtmp]];
metricMatterEqnSolαr                 = Simplify[Factor[D[α[t,r],r] /. metricMatterEqnSolRuleatarαrtmp]];
metricMatterEqnSolρt                 = Simplify[Factor[D[ρ[t,r],t] /. metricMatterEqnSolRuleρtVttmp] /. metricMatterEqnSolRuleatarαrtmp];
metricMatterEqnSolVt                 = Simplify[Factor[D[V[t,r],t] /. metricMatterEqnSolRuleρtVttmp] /. metricMatterEqnSolRuleatarαrtmp];

Integrability condition

The (Subscript[a, ,t]) and (Subscript[a, ,r]) equations need to satisfy (Subscript[a, ,tr]) = (Subscript[a, ,rt]), which is readily satisfied:

FullSimplify[D[metricMatterEqnSolat,r] - D[metricMatterEqnSolar,t]
					 /. metricMatterEqnSolRuleρtVttmp /. metricMatterEqnSolRuleatarαrtmp]

Change of  variables (a, α, ρ, V) -> (g, M, ϱ, V)

We make a change of coordinates, that maybe be adapted to Static: τ = - ln(-t) , x = r.
We previously used the same variables as in KHA, but encountered blow ups in those variables done the line. We instead now try a modified version which should be regular everywhere a posteriori,
M = -(1/(a^2))- Λ (R^2), ϱ = 4π (R^2)ρ and g = (α/a). From now on we shall work with these new variables.
Note: used to have a factor ”t” in the rule for α below. Apparently, it is actually important for the linear perturbation later.
For static solution, this factor can actually be dropped. The reason why it occurs is because dt = tdτ and so, need to cancel that exponential factor.

COVaαρTogMϱRule = {a -> Function[{t,r}, 1/Sqrt[-M[t,r]-Λ R[r]^2]], α -> Function[{t,r},g[t,r]/(Sqrt[-M[t,r]-Λ R[r]^2])], 
				 ρ -> Function[{t,r}, ϱ[t,r]/(4 Pi R[r]^2)]};

metricMatterEqnSolatLHS = Simplify[D[a[t,r],t]/. COVaαρTogMϱRule];
metricMatterEqnSolarLHS = Simplify[D[a[t,r],r] /.COVaαρTogMϱRule];
metricMatterEqnSolαrLHS = Simplify[D[α[t,r],r] /. COVaαρTogMϱRule];
metricMatterEqnSolρtLHS = Simplify[D[ρ[t,r],t]  /. COVaαρTogMϱRule];
metricMatterEqnSolVtLHS = Simplify[D[V[t,r],t] /. COVaαρTogMϱRule];
metricMatterEqnSolatRHS = Simplify[metricMatterEqnSolat /. COVaαρTogMϱRule];
metricMatterEqnSolarRHS = Simplify[metricMatterEqnSolar /. COVaαρTogMϱRule];
metricMatterEqnSolαrRHS = Simplify[metricMatterEqnSolαr /. COVaαρTogMϱRule];
metricMatterEqnSolρtRHS = Simplify[metricMatterEqnSolρt /. COVaαρTogMϱRule];
metricMatterEqnSolVtRHS = Simplify[metricMatterEqnSolVt /. COVaαρTogMϱRule];

PDE system in new coordinates and variables

(metricMatterEqnSolgrMtMrϱrVrRuletmp = Flatten[Simplify[Solve[{metricMatterEqnSolatLHS == metricMatterEqnSolatRHS,
metricMatterEqnSolarLHS == metricMatterEqnSolarRHS, metricMatterEqnSolαrLHS == metricMatterEqnSolαrRHS,metricMatterEqnSolρtLHS == metricMatterEqnSolρtRHS,
metricMatterEqnSolVtLHS == metricMatterEqnSolVtRHS},
{D[g[t,r],r],D[M[t,r],t],D[M[t,r],r],D[ϱ[t,r],r],D[V[t,r],r]}]]]) /. pp
(metricMatterEqnSolgr   = Simplify[Factor[D[g[t,r],r] /. metricMatterEqnSolgrMtMrϱrVrRuletmp]]) /. pp;
(metricMatterEqnSolMt   = Simplify[Factor[D[M[t,r],t] /. metricMatterEqnSolgrMtMrϱrVrRuletmp]]) /. pp;
(metricMatterEqnSolMr   = Simplify[Factor[D[M[t,r],r] /. metricMatterEqnSolgrMtMrϱrVrRuletmp]]) /. pp;
(metricMatterEqnSolϱr   = Simplify[Factor[D[ϱ[t,r],r] /. metricMatterEqnSolgrMtMrϱrVrRuletmp]]) /. pp;
(metricMatterEqnSolVr   = Simplify[Factor[D[V[t,r],r] /. metricMatterEqnSolgrMtMrϱrVrRuletmp]]) /. pp;
Clear[metricMatterEqnSolgrMtMrϱrVrRuletmp]

NOTE:  if f(t, r) is a solution of the above system of PDE (f designated the ensemble of the 4 variables), then so is f(st , r/s) for s constant. Of course, this assumes Λ = 0. We also need the choice R[r] = r. For general R, need transf R -> R/s instead.
		Also, note that the PDEs are singular at the lightcone V = ± 1 and at the sonic point V ± (Sqrt[κ]). This is however not relevant in that we will look for static solutions next.

Static ansatz equations

Static equations

We now apply the Static Ansatz. The EOM will then only depend on the variable x. Note that we need to set Λ -> 0, in order for the equations to not depend on τ.
	NOTE: the ODE for metric variables, ψ, M are functionally the same as for the homothetic choice x = -r/t!!

StaticAnsatzDroptRule = {g -> Function[{t,r},g[r]],M -> Function[{t,r},M[r]],ϱ -> Function[{t,r},ϱ[r]],V -> Function[{t,r},V[r]]};
	(metricMatterEqnFullStaticSolgr  = Simplify[metricMatterEqnSolgr /. StaticAnsatzDroptRule]) /. pp
	(metricMatterEqnStaticalgeqn         = Simplify[metricMatterEqnSolMt /. StaticAnsatzDroptRule]) /. pp
	(metricMatterEqnFullStaticSolMr  = Simplify[metricMatterEqnSolMr /. StaticAnsatzDroptRule]) /. pp
	(metricMatterEqnFullStaticSolϱr  = FullSimplify[metricMatterEqnSolϱr /. StaticAnsatzDroptRule]) /. pp
	(metricMatterEqnFullStaticSolVr  = FullSimplify[metricMatterEqnSolVr /. StaticAnsatzDroptRule]) /. pp

NOTE: Unlike the previous variables, the matter variable do depend on “M” and hence “a” this time! Note that the algebraic equation simply relates V, ϱ and ψ and in particular does not depend on the “mass” M unlike its 3+1 counterpart.
		We shall use two methods from here on and check consistency of both results at the end. We can then compare which method is numerically more efficient.
		1) We will keep the equations as is and use the alg. eqn for consistency checks/requirements. This keeps the equations simpler.
		2) We will use the algebraic equation to get rid of one variable. One equation will thus be redundant modulo the algebraic equation.

Consistency check and fluid' s boundary

The vanishing of the denominator in ϱ’ and V’ indicates the sonic (fluid) boundary. The speed of the fluid will be less than the speed of light.
	We can see that the boundary of causality for the fluid occurs whenever the denominator in the above vanishes.  V^2=1 cannot happen as this corresponds to the speed of light. 
	In Evernote,under EvansColeman_consistency_check,we show this boundary agrees with the theoretical prediction. Note that we get 2 roots, corresponding 
	to the sonic cones at x = 1 and x= -1, or equivalently at ((SubMinus[S])^x) and ((SubPlus[S])^x) = 0.

Simplify[Denominator[metricMatterEqnFullStaticSolϱx]] /. pp

NOTE: A posteriori, it is the first term in the above which will cause the singular behaviour in the system as it vanishes at the sonic point.

ODE equations

Full : Keep all four variables (g, M, ϱ, V)

We can straightaway borrow the result from the previous section:

metricMatterODEFullStaticgMϱVΛ = Table[0,{i,1,4}];
	(metricMatterODEFullStaticgMϱVΛ[[1]] = FullSimplify[Denominator[metricMatterEqnFullStaticSolgr] g'[r] - Numerator[metricMatterEqnFullStaticSolgr]]) /. pp
	(metricMatterODEFullStaticgMϱVΛ[[2]] = FullSimplify[Denominator[metricMatterEqnFullStaticSolMr] M'[r] - Numerator[metricMatterEqnFullStaticSolMr]]) /. pp
	(metricMatterODEFullStaticgMϱVΛ[[3]] = FullSimplify[Denominator[metricMatterEqnFullStaticSolϱr] ω'[r] - Numerator[metricMatterEqnFullStaticSolϱr]]) /. pp
	(metricMatterODEFullStaticgMϱVΛ[[4]] = FullSimplify[Denominator[metricMatterEqnFullStaticSolVr] V'[r] - Numerator[metricMatterEqnFullStaticSolVr]]) /. pp

Reduced : Retain three variables (g, M, ϱ)

The “reduced” ODE system describe evolutions of g, ϱ and V, where we substituted V =V(g, ϱ, M) from the algebraic equation. We also make sure to remove any denominator term in the ODEs.

Redundancy Check

Unevaluable.
		The question that we may ask is which of the new variables ODE, g’ or M’, are redundant? It is rather clear that ψ can be left out.
	 	After all, M only depends on a. We can then view the M’ equation as the one for a’. g’ is consequentially seen as the equation for α, which is redundant by Bianchi. 
	 	Interestingly though, the above change of variable introduced a new kind of symmetry. Indeed, it turns out that we can now drop the M’ equation instead. Intuitively, it is because the Bianchi tells us that
	 	we really need the a’ equation, but the g’ equation also encodes information about a’. The information is thus not lost! See below for explicit calculations.

metricMatterEqnStaticalgeqnSolRulegCheck = Flatten[Simplify[Solve[metricMatterEqnStaticalgeqn == 0,g[x]]]];
		metricMatterEqnStaticalgeqnSolgCheck = Factor[g[x] /. metricMatterEqnStaticalgeqnSolRulegCheck];

metricMatterEqnStaticalgeqnSolgrCheck = Simplify[D[metricMatterEqnStaticalgeqnSolgCheck,r]];
		metricMatterEqnFullStaticSolRuleMr = M' -> Function[r,Evaluate[metricMatterEqnFullStaticSolMr]];
		metricMatterEqnFullStaticSolRuleϱr  = ϱ' -> Function[r,Evaluate[metricMatterEqnFullStaticSolϱr]];
		metricMatterEqnFullStaticSolRuleVr   = V' -> Function[r,Evaluate[metricMatterEqnFullStaticSolVr]];
		Simplify[metricMatterEqnStaticalgeqnSolgrCheck - metricMatterEqnFullStaticSolgr /.
		{metricMatterEqnFullStaticSolRuleMr,metricMatterEqnFullStaticSolRuleϱr,metricMatterEqnFullStaticSolRuleVr} /. metricMatterEqnStaticalgeqnSolRulegCheck]

We shall therefore drop the g’ equation for the reduced system.

Solving algebraic equation in terms of V

metricMatterEqnStaticalgeqnSolRuleVtmp = Flatten[Simplify[Solve[metricMatterEqnStaticalgeqn == 0,V[r]]]];	
		metricMatterEqnStaticalgeqnSolRuleV = V -> Block[{r},Function @@ List[{r}, V[r] /. metricMatterEqnStaticalgeqnSolRuleVtmp]]	   
		Clear[metricMatterEqnStaticalgeqnSolRuleVtmp];

Reduced ODE

(metricMatterEqnReducedStaticSolgrΛ   = Simplify[metricMatterEqnFullStaticSolgr /.  metricMatterEqnStaticalgeqnSolRuleV]) /. pp
	(metricMatterEqnReducedStaticSolMrΛ   = Simplify[metricMatterEqnFullStaticSolMr /.  metricMatterEqnStaticalgeqnSolRuleV]) /. pp
	(metricMatterEqnReducedStaticSolϱrΛ   = Simplify[metricMatterEqnFullStaticSolϱr /.  metricMatterEqnStaticalgeqnSolRuleV]) /. pp

Important note: The algebraic equation could also have been satisfied by taking g=0 or ϱ=0. The latter is tirival while the former is un-physical.

metricMatterODEReducedStaticgMϱΛ = Table[0,{i,1,3}];
	(metricMatterODEReducedStaticgMϱΛ[[1]] = FullSimplify[Denominator[metricMatterEqnReducedStaticSolgrΛ] g'[r] - Numerator[metricMatterEqnReducedStaticSolgrΛ]]) /. pp;
	(metricMatterODEReducedStaticgMϱΛ[[2]] = FullSimplify[Denominator[metricMatterEqnReducedStaticSolMrΛ] M'[r] - Numerator[metricMatterEqnReducedStaticSolMrΛ]])/. pp;
	(metricMatterODEReducedStaticgMϱΛ[[3]] = FullSimplify[Denominator[metricMatterEqnReducedStaticSolϱrΛ] ϱ'[r] - Numerator[metricMatterEqnReducedStaticSolϱrΛ]]) /. pp;

ODE equations, Λ = 0

Full : Keep all four variables (g, M, ϱ, V)

We can straightaway borrow the result from the previous section:

setΛTo0Rule = Λ -> 0;
(metricMatterODEFullStaticgMϱV = FullSimplify[metricMatterODEFullStaticgMϱVΛ /. setΛTo0Rule]) /. pp

Reduced : Retain three variables (g, M, ϱ)

(metricMatterEqnReducedStaticSolgr   = Simplify[metricMatterEqnFullStaticSolgr /.  metricMatterEqnStaticalgeqnSolRuleV/. setΛTo0Rule]) /. pp
	(metricMatterEqnReducedStaticSolMr       = Simplify[metricMatterEqnFullStaticSolMr /.  metricMatterEqnStaticalgeqnSolRuleV/. setΛTo0Rule]) /. pp
	(metricMatterEqnReducedStaticSolϱr       = Simplify[metricMatterEqnFullStaticSolϱr /.  metricMatterEqnStaticalgeqnSolRuleV/. setΛTo0Rule]) /. pp

(metricMatterODEReducedStaticgMϱ = metricMatterODEReducedStaticgMϱΛ /. setΛTo0Rule) /. pp;

Analytical solution of Λ=0

The reduced system can be solved fully analytically. First, note that the g’ equation can be solved by integration once we know about M and ϱ. g itself also decouples from the other 2 ODEs. We have therefore a system of 2 ODE to solve: for M and ϱ.

Re-writing the ODEs

ODEForM = Simplify[M'[r] - metricMatterEqnReducedStaticSolMr == 0]
ODEForϱ = Simplify[ϱ'[r] - metricMatterEqnReducedStaticSolϱr == 0]

In the equation for ω’ above, can further simplify by using equation for M’:

ODEForϱRule = Flatten[Solve[ODEForM,ϱ[r]]]

ODEForϱIntegrabletmp = Simplify[DivideSides[ODEForϱ,ϱ[r], Assumptions-> ϱ[r] > 0]]

In the above, We want now to substitute in ω(x) obtained above, but only for the 2nd term. This makes the resulting equation integrable.

ODEForϱIntegrable = Simplify[First[ODEForϱIntegrabletmp]== (Last[ODEForϱIntegrabletmp  /. ODEForϱRule])]
Clear[ODEForϱIntegrabletmp]

Solve ODE system

THERE IS A BIT OF HACKS IN THERE.

Now, integrate both sides. Note that we need to manually add a constant.

ODEForϱIntegratedtmp = Integrate[First[ODEForϱIntegrable],r] == Integrate[Last[ODEForϱIntegrable],r] + 2 Log[(Subscript[R, ⋆])^2]

NOTE: the answer is not quite right as we really would need abs(M) = -M and NOT just M.
At this point, need to correct the mistake where M should be replaced by - M.

ODEForϱIntegrated = ODEForϱIntegratedtmp /. M[r] -> -M[r]
Clear[ODEForϱIntegratedtmp]

Solve for ω. The exponentiation requires a condition on the positivity of LHS. We use Normal to get rid of that and thus tell Mathematica that this is automatically true. Needs a posteriori check!
For later convenience, we also re-write rule in terms of r:

algrelForMϱRule = Flatten[Simplify[Normal[Solve[ODEForϱIntegrated,ϱ[r]]]]]

ODEForMNoϱ = Simplify[ODEForM /. algrelForMϱRule]

Integrate. We also suppress error messages.

exprForMRuletmp = Quiet[Flatten[Simplify[DSolve[{ODEForMNoϱ},M[r],r]]]]// Simplify

Simplify by redefining constants.

exprForMRule = Simplify[M[r] -> (M[r] /. exprForMRuletmp /. C[1] ->  2 C[1]/(-1+κ) /. (Subscript[R, ⋆]) -> (Subscript[R, ⋆]) Sqrt[1-κ])]

The constant A is still positive.  Now, fix C so that M(0) = 0. Here, we assume that R(0) = 0.

fixingC1Rule = Quiet[Flatten[PowerExpand[Solve[(M[r] /. exprForMRule ) == -1 /. r -> 0 /. R[0] -> 0,C[1]]]]]

exprForMRuleOneParameter = PowerExpand[exprForMRule /. fixingC1Rule] //Simplify

This is the expression for M. Plugging it back into expression for ω gives:

exprForϱRuleOneParameter = PowerExpand[(algrelForMϱRule /. (Subscript[R, ⋆]) -> (Subscript[R, ⋆]) Sqrt[1-κ]) /.  exprForMRuleOneParameter] // Simplify

We can plug this in the equation for g’.

staticlngpEqntmp = metricMatterEqnReducedStaticSolgr / g[r];
staticlngpEqn = staticlngpEqntmp /. exprForϱRuleOneParameter /. exprForMRuleOneParameter // Simplify
Clear[staticlngpEqntmp]

Solution is then easily found by integration. Here,I manually added a minus sign, because Mathematica possibly can get it wrong because it does not know that R < (Subscript[R, ⋆]), which then gives the “wrong sign” inside logarithm.
Recall, that we also have a gauge freedom to rescale the time coordinate. (from above, this comes from the integration constant, which with exponentiation gives arbitrary factor in from of ψ). This residual gauge
 causes α ->α/k, and thus the same for ψ. For convenience, fixed it so that R = 0 is locally flat, i.e. ψ(0)=1.

exprForgRuleOneParameter = g[r] -> Simplify[Evaluate[Exp[Integrate[staticlngpEqn ,r]]] / (Subscript[R, ⋆])^2]

Compile static solution

In terms of R and (Subscript[R, ⋆]) and coordinate r

ϱsSolRule = ϱ -> Function[r, Evaluate[ϱ[r] /. exprForϱRuleOneParameter]]
MsSolRule =M -> Function[r, Evaluate[M[r] /. exprForMRuleOneParameter]]
gsSolRule = g -> Function[r, Evaluate[g[r] /. exprForgRuleOneParameter]]
VsSolRule = V -> Function[r,0]
asSolRule = a -> Function[r, Evaluate[Simplify[1/Sqrt[-M[r]] /. exprForMRuleOneParameter,Assumptions->{1-R[r]^2/(Subscript[R, ⋆])^2 > 0, 0 < κ < 1}]]]
αsSolRule = α -> Function[r, (1-R[r]^2/(Subscript[R, ⋆])^2)^(-1/(-1+1/κ))]
ρsSolRule = ρ -> Function[r, Evaluate[ϱ[r] / (4 Pi R[r]^2) /. exprForϱRuleOneParameter]]
staticSolgMϱVRule = {gsSolRule,MsSolRule,ϱsSolRule,VsSolRule};
staticSolaαρVRule = {asSolRule,αsSolRule,ρsSolRule,VsSolRule};

Note some relationships: α = (a^γ), ϱ ~ (R^2)/(a α).

In terms of x, (Subscript[x, ⋆]) and coordinate y

For linear perturbation later, we will re-write the solution differently.
Compared to the notes, we have (Subscript[R, ⋆]) = s (Subscript[x, ⋆]), with (Subscript[x, ⋆]) = ((2 κ)/(1-κ)). Not, for Λ = 0, this choice of (Subscript[x, ⋆]) is a bit arbitrary as we could make it to be any value by rescaling s (since it is an arbitrary scale).
This choice however actually comes more naturally from Cataldo’s coordinates and this factor of (Subscript[x, ⋆]) comes up in the case Λ ≠ 0. It is just that if Λ = 0, (Subscript[x, ⋆]) could be re-absorbed into s if we wanted to.

staticSolgMϱVInTermsOfyRule = staticSolgMϱVRule /. R[r] -> x[y] /. r -> y /. (Subscript[R, ⋆]) -> (Subscript[x, ⋆])
staticSolaαρVInTermsOfyRule = staticSolaαρVRule /. R[r] -> x[y] /. r -> y /. (Subscript[R, ⋆]) -> (Subscript[x, ⋆]) /. Pi -> Pi s^2

In terms of x, (Subscript[x, ⋆]) and coordinate x

staticSolgMϱVInTermsOfxRule = staticSolgMϱVRule /. R[r] -> x /. r -> x /. (Subscript[R, ⋆]) -> (Subscript[x, ⋆])
staticSolaαρVInTermsOfxRule = staticSolaαρVRule /. R[r] -> x /. r -> x /. (Subscript[R, ⋆]) -> (Subscript[x, ⋆]) /. Pi -> Pi s^2

Check that solution satisfies EFE

g'[r] - metricMatterEqnReducedStaticSolgr /. staticSolgMϱVRule // Simplify
M'[r] - metricMatterEqnReducedStaticSolMr /. staticSolgMϱVRule // Simplify
tmp = ϱ'[r] - metricMatterEqnReducedStaticSolϱr /. staticSolgMϱVRule // FullSimplify;
tmp /. R[r]^2 -> (Subscript[R, ⋆])^2 (1-Ω) // Simplify
Clear[tmp]

Analysis

It is easy to check the following facts:
1) both ψ, M and ω have the same zero at R = (Subscript[R, ⋆]).
2)Location of max of ϱ, is at (Subscript[R, max]^2) = (Subscript[R, ⋆]^2) ((1/κ-1)/2).

tmp = Simplify[Solve[D[ϱ[r] /. staticSolgMϱVRule,r] == 0,R[r]], (Subscript[R, ⋆]) > 0]

3) the max of ϱ itself does not depend on A surprisingly and equals: (1/2) ((1/2) + (((κ/2)))^((κ+1)/(1-κ))).

ϱ[r] /. staticSolgMϱVRule /. tmp // Simplify

For boundary conditions of the linear perturbations, it is required to analyse the asymptotics of the variables as they approach the surface at x = (Subscript[x, ⋆]).

exprg = g[y] /. staticSolgMϱVInTermsOfyRule /. x[y] -> x;
exprϱ = ϱ[y] /. staticSolgMϱVInTermsOfyRule /. x[y] -> x;
exprM = M[y] /. staticSolgMϱVInTermsOfyRule /. x[y] -> x;

exprϱ/exprM // Simplify
exprϱ/exprg // Simplify
exprϱ exprg/exprM  // Simplify
Simplify[exprϱ^3 exprg/exprM^2 /. x^2 -> (Subscript[x, ⋆])^2 (1-Ω)] /. Ω -> 1-x^2/(Subscript[x, ⋆])^2

From the above, notice a few points regarding the above expressions near surface.
	1) (Subscript[g, 0]) ~ 0 (x-(Subscript[x, ⋆]))
	2) ((Subscript[ϱ, 0])/(Subscript[g, 0])) ~ ((Subscript[x, ⋆])-x )^((2κ)/(1-κ)) -> 0
	2) ((Subscript[ϱ, 0])/(Subscript[M, 0])) ~ (1/(Subscript[g, 0]))
	3) (((Subscript[ϱ, 0]^3)(Subscript[g, 0]))/(Subscript[M, 0]^2)) ~ ((Subscript[ϱ, 0])/(Subscript[g, 0]))
	4)(Subscript[M, 0]) ~ (Subscript[ϱ, 0])(Subscript[g, 0])

Plots

For simplicity, we will assume here that R[r] = r. This is equivalent to saying that we plot the variables as in terms of R.

RTorRule = R -> Function[r,r];

Plot of the two functions

Plot[{g[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1 /. κ -> 1/2 /. RTorRule, M[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1 /. κ -> 1/2 /. RTorRule, ϱ[r] /. 
staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1 /. κ -> 1/2 /. RTorRule},
{r,0,1},PlotLegends-> Placed[{"χ(x)","M(x)","ϱ(x)"},{0.8,0.25}],AxesLabel->{"x/(Subscript[x, ⋆])"}]

Plot[{ϱ[r]/(4 Pi) /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1 /. κ -> 1/2 /. RTorRule},
{r,0,1},PlotLegends-> Placed[{"g(x)","M(x)","ϱ(x)"},{0.8,0.25}],AxesLabel->{"x/(Subscript[x, ⋆])"}]

Let us also plot the “primitive variables”:

Plot[{a[r] /. staticSolaαρVRule /. (Subscript[R, ⋆]) -> 1 /. κ -> 1/2 /. RTorRule, α[r] /. staticSolaαρVRule /. (Subscript[R, ⋆]) -> 1/. κ -> 1/2 /. RTorRule, ρ[r] /. staticSolaαρVRule/. (Subscript[R, ⋆]) -> 1 /. κ -> 1/2 /. RTorRule},
{r,0,1},PlotLegends-> Placed[{"a(R)","α(R)","ρ(R)"},{0.9,0.7}], PlotRange->{-1,2}]

Of course, past the point R = (Subscript[R, ⋆]), the solution does not exist. We can push this point to infinity via the change of variable: z = (R/((Subscript[R, ⋆])-R)). Nicely, the solution will not depend on the parameter anymore!

Invert the above transformation. As stated above, this transformation below is not really adequate to make g not depend on M.

tmp = r/((Subscript[R, ⋆]) - r);
ruletmp = Flatten[Solve[tmp == z,r]] // Simplify;
exprForMInzRule = M[z] ->(M[r] /. staticSolgMϱVRule /. RTorRule/. ruletmp) //Simplify
exprForϱInzRule = ϱ[z] ->(ϱ[r] /. staticSolgMϱVRule/. RTorRule/. ruletmp) //Simplify
Clear[tmp, ruletmp]

Plot[{M[z] /. exprForMInzRule/. κ -> 1/2, ϱ[z] /. exprForϱInzRule/. κ -> 1/2},{z,0,5},PlotRange-> {{0,4},{-1,0.3}}]

Parametric plots

tmp = {1, 1/2,1/4,1/8,1/16,1/32};
Plot[Evaluate[Table[If[r < tmp[[j]],Evaluate[g[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> tmp[[j]] /. κ -> 1/2 /. RTorRule],0],{j,1,Length[tmp]}]],{r,0,1},
PlotLegends->Placed[{"(Subscript[R, ⋆]) = 1", "(Subscript[R, ⋆]) = 1/2","(Subscript[R, ⋆]) = 1/4","(Subscript[R, ⋆]) = 1/8","(Subscript[R, ⋆]) = 1/16","(Subscript[R, ⋆]) = 1/32"},{{1.0,0.5}}], AxesLabel->{"r","g(r)"}]
Plot[Evaluate[Table[If[r < tmp[[j]],Evaluate[M[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> tmp[[j]] /. κ -> 1/2 /. RTorRule],0],{j,1,Length[tmp]}]],{r,0,1},
PlotLegends->Placed[{"(Subscript[R, ⋆]) = 1", "(Subscript[R, ⋆]) = 1/2","(Subscript[R, ⋆]) = 1/4","(Subscript[R, ⋆]) = 1/8","(Subscript[R, ⋆]) = 1/16","(Subscript[R, ⋆]) = 1/32"},{{1.0,0.5}}], AxesLabel->{"r","M(r)"},PlotRange->Full]
Plot[Evaluate[Table[If[r <tmp[[j]],Evaluate[ϱ[r] /. staticSolgMϱVRule  /. (Subscript[R, ⋆]) -> tmp[[j]] /. κ -> 1/2/. RTorRule],0],{j,1,Length[tmp]}]],{r,0,1},
PlotLegends->Placed[{"(Subscript[R, ⋆]) = 1", "(Subscript[R, ⋆]) = 1/2","(Subscript[R, ⋆]) = 1/4","(Subscript[R, ⋆]) = 1/8","(Subscript[R, ⋆]) = 1/16","(Subscript[R, ⋆]) = 1/32"},{{1.0,0.5}}], AxesLabel->{"r","ϱ(r)"}]
Clear[tmp]

Parametric log plots

tmp = {1, 1/2,1/4,1/8,1/16,1/32};
Plot[Evaluate[Table[If[Exp[logr] < tmp[[j]],Evaluate[g[Exp[logr]] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> tmp[[j]] /. κ -> 1/2/. RTorRule],0],{j,1,Length[tmp]}]],{logr,Log[1*^-3],Log[1]},
PlotLegends->Placed[{"(Subscript[R, ⋆]) = 1", "(Subscript[R, ⋆]) = 1/2","(Subscript[R, ⋆]) = 1/4","(Subscript[R, ⋆]) = 1/8","(Subscript[R, ⋆]) = 1/16","(Subscript[R, ⋆]) = 1/32"},{{1.0,0.5}}], AxesLabel->{"r","g(r)"}]
Plot[Evaluate[Table[If[Exp[logr] < tmp[[j]],Evaluate[M[Exp[logr]] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> tmp[[j]] /. κ -> 1/2 /. RTorRule],0],{j,1,Length[tmp]}]],{logr,Log[1*^-3],Log[1]},
PlotLegends->Placed[{"(Subscript[R, ⋆]) = 1", "(Subscript[R, ⋆]) = 1/2","(Subscript[R, ⋆]) = 1/4","(Subscript[R, ⋆]) = 1/8","(Subscript[R, ⋆]) = 1/16","(Subscript[R, ⋆]) = 1/32"},{{1.0,0.5}}], AxesLabel->{"r","M(r)"}]
Plot[Evaluate[Table[If[Exp[logr] < tmp[[j]],Evaluate[ϱ[Exp[logr]] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> tmp[[j]] /.κ -> 1/2/. RTorRule],0],{j,1,Length[tmp]}]],{logr,Log[1*^-3],Log[1]},
PlotLegends->Placed[{"(Subscript[R, ⋆]) = 1", "(Subscript[R, ⋆]) = 1/2","(Subscript[R, ⋆]) = 1/4","(Subscript[R, ⋆]) = 1/8","(Subscript[R, ⋆]) = 1/16","(Subscript[R, ⋆]) = 1/32"},{{1.0,0.5}}], AxesLabel->{"r","ϱ(r)"}]
Clear[tmp]

Plot in terms of dimensionless variable

We want to plot is wrt R/(Subscript[R, ⋆]) basically. Obviously independent on (Subscript[R, ⋆]) then. This is needed because in the notes, we define x = R/(Subscript[R, ⋆]) basically (up to a constant actually). In fact, the variables will all have a functional form of ~ (1-((x^2)/((Subscript[x, ⋆])^2))), where ((Subscript[x, ⋆])^2) = ((2κ)/(1-κ)).
So, as you can see, (Subscript[x, ⋆]) is fixed here because the scale has been absorbed into x. Definition is x = R/s, where s is the scale (proportional to (Subscript[R, ⋆])).
Let us plot wrt x/(Subscript[x, ⋆]) .We can then simulate that by pretending that R is just x and take (Subscript[R, ⋆]) = 1.

M[r] /. staticSolgMϱVRule

κrule = κ -> 1/2;
Plot[Evaluate[If[r < 1,Evaluate[g[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1  /. κrule /. RTorRule],0]],{r,0,1}, AxesLabel->{"x/(Subscript[x, ⋆])","g(r)"}]
Plot[Evaluate[If[r < 1,Evaluate[M[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1  /. κrule /. RTorRule],0]],{r,0,1}, AxesLabel->{"x/(Subscript[x, ⋆])","M(r)"}]
Plot[Evaluate[If[r < 1,Evaluate[ϱ[r] /. staticSolgMϱVRule /. (Subscript[R, ⋆]) -> 1  /. κrule /. RTorRule],0]],{r,0,1}, AxesLabel->{"x/(Subscript[x, ⋆])","ϱ(r)"}]
Clear[κrule]

Mathematica -> Gnuplot

3d plot

M converter

filename = "M03d.gp";
κtmp = 1/2;
xmin = 0.0001;
tinit = 0;
tfinal = 5;
tinterpolpts = 100;
interpolationpts = 300;

In the below, approximated dt is needed or else ToString will make it into a weird format. Try for example ToString[1/2] vs ToString[0.5].

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
xmax = Sqrt[2 κtmp / (1-κtmp)];
dt = (tfinal-tinit) / tinterpolpts;
dx = (xmax-xmin)/interpolationpts;
Mfunctmp = M[x] /. staticSolgMϱVInTermsOfxRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /. κ -> κtmp;

Do[tcurrent = tinit + N[j dt]; Do[xcurrent = xmin + i dx;datainput = StringJoin[ToString[tcurrent], "   ",ToString[xcurrent], "   ",
					StringDelete[ToString[NumberForm[(Mfunctmp /. x -> xcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,tinterpolpts}]
Close[filepath]; Clear[filename,rmin,rmax,tinterpolpts, interpolationpts,tinit, tfinal, dt,filepath,dx,xcurrent, tcurrent,datainput,Mfunctmp,κtmp]

g converter

filename = "g03d.gp";
κtmp = 1/2;
xmin = 0.0001;
tinit = 0;
tfinal = 5;
tinterpolpts = 100;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
xmax = Sqrt[2 κtmp / (1-κtmp)];
dt = (tfinal-tinit) / tinterpolpts;
dx = (xmax-xmin)/interpolationpts;
gfunctmp = g[x] /. staticSolgMϱVInTermsOfxRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /. κ -> κtmp;

Do[tcurrent = tinit + N[j dt]; Do[xcurrent = xmin + i dx;datainput = StringJoin[ToString[tcurrent], "   ",ToString[xcurrent], "   ",
					StringDelete[ToString[NumberForm[(gfunctmp /. x -> xcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,tinterpolpts}]
Close[filepath]; Clear[filename,xmin,xmax,tinterpolpts, interpolationpts,tinit, tfinal, dt,filepath,dx,xcurrent, tcurrent,datainput,gfunctmp,κtmp]

ϱ converter

filename = "r2rho03d.gp";
κtmp = 1/2;
xmin = 0.0001;
tinit = 0;
tfinal = 5;
tinterpolpts = 100;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
xmax = Sqrt[2 κtmp / (1-κtmp)];
dt = (tfinal-tinit) / tinterpolpts;
dx = (xmax-xmin)/interpolationpts;
ϱfunctmp = ϱ[x] /. staticSolgMϱVInTermsOfxRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /. κ -> κtmp;

Do[tcurrent = tinit + N[j dt]; Do[xcurrent = xmin + i dx;datainput = StringJoin[ToString[tcurrent], "   ",ToString[xcurrent], "   ",
					StringDelete[ToString[NumberForm[(ϱfunctmp/(4 Pi) /. x -> xcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,tinterpolpts}]
Close[filepath]; Clear[filename,xmin,xmax,tinterpolpts, interpolationpts,tinit, tfinal, dt,filepath,dx,xcurrent, tcurrent,datainput,ϱfunctmp,κtmp]

General analytical solution for Λ≤0

Here, we will recover the above using coordinates in the CG notes from Cataldo. We will change the paradigm/notation a bit though.
Metric in generalised coordinates is: (ds^(2 ))= -(α^2) (dt^2) + (a^2)(((R'))^2) (dr^2)+(R^2)((dθ)^2) =-(α^2) (dt^2) + (a^2) (dR^2)+(R^2)((dθ)^2). We therefore need to express all the coefficients in terms of R.
We therefore need to find r = r(R) to plug it into expressions for metric coefficients.
In this case, the function that needs inverting is (R^2): = -Λ ((r^2)-(r0^2)) + D ((r^(1-1/κ)) - (r0^(1-1/κ))). 
For Λ = 0, can be done analytically and checked to agree with previous solution.

General

Note that in the notes,  λ and Ω are the dimensionless rescales quantities of Λ and (Subscript[ω, 0]). See notes.  Also, r is a dimensionfull quantity of dimension length, defined as (OverBar[r])/s, where s = Sqrt[(Subscript[(OverBar[r]), 0])], where bar means Cataldo quantities, see notes.
We shall make this general for now (i.e. with rotation). We will then set rotation to 0 at the end.

The line element is taken to be: -(α^2) (dt^2) + ...... As in the notes, α is rescaled to be dimensionless and t has dimension length.
To understand the rescalings, either look at the line elements or just:
R ~ length
ω ~ length
h ~ (length^2)
a, β, α, M ~ 1
J ~ length
Knowing above, rescale appropriately.

myh[r_]:=C-λ r^2+D r^(1-1/κ) s^(1-1/κ) +s^4 Ω^2/r^2
myh[r]

Note the sign difference.

myω[r_]:=s^2 Ω/r+EE r s
myω[r]

myR[r_]:=Sqrt[myh[r]-myω[r]^2]
Simplify[myR[r]]

We define the dimensionless quantity β = (OverBar[β])/(s^3), where (OverBar[β]) is the usual definition.

myβ[r_]:=Simplify[-myω[r]r/myR[r]^2]
Simplify[myβ[r]]

The appearance of the s comes from d(OverBar[r])  = s dr and the fact that R’((OverBar[r])) d (OverBar[r]) = R’(r) dr.

Clear[mya]
mya[r_]:=s/(Sqrt[myh[r]] myR'[r])
Simplify[mya[r]]

Note that we choose to make α dimensionless here.

Clear[myα]
myα[r_]:=Simplify[Sqrt[s^2 r^2+s^2 myR[r]^2myβ[r]^2]/s^2]
Simplify[myα[r]]

myJ[r_]:= myR[r]^3 myβ'[r]/(myR'[r]mya[r]myα[r] s)
Simplify[myJ[r]]

Note that α is dimensionless.

Clear[myM]
myM[r_]:=Simplify[- λ/s^2 myR[r]^2+myJ[r]^2/(4 myR[r]^2)-1/mya[r]^2]
Simplify[myM[r]]

myp[r_]:=D(1-1/κ)/(16 Pi) r^(-1-1/κ) s^(-1-1/κ)
Simplify[myp[r]]

We want, in the old coordinates, to have at r = r0 (recall these are of dimension (length^2)) that R(r0) = 0,etc. In this case, the variable r ≥ s.

Crule=Simplify[Flatten[Solve[myR[s]==0,C]], s > 0]

To reinstate Ω, one needs here to make sure that h[s]=0 as an additional condition. This condition is separate from the above R[s]=0, except in spherical symmetry. Should find EE = Ωs. Of course, in SS, this condition is meaningless.

EEruletmp=Solve[Simplify[myh[s]/.Crule, s >0]==0,EE]
EErule=EEruletmp[[1]]

Drule=Simplify[Flatten[Solve[Evaluate[mya[s]/.EErule]==1,D]], s > 0]

CDEErules=Union[EErule, Simplify[Crule/.Drule/.EErule],Drule]

Note: in the below, if you reinstate the rotation parameter, you will need to apply the E rule first, before applying the other rules.

Simplify[myM[s] /. CDEErules, s >0]
Simplify[myR[s] /. CDEErules, s >0]
Simplify[mya[s] /. CDEErules, s >0]
Simplify[myα[s] /. EErule , s >0]

Collect[myh[r]/.CDEErules,r,FullSimplify]

Simplify[myp[r]/.CDEErules, s >0]

FullSimplify[Factor[mya[r]^2/.CDEErules], s > 0]
FullSimplify[Factor[myα[r]^2/.CDEErules]]
FullSimplify[myβ[r]/.CDEErules]
FullSimplify[myR[r]^2/.CDEErules, s >0]

FullSimplify[myR[r]^2/.Crule /. EErule, s >0]

Collect[Simplify[myM[r],s > 0] /. Crule  /. EErule,D,Collect[#,r,Simplify]&]

Note that λ always appears with a the rotation parameter (Ω^2). Basically, the first parametrized Hubble acceleration, while other centripetal force and both depend only on radius. So, makes sense to introduce new variable.
Also, note that the range is 0 ≤ μ ≤ 1.

λToμRule = λ -> -μ - Ω^2;

R2exprtmp=Simplify[myR[r]^2/.CDEErules /. λToμRule, s > 0]
pexpr=Simplify[myp[r] /. CDEErules /. λToμRule, s > 0]
aexpr=Simplify[mya[r]/.CDEErules /. λToμRule, s > 0]
αexpr=Simplify[myα[r]/.CDEErules /. λToμRule,{r > 0, s > 0}]
Mexpr=Simplify[myM[r]/.CDEErules /. λToμRule]
βexpr=Simplify[myβ[r]/.CDEErules /. λToμRule, s > 0]
Jexpr = Simplify[Sqrt[myJ[r]^2/.CDEErules /. λToμRule],Assumptions->{r > 1, 0 < κ < 1, 0 < μ < 1, Ω > 0, s > 0}]

In the case of R, we can rewrite it in a much simpler form:

R2expr = s^2 ( μ(r^2/s^2-1) -2 (1-μ)/(1/κ-1) (r^(1-1/κ)/s^(1-1/κ) - 1))
Simplify[R2expr-R2exprtmp, s > 0]
Clear[R2exprtmp]

C, D, E

CtildeRuletmp2 = Ctilde -> Ω^2 (3-1/κ)+λ (1/κ+1);

CtildeRuletmp= Ctilde -> -(Ω^2+λ) (1+1/κ)+2 Ω^2 (1/κ-1)

Simplify[(C /. CtildeRuletmp) - (C /. CtildeRuletmp2)]
Clear[CtildeRuletmp2]

CtildeRule = CtildeRuletmp /. λToμRule // Simplify
Clear[CtildeRuletmp]

CDEErules /. λToμRule // Simplify

The asymptotic limit

pcentral=Simplify[pexpr/.CDEErules/.r->s, s > 0]

Mtottmp=Simplify[Limit[Simplify[Mexpr/.CDEErules],r->Infinity,Assumptions->{0 < κ<1}]]

Mtot = Collect[Mtottmp, μ, FullSimplify]

Easier for Mathematica :

J2tot=Limit[Simplify[Jexpr^2 /. Crule /. EErule],r->Infinity,Assumptions->{0 < κ<1, s > 0}] /. CDEErules // Simplify

And to get the sign of the square root  (the condition for κ is nonsensical):

Limit[Simplify[D[Jexpr/.CDEErules,Ω]/.Ω->0],r->Infinity,Assumptions->{0 < κ<1, s > 0}]

The case μ = 0

Simplify[R2expr/.CDEErules/.μ -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[aexpr/.CDEErules/.μ -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[αexpr/.CDEErules/.μ -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[Mexpr/.CDEErules/.μ -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[pexpr/.CDEErules/.μ -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]

The case μ = Ω = 0

This is a bit more restrictive and corresponds to flat, spin-less solution.

Simplify[R2expr/.CDEErules/.μ -> 0 /. Ω -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[aexpr/.CDEErules/.μ -> 0 /. Ω -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[αexpr/.CDEErules/.μ -> 0 /. Ω -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[Mexpr/.CDEErules/.μ -> 0 /. Ω -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[pexpr/.CDEErules/.μ -> 0 /. Ω -> 0, Assumptions-> {0<κ<1, s > 0, r > s}]

The case μ = 1

We see that this corresponds to vaccum adS space. The factors of Ω simply come because we are considering a rotation frame. Look at the metric and consider a change of coordinate θ -> θ - Ωt. Then the metric looks like
-(1+(k^2)(R^2)) (dt^2) + (1/(1+(k^2)(R^2)))(dR^2)+(R^2)((dθ)^2), where (k^2) = ((1+(Ω^2))/(s^2)).

Simplify[R2expr/.CDEErules/.μ -> 1, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[aexpr/.CDEErules/.μ -> 1, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[αexpr/.CDEErules/.μ -> 1, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[βexpr/.CDEErules/.μ -> 1, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[Mexpr/.CDEErules/.μ -> 1, Assumptions-> {0<κ<1, s > 0, r > s}]
Simplify[pexpr/.CDEErules/.μ -> 1, Assumptions-> {0<κ<1, s > 0, r > s}]

The case Ω = 0

In terms of r

We set Ω = 0 in all the relevant expressions which will be used later. Note in R and M, we do not use s > 0 assumption, because it is easier for Mathematica for calculations and simplification.

R2exprΩ0=Simplify[R2expr /. λToμRule /. Ω -> 0]
pexprΩ0=Simplify[pexpr /. λToμRule /. Ω -> 0, s > 0]
aexprΩ0=Simplify[aexpr /. λToμRule /. Ω -> 0, s > 0]
αexprΩ0=Simplify[αexpr /. λToμRule /. Ω -> 0,{r > 0, s > 0}]
MexprΩ0=Simplify[Mexpr /. λToμRule /. Ω -> 0]
βexprΩ0=Simplify[βexpr /. λToμRule /. Ω -> 0, s > 0]

In terms of y

We set Ω = 0 in all the relevant expressions which will be used later. Note in R and M, we do not use s > 0 assumption, because it is easier for Mathematica for calculations and simplification.

x2exprΩ0y=Simplify[R2expr/s^2 /. λToμRule /. Ω -> 0 /. r -> y s, s > 0]
pexprΩ0y=Simplify[pexpr /. λToμRule /. Ω -> 0/. r -> y s, s > 0]
aexprΩ0y=Simplify[aexpr /. λToμRule /. Ω -> 0/. r -> y s, s > 0]
αexprΩ0y=Simplify[αexpr /. λToμRule /. Ω -> 0/. r -> y s,{y > 0, s > 0}]
gexprΩ0y=Simplify[αexpr/aexpr /. λToμRule /. Ω -> 0/. r -> y s,{y > 0, s > 0}]
MexprΩ0y=Simplify[Mexpr /. λToμRule /. Ω -> 0/. r -> y s, s > 0]
βexprΩ0y=Simplify[βexpr /. λToμRule /. Ω -> 0 /. r -> y s, s > 0]

Analysis

We find the extrema of a, which are not trivial unlike those for α. In terms of R, this is a’(R) = a’(r)/R’ = 2R a'(r)/((R^2))'.

Simplify[D[aexprΩ0y,y]/D[Sqrt[x2exprΩ0y],y]]

The zeroes are then clear, recalling y ≥ 1. It has extrema (SubMinus[y])=1 and (SubPlus[y]) = (((((1-μ)/(κμ))))^(κ/(1+κ))) if μ ≠ 0.

aExtremayMinus = 1;
aExtremayPlus = ((1-μ)/(κ μ))^(1/(1+1/κ)) // Simplify;

We check the nature of the extrema,

Simplify[D[D[aexprΩ0y,y]/D[Sqrt[x2exprΩ0y],y],y]/D[Sqrt[x2exprΩ0y],y]] /. y -> aExtremayMinus // Simplify
appExtreamPlus = FullSimplify[Simplify[D[D[aexprΩ0y,y]/D[Sqrt[x2exprΩ0y],y],y]/D[Sqrt[x2exprΩ0y],y]] /. y -> aExtremayPlus,{0 < κ < 1, 0 < μ < 1}]

From above, note that  (SubPlus[y]) only makes sense if μ < (1/(1+κ)). Rescaling μ and plotting, we see that the sign of a’’ is always non-positive.

tmp = appExtreamPlus /. μ -> μs/ (1+κ) // Simplify;
Plot3D[tmp,{κ,0,1},{μs,0,1}]
Clear[tmp]

Compile solution for Ω = 0

In terms of R and coordinate r

staticΩ0SolRule = {R -> Function[r, Evaluate[Sqrt[R2exprΩ0]]],g -> Function[{t,r}, Evaluate[αexprΩ0/aexprΩ0]],M -> Function[{t,r}, Evaluate[MexprΩ0]],
ϱ -> Function[{t,r}, Evaluate[4 Pi R2exprΩ0 pexprΩ0/κ]],V -> Function[{t,r}, 0]} // Simplify

In terms of x and coordinate y

For linear perturbations, it is convenient to re-write in terms of y = r/s and x = R/s. Note that then the scale is explicitly gone from the variables, as they should by dimensionality.

staticΩ0SolInTermsOfyRule = {x -> Function[y, Evaluate[Simplify[Sqrt[R2exprΩ0]/s /. r -> y s,s > 0]]],
g -> Function[y, Evaluate[Simplify[αexprΩ0/aexprΩ0 /. r -> y s,{s > 0, y > 1}]]],M -> Function[y, Evaluate[Simplify[MexprΩ0 /. r -> y s,{s > 0, y > 1}]]],
ϱ -> Function[y, Evaluate[Simplify[4 Pi R2exprΩ0 pexprΩ0/κ /. r -> y s,s > 0]]],V -> Function[y, 0]} // Simplify

In terms of coordinate x for μ << 1

Perturbation of y = y((R^2))

While (R^2)  =(R^2)(y) cannot in general be inverted, we wish to find a perturbation expression of the form: y = y((R^2);μ) = y((R^2);0) + μ δy((R^2)).
Plug this ansatz into the expression for (R^2) and only retain to linear order in μ.
Note: expanding in μ implies that the factors of y are not too big. This of course breaks down near the surface which can be defined by y -> ∞. Near this region, we have (R^2) ~ ((y^2)- 1)μ to leading order instead.

x2EqnμSmall = Table[SeriesCoefficient[x^2 - x2exprΩ0y /. y -> (Subscript[y, 0])+μ δy,{μ,0,n}],{n,0,1}]

Solve for (Subscript[y, 0]) (which is known already as this is just the case μ = 0) and for the perturbation δy. We also express everything in terms of χ = 1-((x^2)/(Subscript[x, ⋆]^2)) and convenience. We will replace it later.

y0δySoltmp = Flatten[FullSimplify[Solve[x2EqnμSmall == 0,{(Subscript[y, 0]),δy}],{0 < κ < 1}]] // Quiet;
y0δySol = Simplify[y0δySoltmp /. x^2 -> 2 κ (1-χ)/(1-κ),{χ > 0, 0 < κ < 1}]
Clear[y0δySoltmp]

Expressions

Substitute this into the expressions for the metric and matter variables, then expand in terms of μ.

MexprΩ0yμSmall = Normal[FullSimplify[Series[MexprΩ0y /. y -> (Subscript[y, 0])+μ δy /. y0δySol,{μ,0,1}],{χ > 0, 0 < κ < 1}]]
aexprΩ0yμSmall = Normal[FullSimplify[Series[aexprΩ0y /. y -> (Subscript[y, 0])+μ δy /. y0δySol,{μ,0,1}],{χ > 0, 0 < κ < 1}]]
αexprΩ0yμSmall = Normal[FullSimplify[Series[αexprΩ0y /. y -> (Subscript[y, 0])+μ δy /. y0δySol,{μ,0,1}],{χ > 0, 0 < κ < 1}]]
gexprΩ0yμSmall = Normal[FullSimplify[Series[gexprΩ0y /. y -> (Subscript[y, 0])+μ δy /. y0δySol,{μ,0,1}],{χ > 0, 0 < κ < 1}]]
pexprΩ0yμSmall = Normal[FullSimplify[Series[pexprΩ0y /. y -> (Subscript[y, 0])+μ δy /. y0δySol,{μ,0,1}],{χ > 0, 0 < κ < 1}]]
ϱexprΩ0yμSmall = Collect[4 Pi (Subscript[x, ⋆])^2 (1-χ) s^2/κ pexprΩ0yμSmall /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)],μ,Simplify]

Simplify

mym = 2/(1-κ);
Masstmp = ((1+κ) χ^(mym-1) - (1+κ) χ +2 κ^2 (1-χ^mym))/(κ (1-κ))
gtmp = (1+κ)/(2 κ) (-1+χ^(-mym+2))
ϱtmp = -(1-χ)/(2 κ (1-κ)^2) ((1+κ)^2 χ^(mym-2) - (1-κ^2) - 4 κ^2 χ^(mym-1))

Simplify[Masstmp - D[MexprΩ0yμSmall,μ] /. x^2 -> (Subscript[x, ⋆])^2 (1-χ) ,{0 < χ < 1, 0 < κ < 1}]
Simplify[gtmp - D[gexprΩ0yμSmall,μ]/. x^2 -> (Subscript[x, ⋆])^2 (1-χ) ,{0 < χ < 1, 0 < κ < 1}]
Simplify[ϱtmp - D[ϱexprΩ0yμSmall,μ] /. x^2 -> (Subscript[x, ⋆])^2 (1-χ) ,{0 < χ < 1, 0 < κ < 1}]
Clear[mym,Masstmp,gtmp,ϱtmp]

Some plots

Parametric plots

myparams={μ->1/4, s -> 0.1, κ->1/2,ymax->10};
Defer[μ > 0]
GraphicsRow[{ParametricPlot[{Sqrt[x2exprΩ0y],pexprΩ0y}/.myparams,Evaluate[{y,1,ymax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{"x","p"}],
ParametricPlot[{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams,Evaluate[{y,1,ymax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{"x","M"}]}]

It is interesting to see what happens to a for non-zero μ and thus Λ. Note that a does not blow up, unlike the Λ=0 case! where the maximum blows up as μ ->0 and the location as μ -> 0 is: (x^2) = (Subscript[x, ⋆]^2) = ((2κ)/(1-κ)).
There is a dependence on μ, but this -> 0 as μ -> 0.

myparams={μ->1/4,κ->1/2,ymax->30};
Defer[μ > 0]
ParametricPlot[{Sqrt[x2exprΩ0y],1/Sqrt[μ x2exprΩ0y- MexprΩ0y]}/.myparams,Evaluate[{y,1,ymax}/.myparams],AspectRatio->1,AxesLabel->{"x","a"},PlotRange->{{0,15},{0,1.5}}]

Plotting with different values of μ for a. As a side note, the plot is the same if using the relation between a and M. Here we use expression for a directly.

myparams={κ->1/2,ymax->100};
Legended[Show[
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 1/2}]],Evaluate[{y,1,ymax}/.myparams],AspectRatio->1,AxesLabel->{"x","a"}, PlotRange->{{0,12},{0,9}},PlotStyle->Darker[Yellow]],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 1/4}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Orange],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 1/8}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Green],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 1/16}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Blue],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 1/32}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Red],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 1/64}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Purple],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],aexprΩ0y}/.myparams /. μ -> 0}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Black]
],Placed[LineLegend[{Darker[Yellow],Orange,Green,Blue,Red,Purple,Black},{"μ = 1/2","μ = 1/4","μ = 1/8","μ = 1/16","μ = 1/32","μ = 1/64","μ = 0"}],{0.8,0.6}]]

myparams={κ->1/2,ymax->120};
Show[
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 1/2}]],Evaluate[{y,1,ymax}/.myparams],AspectRatio->1,AxesLabel->{"x","M"}, PlotRange->{{0,12},{-1,0.4}},PlotStyle->Darker[Yellow]],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 1/4}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Orange],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 1/8}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Green],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 1/16}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Blue],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 1/32}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Red],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 1/64}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Purple],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],MexprΩ0y}/.myparams /. μ -> 0}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Black]
]

myparams={κ->1/2,ymax->120};
Show[
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 1/2}]],Evaluate[{y,1,ymax}/.myparams],AspectRatio->1,AxesLabel->{"x","α/a"}, PlotRange->{{0,3},{0,6}},PlotStyle->Darker[Yellow]],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 1/4}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Orange],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 1/8}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Green],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 1/16}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Blue],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 1/32}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Red],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 1/64}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Purple],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],gexprΩ0y}/.myparams /. μ -> 0}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Black]
]

myparams={κ->1/2,ymax->40};
Show[
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 1/2}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,AspectRatio->1,AxesLabel->{"x","(s^2)ρ"}, PlotRange->{{0,3},{0,0.08}},PlotStyle->Darker[Yellow]],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 1/4}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,PlotStyle->Orange],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 1/8}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,PlotStyle->Green],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 1/16}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,PlotStyle->Blue],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 1/32}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,PlotStyle->Red],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 1/64}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,PlotStyle->Purple],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],pexprΩ0y s^2/κ}/.myparams /. μ -> 0}]],Evaluate[{y,1,ymax}/.myparams],PlotPoints -> 500,PlotStyle->Black]
]

myparams={κ->1/2,ymax->40};
Legended[Show[
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],x2exprΩ0y pexprΩ0y s^2/κ}/.myparams /. μ -> 1/2}]],Evaluate[{y,1,ymax}/.myparams],
AspectRatio->1,AxesLabel->{"x","(R^2)ρ"}, PlotRange->{{0,5},{0,0.02}},PlotStyle->Blue],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],x2exprΩ0y pexprΩ0y s^2/κ}/.myparams /. μ -> 1/4}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Orange],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],x2exprΩ0y pexprΩ0y s^2/κ}/.myparams /. μ -> 1/8}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Green],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],x2exprΩ0y pexprΩ0y s^2/κ}/.myparams /. μ -> 1/16}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Red],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],x2exprΩ0y pexprΩ0y s^2/κ}/.myparams /. μ -> 1/32}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Purple],
ParametricPlot[Flatten[Evaluate[{{Sqrt[x2exprΩ0y],x2exprΩ0y pexprΩ0y s^2/κ}/.myparams /. μ -> 1/64}]],Evaluate[{y,1,ymax}/.myparams],PlotStyle->Black]
],Placed[LineLegend[{Blue,Orange,Green,Red,Purple,Black},{"μ = 1/2","μ = 1/4","μ = 1/8","μ = 1/16","μ = 1/32","μ = 1/64"}],{0.8,0.5}]]

Limiting case where μ = 0.

myparams={μ->0,s->1,κ->1/2,Ω->1/2,rmax->7};
Defer[μ = 0]
GraphicsRow[{ParametricPlot[{Sqrt[R2expr],pexpr}/.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,p}],
ParametricPlot[{Sqrt[R2expr],Mexpr}/.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,M}],
ParametricPlot[{Sqrt[R2expr],βexpr}/.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,β}]}]

Try case where μ  < 0.

myparams={μ->-1/2,s->1,κ->1/2,Ω->1/2,rmax->5};
Defer[Ω < 0]
GraphicsRow[{ParametricPlot[{Sqrt[R2expr],pexpr}/.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,p}],
ParametricPlot[{Sqrt[R2expr],Mexpr}/.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,M}]}]

Ω = 0, μ << 1 plots and comparison

comparing expression of a with μ small either directly or using its relation with M. It does a bad job near the “surface” because y -> ∞ at the “surface” and so the terms μ, (μ^2) etc are actually not negligeable.

myμparatmp = 0.001;
Show[Plot[aexprΩ0yμSmall /. κ -> 1/2 /. μ -> myμparatmp,{χ,0,1}],
Plot[1/Sqrt[μ (Subscript[x, ⋆])^2 (1-χ)-MexprΩ0yμSmall] /. (Subscript[x, ⋆])^2 ->  2 κ/(1-κ) /. κ -> 1/2 /. μ -> myμparatmp,{χ,0,1}]
]

Comparing expression of a for small μ with correct one using parametric plotting.

myparams={μ->0.001,s->1,κ->1/2,Ω->0,rmax->7};
Show[Plot[aexprΩ0yμSmall /. myparams,{χ,0,1}],
ParametricPlot[{1-R2expr/(Subscript[x, ⋆])^2,aexpr}/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,p}]
]

same but for α now.

myparams={μ->0.001,s->1,κ->1/2,Ω->0,rmax->7};
Show[Plot[αexprΩ0yμSmall /. myparams,{χ,0,1}],
ParametricPlot[{1-R2expr/(Subscript[x, ⋆])^2,αexpr}/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /.myparams,Evaluate[{r,s,rmax}/.myparams],PlotRange->All,AspectRatio->1,AxesLabel->{R,p}]
]

Check that this satisfies EFE

Via direct substitution of metric

tmpRule =Simplify[ {α -> Function[{t,r}, Evaluate[αexprΩ0]],a -> Function[{t,r}, Evaluate[aexprΩ0]],R -> Function[{r}, Evaluate[Sqrt[R2exprΩ0]]], ρ -> Function[{t,r}, Evaluate[pexprΩ0/κ]]},{r>0,s>0}];
gmetDDtest = gmetDD /.tmpRule // Simplify;
Simplify[einsteinDD[gmetDDtest,cc] - 8 Pi stressDD /. V -> Function[{t,r},0] /. tmpRule /. Λ -> λ/s^2 /. λToμRule /. Ω -> 0,{r>0,s>0}]

Plug solution into PDEs

tmp1 = metricMatterEqnSolMr /. staticΩ0SolRule /. Λ -> -μ/s^2 // Simplify;
tmp2 = D[M[t,r],r] /. staticΩ0SolRule // Simplify;
Simplify[tmp1 - tmp2]
tmp1 = metricMatterEqnSolgr /. staticΩ0SolRule /. Λ -> -μ/s^2 // Simplify;
tmp2 = D[g[t,r],r] /. staticΩ0SolRule // Simplify;
Simplify[tmp1 - tmp2]
tmp1 = metricMatterEqnSolMt /. staticΩ0SolRule /. Λ -> -μ/s^2 // Simplify;
tmp2 = D[M[t,r],t] /. staticΩ0SolRule // Simplify;
Simplify[tmp1 - tmp2]
tmp1 = metricMatterEqnSolϱr /. staticΩ0SolRule /. Λ -> -μ/s^2 // Simplify;
tmp2 = D[ϱ[t,r],r] /. staticΩ0SolRule // Simplify;
Simplify[tmp1 - tmp2]
tmp1 = metricMatterEqnSolVr /. staticΩ0SolRule /. Λ -> -μ/s^2 // Simplify;
tmp2 = D[V[t,r],r] /. staticΩ0SolRule // Simplify;
Simplify[tmp1 - tmp2]
Clear[tmp1,tmp2]

Numerical solution for Λ < 0 through Papapetrou coordinate

This method is not as nice as the one after, so it is a bit deprecated. Made non-evaluable.

alg eqn to polar radial with only parameter C

First, re-write alg eqn for f(r) (see notes) with only parameter C. This obtained from C-(Df^((Γ-1)/Γ))-((Λf)^2) = (r^2). From f’/r = 1 at center, we find the following relation for C:

cf0expr = C - Γ/(1-Γ) (2 f0 + Λ (1+Γ)/Γ f0^2)

Solve for f0. Note that there are two solutions. Both should exhibit positive f(r), as they should as α = f(r). This is readily true for 2nd, although first needs C > 0.
Also, the first has the correct limit as Λ -> 0 (coincides with what it should be had we taken Λ=0 to start with), while the other is not well defined. Roughly, the first’s solution makes the Λ -> 0 and Λ=0 coincide, the second does not.
For completeness, we will try both possibilities.

f0Rule1 = Flatten[Simplify[Solve[cf0expr == 0,f0], 0 < Γ < 1]][[1]]
f0Rule2 = Flatten[Simplify[Solve[cf0expr == 0,f0], 0 < Γ < 1]][[2]]

The below is al algebraic equation that needs to vanish.

funcpr = C-D f[r]^((Γ-1)/Γ) -Λ f[r]^2-r^2

Evaluate at 0, plug above expressions for C and get “dual” relation for D.

DRule = D -> 2 Γ/(1-Γ) f0^(1/Γ) (1+Λ f0)

funcprNoD1 = Simplify[funcpr /. DRule /. f0Rule1]
funcprNoD2 = Simplify[funcpr /. DRule /. f0Rule2]

Fix parameters

Now, fix all the parameters.

ΓRule = Γ -> 1/2;
ΛRule  = Λ -> - Pi^2/4;
paraRule = {ΓRule,ΛRule}
CRule1 = C -> Γ^2/(Abs[Λ] (1-Γ^2))/80(* needs to be between 0 and (Γ^2)/(Abs[Λ] (1-(Γ^2))))*)
CRule2 = C -> Γ^2/(Abs[Λ] (1-Γ^2))/2(* only needs to be less than (Γ^2)/(Abs[Λ] (1-(Γ^2))). It could therefore be negative!!*)

Numerical solution

funcprNoD1Invertible = Simplify[funcprNoD1  /. CRule1/. paraRule]
funcprNoD2Invertible = Simplify[funcprNoD2  /. CRule2/. paraRule]

Numerically solve for f. Note that for (c^2)=1/2 as in here, get 3rd order poly eqn and could thus find analytical solution.

frSolRule1 = Simplify[NSolve[funcprNoD1Invertible == 0,f[r],Reals], r > 0]
frSolRule2 = Simplify[NSolve[funcprNoD2Invertible == 0,f[r],Reals], r > 0]

One easily checks that 2nd solution in both cases produces negative valued f(x) and should thus be discarded. 
The discontinuity for 1st solution depends of course on the parameters.

rdiscont1 = Last[Last[f[r] /.frSolRule1[[1]]]]
rdiscont2 = Last[Last[f[r] /.frSolRule2[[1]]]]

We note that 1st and 3rd solution nicely coincide at the discontinuity. So, we will take this piecewise function as the solution.

Show[Plot[f[r] /. frSolRule1[[1]],{r,0,rdiscont1}],Plot[f[r] /. frSolRule1[[3]],{r,rdiscont1,1}],PlotRange -> {{0,1},{0,0.6}}]
Show[Plot[f[r] /. frSolRule2[[1]],{r,0,rdiscont2}],Plot[f[r] /. frSolRule2[[3]],{r,rdiscont2,1}],PlotRange -> {{0,1},{0,0.6}}]

fSol1 = Piecewise[{{Normal[f[r] /. frSolRule1[[1]]], 0 < r< rdiscont1},{Normal[f[r] /. frSolRule1[[3]]], r > rdiscont1}}];
fSol2 = Piecewise[{{Normal[f[r] /. frSolRule2[[1]]], 0 < r< rdiscont2},{Normal[f[r] /. frSolRule2[[3]]], r > rdiscont2}}];

Now, from f, can find a = f’/r.

fpr1 = Piecewise[{{D[Normal[f[r] /. frSolRule1[[1]]],r], 0 < r< rdiscont1},{D[Normal[f[r] /. frSolRule1[[3]]],r], r > rdiscont1}}];
fpr2 = Piecewise[{{D[Normal[f[r] /. frSolRule2[[1]]],r], 0 < r< rdiscont2},{D[Normal[f[r] /. frSolRule2[[3]]],r], r > rdiscont2}}];

afunc1 = fpr1/r;
afunc2 = fpr2/r;

Compute and plot mass M now.

Mfunc1 = -Λ r^2-1/afunc1^2 /. paraRule;
Mfunc2 = -Λ r^2-1/afunc2^2 /. paraRule;

Compute α.

αfunc1 = fSol1;
αfunc2 = fSol2;

Comparison with the static Λ = 0 solution

Show[Plot[Mfunc1,{r,0,1},PlotRange->{{0,0.5},{-1,0.5}}],Plot[M[x] /. MsSolRule /. A -> 30 /. RToxRule/. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,0.5}]]

We see that first sol does resemble static Λ=0 quite a bit, with a departure from it only at the end. On the other hand, the 2nd solution is very different, presumably because it misses the consistency between Λ -> 0 and Λ=0 as previously discussed.
This solution is therefore probably not important?

Show[Plot[Mfunc2,{r,0,5},PlotRange->{{0,5},{-1,0.3}}],Plot[M[x] /. MsSolRule /. A ->0.6 /. RToxRule/. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,5}]]

Note: in the code, if a solution has actually M go to zero  “too far” for Mfunc1, as Mfunc1 crosses 0 at the latest at around 0.6 (when C is maximal), consider instead Mfunc1(r/λ), where λ>1 parameter. This allows to get Mfunc to cross 0 later.

rescalepara = 2.7;
Mfuncrescaled = Mfunc1 /. r -> r/rescalepara ;
Show[Plot[Mfuncrescaled,{r,0,3},PlotRange->{{0,1},{-1,0.3}}],Plot[M[x] /. MsSolRule /. RToxRule/. A -> 2 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1}]]

Trying to fit all the variables for a given static solution

We will take a static solution which hits 0 “far enough” that a rescaling is appropriate. The value of A = 0.5 below is motivated from the Fortran code as it is with that value that the variables look very similar to the corresponding static sol for Λ=0.
So, if we want instead the static sol to be Λ < 0, we need it to be close to its Λ=0 counterpart.
Note: the below is achieved for C which is 1/80 its maximal value. In general, the closer C is to 0, the closer both static sol will look alike. This might be because this is equivalent to fixing C in the solution and taking Λ -> 0 instead?
Heuristically, as we saw above, this is also because the smaller C, the smaller the total mass M. Since for Λ = 0, total mass asymptotes 0, then for a good fit, the total mass for Λ<0 should stay close to 0 as well.
For this case, this is maybe the best guess, because from the code, we only want both solutions to coincide up to about r = 1.1. After that, especially for a, the solution should stay finite, as it does for a with Λ < 0, and by r = 1.3, there should be a big difference.
That is why, one should not make C too small either.

For a α, ρ

rescalepara = 34.4;
afuncrescaled = afunc1 /. r -> r/rescalepara ;
Show[Plot[afuncrescaled,{r,0,1.5}],Plot[1/Sqrt[-M[x]]/. MsSolRule /. RToxRule/. A -> 0.5 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1.5}],PlotRange -> {{0,1.5},{1,40}}]

Now, for α, recall the gauge freedom t -> kt, where k is a constant, which we use to impose that α(0)=1 on our numerical solution.

rescaleα = 1/(αfuncrescaled /. r -> 0.00000001);
rescalepara = 34.4;
αfuncrescaled = αfunc1 /. r -> r/rescalepara;
Show[Plot[rescaleα αfuncrescaled,{r,0,1.5}],Plot[ψ[x]/Sqrt[-M[x]]/. MsSolRule/. ψsSolRule /. RToxRule /. A -> 0.5 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1.5}],PlotRange -> {{0,1.3},{0,6}}]

Finally, comparing ω = 4 π (r^2) ρ.
Note: in the Cataldo paper, the 4π is absorbed into the stress tensor, which in this case, means that it is absorbed into the density ρ. To take it into account, we will then need to rescale the Cataldo’s ρ by 1/4π.

ρfunc1 = (D (1-Γ)/(2 Γ))^(1+Γ) fSol1^(-(Γ+1)/Γ)/(4 Pi C (1-Γ)) /. DRule /. f0Rule1 /. CRule1 /. paraRule;
rescalepara = 34.4;
ρfuncrescaled = ρfunc1 /. r -> r/rescalepara;
Show[Plot [ρfuncrescaled/rescalepara^2,{r,0,1.4}],Plot[ρ[x]/. ρsSolRule /. RToxRule/. A -> 0.5 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1.4}]]

For M, ψ, ϱ

rescalepara = 34.4;
Mfuncrescaled = Mfunc1 /. r -> r/rescalepara ;
Show[{Plot[Mfuncrescaled,{r,0,1.3},PlotRange->{{0,1.3},{-1,0.3}}, PlotStyle-> Red, PlotLegends-> Placed[{"M(x; Λ = 0)"},{0.8,0.25}]],
Plot[M[x] /. MsSolRule /. RToxRule /. A -> 0.5 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1.3}, PlotLegends-> Placed[{"M(x; Λ < 0)"},{0.8,0.25}]]}]

rescalepara = 34.4;
αfuncrescaled = αfunc1 /. r -> r/rescalepara ;
Show[{Plot[rescaleα αfuncrescaled/afuncrescaled,{r,0,1.3},PlotStyle-> Red, PlotLegends-> Placed[{"ψ(x; Λ = 0)"},{0.3,0.55}]],
Plot[ψ[x] /. ψsSolRule /. RToxRule /. A -> 0.5 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1.5},PlotLegends-> Placed[{"ψ(x; Λ < 0)"},{0.3,0.55}]],PlotRange -> {{0,1.3},{0,1}}}]

Finally, comparing ϱ = 4 π (r^2) ρ.
Note: in the Cataldo paper, the 4π is absorbed into the stress tensor, which in this case, means that it is absorbed into the density ρ. To take it into account, we will then need to rescale the Cataldo’s ρ by 1/4π.

ρfunc1 = (D (1-Γ)/(2 Γ))^(1+Γ) fSol1^(-(Γ+1)/Γ)/(4 Pi C (1-Γ)) /. DRule /. f0Rule1 /. CRule1 /. paraRule;
rescalepara = 34.4;
ρfuncrescaled = ρfunc1 /. r -> r/rescalepara;
Show[Plot [4Pi r^2 ρfuncrescaled/ rescalepara^2,{r,0,1.4},PlotStyle-> Red, PlotLegends-> Placed[{"(r^2)ρ(x; Λ = 0)"},{0.5,0.35}]],
Plot[ϱ[x]/. ϱsSolRule /. RToxRule /. A -> 0.5 /. (Subscript[c, s]) -> 1/Sqrt[2],{x,0,1.4}, PlotLegends-> Placed[{"(r^2)ρ(x; Λ < 0)"},{0.5,0.25}]]]

Mathematica -> gnuplot converter

Note: not efficient, should only need to calculate the function only once, while here it redoes the calculation for each time iteration.

2d plot

M converter

filename = "M2d.gp";
rmin = 0.0001;
rmax = 2;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[rcurrent = rmin + i dr; datainput = StringJoin[ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(Mfuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,filepath,dr,rcurrent,datainput]

a converter

filename = "a2d.gp";
rmin = 0.0001;
rmax = 2;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[rcurrent = rmin + i dr; datainput = StringJoin[ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(afuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,filepath,dr,rcurrent,datainput]

α converter

filename = "alpha2d.gp";
rmin = 0.0001;
rmax = 2;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[rcurrent = rmin + i dr; datainput = StringJoin[ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(rescaleα αfuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,filepath,dr,rcurrent,datainput]

ψ converter

filename = "psi2d.gp";
rmin = 0.0001;
rmax = 2;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[rcurrent = rmin + i dr; datainput = StringJoin[ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(rescaleα αfuncrescaled / afuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,filepath,dr,rcurrent,datainput]

ϱ converter

filename = "varrho2d.gp";
rmin = 0.0001;
rmax = 2;
interpolationpts = 300;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[rcurrent = rmin + i dr; datainput = StringJoin[ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(4Pi r^2 ρfuncrescaled/ rescalepara^2 /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,filepath,dr,rcurrent,datainput]

3d plot

M converter

filename = "M3d.gp";
rmin = 0.0001;
rmax = 2;
tinit = 0;
dt = 0.1;
interpolationpts = 300;
tinterpolpts = 20;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[tcurrent = tinit + j dt; Do[rcurrent = rmin + i dr;datainput = StringJoin[ToString[tcurrent], "   ",ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(Mfuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,20}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,tinit, dt,filepath,dr,rcurrent, tcurrent,datainput]

a converter

filename = "a3d.gp";
rmin = 0.0001;
rmax = 2;
tinit = 0;
dt = 0.1;
interpolationpts = 300;
tinterpolpts = 20;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[tcurrent = tinit + j dt; Do[rcurrent = rmin + i dr;datainput = StringJoin[ToString[tcurrent], "   ",ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(afuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,20}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,tinit, dt,filepath,dr,rcurrent, tcurrent,datainput]

α converter

filename = "alpha3d.gp";
rmin = 0.0001;
rmax = 2;
tinit = 0;
dt = 0.1;
interpolationpts = 300;
tinterpolpts = 20;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[tcurrent = tinit + j dt; Do[rcurrent = rmin + i dr;datainput = StringJoin[ToString[tcurrent], "   ",ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(rescaleα αfuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,20}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,tinit, dt,filepath,dr,rcurrent, tcurrent,datainput]

ψ converter

filename = "psi3d.gp";
rmin = 0.0001;
rmax = 2;
tinit = 0;
dt = 0.1;
interpolationpts = 300;
tinterpolpts = 20;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[tcurrent = tinit + j dt; Do[rcurrent = rmin + i dr;datainput = StringJoin[ToString[tcurrent], "   ",ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(rescaleα αfuncrescaled/afuncrescaled /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,20}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,tinit, dt,filepath,dr,rcurrent, tcurrent,datainput]

ϱ converter

filename = "varrho3d.gp";
rmin = 0.0001;
rmax = 2;
tinit = 0;
dt = 0.1;
interpolationpts = 300;
tinterpolpts = 20;

filepath = FileNameJoin[{NotebookDirectory[],filename}];
OpenWrite[filepath];
dr = (rmax-rmin)/interpolationpts;

Do[tcurrent = tinit + j dt; Do[rcurrent = rmin + i dr;datainput = StringJoin[ToString[tcurrent], "   ",ToString[rcurrent], "   ",
					StringDelete[ToString[NumberForm[(4Pi r^2 ρfuncrescaled/ rescalepara^2 /. r -> rcurrent),Infinity,ExponentFunction->(Null&)]],"`"]]; 
						WriteLine[filepath, datainput], {i,0,interpolationpts}],{j,0,20}]
Close[filepath]; Clear[filename,rmin,rmax,interpolationpts,tinit, dt,filepath,dr,rcurrent, tcurrent,datainput]

Symbolic solution for Λ < 0 using generalised polar coordinates

alg eqn to polar radial with only parameters s and μ

So, define equation from generalised polar radial to polar radial coordinates.

rToRTransformationEqnF[R_,r_] := s^2 ( μ((r/s)^2-1) -2 (1-μ)/(1/κ-1) ((r/s)^(1-1/κ) - 1)) - R^2
rToRTransformationEqnF[R,r]

Fix parameters

Now, fix all the parameters. Recall that 0 ≤ μ ≤ 1, while “s” is a free length-scale. Since we consider here no rotation, μ = -λ.
In spherical symmetry, the solution is given by a two-parameter family of solution: s and μ.

κRule = κ -> 1/2;
μRule  = μ -> 0.1;
sRuleF[sscale_] := s -> sscale;
μRuleF[μscale_] := μ -> μscale;
fullRuleF[sscale_,μscale_] := Flatten[{κRule,sRuleF[sscale], μRuleF[μscale]}]

Numerical solution

Numerically solve for f. Note that for (c^2)=1/2 as in here, get 3rd order poly eqn and could thus find analytical solution.

rToRTransformationEqnInvertibleSolRuleF[R_,sscale_,μscale_] := Simplify[NSolve[rToRTransformationEqnF[R,r] == 0 /. fullRuleF[sscale,μscale],r, Reals], R > 0]

One easily checks that 2nd solution produces negative valued r and should thus be discarded. The first solution is discontinuous at the shown value of R.
The discontinuity for 1st solution depends of course on the parameters. Note that in the definition of discontinuity, we need to keep R arbitrary for the below to work.

RdiscontF[sscale_,μscale_] := Last[Last[r /.rToRTransformationEqnInvertibleSolRuleF[R,sscale,μscale][[1]]]];

We note that 1st and 3rd solution nicely coincide at the discontinuity. So, we will take this piecewise function as the solution.
Note: For ϵ=2, can solve the eqn algebraically. In this case, get 3 solutions, only “the first one” is real on entire plan, other complex, except at that “discontinuity”. There is no discontinuity for the real solution though.
The real, closed form solution is then precisely this combination here of the first and third solution.
NOTE: below is for possible debugging purposes. Made in non-evaluable. There are warning message popping up. Shouldn’t be a problem....

sscale = 1;
μscale = 0.5;
Show[Plot[r /. rToRTransformationEqnInvertibleSolRuleF[R,sscale,μscale][[1]],{R,0,RdiscontF[sscale,μscale]}],
Plot[r /. rToRTransformationEqnInvertibleSolRuleF[R,sscale,μscale][[3]],{R,RdiscontF[sscale,μscale],RdiscontF[sscale,μscale]+1}],PlotRange -> {{0,RdiscontF[sscale,μscale]+1},{0.,4}}]
Clear[sscale,μscale]

rToRTransformationF[R_,sscale_,μscale_]:= Piecewise[{{Normal[r /. rToRTransformationEqnInvertibleSolRuleF[R,sscale,μscale][[1]]], 0 < R< RdiscontF[sscale,μscale]},
{Normal[r /. rToRTransformationEqnInvertibleSolRuleF[R,sscale,μscale][[3]]], R > RdiscontF[sscale,μscale]}}];

Now that we have r(R), just plug it into the various expressions for the variables.

afuncF[R_,sscale_,μscale_] := aexprΩ0 /. r -> rToRTransformationF[R,sscale,μscale] /. CDEErules /. fullRuleF[sscale,μscale] //Simplify;
MfuncF[R_,sscale_,μscale_] := μscale R^2/sscale^2-1/afuncF[R,sscale,μscale]^2 /. fullRuleF[sscale,μscale];
αfuncFtmp[R_,sscale_,μscale_] := αexprΩ0 /. r -> rToRTransformationF[R,sscale,μscale] /. CDEErules /. fullRuleF[sscale,μscale] //Simplify;
ρfuncF[R_,sscale_,μscale_] := pexprΩ0/κ /. r -> rToRTransformationF[R,sscale,μscale] /. CDEErules /. fullRuleF[sscale,μscale] //Simplify;

Now, currently, the function α still enjoys the gauge freedom from rescaling the time coordinate. We fix it by requiring that α(0)=1.

αfuncF[R_,sscale_,μscale_] := αfuncFtmp[R,sscale,μscale] / αfuncFtmp[1*^-8,sscale,μscale]

Plots

sscale = 0.3;
μscale = 0.1;
GraphicsRow[{Plot[Evaluate[Quiet[αfuncF[R,sscale,μscale]]],{R,0,1},PlotRange->{{0,0.3},{1,1.6}}],
Plot[Evaluate[Quiet[MfuncF[R,sscale,μscale]]],{R,0,1},PlotRange->{{0,1},{-1,0.3}}],
Plot[Evaluate[4 Pi R^2 Quiet[ρfuncF[R,sscale,μscale]]],{R,0,1},PlotRange->{{0,1},{0,0.25}}]}]
Clear[sscale,μscale]

Parametric plots

Now plotting the variables for different value of the scaling parameter. TO ADD LEGEND : , PlotLegends->Placed[{Table[Row[{“scale =”,j}],{j,paratmp}]},Above]

Here, we plot by fixing the dimensionless “cosmological constant” (Subscript[Λ, ω0]) and varying (Subscript[r, 0]). Note that the total mass (Subscript[M, tot]) stays the same, as it should, since it only depends on (Subscript[Λ, ω0]) explicitly and not on (Subscript[r, 0]).

sscale = 1.;
μscale = 0.1;
paratmp = {sscale, sscale/2,sscale/4,sscale/8,sscale/16,sscale/32};
GraphicsRow[{Plot[Evaluate[Quiet[αfuncF[R,#,μscale] & /@ paratmp]],{R,0,2},PlotRange->{{0,1},{1,1.6}}],
Plot[Evaluate[Quiet[MfuncF[R,#,μscale] & /@ paratmp]],{R,0,3},PlotRange->{{0,3},{-1,0.3}}],
Plot[Evaluate[4 Pi R^2 Quiet[ρfuncF[R,#,μscale] & /@ paratmp]],{R,0,3},PlotRange->{{0,3},{0,0.25}}]}]
Clear[paratmp,sscale,μscale]

Here, we plot by fixing the (Subscript[r, 0]) and varying dimensionless “cosmological constant” (Subscript[Λ, ω0]). Note that the total mass (Subscript[M, tot]) goes asymptotically to 0, as it should, since it is proportional to  (Subscript[Λ, ω0]).

sscale = 0.3;
Λω0scale = 0.1;
paratmp = {Λω0scale, Λω0scale/2,Λω0scale/4,Λω0scale/8,Λω0scale/16,Λω0scale/32};
GraphicsRow[{Plot[Evaluate[Quiet[αfuncF[R,sscale,#] & /@ paratmp]],{R,0,1},PlotRange->{{0,0.3},{1,1.6}}],
Plot[Evaluate[Quiet[MfuncF[R,sscale,#] & /@ paratmp]],{R,0,1},PlotRange->{{0,1},{-1,0.3}}],
Plot[Evaluate[4 Pi R^2 Quiet[ρfuncF[R,sscale,#] & /@ paratmp]],{R,0,1},PlotRange->{{0,1},{0,0.25}}]}]
Clear[paratmp,sscale,Λω0scale]

Log parametric plots

Same as above, except, we now plot it on a log plot. Note that the maximum of ϱ stays the same.

sscale = 1.;
μscale = 0.1;
paratmp = {sscale, sscale/2,sscale/4,sscale/8,sscale/16,sscale/32};
GraphicsRow[{Plot[Evaluate[Quiet[αfuncF[Exp[logR],#,μscale] & /@ paratmp]],{logR,Log[1*^-3],Log[2]},PlotRange->{{Log[1*^-3],Log[2]},{1,1.6}}],
Plot[Evaluate[Quiet[MfuncF[Exp[logR],#,μscale] & /@ paratmp]],{logR,Log[1*^-3],Log[10]},PlotRange->{{Log[1*^-3],Log[10]},{-1,0.3}},AxesOrigin->{2,0}],
Plot[Evaluate[4 Pi Exp[logR]^2 Quiet[ρfuncF[Exp[logR],#,μscale] & /@ paratmp]],{logR,Log[1*^-3],Log[10]},PlotRange->{{Log[1*^-3],Log[10]},{0,0.25}},AxesOrigin->{2,0}]}]
Clear[paratmp,sscale,μscale]

sscale = 1;
μscale = 0.1;
paratmp = {μscale, μscale/2,μscale/4,μscale/8,μscale/16,μscale/32};
GraphicsRow[{Plot[Evaluate[Quiet[αfuncF[Exp[logR],sscale,#] & /@ paratmp]],{logR,Log[1*^-2],Log[2]},PlotRange->{{Log[1*^-2],Log[2]},{1,1.6}}],
Plot[Evaluate[Quiet[MfuncF[Exp[logR],sscale,#] & /@ paratmp]],{logR,Log[1*^-2],Log[10]},PlotRange->{{Log[1*^-2],Log[10]},{-1,0.3}},AxesOrigin->{2,0}],
Plot[Evaluate[4 Pi Exp[logR]^2 Quiet[ρfuncF[Exp[logR],sscale,#] & /@ paratmp]],{logR,Log[1*^-2],Log[10]},PlotRange->{{Log[1*^-2],Log[10]},{0,0.25}},AxesOrigin->{2,0}]}]
Clear[paratmp,sscale,μscale]

Note that the increase/decrease in the variables for decreasing (Subscript[Λ, ω0]) goes exponentially at longer scales:

Individual parametric plots

Varying s

sscale = 1.;
μscale = 0.1;
paratmp = {sscale, sscale/2,sscale/4,sscale/8,sscale/16,sscale/32};
Plot[Evaluate[Quiet[αfuncF[Exp[logR],#,μscale] & /@ paratmp]],{logR,Log[1*^-3],Log[2]},PlotRange->{{Log[1*^-3],Log[2]},{1,1.6}},
PlotLegends->Placed[{"s = 1","s = 1/2","s = 1/4","s = 1/8","s = 1/16","s = 1/32"},{{1.0,0.5}}], AxesLabel->{"Log x","α(x)"}]
Plot[Evaluate[Quiet[MfuncF[Exp[logR],#,μscale] & /@ paratmp]],{logR,Log[1*^-3],Log[10]},PlotRange->{{Log[1*^-3],Log[10]},{-1,0.3}},
PlotLegends->Placed[{"s = 1","s = 1/2","s = 1/4","s = 1/8","s = 1/16","s = 1/32"},{{1.0,0.5}}], AxesLabel->{"Log x","M(x)"},AxesOrigin->{2,0}]
Plot[Evaluate[4 Pi Exp[logR]^2 Quiet[ρfuncF[Exp[logR],#,μscale] & /@ paratmp]],{logR,Log[1*^-3],Log[10]},PlotRange->{{Log[1*^-3],Log[10]},{0,0.25}},
PlotLegends->Placed[{"s = 1","s = 1/2","s = 1/4","s = 1/8","s = 1/16","s = 1/32"},{{1.0,0.5}}], AxesLabel->{"Log x","ϱ(x)"},AxesOrigin->{2,0}]
Clear[paratmp,sscale,μscale]

Varying μ

sscale = 1.;
μscale = 0.1;
paratmp = {μscale, μscale/2,μscale/4,μscale/8,μscale/16,μscale/32};
Plot[Evaluate[Quiet[αfuncF[Exp[logR],sscale,#] & /@ paratmp]],{logR,Log[1*^-2],Log[2]},PlotRange->{{Log[1*^-2],Log[2]},{1,1.6}},
PlotLegends->Placed[{"μ = (10^(-1))","μ = (10^(-1))/2","μ = (10^(-1))/4","μ = (10^(-1))/8","μ = (10^(-1))/16","μ = (10^(-1))/32"},{{1.0,0.5}}], AxesLabel->{"Log x","α(x)"}]
Plot[Evaluate[Quiet[MfuncF[Exp[logR],sscale,#] & /@ paratmp]],{logR,Log[1*^-2],Log[10]},PlotRange->{{Log[1*^-2],Log[10]},{-1,0.3}},
PlotLegends->Placed[{"μ = (10^(-1))","μ = (10^(-1))/2","μ = (10^(-1))/4","μ = (10^(-1))/8","μ = (10^(-1))/16","μ = (10^(-1))/32"},{{1.0,0.5}}], AxesLabel->{"Log x","M(x)"},AxesOrigin->{2,0}]
Plot[Evaluate[4 Pi Exp[logR]^2 Quiet[ρfuncF[Exp[logR],sscale,#] & /@ paratmp]],{logR,Log[1*^-2],Log[10]},PlotRange->{{Log[1*^-2],Log[10]},{0,0.25}},
PlotLegends->Placed[{"μ = (10^(-1))","μ = (10^(-1))/2","μ = (10^(-1))/4","μ = (10^(-1))/8","μ = (10^(-1))/16","μ = (10^(-1))/32"},{{1.0,0.5}}], AxesLabel->{"Log x","ϱ(x)"},AxesOrigin->{2,0}]
Clear[paratmp,sscale,μscale]

Exponential behaviour plots

Varying s

sscale = 1.;
μscale = 0.1;
paratmp = {sscale, sscale/2,sscale/4,sscale/8,sscale/16,sscale/32};
LogLogPlot[Evaluate[Quiet[αfuncF[R,#,μscale] & /@ paratmp]],{R,1*^-4,5},
PlotLegends->Placed[{"s = 1","s = 1/2","s = 1/4","s = 1/8","s = 1/16","s = 1/32"},{{1.0,0.5}}], AxesLabel->{"Log x","Log α(x)"}]
LogLogPlot[Evaluate[Quiet[MfuncF[R,#,μscale] & /@ paratmp]],{R,1*^-4,5},
PlotLegends->Placed[{"s = 1","s = 1/2","s = 1/4","s = 1/8","s = 1/16","s = 1/32"},{{1.0,0.5}}], AxesLabel->{"Log x","Log M(x)"}]
LogLogPlot[Evaluate[4 Pi R^2 Quiet[ρfuncF[R,#,μscale] & /@ paratmp]],{R,1*^-4,5},
PlotLegends->Placed[{"s = 1","s = 1/2","s = 1/4","s = 1/8","s = 1/16","s = 1/32"},{{1.0,0.5}}], AxesLabel->{"Log x","Log ϱ(x)"}]
Clear[paratmp,sscale,μscale]

Varying μ

Not sure I trust the output, especially for M. Total mass should go to -∞ as μ -> 0???

sscale = 1.;
μscale = 0.1;
paratmp = {μscale, μscale/2,μscale/4,μscale/8,μscale/16,μscale/32};
LogLogPlot[Evaluate[Quiet[αfuncF[R,sscale,#] & /@ paratmp]],{R,1*^-1,5},
PlotLegends->Placed[{"μ = (10^(-1))","μ = (10^(-1))/2","μ = (10^(-1))/4","μ = (10^(-1))/8","μ = (10^(-1))/16","μ = (10^(-1))/32"},{{1.0,0.5}}], AxesLabel->{"Log x","Log α(x)"}]
LogLogPlot[Evaluate[Quiet[MfuncF[R,sscale,#] & /@ paratmp]],{R,1*^-1,5},
PlotLegends->Placed[{"μ = (10^(-1))","μ = (10^(-1))/2","μ = (10^(-1))/4","μ = (10^(-1))/8","μ = (10^(-1))/16","μ = (10^(-1))/32"},{{1.0,0.5}}], AxesLabel->{"Log x","Log M(x)"}]
LogLogPlot[Evaluate[4 Pi R^2 Quiet[ρfuncF[R,sscale,#] & /@ paratmp]],{R,1*^-1,5},
PlotLegends->Placed[{"μ = (10^(-1))","μ = (10^(-1))/2","μ = (10^(-1))/4","μ = (10^(-1))/8","μ = (10^(-1))/16","μ = (10^(-1))/32"},{{1.0,0.5}}], AxesLabel->{"Log x","Log ϱ(x)"}]
Clear[paratmp,sscale,μscale]

Analytic solution for Λ < 0 and κ = 1/2 in polar coordinates

Fix κ here

κRule = κ -> 1/2;

alg eqn to polar radial with parameters s and μ

So, define equation from generalised polar radial to polar radial coordinates:

rToRTransformationEqnκHalfF[R_,r_] := s^2 ( μ((r/s)^2-1) -2 (1-μ)/(1/κ-1) ((r/s)^(1-1/κ) - 1)) - R^2 /. κRule

Analytical solution

κ=1/2 leads to a 3rd order equation for r(R) which can be solved in closed form. We pick the “first” solution, as it is the one for which r is real.

rToRTransformationEqnInvertibleSolRuleκHalfF= Simplify[Solve[rToRTransformationEqnκHalfF[R,r] == 0 ,r], R > 0][[1]]

Now that we have r(R), just plug it into the various expressions for the variables. Also, write everything in terms of the parameter (Subscript[r, 0]).

afuncκHalf = aexprΩ0 /. rToRTransformationEqnInvertibleSolRuleκHalfF/. κRule//FullSimplify;
MfuncκHalf= μ/s^2 R^2-1/afuncκHalf^2;
αfuncκHalftmp = αexprΩ0 /. rToRTransformationEqnInvertibleSolRuleκHalfF /. κRule//FullSimplify;
ρfuncκHalf= pexprΩ0/κ /. rToRTransformationEqnInvertibleSolRuleκHalfF /. κRule//FullSimplify;

Now, currently, the function α still enjoys the gauge freedom from rescaling the time coordinate. We fix it by requiring that α(0)=1.

αfuncκHalf:= αfuncκHalftmp / (αfuncκHalftmp /. R -> 0)

Compile solution

αsΛNot0κHalfSolRule = α -> Function[R, Evaluate[αfuncκHalf]];
asΛNot0κHalfSolRule = a -> Function[R, Evaluate[afuncκHalf]];
ρsΛNot0κHalfSolRule = ρ -> Function[R, Evaluate[ρfuncκHalf]];
gsΛNot0κHalfSolRule = g -> Function[R, Evaluate[αfuncκHalf/afuncκHalf]] // Simplify;
MsΛNot0κHalfSolRule = M -> Function[R, Evaluate[MfuncκHalf]] //Simplify;
ϱsΛNot0κHalfSolRule = ϱ -> Function[R, Evaluate[4 Pi R^2 ρfuncκHalf]] // Simplify;

Fix parameters

μRule  = μ -> 1/4;
paraRule = {κRule,μRule};
sRuleF[sscale_] := s -> sscale;
fullRuleF[sscale_] := Flatten[{paraRule, sRuleF[sscale]}]

Plots

Has been checked to agree with the symbolic-numerical computation in the previous section. Note that Mathematica does have a bit of trouble drawing M though for different values of μ...

scale = 0.2;
GraphicsRow[{Plot[Evaluate[α[R] /. αsΛNot0κHalfSolRule /. fullRuleF[scale]],{R,0,1},PlotRange->{{0,0.3},{1,1.6}}],
Plot[Evaluate[M[R] /. MsΛNot0κHalfSolRule  /. fullRuleF[scale]],{R,0,1},PlotRange->{{0,1},{-1,0.3}}],
Plot[Evaluate[4 Pi R^2 ρ[R] /. ρsΛNot0κHalfSolRule /. fullRuleF[scale]],{R,0,1},PlotRange->{{0,1},{0,0.2}}]}]

Upgrade from static solution

The below shows that exactly contracting static Λ=0 solutions are not possible.

Ansatz

This is motivated from numerical evidence. From numerics, I can start from initial Gaussian profile for energy density and parametrize it by its amplitude. Turns out that the maximum possible amplitude will lead
the solution to get more and more static as times goes on. However, the max of ρ and its location where it vanishes are not related in the way that the family of static solutions are related.
More precisely, for a given time, if I try to fit a member of the family of static solution to the numerical data, I will find that the latter gets (presumably) 0 at smaller r and the static solution.
I conjecture though that the “distance” separating where they vanish gets smaller with time. This motivates the ansatz:

ϱAnsatzRule = ϱ -> Function[{t,r},Evaluate[A[t] (ϱ[r]/(Subscript[R, ⋆]) /. ϱsSolRule /. (Subscript[R, ⋆]) -> (Subscript[R, ⋆])[t])]]

From (Subscript[g, ,x]) equation, we immediately see that A = B:

gAnsatzRule = g -> Function[{t,r},Evaluate[(g[r]/. gsSolRule /. (Subscript[R, ⋆]) -> (Subscript[R, ⋆])[t])]];
MAnsatzRule = M -> Function[{t,r},Evaluate[(M[r] /. MsSolRule /. (Subscript[R, ⋆]) -> (Subscript[R, ⋆])[t])]];
gMϱAnsatzRule = {gAnsatzRule,MAnsatzRule,ϱAnsatzRule};

Simplify[metricMatterEqnSolgr/. gMϱAnsatzRule /. setΛTo0Rule]

Quiet[Simplify[Flatten[Solve[(D[g[t,r],r] - metricMatterEqnSolgr /. gMϱAnsatzRule /. setΛTo0Rule) == 0,(Subscript[R, ⋆])[t]]],{1-(Subscript[R, ⋆])[t] R[r]^2 > 0, 0 < κ < 1}]]

This simpler upgrade (Subscript[R, ⋆]) ->(Subscript[R, ⋆])(t), corresponds to a solution that “goes through” the whole family of static solution. Similarly,

gMϱAnsatzRule = {gAnsatzRule,MAnsatzRule,ϱAnsatzRule} /. A -> (Subscript[R, ⋆]);

But then, from (Subscript[M, ,x]) equation:

Simplify[(D[M[t,r],r] - metricMatterEqnSolMr == 0 /. gMϱAnsatzRule /. setΛTo0Rule)] /. pp

The above is 0 for V = 0. We end back to our static solution, since V=0 will inevitably cause A(τ)=constant! So, unlike for the Yang-Mills case (see Bizon and Ovchinnikov), if χ(r) is a static solution, then χ(r/s(t)) is a solution, only if s(t) = constant.

Find contracting static solution

From above, we needed V = 0. The idea instead is to look for perturbation such that v ~ ϵ and f = (Subscript[f, 0])(R) + (ϵ^2)(Subscript[f, 2])(t,R) where (OverDot[s])~ϵ and obviously f stands for all variables other than v.
This is formalised by introducing slow time: s = s(ϵ t). Then, for ϵ=0, we retrieve leading order static solution with scale s(0) which is some constant.
From above, leading order is satisfied and leading correction order gives a relation between perturbed parts.
We can find a solution like that instead. In other words, compared to above, the static part is only leading order and velocity v appears at the next order only, whereas above, f has no correction and v is of order 1.

Recall that we have a static solution (Subscript[χ, static])(r) for both Λ=0 and Λ≠0. And both can be written (for specific ϵ in latter case) as functions of R. 
We now try to find a solution of the form f(t,r) = (Subscript[χ, static])(R/s(t)), where s(t) needs to be found. Here f is g, M or ϱ.
On the other hand, V gets updated to V(t,r). So, need to equations. If we plug this ansatz in the PDE, get a seemingly overdetermined system, but for now, wont be bothered by that.
We will choose the (Subscript[M, ,r]) and (Subscript[M, ,τ]) equations. 
In the above section, we tried doing that with Λ=0 in the equations, but found that s needs to be a constant. Now, assume Λ≠0 in the PDE system.
For the static solution, we will first try the one from Λ=0, as we have a closed form result.

Λ < 0 (old)

Λ<0 exact case

IN PROGRESS. non-evaluable.

Since this is now polar radial coordinates, R = r = x.

contractingansatzRule = (Subscript[R, ⋆]) -> (Subscript[R, ⋆])[τ];
ϱΛNot0ϵ2AnsatzRule = ϱ -> Function[{τ,R},Evaluate[ϱ[R]/. ϱsΛNot0ϵ2SolRule /. contractingansatzRule]];
ψΛNot0ϵ2AnsatzRule = ψ -> Function[{τ,R},Evaluate[ψ[R]/. ψsΛNot0ϵ2SolRule /. contractingansatzRule]];
MΛNot0ϵ2AnsatzRule = M -> Function[{τ,R},Evaluate[M[R] /. MsΛNot0ϵ2SolRule /. contractingansatzRule]];
ψMϱΛNot0ϵ2AnsatzRule = {ψΛNot0ϵ2AnsatzRule,MΛNot0ϵ2AnsatzRule,ϱΛNot0ϵ2AnsatzRule};

The below is too hard for Mathematica. So, next section, we will see if we can make the static solution simplier, such as by assuming that (Subscript[r, 0]) is small.

fromgprToprRule = R -> Function[x,x];
MxcontractingEqn = Simplify[(D[M[τ,x],x] - metricMatterEqnSolMx == 0 /. ψMϱΛNot0ϵ2AnsatzRule/. γTocsRule /. fromgprToprRule /. ϵRule /. ϵ -> 1/Sqrt[2])] // Simplify
MτcontractingEqn = Simplify[(D[M[τ,x],τ] - metricMatterEqnSolMτ == 0 /. ψMϱΛNot0ϵ2AnsatzRule/. γTocsRule /. fromgprToprRule)] // Simplify

Try to simplify obtained expression for M assuming r0 small

For now, just try to simplify the expression for M.

Note: could try to only consider r0 small. Note that the rule for M can be written as (- ((C^(2/3)) + AC / ((C^(2/3) + B)^2 + B))^2)/(3^(4/3) r0^2 C^(2/3)) - R^2Λ/(s^2).Now, A ~ (r0^5), while B is either (((~r0))^2)(general) or (((~r0))^3) if R small.
In both cases (C^(2/3)) ~ -B and in fact (C^(2/3))+B ~ 0(r0). To find the factor for r0, can re-write (say for the case where R=0), (C^(2/3))+B = (r0^3) (sqrt(r0 (OverTilde[A])^2 - (OverTilde[B])^3) + r0 (OverTilde[A]))^(2/3)+ (OverTilde[B])), where the tilde mean that terms are of order 1 and are appropriately rescaled versions
of A and B. In both case, this means that for the expression for M, need only consider the “middle” term as it is the one which, when divided with denominator, is of order 1, the others are of some power of r0.

AtmpRule =myA ->  9 r0^5 Λ^2 (1+r0 Λ);
BtmpRule = myB -> 3^(1/3) r0^2 Λ (r0 (2+3 r0 Λ)-R^2/s[τ]^2);
CtmpRule = myC -> myA + Sqrt[myA^2-myB^3];
ABCRule = {AtmpRule, BtmpRule, (CtmpRule /. AtmpRule /. BtmpRule)} 
myM = -(myC^(2/3) + myA myC/(myC^(2/3) + myB)^2+myB)^2/(3^(4/3) r0^2 myC^(2/3))-R^2 Λ/s[τ] /.CtmpRule //Simplify

The below M, is the very same as MΛNot0ϵ2AnsatzRule, although Mathematica has trouble seeing that.

Plot[Evaluate[myM /. ABCRule /. s[τ] -> 1  /. fullRuleF[100000]],{R,0,0.01},PlotRange->{{0,0.002},{-1,0.2}}]

With the above, comment, can take:

r0smallM = (myA (-myB)^(3/2)/(myC^(2/3)+myB)^2)^2  /( 3^(4/3) myB r0^2)-Λ R^2  /. CtmpRule

Plot[Evaluate[r0smallM /. ABCRule /. s[τ] -> 1  /. fullRuleF[100000]],{R,0,0.002},PlotRange->{{0,0.002},{-1,0.2}}]

The above is not very good numerically speaking. Mathematica has visible trouble with it. One can see that as beyond some R, solution becomes seemingly complex and also if the scale factor is not very small, then M is not about -1 at center.
This is due to the fact that there are lots of r0 in the above expression, with “big” powers, so numerical computation is error prone.

Can simplify the expression further by “extracting” and cancelling out the r0 as much as possible. The corresponding variables of order 1 are denoted by tilde. The most tricky part is the (C^(2/3))+B where we use that:

C2o3pBtmp = (Sqrt[r0^10 Atilde^2 - r0^6 Btilde^3]+r0^5 Atilde)^(2/3)+ r0^2 Btilde

Simplify[Series[C2o3pBtmp,{r0,0,4}], {Btilde <0, r0 > 0}]

The above makes it look like it is of order 4. The thing to be careful though, is that near center R=0, Btilde is actually of order r0!!! Away from center, it is of order 1 though, and that is what we took.

AtildetmpRule = myAtilde ->  9 Λ^2 (1+r0 Λ);
BtildetmpRule = myBtilde -> 3^(1/3) Λ (r0 (2+3 r0 Λ)-R^2/s[τ]^2);
CtildetmpRule = myCtilde -> myAtilde + Sqrt[myAtilde^2-myBtilde^3];
ABCtildeRule = {AtildetmpRule, BtildetmpRule, (CtildetmpRule /. AtildetmpRule /. BtildetmpRule)} 
r0smallMV2 = -myBtilde^4 3^(8/3) / (r0^4 2^4 myAtilde^2)  -R^2 Λ/s[τ] /.CtmpRule //Simplify

As mentioned above, near R=0, Btilde is actually of order r0, which cancels with the one from the denominator. The result is what is expected. Note again that this only holds in the r0->0 limit.

Limit[r0smallMV2 /. ABCtildeRule /. R -> 0,r0 -> 0]

This approximation should only be up to order (r0^2)or (r0^3), because the simplification came from ignoring ((C^(2/3))+B)^2 / (r0^2(C^(2/3))). Now, (C^(2/3))~B and B is of order (r0^2) far from center, and (r0^3)close to it.
So, the above approximation is a bit better closer to the center than away and that means that one expects things to break down “far away” from the center first, as one could naively expect I think.

Plot[Evaluate[r0smallMV2 /. ABCtildeRule /. s[τ] -> 1  /. fullRuleF[1000]],{R,0,0.02},PlotRange->{{0,0.02},{-1,0.2}}]

This shows what was clear from the get-go: as you take r0->0, you recover to static Λ=0 solution, just as you would if you took Λ->0. The reason is that any appearance of r0 is always multipled by Λ and so,
intuitively, making r0 small is like making Λ small.

Comparing with the numerical “exact” one:

Show[Plot[Evaluate[M[R] /. MsΛNot0ϵ2SolRule  /. fullRuleF[1000]],{R,0,0.1},PlotRange->{{0,0.02},{-1,0.3}}],
Plot[Evaluate[r0smallMV2 /. ABCtildeRule /. s[τ] -> 1  /. fullRuleF[1000]],{R,0,0.02},PlotRange->{{0,0.02},{-1,0.2}}]
]

Try instead to invert R(r) assuming r0 small and plug result into exact expression for M

Try ignoring powers of 1-ϵ

This is hopefully a bit more general. We ill neglect (r0^ϵ) term in the expression for R. Note, that the bigger ϵ, the better!

tmpRule = r -> Sqrt[r0^2-R^2/Λ]

tmpM = Mexpr /. tmpRule // Simplify

Plot[tmpM /. fullRuleF[10],{R,0,1},PlotRange->{{0,0.2},{-1,0.1}}]

Simplify[tmpM /. R -> 0,{r0 > 0, ϵ > 1}]

As a side note, one CANNOT simplify the above expression for M any further, because if R is small, then r0 cannot be neglected in r0^2-(R^2)/Λ. Also, the power of those terms is negative and thus those terms actually get big as R is small and r0 small!

Here, we compare this result, with the previous one:

Show[Plot[tmpM /. fullRuleF[1000],{R,0,0.2},PlotRange->{{0,0.02},{-1,0.1}}],
Plot[Evaluate[r0smallMV2 /. ABCtildeRule /. s[τ] -> 1  /. fullRuleF[1000]],{R,0,0.02},PlotRange->{{0,0.02},{-1,0.2}}]]

So, this does not work at all! A posteriori, I think that this is because if r is small, but not quite r0, then r^(1-ϵ) is big and so neglecting such terms is not correct.

Try ignoring powers of 2 instead

This is hopefully a bit more general. We ill neglect (r0^2) term in the expression for R. Note, that this is the same as ignoring Λ term as far as (R^2) is concerned.

rOfRIgnoreDRule = r -> (r0^(1-ϵ)+R^2/(D /. Drule))^(1/(1-ϵ))

MOfRr0smallexpr = Mexpr /. rOfRIgnoreDRule // Simplify

Plot[MOfRr0smallexpr /. fullRuleF[10],{R,0,1},PlotRange->{{0,0.2},{-1,0.1}}]

Simplify[MOfRr0smallexpr  /. R -> 0,{r0 > 0, ϵ > 1}]

As a side note, one CANNOT simplify the above expression for M any further, because if R is small, then r0 cannot be neglected in r0^2-(R^2)/Λ. Also, the power of those terms is negative and thus those terms actually get big as R is small and r0 small!

Here, we compare this result, with the previous one:

Show[Plot[MOfRr0smallexpr  /. fullRuleF[1000],{R,0,0.2},PlotRange->{{0,0.02},{-1,0.1}}],
Plot[Evaluate[r0smallMV2 /. ABCtildeRule /. s[τ] -> 1  /. fullRuleF[1000]],{R,0,0.02},PlotRange->{{0,0.02},{-1,0.2}}]]

This works now! A posteriori, I think that this is because if r is small, but not quite r0, then r^(1-ϵ) is big and so neglecting such terms is not correct.

In a similar way, we can define the other variables:

ψOfRr0smallexprtmp = Simplify[αexpr/aexpr /. rOfRIgnoreDRule,{r0 > 0, ϵ > 1}]

Mathematica does not want to simplify even given that term inside square is positive, so we do this manually. note that we rescaled by r0 so that ψ = 1 at center.

Aruletmp = A -> (ϵ-1) / (2 r0 (1+ r0 Λ));
ψOfRr0smallexpr = (1-A R^2) (1+r0 Λ (1-(1-A R^2)^((1+ϵ)/(1-ϵ)))) /. Aruletmp
Clear[Aruletmp]

Compare both to be sure. Note that beyond the singularity, they disagree up to a sign, which comes from the fact that in the above simplification, assumed that term inside squares is positive.

Show[Plot[{ψOfRr0smallexpr} /. fullRuleF[2],{R,0,0.3}], Plot[{ψOfRr0smallexprtmp/r0} /. fullRuleF[2],{R,0,0.3}]]

Finally, for ϱ:

ϱOfRr0smallexprtmp = Simplify[4 Pi R^2 pexpr ϵ /.rOfRIgnoreDRule,{r0 > 0, ϵ > 1}]

ϱOfRr0smallexpr = (1/(2 r0)) R^2 ϵ (1+r0 Λ) (1-((R^2 (-1+ϵ))/(2  r0 (1+r0 Λ))))^((1+ϵ)/(ϵ-1));
Clear[ϱOfRr0smallexprtmp]

Plot[ϱOfRr0smallexpr /. fullRuleF[1000],{R,0,0.02}]

Λ = 0

Λ=0 exact case

Old need update

We try to do something a tad different as in the section “Upgrade from static solution”. Here, we will plug, as before, the static solution in the Einsteins equations, but will keep Λ contribution from equations.
Previously, taking Λ=0, leads to the requirement that s(t) = constant. By adding this Λ contribution (think perturbatively), we could hope to get something non-trivial.

contractingansatzRule = (Subscript[R, ⋆]) ->  (Subscript[R, ⋆])[t];
fromgprToprRule = R -> Function[r,r];
ϱAnsatzRule = ϱ -> Function[{t,r},Evaluate[ϱ[r]/. ϱsSolRule /. contractingansatzRule /. fromgprToprRule]];
gAnsatzRule = g -> Function[{t,r},Evaluate[g[r]/. gsSolRule /. contractingansatzRule /. fromgprToprRule]];
MAnsatzRule = M -> Function[{t,r},Evaluate[M[r] /. MsSolRule /. contractingansatzRule /. fromgprToprRule]];
gMϱAnsatzRule = {gAnsatzRule,MAnsatzRule,ϱAnsatzRule}

MxcontractingEqn = Simplify[(D[M[t,r],r] - metricMatterEqnSolMr == 0 /. gMϱAnsatzRule /. fromgprToprRule)] // Simplify
MτcontractingEqn = Simplify[(D[M[t,r],t] - metricMatterEqnSolMt == 0 /. gMϱAnsatzRule /. fromgprToprRule)] // Simplify

VcontractingSolRule = Simplify[Flatten[Solve[MxcontractingEqn ,V[t,r]]],{0 < κ < 1, Λ < 0}];

This is already enough to know that this will not work because by spherical symmetry, we should have that V = 0 at the center x = 0, but we have:

Simplify[VcontractingSolRule  /. r -> 0]

which in general will not vanish, except for Λ=0. So, using as a base model the static solution from Λ=0 into the equations for Λ≠0 does not work, in the sense that there is no exact solution. 
This was to be expected I guess, since we would really need the static solution with Λ < 0, for consistency. This was done/tried above, but resulting equations are pretty complicated...

Try find ODE for s(t)

From this point onwards, we are in usual polar coordinates: R(r) = r. All the appearances of “r” should then really be R, where R is now treated as the coordinate.
THIS CANNOT BE DONE IF Λ < 0, because to do that, need to express solution in terms of coordinate R first, which cannot be done.
SO, BEFORE TAKING NON-ZERO COSMO CONSTANT, SHOULD TRY TO IMPROVE THE BELOW TO WORK FOR GENERIC R(r), not just R(r)=r, since in our case, R(r) is not trivial and we can “trivialise it” only after we have written the solution in terms of it.

Expressions

Xexpr = R τ[t,R];
fXexpr = α[t,R] R v[t,R] σ[t,R] / a[t,R];
sXexpr = 0;
Yexpr = v[t,R] σ[t,R];
fYexpr = α[t,R] (P[t,R]+v[t,R]^2 σ[t,R]) / a[t,R];
sYexpr = (-v[t,R]^2 σ[t,R] α[t,R]/R - τ[t,R] D[α[t,R],R] -(P[t,R]+v[t,R]^2 σ[t,R]) α[t,R] D[Log[a[t,R]],R] -2 v[t,R] σ[t,R] D[a[t,R],t])/a[t,R];

(XconsEqntmp = D[Xexpr,t] + D[fXexpr,R] - sXexpr) /. pp
(YconsEqntmp = Simplify[D[Yexpr,t] + D[fYexpr,R] - sYexpr]) /. pp

Lets use the metric PDEs to get rid of all the metric derivatives.

αRRule = D[α[t,R],R] -> a[t,R]^2 α[t,R] R ( 8 Pi (P[t,R]+v[t,R]^2 σ[t,R]) - Λ);
aRRule = D[a[t,R],R] -> a[t,R]^3 R ( 8 Pi τ[t,R] + Λ);
atRule = D[a[t,R],t] -> -8 Pi a[t,R]^2 α[t,R] R v[t,R] σ[t,R];
ataRαRRule = {atRule,aRRule,αRRule}
Clear[aRRule,atRule,αRRule]

XconsEqntmp2 = XconsEqntmp /. ataRαRRule //Simplify
YconsEqntmp2 = YconsEqntmp /. ataRαRRule //Simplify
Clear[XconsEqntmp, YconsEqntmp]

Now, plug in expression for P, σ, τ and Γ.

ΓRule = Γ -> Function[{t,R},  Sqrt[1/(1-v[t,R]^2)]];
PRule = P -> Function[{t,R},κ ρ[t,R]];
σRule = σ -> Function[{t,R},(1+κ) ρ[t,R]/(1-v[t,R]^2)];
τRule = τ -> Function[{t,R},Evaluate[σ[t,R] - P[t,R] /. PRule /. σRule]];
PστΓRule = {PRule,σRule,τRule,ΓRule} //Simplify
Clear[ΓRule,PRule,σRule,τRule]

XconsEqn = XconsEqntmp2 /. PστΓRule  //Simplify;
YconsEqn = YconsEqntmp2 /. PστΓRule  //Simplify;
Clear[XconsEqntmp2,YconsEqntmp2]

Contracting solution ansatz

Now, apply the contracting static solution ansatz.
First, we try to find a solution for which the  total mass is still zero, even for the perturbed solution (up to 0((δ^2))). Now, since M ~ ∫ X dr = ∫ Rρ (1+ (1+κ)(v^2) + ....) dR.
So, the next order contribution where the velocity is contributing is of order ~0((ϵ^2)). 
It will be proportional to (v^2) ~ ((OverDot[s])^2). This also means that in the perturbation, the metric variables had also better be of that order. 
This will actually not disappear by itself and we note to balance that by a perturbation of the density term: ρ -> ρ + (Subscript[ρ, pert]). From the above, we then require to leading order that (Subscript[ρ, pert]) ~ O((ϵ^2)).
Now, since M gets modified by a factor of (ϵ^2), we then also need a(t,r) to also be modified by a factor (ϵ^2). From (Subscript[a, ,t]) ~O(ϵ) equation, we then need α to be corrected by a factor (ϵ^2) as well. The other equations ((Subscript[a, ,r]) and (Subscript[α, ,r])) are consistent with this.
This can be see also in the Y-balance law, where leading correction in the velocity appears only at second order. So, if any variable had an order ~ 0(ϵ), it would not “feel” the correction in the velocity, which is not consistent, 
in the sense that if we switch back off the velocity, we should end up with static 0(1) term.
Note that it is important that the density ρ is replaced by its dimensionless version so that the “upgrade” s -> s(t) is done correctly.

Try an ansatz  f(t,R)= = (Subscript[f, ⋆])(x) + s'(((t))^2)(Subscript[f, p])(x) = (Subscript[f, ⋆])(x) + (ϵ^2) S'(((T))^2)(Subscript[f, p])(x). Note that we made the perturbation depend on x up to that factor ~s'(t)!
We made the slow time ansatz s(t) = S(ϵ (t-t*)) = S(T). We take t* = 0 here for simplicity.
You can try the more general case of f(t,R)= = (Subscript[f, ⋆])(x) + s'(((t))^2)(Subscript[f, p])(t,R) instead, but you will see that the above requirement is actually very natural. Note that out of consistency, we will need (Subscript[f, p])(t,R) ~ (Subscript[f, p])(x) at some point. In the above, we claim
that the factor is simply ~s'(t). This factor is anyway needed for the slow time ansatz for consistency. We then don’t need an extra term that is a function of R or s(t), but just x=R/s.
A bit more in details as to why we think this works is because, this ansatz is the only one for v that solves the leading equation of X-cons law and for the Y-cons law, we see that the equations naturally want to be re-arranged into two terms,
one proportional S S'' and the other to (((S'))^2). This ansatz is then the only one that makes this happen. So, we are attempting to extract some consistent ODE out of those PDEs.
Recall after all that we have somehow to have an ODE for s(t)!! Logically, this should be obtained from the Y-cons law, since it is the law that governs how the fluid’s velocity moves and should therefore determine s(t).
Of course, to obtain (ϵ^2), we used s'(((t))^2) technically, it could also have been s’’(t) etc. We here choose the nicest option. See later...
Anyway, the above is really an ansatz then!
Note: this ansatz is pretty general, in the sense that the function of t should be either ~ ((OverDot[s])^2) or ~ (Overscript[s, ..]). The reason is that we want the Y law to be an ODE for s(t). Note that Y law only depends on a and ϱ, so this amounts to choosing it for these two.
If one of the expansion at least is not of the two form given, then we will separately get an ODE for a and ϱ, and I don’t think that the solutions will be consistent with the other equations.
Now, we are then left with three choices: either both are ~ ((OverDot[s])^2) or both ~ (Overscript[s, ..]) or one ~ ((OverDot[s])^2) while the other is ~ (Overscript[s, ..]). This actually makes not all that much difference in the end, because the ODE for s(t) is:  f((OverDot[s])^2) + g s (Overscript[s, ..]) = 0. We then require f = constant * g.
Now, whether a (and ϱ) will contribute to f or g depends on whether they have a ~ ((OverDot[s])^2) or ~ (Overscript[s, ..]) term. However, from f = constant * g, this then does not really matter, since all we need is to redefine the (Subscript[a, 2])(x) and (Subscript[ϱ, 2])(x).

contStaticAnsatzRule = {ρ -> Function[{t,R} , (ϱ[R/s[t]] + s'[t]^2 (Subscript[ϱ, p])[R/s[t]])/(4 Pi R^2)], a -> Function[{t,R}, a[R/s[t]]+s'[t]^2 (Subscript[a, p])[R/s[t]]], 
α -> Function[{t,R}, α[R/s[t]]+s'[t]^2 (Subscript[α, p])[R/s[t]]], v -> Function[{t,R}, s'[t] (Subscript[v, p])[R/s[t]]]};
XconsCSAnsatzEqn = XconsEqn /. contStaticAnsatzRule;
YconsCSAnsatzEqn = YconsEqn /. contStaticAnsatzRule;
Clear[XconsEqn, YconsEqn]

As a little HACK,  we replace T = ϵT before re-arranging in powers of ϵ or else Mathematica I think will try to Taylor expand f(R/S(ϵt)) which is not what we want.
From here on, we also set the cosmological constant to 0.

XconsExpansionEqn = Series[XconsCSAnsatzEqn/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}] /. R -> x S[T] /. Λ -> 0 // Simplify
YconsExpansionEqn = Series[YconsCSAnsatzEqn/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}] /. R -> x S[T]  /. Λ -> 0 // Simplify

Check 0(1) term

For consistency, check that the Λ=0 static solution with s(t) = constant solves these two equations at leading order.
Note that X-cons eqn is ~ 0(ϵ) and thus automatically satisfied.

SeriesCoefficient[XconsExpansionEqn,0]

Checking the 0(1) term for Y-balance law now.

Simplify[SeriesCoefficient[YconsExpansionEqn,{ϵ,0,0}] /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule]

0(ϵ) of X eqn

The 0(ϵ) equation gives a relation between v and (OverDot[s]). Assuming integration constant 0, so that v = 0 at x = 0, we have:

vpRule = (Subscript[v, p]) -> Function[{x}, a[x] x/α[x]/(1+κ)]

Checking that this works out to leading order,

XconsExpansionEqn /. vpRule /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule// Simplify

The similarity is supposed to hold close to the center, since (Subscript[v, ⋆]) blows up near the surface for example, so we expect the behaviour for the velocity to only be correctly described close to center.
Thus, this singular behaviour “far away” is not a problem. This comment therefore also holds for all other perturbation variables.

Careful: In the following, I am using this very definition of (Subscript[v, p]) (whenever I manually give expressions in terms of this function). Changing it will thus require to change code in below O((δ^2)) expressions for (Subscript[Y, ,t]) and  (Subscript[f, ,x]), as well as in the "\"O(\!\(\n\*SuperscriptBox[\(δ\), \(2\)]\)") term” section.

Plot of the function

From the equations for mass conservation, we attempt first the one where we have a singularity at the center, which comes from not taking the constant to be zero, when we integrate the X cons law, as we did above.

tmp = 0.001;
tmp2 = 1;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Plot[{tmptest[R]} /. fullRuleF[280],{R,0.00001,0.1}]
Clear[tmp,tmp2,tmptest]

Comparing to the numerical data.

tmp = StringJoin[NotebookDirectory[],"vxcritical"];
data = Import[tmp];

tmp = 0.0025;
tmp2 = 1.;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Show[Plot[{tmptest[R]} /. fullRuleF[130],{R,0.0001,0.1},PlotStyle->Red],
ListPlot[data,PlotRange->{{0,0.01},{-0.2,0.5}},Joined -> True]]
Clear[tmp,tmp1,tmptest]

Try instead by taking that constant to be zero. This ensures v = 0 at center, although it also makes v to not change sign on the whole domain. For the static solution, we take the one with Λ not 0.

tmp = 0.00;
tmp2 = 1;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Plot[{tmptest[R]} /. fullRuleF[280],{R,0.00001,0.1},PlotRange->All]
Clear[tmp,tmp2,tmptest]

Compare with the one where Λ = 0. In particular, note that while for Λ = 0, the solution has a clear pole, this is not the case for the Λ not 0 case!

tmp = 0.00;
tmp2 = 1;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. staticSolψMϱVprRule
tmptest2[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Plot[{(tmptest[R] /. (Subscript[c, s])^2 -> 0.5 /. A -> 870), (tmptest2[R] /. fullRuleF[280])} /. fullRuleF[280],{R,0.00001,0.034}]
Clear[tmp,tmp2,tmptest,tmptest2]

tmp = StringJoin[NotebookDirectory[],"vxcritical"];
data = Import[tmp];

tmp = 0.003;
tmp2 = 1.;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Show[Plot[{tmptest[R]} /. fullRuleF[130],{R,0.0001,0.1},PlotStyle->Red],
ListPlot[data,PlotRange->{{0,0.01},{-0.2,0.5}},Joined -> True]]

0((ϵ^2)) of Y eqn

(Subscript[Y, ,t])

Focus now on 2nd order Y cons eqn. We will focus on each term separately. Expand (Subscript[Y, t]) to second order.

YexprExpansion = Series[D[Yexpr ,t] /. ataRαRRule /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}]/. R -> x S[T] // Simplify
Yexpr2ndOrder = SeriesCoefficient[YexprExpansion,2];

(Subscript[(Subscript[f, Y]), ,R])

Expand (Subscript[f, Y,R]) to second order. We also put Λ = 0 again.

fYexprExpansion = Series[D[fYexpr ,R] /. ataRαRRule /. PστΓRule  /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}]/. R -> x S[T] /. Λ -> 0 // Simplify
fYexpr2ndOrder = SeriesCoefficient[fYexprExpansion,2] // Simplify;

(Subscript[s, Y])

Expand (Subscript[s, Y]) to second order. We first get rid of all explicit derivatives.

sYexprExpansion = Series[sYexpr /. ataRαRRule /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}]/. R -> x S[T] /. Λ -> 0 // Simplify
sYexpr2ndOrder = SeriesCoefficient[sYexprExpansion,2];

Checked that above agrees with result from notes where the perturbation terms are neglected.

0((ϵ^2)) term

We can now put everything together to obtain the second order expression from the Y “conservation” eqn.

YEqn2ndOrder = Yexpr2ndOrder + fYexpr2ndOrder - sYexpr2ndOrder// Simplify

Checking that this is the same as the expansion of Y at 2nd order calculated previously.

tmp = Simplify[SeriesCoefficient[YconsExpansionEqn,2]];
FullSimplify[tmp == YEqn2ndOrder] // Simplify
Clear[tmp]

Remove derivative of static solution

Plug in the derivative of the known function with respect to static solution. One easily checks that a’(x) = -((2x)/((-1+κ) (Subscript[x, ⋆]^2)))  ((a^2)/α),    α’(x) = -((2κ x)/((-1+κ)(Subscript[x, ⋆]^2)))a,    ϱ’(x) = ((2x)/(((1-κ))^2)) (((2 (1-κ))/(x^2))ϱ - (((1+κ))/((α^2) (Subscript[x, ⋆]^2)))), which we also check.

aptmpRule = D[a[x],x] -> -2 x/(-1+κ)/(Subscript[x, ⋆])^2 a[x]^2/α[x] // Simplify;
αptmpRule = D[α[x],x] -> -2 x/(-1+κ) κ a[x]/(Subscript[x, ⋆])^2 // Simplify;
ϱptmpRule = D[ϱ[x],x] -> 2 x/(1-κ)^2 (2 ϱ[x] (1-κ)/x^2 - (1+ κ)/α[x]^2/(Subscript[x, ⋆])^2) // Simplify;
D[a[x],x] - (D[a[x],x] /. aptmpRule) /. staticSolaαρVInTermsOfxRule  // Simplify
D[α[x],x] - (D[α[x],x] /. αptmpRule) /. staticSolaαρVInTermsOfxRule // Simplify
tmp = D[ϱ[x],x] - (D[ϱ[x],x] /. ϱptmpRule) /.staticSolaαρVInTermsOfxRule /.staticSolgMϱVInTermsOfxRule // Simplify;
tmp /. x^2 -> (Subscript[x, ⋆])^2 (1-χ) // Simplify
Clear[tmp]

YEqn2ndOrderCompacttmp = ReleaseHold[YEqn2ndOrder] /. vpRule /. aptmpRule /. αptmpRule /. ϱptmpRule // Simplify

We can simplify further by noting that the factor ~ (Subscript[α, p]) is actually 0! This means that in general, (Subscript[α, p]) does not contribute to second order for Y!

D[YEqn2ndOrderCompacttmp,(Subscript[α, p])[x]]/.staticSolaαρVInTermsOfxRule /.staticSolgMϱVInTermsOfxRule // FullSimplify

We can then remove (Subscript[α, p]) term as a hack. Also, rescale the whole equation by (S^3).

YEqn2ndOrderCompact = Collect[Collect[YEqn2ndOrderCompacttmp S[T]^3 /. (Subscript[α, p])[x] -> 0 /. (Subscript[x, ⋆]) -> Sqrt[2 κ / (1-κ)],S''[T]],S'[T],Simplify]
Clear[YEqn2ndOrderCompacttmp]

This comment is a bit old: Note that (Subscript[ϱ, p]) has a term like : (Subscript[ϱ, p])/(x^3). Since we want perturbation to be 0 (in particular finite) at center, we require (Subscript[ϱ, p]) ~ (x^4) at least. This is in fact the case for the rule for (Subscript[ϱ, p]) found in the next section. This is also clear in that every other term in perturbed Y is ~ x.
In fact, it is clear that (Subscript[ϱ, p]) ~ (x^4) because the terms in ((Overscript[s, ..])/(R^2)) and (((OverDot[s])^2)/((R^2)s)) go like ~ x, so, the perturbed terms had also better be of the same magnitude!
The fact that (Subscript[α, p]) does not explicitly appear can be understood in the sense that we can view the above as a PDE for (Subscript[ϱ, p]) as well as S’. See later. 
The later however only depends on M (via integration), which only depends on a. Similarly, note that the PDE for (Subscript[a, p]) is also independent on (Subscript[α, p]). Thus, we can say that the ODEs for (Subscript[ϱ, p]) and (Subscript[a, p]) decouple from (Subscript[α, p]).

Re-write Y-law as S (Overscript[S, ..]) + f ((OverDot[S])^2) = 0

Currently, it is written as g (Overscript[S S, ..]) + h ((OverDot[S])^2) = 0. So, we first extract the g and h.

gexprtmp = D[YEqn2ndOrderCompact,S''[T]]/S[T]
hexprtmp = D[YEqn2ndOrderCompact,S'[T]]/(2 S'[T])

Then, we have that f = h/g

fexpr = hexprtmp/gexprtmp // FullSimplify
Clear[gexprtmp, hexprtmp]

Write f = f((Subscript[M, p]) , (Subscript[M, p])', (Subscript[M, p])'')

Currently, f is a function of (Subscript[a, p]), (Subscript[ϱ, p]) and (Subscript[ϱ, p])'. We first get rid of (Subscript[ϱ, p]) via the (Subscript[a, p]) ODE.

aRExpansion =   Series[D[a[t,R],R] - (D[a[t,R],R] /. ataRαRRule) /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}]/. R -> x S[T] /. Λ ->  0 // Simplify;
αRExpansion = Series[D[α[t,R],R] - (D[α[t,R],R] /. ataRαRRule) /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ,{ϵ,0,2}]/. R -> x S[T]  /. Λ ->  0 // Simplify;

ϱpRexprRule = Flatten[Solve[SeriesCoefficient[aRExpansion,2] == 0, (Subscript[ϱ, p])[x]]] // Simplify
ϱpPrimeRexprRule = Flatten[Solve[D[SeriesCoefficient[aRExpansion,2],x] == 0, (Subscript[ϱ, p])'[x]]]  /. vpRule /. aptmpRule /. αptmpRule /. ϱptmpRule/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify

ϱpRexprRule = Flatten[Solve[SeriesCoefficient[aRExpansion,2] == 0, (Subscript[ϱ, p])[x]]] /. vpRule // Simplify
ϱpPrimeRexprRule =  {(Subscript[ϱ, p])'[x] -> Simplify[D[((Subscript[ϱ, p])[x] /. ϱpRexprRule),x] /. vpRule /. aptmpRule /. αptmpRule /. ϱptmpRule/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]]}

fexprODEForap = fexpr /. ϱpPrimeRexprRule /. ϱpRexprRule  /. vpRule // Simplify
Clear[ϱpPrimeRexprRule]

Now re-writing this for the ODE for M. Writing M = (Subscript[M, 0])+(ϵ^2) ((OverDot[S])^2)(Subscript[M, p]). From the definition M = -(1/(a^2)), we easily deduce that (Subscript[M, p]) = (2/(Subscript[a, 0]^3))(Subscript[a, p]).

apptmpRule = a''[x] -> D[a'[x] /. aptmpRule,x]/. aptmpRule /. αptmpRule // Simplify;
fexprODEForMp = fexprODEForap /. (Subscript[a, p]) -> Function[x, (Subscript[M, p])[x] a[x]^3/2] /. aptmpRule /. apptmpRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] // Simplify
Clear[aptmpRule,αptmpRule,ϱptmpRule,apptmpRule, fexprODEForap]

Finally, plug in the values of the unperturbed ones and also express the ODE in terms of χ = 1-((x^2)/(Subscript[x, ⋆]^2)).

fexprODEForMpχ = fexprODEForMp /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule /. (Subscript[M, p]) -> Function[x,(Subscript[M, p])[1-x^2/(Subscript[x, ⋆])^2]] /. x -> (Subscript[x, ⋆]) Sqrt[1-χ] /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify;
Collect[Collect[Collect[fexprODEForMpχ,(Subscript[M, p])''[χ]],(Subscript[M, p])'[χ]],(Subscript[M, p])''[χ], Simplify]
Clear[fexprODEForMp]

We can re-write it in a nicer form, namely, it is currently in the form (Subscript[f, 0]) + (Subscript[f, 1]) M + (Subscript[f, 2]) M' + (Subscript[f, 3]) M'' = c. We just need to divide through by (Subscript[f, 3]).
For some reason Mathematica has some trouble doing the simplification, so we do this manually.

myf3 = D[fexprODEForMpχ,(Subscript[M, p])''[χ]];
myf2 = D[fexprODEForMpχ,(Subscript[M, p])'[χ]];
myf1 = D[fexprODEForMpχ,(Subscript[M, p])[χ]];
myf0 = fexprODEForMpχ/. (Subscript[M, p]) -> Function[χ,0];
fexprODEForMpχStandard = myf0/myf3 + myf1/myf3 (Subscript[M, p])[χ] + myf2/myf3 (Subscript[M, p])'[χ] + (Subscript[M, p])''[χ] // FullSimplify;
Clear[myf0,myf1,myf2, myf3]

Collect[Collect[Collect[fexprODEForMpχStandard,(Subscript[M, p])''[χ]],(Subscript[M, p])'[χ]],(Subscript[M, p])''[χ]]

Solve ODE for f

The equation is just an inhomogeneous Euler equation, as is clear from the standard form, so it is easy to work out the solution by decomposing into homogenous + inhomogeneous part.

fexprODEForMpχSol = χ^(2/(1-κ)-1) (C[1] - C[2] χ + 6 κ/(1-κ)^2/(1+κ)/ χ - 2 (c (1+κ)-κ) Log[χ]/(1-κ)^2/(1+κ)) // Simplify;
fexprODEForMpχSolRuletmp = (Subscript[M, p]) -> Function[χ,Evaluate[fexprODEForMpχSol]]

Here, we verify that this gives the correct answer

fexprODEForMpχ /. fexprODEForMpχSolRuletmp // Simplify

Now we fix the integration constants by requiring that (Subscript[M, p])(χ = 0) = (Subscript[M, p])(χ = 1) = 0.
First, the perturbation  is already 0 at the surface,

Limit[fexprODEForMpχSol,χ -> 0,Assumptions->{0 < κ < 1}]

At the center, the requirement fixes one of the constants.

tmp = Limit[fexprODEForMpχSol,χ -> 1,Assumptions->{0 < κ < 1}];
tmp2 = Solve[tmp == 0,C[2]] // Flatten// Simplify
Clear[tmp]

fexprODEForMpχReduced = Collect[fexprODEForMpχSol /. tmp2,C[1],FullSimplify]
Clear[tmp2]

For analyticity, we need to ensure that the Log term is absent, fixing the constant c. This may not be needed as the background is anyway not regular there in the first place!!!

myc = κ/(1+κ)

Collect[fexprODEForMpχReduced /. c -> myc,C[1],Simplify]

The term in front of the integration constant is just a rescaling of the scale s of the background.

fexprODEForMpχReduced /. C[1] -> 0 /. c -> κ/(1+κ) // Simplify

As a side note, for C[1]=0 and c = (κ/(1+κ)), the power of χ may coincide with the one of the linear perturbation than later with a suitable choice of p (p=-2), which is one of the negative integers needed to make the perturbation also 0 at both center and surface.
Maybe, because of the (-1+χ) the above is like the first two orders of expansion? Also, study the ODE for M above as it has two 3 regular singular points and should be recast-able using hypergeometric functions.

C2ruletmp = C[1] -> {-2,-1,0,1,2};
Plot[Evaluate[fexprODEForMpχReduced /. κ -> 1/2  /. c -> 1/. C2ruletmp],{χ,0,1}]
Clear[C2ruletmp]

Solve for S(T)

myST = A (1+B T)^(1/(1+f))
Simplify[S[T] S''[T] + f S'[T]^2 == 0  /. S -> Function[T,Evaluate[myST]]]

The linearization close to criticality T = 0 is,

mySTLinear = Series[myST,{T,0,1}] // Normal

Plot[Evaluate[{myST, mySTLinear} /. A -> 1 /. B -> -1 /. f -> myc /. κ -> 1/2],{T,0,1},PlotRange->{{0,1},{0,1}},PlotLegends->Placed[{"S(T)","(Subscript[S, lin])(T)"},{0.8,0.8}],AxesLabel->Automatic]

Λ perturbation

Try find ODE for s(t)

From this point onwards, we are in usual polar coordinates: R(r) = r. All the appearances of “r” should then really be R, where R is now treated as the coordinate.
THIS CANNOT BE DONE IF Λ < 0, because to do that, need to express solution in terms of coordinate R first, which cannot be done.
SO, BEFORE TAKING NON-ZERO COSMO CONSTANT, SHOULD TRY TO IMPROVE THE BELOW TO WORK FOR GENERIC R(r), not just R(r)=r, since in our case, R(r) is not trivial and we can “trivialise it” only after we have written the solution in terms of it.

Expressions

Xexpr = R τ[t,R];
fXexpr = α[t,R] R v[t,R] σ[t,R] / a[t,R];
sXexpr = 0;
Yexpr = v[t,R] σ[t,R];
fYexpr = α[t,R] (P[t,R]+v[t,R]^2 σ[t,R]) / a[t,R];
sYexpr = (-v[t,R]^2 σ[t,R] α[t,R]/R - τ[t,R] D[α[t,R],R] -(P[t,R]+v[t,R]^2 σ[t,R]) α[t,R] D[Log[a[t,R]],R] -2 v[t,R] σ[t,R] D[a[t,R],t])/a[t,R];

(XconsEqntmp = D[Xexpr,t] + D[fXexpr,R] - sXexpr) /. pp
(YconsEqntmp = Simplify[D[Yexpr,t] + D[fYexpr,R] - sYexpr]) /. pp

Lets use the metric PDEs to get rid of all the metric derivatives.

αRRule = D[α[t,R],R]    -> a[t,R]^2 α[t,R] R (8 Pi (P[t,R]+v[t,R]^2 σ[t,R]) +1/l^2);
aRRule = D[a[t,R],R] -> a[t,R]^3 R (8 Pi τ[t,R] - 1/l^2);
atRule = D[a[t,R],t] -> -8 Pi a[t,R]^2 α[t,R] R v[t,R] σ[t,R];
ataRαRRule = {atRule,aRRule,αRRule}
Clear[aRRule,atRule,αRRule]

XconsEqntmp2 = XconsEqntmp /. ataRαRRule //Simplify
YconsEqntmp2 = YconsEqntmp /. ataRαRRule //Simplify
Clear[XconsEqntmp, YconsEqntmp]

Now, plug in expression for P, σ, τ and Γ.

ΓRule = Γ -> Function[{t,R},  Sqrt[1/(1-v[t,R]^2)]];
PRule = P -> Function[{t,R},ρ[t,R] κ];
σRule = σ -> Function[{t,R},(1+κ) ρ[t,R]/(1-v[t,R]^2)];
τRule = τ -> Function[{t,R},Evaluate[σ[t,R] - P[t,R] /. PRule /. σRule]];
PστΓRule = {PRule,σRule,τRule,ΓRule} //Simplify
Clear[ΓRule,PRule,σRule,τRule]

XconsEqn = XconsEqntmp2 /. PστΓRule  //Simplify;
YconsEqn = YconsEqntmp2 /. PστΓRule  //Simplify;
Clear[XconsEqntmp2,YconsEqntmp2]

Contracting solution ansatz

Now, apply the contracting static solution ansatz.
First, we try to find a solution for which the  total mass is still zero, even for the perturbed solution (up to 0((δ^2))). Now, since M ~ ∫ X dr = ∫ rρ (1+ (1+κ)(v^2) + ....). So, the next order contribution where the velocity is contributing is of order ~0((ϵ^2)). 
It will be proportional to (v^2) ~ ((OverDot[s])^2). This also means that in the perturbation, the metric variables had also better be of that order. 
This will actually not disappear by itself and we note to balance that by a perturbation of the density term: ρ -> ρ + (Subscript[ρ, pert]). From the above, we then require to leading order that (Subscript[ρ, pert]) ~ O((ϵ^2)).
Now, since M gets modified by a factor of (ϵ^2), we then also need a(t,r) to also be modified by a factor (ϵ^2). From (Subscript[a, ,t]) ~O(ϵ) equation, we then need α to be corrected by a factor (ϵ^2) as well. The other equations ((Subscript[a, ,r]) and (Subscript[α, ,r])) are consistent with this.
This can be see also in the Y-balance law, where leading correction in the velocity appears only at second order. So, if any variable had an order ~ 0(ϵ), it would not “feel” the correction in the velocity, which is not consistent, 
in the sense that if we switch back off the velocity, we should end up with static 0(1) term.
Note that it is important that the density ρ is replaced by its dimensionless version so that the “upgrade” s -> s(t) is done correctly.

Try an ansatz  f(t,R)= = (Subscript[f, ⋆])(x) + s'(((t))^2)(Subscript[f, p])(x) = (Subscript[f, ⋆])(x) + (ϵ^2) S'(((T))^2)(Subscript[f, p])(x). Note that we made the perturbation depend on x up to that factor ~s'(t)!
We made the slow time ansatz s(t) = S(ϵ (t-t*)) = S(T). We take t* = 0 here for simplicity.
You can try the more general case of f(t,R)= = (Subscript[f, ⋆])(x) + s'(((t))^2)(Subscript[f, p])(t,R) instead, but you will see that the above requirement is actually very natural. Note that out of consistency, we will need (Subscript[f, p])(t,R) ~ (Subscript[f, p])(x) at some point. In the above, we claim
that the factor is simply ~s'(t). This factor is anyway needed for the slow time ansatz for consistency. We then don’t need an extra term that is a function of R or s(t), but just x=R/s.
A bit more in details as to why we think this works is because, this ansatz is the only one for v that solves the leading equation of X-cons law and for the Y-cons law, we see that the equations naturally want to be re-arranged into two terms,
one proportional S S'' and the other to (((S'))^2). This ansatz is then the only one that makes this happen. So, we are attempting to extract some consistent ODE out of those PDEs.
Recall after all that we have somehow to have an ODE for s(t)!! Logically, this should be obtained from the Y-cons law, since it is the law that governs how the fluid’s velocity moves and should therefore determine s(t).
Of course, to obtain (ϵ^2), we used s'(((t))^2) technically, it could also have been s’’(t) etc. We here choose the nicest option. See later...
Anyway, the above is really an ansatz then!
Note: this ansatz is pretty general, in the sense that the function of t should be either ~ ((OverDot[s])^2) or ~ (Overscript[s, ..]). The reason is that we want the Y law to be an ODE for s(t). Note that Y law only depends on a and ϱ, so this amounts to choosing it for these two.
If one of the expansion at least is not of the two form given, then we will separately get an ODE for a and ϱ, and I don’t think that the solutions will be consistent with the other equations.
Now, we are then left with three choices: either both are ~ ((OverDot[s])^2) or both ~ (Overscript[s, ..]) or one ~ ((OverDot[s])^2) while the other is ~ (Overscript[s, ..]). This actually makes all that much difference in the end, because the ODE for s(t) is:  f((OverDot[s])^2)s + g(Overscript[s, ..]) = 0. We then require f = constant * g.
Now, whether a (and ϱ) will contribute to f or g depends on whether they have a ~ ((OverDot[s])^2) or ~ (Overscript[s, ..]) term. However, from f = constant * g, this then does not really matter, since all we need is to redefine the (Subscript[a, 2])(x) and (Subscript[ϱ, 2])(x).

The perturbation is motivated by the fact that  the cosmological constant only appears in the source term and we have a term that schematically looks like: ~ ρ + 1/(l^2) ~ ϱ + (x^2) ((S^2)/(l^2)). So, to interact with such term, we add a second perturbed term with a factor ~((S^2)/(l^2)).

contStaticAnsatzRule = {ρ -> Function[{t,R} , (ϱ[R/s[t]] + s'[t]^2 (Subscript[ϱ, 2])[R/s[t]] + s[t]^2/l^2 (Subscript[(OverBar[ϱ]), 2])[R/s[t]])/(4 Pi R^2)], a -> Function[{t,R}, a[R/s[t]]+s'[t]^2 (Subscript[a, 2])[R/s[t]]+ s[t]^2/l^2 (Subscript[(OverBar[a]), 2])[R/s[t]]], 
α -> Function[{t,R}, α[R/s[t]]+s'[t]^2 (Subscript[α, 2])[R/s[t]]+s[t]^2/l^2 (Subscript[(OverBar[α]), 2])[R/s[t]]], v -> Function[{t,R}, s'[t] (Subscript[v, 1])[R/s[t]]+s[t]/l (Subscript[(OverBar[v]), 1])[R/s[t]]]};
XconsCSAnsatzEqn = XconsEqn /. contStaticAnsatzRule;
YconsCSAnsatzEqn = YconsEqn /. contStaticAnsatzRule;
Clear[XconsEqn, YconsEqn]

As a little HACK,  we replace T = ϵT before re-arranging in powers of ϵ or else Mathematica I think will try to Taylor expand f(R/S(ϵt)) which is not what we want.
We also take l ~ 0(1/ϵ) for consistency and to see this as a perturbation. Notice that we want to find in the end that if we take l = (1/(jϵ)), then as j -> 0, the perturbation will becomes just the static case with S(T) constant, only if we have something like S(T) ~ (OverBar[S])(jT).

XconsExpansionEqn = Series[XconsCSAnsatzEqn/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ /. l -> 1/(j ϵ),{ϵ,0,2}] /. R -> x S[T] // Simplify
YconsExpansionEqn = Series[YconsCSAnsatzEqn/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ /. l -> 1/(j ϵ),{ϵ,0,2}] /. R -> x S[T] // Simplify

Check 0(1) term

For consistency, check that the Λ=0 static solution with s(t) = constant solves these two equations at leading order.
Note that X-cons eqn is ~ 0(ϵ) and thus automatically satisfied.

SeriesCoefficient[XconsExpansionEqn,0]

Checking the 0(1) term for Y-balance law now.

Simplify[SeriesCoefficient[YconsExpansionEqn,{ϵ,0,0}] /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule]

0(ϵ) of X eqn

It is easy to check that (Subscript[(OverBar[v]), 1]) has solution ~(1/(x (Subscript[M, 0]))).

D[XconsExpansionEqn,j]
XconsExpansionEqn /. j -> 0

Simplify[DSolve[D[XconsExpansionEqn,j] == 0 /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)],(Subscript[(OverBar[v]), 1])[x],x], {x > 0, 0 < κ < 1}]

This is singular at the center and so we better take it to be 0! This is also needed later because otherwise (v^2) could have a term ~ S (OverDot[S]).

The other 0(ϵ) equation gives (Subscript[v, 1]). Assuming integration constant 0, so that v = 0 at x = 0, we have:

v1Rule = {(Subscript[v, 1]) -> Function[x, a[x] x/α[x]/(1+κ)], (Subscript[(OverBar[v]), 1]) -> Function[x,0]}

Checking that this works out to leading order,

XconsExpansionEqn /. v1Rule /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule// Simplify

The similarity is supposed to hold close to the center, since (Subscript[v, ⋆]) blows up near the surface for example, so we expect the behaviour for the velocity to only be correctly described close to center.
Thus, this singular behaviour “far away” is not a problem. This comment therefore also holds for all other perturbation variables.

Careful: In the following, I am using this very definition of (Subscript[v, p]) (whenever I manually give expressions in terms of this function). Changing it will thus require to change code in below O((δ^2)) expressions for (Subscript[Y, ,t]) and  (Subscript[f, ,x]), as well as in the "\"O(\!\(\n\*SuperscriptBox[\(δ\), \(2\)]\)") term” section.

Plot of the function

From the equations for mass conservation, we attempt first the one where we have a singularity at the center, which comes from not taking the constant to be zero, when we integrate the X cons law, as we did above.

tmp = 0.001;
tmp2 = 1;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Plot[{tmptest[R]} /. fullRuleF[280],{R,0.00001,0.1}]
Clear[tmp,tmp2,tmptest]

Comparing to the numerical data.

tmp = StringJoin[NotebookDirectory[],"vxcritical"];
data = Import[tmp];

tmp = 0.0025;
tmp2 = 1.;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Show[Plot[{tmptest[R]} /. fullRuleF[130],{R,0.0001,0.1},PlotStyle->Red],
ListPlot[data,PlotRange->{{0,0.01},{-0.2,0.5}},Joined -> True]]
Clear[tmp,tmp1,tmptest]

Try instead by taking that constant to be zero. This ensures v = 0 at center, although it also makes v to not change sign on the whole domain. For the static solution, we take the one with Λ not 0.

tmp = 0.00;
tmp2 = 1;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Plot[{tmptest[R]} /. fullRuleF[280],{R,0.00001,0.1},PlotRange->All]
Clear[tmp,tmp2,tmptest]

Compare with the one where Λ = 0. In particular, note that while for Λ = 0, the solution has a clear pole, this is not the case for the Λ not 0 case!

tmp = 0.00;
tmp2 = 1;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. staticSolψMϱVprRule
tmptest2[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Plot[{(tmptest[R] /. (Subscript[c, s])^2 -> 0.5 /. A -> 870), (tmptest2[R] /. fullRuleF[280])} /. fullRuleF[280],{R,0.00001,0.034}]
Clear[tmp,tmp2,tmptest,tmptest2]

tmp = StringJoin[NotebookDirectory[],"vxcritical"];
data = Import[tmp];

tmp = 0.003;
tmp2 = 1.;
tmptest[R_] := -tmp2 R/ψ[R]+tmp R/(ϱ[R] ψ[R]) /. ψsΛNot0ϵ2SolRule /. ϱsΛNot0ϵ2SolRule 
Show[Plot[{tmptest[R]} /. fullRuleF[130],{R,0.0001,0.1},PlotStyle->Red],
ListPlot[data,PlotRange->{{0,0.01},{-0.2,0.5}},Joined -> True]]

0((ϵ^2)) of Y eqn

(Subscript[Y, ,t])

Focus now on 2nd order Y cons eqn. We will focus on each term separately. Expand (Subscript[Y, t]) to second order.

YexprExpansion = Series[D[Yexpr ,t] /. ataRαRRule /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ /. l -> 1/(j ϵ),{ϵ,0,2}]/. R -> x S[T] // Simplify
Yexpr2ndOrder = SeriesCoefficient[YexprExpansion,2];

(Subscript[(Subscript[f, Y]), ,R])

Expand (Subscript[f, Y,R]) to second order.

fYexprExpansion = Series[D[fYexpr ,R] /. ataRαRRule /. PστΓRule  /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ /. l -> 1/(j ϵ),{ϵ,0,2}]/. R -> x S[T] // Simplify
fYexpr2ndOrder = SeriesCoefficient[fYexprExpansion,2] // Simplify;

(Subscript[s, Y])

Expand (Subscript[s, Y]) to second order. We first get rid of all explicit derivatives.

sYexprExpansion = Series[sYexpr /. ataRαRRule /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ /. l -> 1/(j ϵ),{ϵ,0,2}]/. R -> x S[T] // Simplify
sYexpr2ndOrder = SeriesCoefficient[sYexprExpansion,2];

Checked that above agrees with result from notes where the perturbation terms are neglected.

0((ϵ^2)) term

We can now putting everything together to obtain the second order expression from the Y “conservation” eqn.

YEqn2ndOrder = Yexpr2ndOrder + fYexpr2ndOrder - sYexpr2ndOrder// Simplify

Checking that this is the same as the expansion of Y at 2nd order calculated previously.

tmp = Simplify[SeriesCoefficient[YconsExpansionEqn,2]];
FullSimplify[tmp == YEqn2ndOrder] // Simplify
Clear[tmp]

Remove derivative of static solution

Plug in the derivative of the known function with respect to static solution. One easily checks that a’(x) = -((2x)/((-1+κ) (Subscript[x, ⋆]^2)))  ((a^2)/α),    α’(x) = -((2κ x)/((-1+κ)(Subscript[x, ⋆]^2)))a,    ϱ’(x) = ((2x)/(((1-κ))^2)) (((2 (1-κ))/(x^2))ϱ - (((1+κ))/((α^2) (Subscript[x, ⋆]^2)))), which we also check.

aptmpRule = D[a[x],x] -> -2 x/(-1+κ)/(Subscript[x, ⋆])^2 a[x]^2/α[x] // Simplify;
αptmpRule = D[α[x],x] -> -2 x/(-1+κ) κ a[x]/(Subscript[x, ⋆])^2 // Simplify;
ϱptmpRule = D[ϱ[x],x] -> 2 x/(1-κ)^2 (2 ϱ[x] (1-κ)/x^2 - (1+ κ)/α[x]^2/(Subscript[x, ⋆])^2) // Simplify;
D[a[x],x] - (D[a[x],x] /. aptmpRule) /. staticSolaαρVInTermsOfxRule  // Simplify
D[α[x],x] - (D[α[x],x] /. αptmpRule) /. staticSolaαρVInTermsOfxRule // Simplify
tmp = D[ϱ[x],x] - (D[ϱ[x],x] /. ϱptmpRule) /.staticSolaαρVInTermsOfxRule /.staticSolgMϱVInTermsOfxRule // Simplify;
tmp /. x^2 -> (Subscript[x, ⋆])^2 (1-χ) // Simplify
Clear[tmp]

YEqn2ndOrderCompacttmp = ReleaseHold[YEqn2ndOrder] /. v1Rule /. aptmpRule /. αptmpRule /. ϱptmpRule // Simplify

We can simplify further by noting that the factor ~ (Subscript[α, 2]) is actually 0! This means that in general, (Subscript[α, p]) does not contribute to second order for Y!

D[YEqn2ndOrderCompacttmp,(Subscript[α, 2])[x]]/.staticSolaαρVInTermsOfxRule /.staticSolgMϱVInTermsOfxRule // FullSimplify
D[YEqn2ndOrderCompacttmp,(Subscript[(OverBar[α]), 2])[x]]/.staticSolaαρVInTermsOfxRule /.staticSolgMϱVInTermsOfxRule // FullSimplify

We can then remove (Subscript[α, 2]) and (Subscript[(OverBar[α]), 2]) terms. Also, rescale the whole equation by (S^3).

YEqn2ndOrderCompact = Collect[Collect[YEqn2ndOrderCompacttmp S[T]^3 /. (Subscript[α, 2])[x] -> 0 /. (Subscript[(OverBar[α]), 2])[x] -> 0 /. (Subscript[x, ⋆]) -> Sqrt[2 κ / (1-κ)],S''[T]],S'[T],Simplify]
Clear[YEqn2ndOrderCompacttmp]

This comment is a bit old: Note that (Subscript[ϱ, p]) has a term like : (Subscript[ϱ, p])/(x^3). Since we want perturbation to be 0 (in particular finite) at center, we require (Subscript[ϱ, p]) ~ (x^4) at least. This is in fact the case for the rule for (Subscript[ϱ, p]) found in the next section. This is also clear in that every other term in perturbed Y is ~ x.
In fact, it is clear that (Subscript[ϱ, p]) ~ (x^4) because the terms in ((Overscript[s, ..])/(R^2)) and (((OverDot[s])^2)/((R^2)s)) go like ~ x, so, the perturbed terms had also better be of the same magnitude!
The fact that (Subscript[α, p]) does not explicitly appear can be understood in the sense that we can view the above as a PDE for (Subscript[ϱ, p]) as well as S’. See later. 
The later however only depends on M (via integration), which only depends on a. Similarly, note that the PDE for (Subscript[a, p]) is also independent on (Subscript[α, p]). Thus, we can say that the ODEs for (Subscript[ϱ, p]) and (Subscript[a, p]) decouple from (Subscript[α, p]).

Re-write Y-law as S (Overscript[S, ..]) + f ((OverDot[S])^2) + h (S^2) = 0

Currently, it is written as g(Overscript[S, ..]) S + f ((OverDot[S])^2) + h (S^2) = 0. So, we first extract the g, f, h. Note that we can extract h by diff by j since h ~ j.

gexprtmp = D[YEqn2ndOrderCompact,S''[T]]/S[T] // Simplify
fexprtmp = D[YEqn2ndOrderCompact,S'[T]]/(2 S'[T]) // Simplify
hexprtmp = j D[YEqn2ndOrderCompact,j]/2/S[T]^2 // Simplify

Then, we just need to rescale f and h.

fexpr = fexprtmp/gexprtmp // FullSimplify
hexpr = hexprtmp / gexprtmp // FullSimplify
Clear[gexprtmp, hexprtmp, fexprtmp]

Write f = f ((Subscript[M, p]), (Subscript[M, p])', (Subscript[M, p])'') and h = h ((Subscript[(OverBar[M]), p]), (Subscript[(OverBar[M]), p])', (Subscript[(OverBar[M]), p])'')

Currently, f is a function of (Subscript[a, p]), (Subscript[ϱ, p]) and (Subscript[ϱ, p])' and its bar components. We first get rid of (Subscript[ϱ, p]) via the (Subscript[a, p]) ODE (and similarly for the bar components).

aRExpansion = Series[D[a[t,R],R] - (D[a[t,R],R] /. ataRαRRule) /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ /. l -> 1/(j ϵ) /. v1Rule,{ϵ,0,2}]/. R -> x S[T] // Simplify;
αRExpansion = Series[D[α[t,R],R] - (D[α[t,R],R] /. ataRαRRule) /. PστΓRule /. contStaticAnsatzRule/. s -> Function[t, S[ϵ t]] /. t -> T/ϵ  /. l -> 1/(j ϵ) /. v1Rule,{ϵ,0,2}]/. R -> x S[T] // Simplify;

As before, we need to split this into a term proportional to (S^2) and ((OverDot[S])^2).

ϱ2xexprRule = Flatten[Solve[D[S[T] SeriesCoefficient[aRExpansion,2],S'[T]] == 0, (Subscript[ϱ, 2])[x]]]// Simplify
ϱbar2xexprRule = Flatten[Solve[D[S[T] SeriesCoefficient[aRExpansion,2],S[T]] == 0, (Subscript[(OverBar[ϱ]), 2])[x]]]// Simplify

ϱ2pxexprRule = Flatten[Solve[D[D[S[T] SeriesCoefficient[aRExpansion,2],S'[T]],x] == 0, (Subscript[ϱ, 2])'[x]]]/. aptmpRule /. αptmpRule /. ϱptmpRule/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify
ϱbar2pxexprRule = Flatten[Solve[D[D[S[T] SeriesCoefficient[aRExpansion,2],S[T]],x] == 0, (Subscript[(OverBar[ϱ]), 2])'[x]]]/. aptmpRule /. αptmpRule /. ϱptmpRule/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify

fexprODEFora2 = fexpr /. ϱ2pxexprRule /. ϱ2xexprRule // Simplify
hexprODEForabar2 = hexpr /. ϱbar2pxexprRule /. ϱbar2xexprRule // Simplify

Now re-writing this for the ODE for M. Writing M = (Subscript[M, 0])+(ϵ^2) ((OverDot[S])^2)(Subscript[M, 2]) + (S^2)/(l^2) (Subscript[(OverBar[M]), 2]). From the definition M = -(1/(a^2)), we easily deduce that (Subscript[M, 2]) = (2/(Subscript[a, 0]^3))(Subscript[a, 2]) and similarly for (Subscript[(OverBar[M]), 2]).

apptmpRule = a''[x] -> D[a'[x] /. aptmpRule,x]/. aptmpRule /. αptmpRule // Simplify;
fexprODEForM2 = fexprODEFora2 /. (Subscript[a, 2]) -> Function[x, (Subscript[M, 2])[x] a[x]^3/2]  /. aptmpRule /. apptmpRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] // Simplify
hexprODEForMbar2 = hexprODEForabar2 /. (Subscript[(OverBar[a]), 2]) -> Function[x, (Subscript[(OverBar[M]), 2])[x] a[x]^3/2] /. aptmpRule /. apptmpRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] // Simplify
Clear[aptmpRule,αptmpRule,ϱptmpRule,apptmpRule]

Finally, plug in the values of the unperturbed ones and also express the ODE in terms of χ = 1-((x^2)/(Subscript[x, ⋆]^2)).

fexprODEForM2χ = fexprODEForM2 /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule /. (Subscript[M, 2]) -> Function[x,(Subscript[M, 2])[1-x^2/(Subscript[x, ⋆])^2]] /. x -> (Subscript[x, ⋆]) Sqrt[1-χ] /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify;
Collect[Collect[Collect[fexprODEForM2χ,(Subscript[M, 2])''[χ]],(Subscript[M, 2])'[χ]],(Subscript[M, 2])[χ], FullSimplify]
hexprODEForMbar2χ = hexprODEForMbar2 /. staticSolaαρVInTermsOfxRule /. staticSolgMϱVInTermsOfxRule /. (Subscript[(OverBar[M]), 2]) -> Function[x,(Subscript[(OverBar[M]), 2])[1-x^2/(Subscript[x, ⋆])^2]] /. x -> (Subscript[x, ⋆]) Sqrt[1-χ] /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify;
Collect[Collect[Collect[hexprODEForMbar2χ,(Subscript[(OverBar[M]), 2])''[χ]],(Subscript[(OverBar[M]), 2])'[χ]],(Subscript[(OverBar[M]), 2])[χ], FullSimplify]

This has effectively four terms: proportional to (Subscript[M, 2]), (Subscript[M, 2])', (Subscript[M, 2])'' and an inhomogeneous term (which includes ~ j). Since Mathematica has trouble simplifying, we go through each term one by one and simplify.

MppTerm = D[fexprODEForM2χ,(Subscript[M, 2])''[χ]];
MppTermSimplified = (1-κ)^2/2 χ^((-1+3 κ)/(-1+κ));
Simplify[MppTerm - MppTermSimplified]
MbarppTerm = D[hexprODEForMbar2χ,(Subscript[(OverBar[M]), 2])''[χ]];
MbarppTermSimplified = j^2 (1-κ)^2 χ^((1-3 κ)/(1-κ))/2;
Simplify[MbarppTerm - MbarppTermSimplified]
Clear[MppTerm,MbarppTerm]

MpTerm = D[fexprODEForM2χ,(Subscript[M, 2])'[χ]];
MpTermSimplified = (-1+κ^2) χ^((2 κ)/(-1+κ));
Simplify[MpTerm - MpTermSimplified]
MbarpTerm = D[hexprODEForMbar2χ,(Subscript[(OverBar[M]), 2])'[χ]];
MbarpTermSimplified = -j^2 (1-κ^2) χ^(-2 κ/(1-κ));
Simplify[MbarpTerm - MbarpTermSimplified]
Clear[MpTerm,MbarpTerm]

MTerm = D[fexprODEForM2χ,(Subscript[M, 2])[χ]];
MTermSimplified = (1+κ) χ^((1+κ)/(-1+κ));
Simplify[MTerm - MTermSimplified]
MbarTerm = D[hexprODEForMbar2χ,(Subscript[(OverBar[M]), 2])[χ]];
MbarTermSimplified = j^2 (1+κ) χ^(-(1+κ)/(1-κ));
Simplify[MbarTerm - MbarTermSimplified]
Clear[MTerm,MbarTerm]

InhomoTerm = fexprODEForM2χ /. (Subscript[M, 2]) -> Function[χ, 0] // FullSimplify;
InhomoTermSimplified = κ (-6+χ)/((1+κ) χ);
Simplify[InhomoTerm - InhomoTermSimplified]
InhomoTermbar = hexprODEForMbar2χ /. (Subscript[(OverBar[M]), 2]) -> Function[χ, 0] // FullSimplify;
InhomoTermbarSimplified = j^2 (1+κ) (1+2 κ) χ^(-2 κ/(1-κ));
Simplify[InhomoTermbar - InhomoTermbarSimplified]
Clear[InhomoTerm,InhomoTermbar]

fexprODEForM2χSimplified = InhomoTermSimplified + MTermSimplified (Subscript[M, 2])[χ] + MpTermSimplified (Subscript[M, 2])'[χ] + MppTermSimplified (Subscript[M, 2])''[χ]
hexprODEForMbar2χSimplified = InhomoTermbarSimplified + MbarTermSimplified (Subscript[(OverBar[M]), 2])[χ] + MbarpTermSimplified (Subscript[(OverBar[M]), 2])'[χ] + MbarppTermSimplified (Subscript[(OverBar[M]), 2])''[χ]

We then need the above to be constants, say c and (OverBar[c]).
We can re-write it in a nicer form, namely, it is currently in the form (Subscript[f, 0]) + (Subscript[f, 1]) M + (Subscript[f, 2]) M' + (Subscript[f, 3]) M'' = c. We just need to divide through by (Subscript[f, 3]).
For some reason Mathematica has some trouble doing the simplification, so we do this manually.
Note that it is not possible to combine f and h by taking (OverDot[S]) ~ S. This would require S ~ (e^T) but then the solution requires the value of the constant to be such that the log term disappears and this would not make the ODE for S consistent with this.
The 1/l perturbation does not change this because looking at the above, the log term appears in the f term because of the constant term. The h part has no constant term though, so it does not influence when the log term disappears.
This is also not making a lot of sense as far as the ansatz is concerned since we could combine the perturbation of (OverDot[S]) with the one for (S/l) in the first place.

M2ODE = InhomoTermSimplified/MppTermSimplified + MTermSimplified/MppTermSimplified (Subscript[M, 2])[χ] + MpTermSimplified/MppTermSimplified (Subscript[M, 2])'[χ] + MppTermSimplified/MppTermSimplified (Subscript[M, 2])''[χ] - c/MppTermSimplified // Simplify
Mbar2ODEtmp =InhomoTermbarSimplified/MbarppTermSimplified + MbarTermSimplified/MbarppTermSimplified (Subscript[(OverBar[M]), 2])[χ] + MbarpTermSimplified/MbarppTermSimplified (Subscript[(OverBar[M]), 2])'[χ] + 
MbarppTermSimplified/MbarppTermSimplified (Subscript[(OverBar[M]), 2])''[χ] - (OverBar[c])/MbarppTermSimplified;
Mbar2ODE = 2 (1+κ) (1+2 κ)/(1-κ)^2/χ + 2 (1+κ)/(1-κ)^2/χ^2 (Subscript[(OverBar[M]), 2])[χ] - 2 χ^(-(1-3 κ)/(1-κ))/(1-κ)^2/j^2 (OverBar[c])-2 (1+κ)/(1-κ)/χ (Subscript[(OverBar[M]), 2])'[χ] + (Subscript[(OverBar[M]), 2])''[χ]
Simplify[Mbar2ODEtmp-Mbar2ODE]
Clear[Mbar2ODEtmp]

The ODE for both f and h are therefore an inhomogeneous Cauchy Euler equation. Notice that the homogenous part are the same.

Solve[a (a-1)-2 (1+κ)/(1-κ) a+2 (1+κ)/(1-κ)^2 == 0,a] // Simplify

Solve ODE for f

The equation is just an inhomogeneous Euler equation, as is clear from the standard form, so it is easy to work out the solution by decomposing into homogenous + inhomogeneous part.

M2χSol = χ^(2/(1-κ)-1) (C[1] - C[2] χ + 6 κ/(1-κ)^2/(1+κ)/ χ - 2 (c (1+κ)-κ) Log[χ]/(1-κ)^2/(1+κ)) // Simplify;
M2χSolRuletmp = (Subscript[M, 2]) -> Function[χ,Evaluate[M2χSol]]

Here, we verify that this gives the correct answer

M2ODE/. M2χSolRuletmp // Simplify

Now we fix the integration constants by requiring that (Subscript[M, 2])(χ = 0) = (Subscript[M, 2])(χ = 1) = 0.
First, the perturbation  is already 0 at the surface,

Limit[M2χSol,χ -> 0,Assumptions->{0 < κ < 1}]

At the center, the requirement fixes one of the constants.

tmp = Limit[M2χSol,χ -> 1,Assumptions->{0 < κ < 1}];
tmp2 = Solve[tmp == 0,C[2]] // Flatten// Simplify
Clear[tmp]

M2χReduced = Collect[M2χSol /. tmp2,C[1],FullSimplify]
Clear[tmp2]

Collect[M2χReduced /. c -> κ/(1+κ),C[1],Simplify]

Note that second term is just the perturbation of the scale s -> s(1-ϵ).

C2ruletmp = C[1] -> {-2,-1,0,1,2};
Plot[Evaluate[M2χReduced /. κ -> 1/2  /. c -> 1/. C2ruletmp],{χ,0,1}]
Clear[C2ruletmp]

Solve ODE for h

The equation is also just an inhomogeneous Euler equation, as is clear from the standard form, so it is easy to work out the solution by decomposing into homogenous + inhomogeneous part.

Mbar2χSol = χ^(2/(1-κ)-1) (C[1] - C[2] χ-2 (OverBar[c])/j^2 /(1-κ)^2 Log[χ]) -(1+2 κ)/κ χ// Simplify;
Mbar2χSolRuletmp = (Subscript[(OverBar[M]), 2]) -> Function[χ,Evaluate[Mbar2χSol]]

Here, we verify that this gives the correct answer

Mbar2ODE/. Mbar2χSolRuletmp // Simplify

Now we fix the integration constants by requiring that (Subscript[M, 2])(χ = 0) = (Subscript[M, 2])(χ = 1) = 0.
First, the perturbation  is already 0 at the surface,

Limit[Mbar2χSol,χ -> 0,Assumptions->{0 < κ < 1}]

At the center, the requirement fixes one of the constants.

tmp = Limit[Mbar2χSol,χ -> 1,Assumptions->{0 < κ < 1}];
tmp2 = Solve[tmp == 0,C[2]] // Flatten// Simplify
Clear[tmp]

Mbar2χReduced = Collect[Mbar2χSol /. tmp2,C[1],FullSimplify]
Clear[tmp2]

Want analyticity and so log term needs to vanish.

Collect[Mbar2χReduced /. (OverBar[c]) -> 0,C[1],FullSimplify]

Note that second term is just the perturbation of the scale s -> s(1-ϵ) as before.

C2ruletmp = C[1] -> {-2,-1,0,1,2};
Plot[Evaluate[Mbar2χReduced /. κ -> 1/2 /. (OverBar[c]) -> 0 /. C2ruletmp],{χ,0,1}]
Clear[C2ruletmp]

Λ < 0

We immediately rewrite everything in terms of y given implicitly by x = x(y,μ) and μ = -Λs(((t))^2).
Note: the change in the independent variables from (t,R) -> (y,μ) should be seen as simply a change of variable in a PDE context.
This is a completely legitimate thing to do. We can say R = s f(y,μ), for a given function f. This then writes everything in terms of y and μ.
We then set f = x, so that the variable y actually corresponds with the Cataldo variables and so we know the functional form of the background variables.
This is akin the a gauge choice from the point of view of the metric. Of course, the perturbed variables are going to depend on this,
but since we are solving for them anyway, this is not a problem. From the point of view of the metric, the metric in Cataldo
coordinate will be a mess due to this choice, (will probably contain cross terms), but we don’t care about that.
To look at it, just start from the metric in polar coordinates and change R = s x(r/s,-((Λs)^2)). This write the metric in (t,r)
and you can see that you will obtain a big mess as well as cross terms ~dt dr, but again, we don’t care about that.
We also have computed (Subscript[v, 1])(y,μ) by hand, so there is no need to do that here.

We use the fact that (1/2) ((∂(x^2))/(∂y)) (∂/(∂t)) = ((OverDot[s])/s) (μ ((∂(x^2))/(∂y)) (∂/(∂μ)) - (μ ((∂(x^2))/(∂μ)) + (x^2)) (∂/(∂y)))   and   ((∂(x^2))/(∂y)) (R/2) (∂/(∂R)) = (x^2) (∂/(∂y))    which come from applying the chain rule.

Expressions

We define χ = ln α/a. We will also split the flux in two bits as: (Subscript[f, Y]) = (e^χ) (Subscript[(OverBar[f]), Y]).
We will then re-absorb the term (Subscript[(e^χ), ,R]) (Subscript[(OverBar[f]), Y]) into a modified source term.

Yexpr     = v[y,μ] σ[y,μ];
fYexpr = Exp[χ[y,μ]] (P[y,μ]+v[y,μ]^2 σ[y,μ]);
fYbarexpr = P[y,μ]+v[y,μ]^2 σ[y,μ];

For the source, we use the Einstein equations to get rid of all the derivatives.

αRRule = D[α[t,R],R] -> a[t,R]^2 α[t,R] R (8 Pi (P[t,R]+v[t,R]^2 σ[t,R]) - Λ);
aRRule = D[a[t,R],R] -> a[t,R]^3 R (8 Pi τ[t,R] + Λ);
χRRule = D[χ[t,R],R] -> -2 a[t,R]^2 R (Λ + 4 Pi (1-κ) ρ[t,R]);
atRule = D[a[t,R],t] -> -8 Pi a[t,R]^2 α[t,R] R v[t,R] σ[t,R];
ataRαRχRRule = {atRule,aRRule,αRRule, χRRule}
Clear[aRRule,atRule,αRRule,χRRule]

Write now the modified source term. We will replace a and α by M and χ.

sYexprtmp = (-v[t,R]^2 σ[t,R] α[t,R]/R - τ[t,R] D[α[t,R],R] -
(P[t,R]+v[t,R]^2 σ[t,R]) α[t,R] D[Log[a[t,R]],R] -2 v[t,R] σ[t,R] D[a[t,R],t])/a[t,R];
sYbarexprtmp = sYexprtmp - D[Exp[χ[t,R]],R] fYbarexpr // FullSimplify;
tmp = sYbarexprtmp /. ataRαRχRRule // FullSimplify;
tmp = tmp  /. α[t,R] -> α[y,μ] /. χ[t,R] -> χ[y,μ] /. a[t,R] -> a[y,μ] /. σ[t,R] -> σ[y,μ] /.
τ[t,R] -> τ[y,μ]  /. P[t,R] -> P[y,μ] /. ρ[t,R] -> ρ[y,μ] /. v[t,R] -> v[y,μ] /. R -> x[y,μ] s[t] /. Λ -> -μ/s[t]^2 // FullSimplify;
sYbarexpr = tmp /. α[y,μ] -> Exp[χ[y,μ]] a[y,μ] /. a[y,μ] -> 1/Sqrt[μ x[y,μ]^2-M[y,μ]] // FullSimplify
Clear[tmp, sYexprtmp,sYbarexprtmp]

The momentum balance is written in the form (Subscript[Y, ,t]) + χ (Subscript[(OverBar[f]), Y,r]) = (Subscript[(OverBar[s]), Y]). Using the above, rules, we rewrite it in terms of y and μ using above transformation.

Contracting solution ansatz and rules

Now, define the contracting static solution ansatz.

contStaticAnsatzRule = {ρ -> Function[{y,μ} , ((Subscript[ϱ, 0])[y,μ] + s'[t]^2 (Subscript[ϱ, 2])[y,μ])/(4 Pi R^2)], 
M -> Function[{y,μ}, (Subscript[M, 0])[y,μ]+s'[t]^2 (Subscript[M, 2])[y,μ]],
χ -> Function[{y,μ}, (Subscript[χ, 0])[y,μ]+s'[t]^2 (Subscript[χ, 2])[y,μ]], v -> Function[{y,μ}, s'[t] (Subscript[v, 1])[y,μ]]};

Rules for expression for P, σ, τ and Γ.

ΓRule = Γ -> Function[{y,μ},  1/Sqrt[1-v[y,μ]^2]];
PRule = P -> Function[{y,μ},κ ρ[y,μ]];
σRule = σ -> Function[{y,μ},(1+κ) ρ[y,μ]/(1-v[y,μ]^2)];
τRule = τ -> Function[{y,μ},Evaluate[σ[y,μ] - P[y,μ] /. PRule /. σRule]];
PστΓRule = {PRule,σRule,τRule,ΓRule} //Simplify
Clear[ΓRule,PRule,σRule,τRule]

0(ϵ) of X law

The below is done in two parts: FIrst, we re-write the derivatives of t and R in terms of derivatives of y and μ.
Then, we can formally find (Subscript[v, 1]) in terms of some integral. See notes for more details.
By using the rules above, the O((OverDot[s])) term can be written as:   μ (((∂(x^2))/(∂y)) ((∂(Subscript[ϱ, 0]))/(∂μ)) - ((∂(x^2))/(∂μ))((∂(Subscript[ϱ, 0]))/(∂y))) = (x^2) ((∂F)/(∂y)),   F := (Subscript[ϱ, 0]) - (1+κ) (e^(Subscript[χ, 0])) (Subscript[ϱ, 0]) ((Subscript[v, 1])/x).
The solution can therefore formally be written as:   (Subscript[v, 1]) = ((x (e^(-(Subscript[χ, 0]))))/(1+κ)) (1-μ (I/(Subscript[ϱ, 0]))),   I := ((∫_1)^y) (1/(x^2))(((∂(x^2))/(∂y)) ((∂(Subscript[ϱ, 0]))/(∂μ)) - ((∂(x^2))/(∂μ))((∂(Subscript[ϱ, 0]))/(∂y))) dy .

myx2 = μ (y^2-1) + 2 κ/(1-κ) (1-μ) (1-y^(1-1/κ));
myρ = (1-μ)/(8 Pi κ s^2) y^(-1-1/κ);
myϱ = 4 Pi myx2 s^2 myρ // Simplify;
myα = y;
myM = μ myx2 - 1/4 D[myx2,y]^2 // FullSimplify;
mya = 2y / myα / D[myx2,y] // FullSimplify;
myχ = Log[myα/mya] // FullSimplify;

myItmp = Integrate[(D[myx2,y] D[myϱ,μ] - D[myx2,μ] D[myϱ,y])/myx2,y] // FullSimplify;
integrationconstant = Limit[myItmp,y -> 1] // Simplify;
myItmp = myItmp - integrationconstant // FullSimplify;
myI =  1/(2 κ (1-κ)) (2 κ^2 (1-μ) (1-y^(-2/κ)) + (1+κ) (1-μ) (y^(-1-1/κ)-y^(1-1/κ)) - 2 κ μ (1-y^(1-1/κ)));
Simplify[myI ==  myItmp]
Clear[myItmp,integrationconstant]

myv1 = Sqrt[myx2] Exp[-myχ] / (1+κ) (1 - μ myI/myϱ) // FullSimplify;

Note that (Subscript[v, 1]) is actually only regular for y -> ∞ if κ ≥ (1/2).

Limit[myv1 y^(2-1/κ),y -> +∞,Assumptions->{0 < κ < 1, 0 < μ < 1}]

In particular, since v = (OverDot[s]) (Subscript[v, 1]), it follows that for κ = 1/2 and small μ, v ~ ((OverDot[s])/s). Wanting something finite out of this then implies that s is exponential.
This seems to suggest that κ=1/2 is actually very special. For κ > 1/2, then v -> 0, for any sensible s(t) and for κ < 1/2, v actually just blows up as y -> ∞, which
seems to suggest that this ansatz is just wrong, at least for large values of y. However, if we assume that the critical solution contracts irrespective of κ,
then this would mean that our model is actually only good up to some point inside the star x=(Subscript[x, ⋆]), since in the limit μ ->0, y =∞ gets mapped to x=(Subscript[x, ⋆]).
Of course, it may be that the critical behaviour is just entirely different for κ < 1/2, which does look suspicious.

Check O(1) of Y law and Einstein equations

Background solution rules:

myxRule   =  x  -> Function[{y,μ}, Sqrt[μ (y^2-1) + 2 κ/(1-κ) (1-μ) (1-y^(1-1/κ))]];
myϱ0Rule = (Subscript[ϱ, 0]) -> Function[{y,μ},(1-μ)/(2 κ) x[y,μ]^2 y^(-1-1/κ)];
mya0Rule = (Subscript[a, 0]) -> Function[{y,μ},1/(μ y+ (1-μ) y^(-1/κ))];
myM0Rule = (Subscript[M, 0]) -> Function[{y,μ}, Evaluate[FullSimplify[μ x[y,μ]^2 - 1/4 D[x[y,μ]^2,y]^2 /. myxRule /. myϱ0Rule]]];
myχ0Rule = (Subscript[χ, 0]) -> Function[{y,μ}, Log[y (μ y+(1-μ) y^(-1/κ))]];

Check Einstein equation for a,α and χ:

ayexpr =    D[x[y,μ]^2,y] (Subscript[a, 0])[y,μ]^3(2 (Subscript[ϱ, 0])[y,μ]/x[y,μ]^2 -μ)/2;
αyexpr =    D[x[y,μ]^2,y] (Subscript[a, 0])[y,μ]^2(Subscript[α, 0])[y,μ] (2 κ (Subscript[ϱ, 0])[y,μ]/x[y,μ]^2 +μ)/2;
χyexpr = -D[x[y,μ]^2,y] (Subscript[a, 0])[y,μ]^2((1-κ) (Subscript[ϱ, 0])[y,μ]/x[y,μ]^2 -μ);
Simplify[(D[(Subscript[a, 0])[y,μ],y] /. mya0Rule) == (ayexpr /. myϱ0Rule /. myxRule /. mya0Rule)]
Simplify[(D[(Subscript[α, 0])[y,μ],y] /. (Subscript[α, 0]) -> Function[{y,μ},y]) == (αyexpr /. (Subscript[α, 0]) -> Function[y,y] /. myϱ0Rule /. myxRule /. mya0Rule)]
Simplify[(D[(Subscript[χ, 0])[y,μ],y] /. myχ0Rule) == (χyexpr /. myϱ0Rule /. myxRule /. mya0Rule)]

Check O(1) of Y balance law.

(χfYRbar0Order = x[y,μ]/(2 Pi s[t]^3 HoldForm[D[x[y,μ]^2,y]]) Exp[(Subscript[χ, 0])[y,μ]] (κ HoldForm[D[(Subscript[ϱ, 0])[y,μ]/x[y,μ]^2,y]])) /. pp;
tmp = FullSimplify[sYbarexpr /. PστΓRule] /. contStaticAnsatzRule;
sYbar0Order = FullSimplify[tmp /. s'[t] -> 0 /. R -> x[y,μ] s[t]];
ReleaseHold[χfYRbar0Order] == sYbar0Order/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule // Simplify
Clear[tmp,χfYRbar0Order,sYbar0Order]

0((ϵ^2)) of Y law

(Subscript[Y, ,t])

Focus now on 2nd order Y cons equation. This is easily done by hand, and for simplicity, we just write the answer. The derivation is:
Y = v σ = (Γ^2) (1+κ) (OverDot[s]) ((Subscript[v, 1])/(4 π (R^2))) ((Subscript[ϱ, 0]) + ((OverDot[s])^2) (Subscript[ϱ, 2]) + ...) = (OverDot[s]) ((1+ κ)/(4 π (R^2))) (Subscript[v, 1]) (Subscript[ϱ, 0]) + O(((OverDot[s])^3)).
-> (Subscript[Y, ,t]) = ((1+κ)/(4 π (s^2) (x^2))) ((Overscript[s, ..]) (Subscript[v, 1]) (Subscript[ϱ, 0]) + (OverDot[s]) (Subscript[((Subscript[v, 1]) (Subscript[ϱ, 0])), ,t])) + ... .

(Yt2ndOrder = (1+κ) / (4 Pi s[t]^2 x[y,μ]^2) (s''[t] (Subscript[v, 1])[y,μ] (Subscript[ϱ, 0])[y,μ] + 2 s'[t]^2/
(HoldForm[D[x[y,μ]^2,y]]s[t]) (μ HoldForm[D[x[y,μ]^2,y]] HoldForm[D[(Subscript[v, 1])[y,μ] (Subscript[ϱ, 0])[y,μ],μ]] - 
(μ HoldForm[D[x[y,μ]^2,μ]]+x[y,μ]^2) HoldForm[D[(Subscript[v, 1])[y,μ] (Subscript[ϱ, 0])[y,μ],y]]))) /. pp

(e^χ)(Subscript[(Subscript[(OverBar[f]), Y]), ,R])

(e^χ) (Subscript[(OverBar[f]), Y,R]) = (e^χ) (Subscript[(P+(v^2) σ), ,R])
= (e^(Subscript[χ, 0]))(1 + ((OverDot[s])^2) (Subscript[χ, 2])) (Subscript[((κ/(4 π (R^2))) ((Subscript[ϱ, 0]) + ((OverDot[s])^2) (Subscript[ϱ, 2])) + ((((OverDot[s])^2)(Subscript[v, 1]^2))/(4 π (R^2))) (1+κ) (Subscript[ϱ, 0])), ,R])
= ((x ((OverDot[s])^2))/(2 π (s^3) (Subscript[x, ,y]^2))) (e^(Subscript[χ, 0]))((Subscript[(κ ((Subscript[ϱ, 2])/(x^2)) + (1+κ) ((Subscript[ϱ, 0])/(x^2)) (Subscript[v, 1]^2)), ,y]) + κ (Subscript[χ, 2]) (Subscript[(((Subscript[ϱ, 0])/(x^2))), ,y])).

(χfYRbar2ndOrder = x[y,μ] s'[t]^2/(2 Pi s[t]^3 HoldForm[D[x[y,μ]^2,y]]) Exp[(Subscript[χ, 0])[y,μ]] (HoldForm[D[κ (Subscript[ϱ, 2])[y,μ]/x[y,μ]^2 + 
(1+κ) (Subscript[ϱ, 0])[y,μ]/x[y,μ]^2 (Subscript[v, 1])[y,μ]^2,y]] + κ (Subscript[χ, 2])[y,μ] HoldForm[D[(Subscript[ϱ, 0])[y,μ]/x[y,μ]^2,y]])) /. pp

(Subscript[s, Y])

We use differentiation to get the ((OverDot[s])^2) term.

tmp = FullSimplify[sYbarexpr /. PστΓRule] /. contStaticAnsatzRule;
tmp = FullSimplify[Limit[D[tmp,s'[t]]/(2 s'[t]),s'[t] -> 0]];
(sYbar2ndOrder = FullSimplify[s'[t]^2 tmp /. R -> s[t] x[y,μ]]) /. pp
Clear[tmp]

Checked that above agrees with result from notes where the perturbation terms are neglected.

0((ϵ^2)) term

We can now put everything together to obtain the second order expression from the momentum balance law.

(YEqn2ndOrder = Simplify[Yt2ndOrder + χfYRbar2ndOrder - sYbar2ndOrder]) /. pp;
(YEqn2ndOrder = Simplify[YEqn2ndOrder 4 Pi s[t]^3 x[y,μ]^3]) /. pp

Re-write Y-law as (((Overscript[s, ..])s)/((OverDot[s])^2)) = K(y,μ)

Currently, it is written as g ((OverDot[s])^2) + f s (Overscript[s, ..]) = 0.

gexprtmp = D[YEqn2ndOrder,s'[t]]/(2 s'[t]) // Simplify;
fexprtmp = D[YEqn2ndOrder,s''[t]]/s[t] // Simplify;
Kexpr = FullSimplify[-gexprtmp/fexprtmp];
Clear[gexprtmp,fexprtmp]

Write K(y,μ) = G(μ)

K(y,μ)

Currently, K(y,μ) depends on the (Subscript[f, 2]) term by (Subscript[M, 2]), (Subscript[χ, 2]), (Subscript[ϱ, 2]), (Subscript[ϱ, 2,y]). 
First, we show that the the term ~(Subscript[χ, 2]) disappears.

χ2Term = D[ReleaseHold[Kexpr],(Subscript[χ, 2])[y,μ]] // Simplify;
myxRule   =  x  -> Function[{y,μ}, Sqrt[μ (y^2-1) + 2 κ/(1-κ) (1-μ) (1-y^(1-1/κ))]];
myϱ0Rule = (Subscript[ϱ, 0]) -> Function[{y,μ},Evaluate[FullSimplify[(1-μ)/(2 κ) x[y,μ]^2 y^(-1-1/κ) /. myxRule]]];
myM0Rule = (Subscript[M, 0]) -> Function[{y,μ}, Evaluate[FullSimplify[μ x[y,μ]^2 - 1/4 D[x[y,μ]^2,y]^2 /. myxRule /. myϱ0Rule]]];
myχ0Rule = (Subscript[χ, 0]) -> Function[{y,μ}, Log[y (μ y+(1-μ) y^(-1/κ))]];
myv1Rule = (Subscript[v, 1]) -> Function[{y,μ}, Evaluate[myv1]];
χ2Term /. myxRule /. myϱ0Rule /. myM0Rule /. myχ0Rule // FullSimplify

So we can remove it via a hack:

Kexpr = Kexpr /. (Subscript[χ, 2])[y,μ] -> 0 // FullSimplify;

(Subscript[ϱ, 2,y])

Here, we keep the system as a 1st order system. From K(y,μ) = G(μ), we can write an expression for (Subscript[ϱ, 2,y]).
To close the system, we also write down the 2nd order equation for (Subscript[M, 2,y]).
Note that the inhomogeneous term in (Subscript[ϱ, 2]) has terms proportional to (Subscript[v, 1]) and its derivatives.

ϱ2yExpr = D[(Subscript[ϱ, 2])[y,μ],y] /. Flatten[Solve[ReleaseHold[Kexpr] == G[μ], D[(Subscript[ϱ, 2])[y,μ],y]]] // FullSimplify;
M2yExpr = 2 D[x[y,μ]^2,y] ((Subscript[ϱ, 2])[y,μ] + (1+κ) (Subscript[ϱ, 0])[y,μ] (Subscript[v, 1])[y,μ]^2)/x[y,μ]^2;

We work on each term separately.

(M2TermInϱ2y = FullSimplify[D[ϱ2yExpr,(Subscript[M, 2])[y,μ]]]) /. pp
(ϱ2TermInϱ2y = FullSimplify[D[ϱ2yExpr,(Subscript[ϱ, 2])[y,μ]]]) /. pp
(inhomogTermInϱ2y = FullSimplify[ϱ2yExpr - (Subscript[M, 2])[y,μ] M2TermInϱ2y -  (Subscript[ϱ, 2])[y,μ] ϱ2TermInϱ2y]) /. pp
(ϱ2TermInM2y = FullSimplify[D[M2yExpr,(Subscript[ϱ, 2])[y,μ]]]) /. pp
(inhomogTermInM2y = FullSimplify[M2yExpr - (Subscript[ϱ, 2])[y,μ] ϱ2TermInM2y]) /. pp

M2TermInϱ2yExplicit = M2TermInϱ2y/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
ϱ2TermInϱ2yExplicit =  ϱ2TermInϱ2y/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
inhomogTermInϱ2yExplicit = inhomogTermInϱ2y/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
ϱ2TermInM2yExplicit =  ϱ2TermInM2y/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
inhomogTermInM2yExplicit = inhomogTermInM2y/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
M2ϱ2PDE = {D[(Subscript[M, 2])[y,μ],y]-  (Subscript[ϱ, 2])[y,μ] ϱ2TermInM2yExplicit - inhomogTermInM2yExplicit,
D[(Subscript[ϱ, 2])[y,μ],y]-(Subscript[M, 2])[y,μ] M2TermInϱ2yExplicit -  (Subscript[ϱ, 2])[y,μ] ϱ2TermInϱ2yExplicit - inhomogTermInϱ2yExplicit};

We analysis here the leading behaviour of each term:

Limit[{M2TermInϱ2yExplicit/(y-1),ϱ2TermInϱ2yExplicit (y-1),inhomogTermInϱ2yExplicit/(y-1)},y -> 1]
Limit[{ϱ2TermInM2yExplicit (y-1),inhomogTermInM2yExplicit/(y-1)},y -> 1]
Limit[{M2TermInϱ2yExplicit y^(2+1/κ),ϱ2TermInϱ2yExplicit y,inhomogTermInϱ2yExplicit y^(4-1/κ)},y -> ∞,Assumptions->{0 < κ < 1, 0 < μ < 1}]
Limit[{ϱ2TermInM2yExplicit y,inhomogTermInM2yExplicit y^(4-1/κ)},y -> ∞,Assumptions->{0 < κ < 1, 0 < μ < 1}]

Power series around y=1

We need (Subscript[M, 2])(y=1,μ) = 0 to avoid conical singularities. Also, we require (Subscript[ϱ, 2])(y=1,μ)=0 from the definition. 
This is because we want ρ to have a regular expansion at the center and since to leading order y-1 ≃ (x^2), it follows that (Subscript[ϱ, 2])(1,μ)=0.
This can also be seen from power expansion, where the (Subscript[ϱ, 2])' equation gets a pole at y=1, that vanishes only if (Subscript[ϱ, 2])(1,μ)=0.

poweransatzRule = {(Subscript[M, 2]) -> Function[{y,μ}, Evaluate[Sum[(Subscript[M, 2]^c)[n,μ] (y-1)^n,{n,1,6}]]],
(Subscript[ϱ, 2]) -> Function[{y,μ}, Evaluate[Sum[(Subscript[ϱ, 2]^c)[n,μ] (y-1)^n,{n,1,6}]]]};

seriestmp = Series[(M2ϱ2PDE /. poweransatzRule), {y,1,2}];
PSSolutionCentreRule = Solve[{SeriesCoefficient[seriestmp,{y,1,0}],SeriesCoefficient[seriestmp,{y,1,1}],SeriesCoefficient[seriestmp,{y,1,2}]} == 0,
{(Subscript[ϱ, 2]^c)[1,μ], (Subscript[ϱ, 2]^c)[2,μ], (Subscript[ϱ, 2]^c)[3,μ], (Subscript[M, 2]^c)[2,μ],(Subscript[M, 2]^c)[3,μ]}] // Flatten // FullSimplify
Clear[seriestmp, poweransatzRule]

Power series around y=∞

Define the power series ansatz. Note that we require the perturbation to vanish at the centre to avoid conical singularities.

poweransatzRule = {(Subscript[M, 2]) -> Function[{y,μ}, Evaluate[Sum[(Subscript[M, 2]^∞)[n,μ]/y^n,{n,0,8}]]],
(Subscript[ϱ, 2]) -> Function[{y,μ}, Evaluate[Sum[(Subscript[ϱ, 2]^∞)[n,μ]/y^n,{n,1,4}]]]};

seriestmp = Series[(M2ϱ2PDE /. poweransatzRule /. κ -> 1/2), {y,∞,4},Assumptions->{0 < κ < 1}]

Shooting

IC at origin

We will suppress the μ dependence of all the variables for convenience.

M2ϱ2PDENum = M2ϱ2PDE /. (Subscript[M, 2])[y,μ] -> (Subscript[M, 2])[y] /. (Subscript[ϱ, 2])[y,μ] -> (Subscript[ϱ, 2])[y]/. D[(Subscript[M, 2])[y,μ],y] -> (Subscript[M, 2])'[y] /. D[(Subscript[ϱ, 2])[y,μ],y] -> (Subscript[ϱ, 2])'[y] /. G[μ] -> G;
ICPerturbedOrigin[Gpara_, Mc1para_,μpara_, κpara_, ϵpara_] := {(Subscript[M, 2]^c)[1,μ] (y-1) + (Subscript[M, 2]^c)[2,μ] (y-1)^2 + (Subscript[M, 2]^c)[3,μ] (y-1)^3, 
(Subscript[ϱ, 2]^c)[1,μ] (y-1) + (Subscript[ϱ, 2]^c)[2,μ] (y-1)^2 + (Subscript[ϱ, 2]^c)[3,μ] (y-1)^3} /. PSSolutionCentreRule  /.
{(Subscript[M, 2]^c)[1,μ] -> (Subscript[M, 2]^c)[1],(Subscript[M, 2]^c)[2,μ] -> (Subscript[M, 2]^c)[2],(Subscript[M, 2]^c)[3,μ] -> (Subscript[M, 2]^c)[3],(Subscript[ϱ, 2]^c)[1,μ] -> (Subscript[ϱ, 2]^c)[1],(Subscript[ϱ, 2]^c)[2,μ] -> (Subscript[ϱ, 2]^c)[2],(Subscript[ϱ, 2]^c)[3,μ] -> (Subscript[ϱ, 2]^c)[3],G[μ] -> G} /. (Subscript[M, 2]^c)[1] -> Mc1para /. G -> Gpara /.
{μ -> μpara, κ -> κpara, y -> 1+ϵpara}

Left shooting

LeftShooting[evaluation_?NumericQ, Gpara_?NumericQ, Mc1para_?NumericQ, μpara_?NumericQ, κpara_?NumericQ, ϵpara_?NumericQ] := Flatten[NDSolve[
{M2ϱ2PDENum[[1]] == 0 /. G -> Gpara  /. μ -> μpara /. κ -> κpara,
M2ϱ2PDENum[[2]] == 0 /. G -> Gpara  /. μ -> μpara /. κ -> κpara, 
(Subscript[M, 2])[1+ϵpara] == ICPerturbedOrigin[Gpara,Mc1para, μpara, κpara, ϵpara][[1]],
(Subscript[ϱ, 2])[1+ϵpara] == ICPerturbedOrigin[Gpara,Mc1para, μpara, κpara, ϵpara][[2]]},
{(Subscript[M, 2]), (Subscript[ϱ, 2])},{y,1+ϵpara,evaluation}]]

ymax = 100;
myϵ = 0.000001;
myμ = 0.001;
myκ = 0.5;
myG = 0.5;
myMpara =  2 (5 myκ-myG (1+myκ))/(myκ (1-myκ^2)); (* For -70.5, we get M = 0 asymptotically! *) 
				(* To make complementary function vanish: 2(((5κ-(Subscript[G, 0])(1+κ)))/(κ(1-(κ^2)))), 2 (5 myκ-myG (1+myκ))/(myκ (1-myκ^2))   *)
tmp = LeftShooting[ymax,myG,myMpara,myμ,myκ,myϵ];
Row[{Plot[(Subscript[M, 2])[y] /. tmp,{y,1+myϵ,ymax},PlotRange-> All,ImageSize->Medium],
Plot[(Subscript[ϱ, 2])[y] /. tmp,{y,1+myϵ,ymax},PlotRange->All,ImageSize->Medium]}]
Clear[tmp]

K((Subscript[M, 2]),(Subscript[M, 2,y]), (Subscript[M, 2,yy]))

Terms

Together with the (Subscript[M, 2,y]) equation, we then have a 1st order PDE system for (Subscript[M, 2]) and (Subscript[ϱ, 2]).
We can use the (Subscript[M, 2,y]) equation however to turn the K(y,μ)=G(μ) into a single 2nd order PDE for (Subscript[M, 2]).
The (Subscript[M, 2]) equation is checked to be: (Subscript[M, 2,y]) = ((2 (Subscript[x, ,y]^2))/(x^2)) ((Subscript[ϱ, 2]) + (1+κ) (Subscript[ϱ, 0]) (Subscript[v, 1]^2)).

tmp = (Subscript[ϱ, 2]) -> Function[{y,μ}, - (1+κ) (Subscript[v, 1])[y,μ]^2 (Subscript[ϱ, 0])[y,μ] + x[y,μ]^2 D[(Subscript[M, 2])[y,μ],y]/(2 D[x[y,μ]^2,y])];
KexprM = ReleaseHold[Kexpr] /. tmp // FullSimplify
Clear[tmp]

Have a look at the different terms:
The ensuing equation to be considered is then (Subscript[a, 2])(Subscript[M, 2,yy]) + (Subscript[a, 1])(Subscript[M, 2,y]) + (Subscript[a, 0])(Subscript[M, 2]) + b = G(μ),   where (Subscript[a, 2]), (Subscript[a, 1]), (Subscript[a, 0]) and b are all functions of y and μ.
Note the K(y,μ) is not homogenous in (Subscript[f, 2]) because of the b term.

M2Term = D[ReleaseHold[KexprM],(Subscript[M, 2])[y,μ]] // Simplify
M2yTerm = D[ReleaseHold[KexprM],D[(Subscript[M, 2])[y,μ],y]] // Simplify
M2yyTerm = D[ReleaseHold[KexprM],D[(Subscript[M, 2])[y,μ],{y,2}]] // Simplify
inhomogTerm = ReleaseHold[KexprM] - M2Term (Subscript[M, 2])[y,μ] - M2yTerm D[(Subscript[M, 2])[y,μ],y] - M2yyTerm D[(Subscript[M, 2])[y,μ],{y,2}] // FullSimplify

We now substitute the known expressions for the background variables and (Subscript[v, 1]).

M2TermExplicit = M2Term/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
M2yTermExplicit = M2yTerm/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
M2yyTermExplicit = M2yyTerm/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule/. myv1Rule // FullSimplify;
inhomogTermExplicit = inhomogTerm/. myϱ0Rule /. myxRule /. myM0Rule /. myχ0Rule /. myv1Rule // FullSimplify;
KexprMExplicit = D[(Subscript[M, 2])[y,μ],{y,2}] M2yyTermExplicit + D[(Subscript[M, 2])[y,μ],y] M2yTermExplicit + (Subscript[M, 2])[y,μ] M2TermExplicit + inhomogTermExplicit ;

Asymptotics

Checking now the asymptotic behaviours of the coefficients.
There is something weird happening with the inhomogeneous part of K(y,μ) at infinity, where it blows up except for κ=1/2.

Limit[inhomogTermExplicit,y -> 1]
Limit[inhomogTermExplicit,y -> ∞,Assumptions->{0 < κ < 1, 0 < μ < 1}]
Limit[inhomogTermExplicit /. κ -> 1/2,y -> ∞,Assumptions->{0 < μ < 1}]

Here, we show that basically, the inhomogeneous term goes like something less than y at infinity.
In the below, the condition is generally not satisfied if we consider small μ and the term then goes to zero. We make an explicit example with κ=1/2.

Limit[inhomogTermExplicit/y,y -> ∞,Assumptions->{0 < κ < 1, 0 < μ < 1}]
Limit[inhomogTermExplicit/y /. κ -> 1/2,y -> ∞,Assumptions->{0 < μ < 1}]

For the other terms, (Subscript[M, 2]) term vanishes, while the other ones blow up at infinity.
If we consider a power series ansatz of the form (Subscript[M, 2]) = (Subscript[m, 0]) + ((Subscript[m, 1])/y) + ..., this means that (Subscript[m, 0]) is arbitrary, while we have some condition on (Subscript[m, 1]) so that LHS vanishes since
(Subscript[a, 2])(Subscript[M, 2])'' ~ (Subscript[a, 1])(Subscript[M, 1])'' ~ b ~ y.

Limit[{M2TermExplicit,M2yTermExplicit,M2yyTermExplicit},y -> 1,Assumptions->{0 < κ < 1, 0 < μ < 1}]
Limit[{M2TermExplicit,M2yTermExplicit/y^3,M2yyTermExplicit/y^4},y -> ∞,Assumptions->{0 < κ < 1, 0 < μ < 1}]

Homogenous solution

acoeff = y^2 M2yyTermExplicit / M2yyTermExplicit (1+(-1+y^(1+1/κ)) μ) // FullSimplify;
bcoeff = y^2 M2yTermExplicit / M2yyTermExplicit (1+(-1+y^(1+1/κ)) μ) // FullSimplify;
ccoeff = y^2 M2TermExplicit / M2yyTermExplicit (1+(-1+y^(1+1/κ)) μ) // FullSimplify;
inhomocoeff =  y^2 (inhomogTermExplicit - G) / M2yyTermExplicit (1+(-1+y^(1+1/κ)) μ) // FullSimplify;
M2ODETerm = acoeff (Subscript[M, 2])''[y] + bcoeff (Subscript[M, 2])'[y]+ccoeff (Subscript[M, 2])[y]

The solution:
Note that first term is 0 at the centre and this is explained below as it corresponds to a perturbation of static solution keeping R fixed.

M2homosol = (κ μ (κ (-1+μ)+μ)-y^(-2/κ) κ (-1+μ) (-1+μ+κ μ)+y^(-1-1/κ) (κ+(-1+y^2-2 κ) μ-(-1+y^2) (1+κ) μ^2)) (C[1])-
	(-y^(-2/κ) κ (-1+μ)-y^(1-1/κ) μ) (C[2]);
Simplify[M2ODETerm == 0 /. (Subscript[M, 2]) -> Function[y,Evaluate[M2homosol]]]

Checking that perturbation, say of the form s -> s (1-ϵ) by keeping R fixed, of (Subscript[M, 0]) is a solution.

myx2 = μ (y^2-1) + 2κ (1-μ)/(1-κ) (1-y^(1-1/κ));
myM = μ myx2-1/4 D[myx2,y]^2 // FullSimplify;
drds = (y D[myx2,y]-2 myx2-2 μ D[myx2,μ])/D[myx2,y] // Simplify;
MstaticpertRfixed = - D[myM,y] drds-2 μ D[myM,μ]+y D[myM,y] // FullSimplify;
Simplify[M2ODETerm == 0 /. (Subscript[M, 2]) -> Function[y,Evaluate[MstaticpertRfixed]]]

It is not true that a perturbation, keeping r fixed instead is a solution! Although it is if μ = 0. I don’t understand what that means...

myM0[y_,μ_] := -y^(-2/κ) (-1+μ)^2-((2 y^(1-1/κ) (-1+μ) μ)/(-1+κ))+((μ (κ (-2+μ)+μ))/(-1+κ))
Simplify[((Subscript[M, 0])[y,μ] /. myM0Rule) == myM0[y,μ]]

Mstaticpert=  SeriesCoefficient[myM0[y/(1-ϵ),μ (1-ϵ)^2],{ϵ,0,1}] // Simplify;
Simplify[M2ODETerm /. (Subscript[M, 2]) -> Function[y,Evaluate[Mstaticpert]]]
% /. μ -> 0

μ = 0

ODE

We take μ = 0 and solve the resulting equation for (Subscript[M, 2]). We have checked that the resulting equation is the same as when we start with Λ=0 from the beginning.

M2ODEμ0 = FullSimplify[M2yyTermExplicit D[(Subscript[M, 2])[y,μ],{y,2}] + M2yTermExplicit D[(Subscript[M, 2])[y,μ],y] + M2TermExplicit (Subscript[M, 2])[y,μ] + inhomogTermExplicit - (Subscript[G, 0]) 
	/. (Subscript[M, 2]) -> Function[{y,μ}, (Subscript[M, 2])[y]]  /. μ -> 0 , {y > 0, 0 < κ < 1}];
M2yyμ0 = D[M2ODEμ0,(Subscript[M, 2])''[y]] // Simplify
M2yμ0 = D[M2ODEμ0,(Subscript[M, 2])'[y]]// Simplify
M2μ0 = D[M2ODEμ0,(Subscript[M, 2])[y]]// Simplify
inhomogμ0=M2ODEμ0 /. (Subscript[M, 2]) -> Function[y,0]// Simplify

Solution

The equation is just an inhomogeneous Euler equation, as is clear from the standard form, so it is easy to work out the solution by decomposing into homogenous + inhomogeneous part.
We defined the integration constants in such a way that the term ~ (Subscript[C, 1]) corresponds to (Subscript[δM, 0])(x) while the term ~(Subscript[C, 2]) corresponds to (Subscript[δM, 0])(y).
This is because if we consider a rescaling s -> s(1-ϵ), in the coordinate x and y, we get slightly different results. With this definition, (Subscript[C, 2]) = 0 by regularity near the centre.

M2Sol = y^(-1-1/κ) (1-y^(1-1/κ)) (C[1])+y^(-2/κ) (C[2])+((6 κ y^(-2) (1-y^(2-2/κ)))/((1-κ)^2 (1+κ)))-y^(-1-1/κ) ((2 ((Subscript[G, 0])+κ+(Subscript[G, 0]) κ) Log[y])/(κ (1-κ^2)));
M2SolRuletmp = (Subscript[M, 2]) -> Function[y,Evaluate[M2Sol]];
M2ODEμ0 == 0 /. M2SolRuletmp // Simplify

The perturbation is 0 at the surface. For regularity, we impose that mass perturbation vanishes at the centre.

Limit[M2Sol,y -> ∞,Assumptions->{0 < κ < 1}]
tmp = Limit[M2Sol,y -> 1,Assumptions->{0 < κ < 1}];
tmp2 = Solve[tmp == 0,C[2]] // Flatten// Simplify
M2SolReg = Collect[M2Sol /. tmp2,C[1],FullSimplify]
Clear[tmp,tmp2]

For analyticity, we need to ensure that the Log term is absent, fixing the constant (Subscript[G, 0]) = -(κ/(1+κ)).
This requirement is however not justified in that the background is not regular in the first place at the surface!
The term in front of the integration constant is just a rescaling of the scale s of the background, i.e. a zero mode of the static solution.
As a side note, the above ODE has three regular singular points and thus can be recast as a hypergeometric equation.

Power series around y=1

Define the power series ansatz. Note that we require the perturbation to vanish at the centre to avoid conical singularities.

poweransatzRule = (Subscript[M, 2]) -> Function[{y,μ}, Evaluate[Sum[(Subscript[M, 2]^c)[n,μ] (y-1)^n,{n,1,4}]]];

We only consider the term up to (((y-1))^2). We find that (Subscript[M, 2])'(1,μ) is arbitrary. The leading order term is ~O(1) and serves to solve for (Subscript[M, 2])''(1,μ).

seriestmp = Series[(KexprMExplicit - G[μ] /. poweransatzRule), {y,1,2}];
PSSolutionCentre = Solve[{SeriesCoefficient[seriestmp,{y,1,0}],SeriesCoefficient[seriestmp,{y,1,1}],SeriesCoefficient[seriestmp,{y,1,2}]} == 0,
{(Subscript[M, 2]^c)[2,μ],(Subscript[M, 2]^c)[3,μ],(Subscript[M, 2]^c)[4,μ]}] // Flatten // FullSimplify
Clear[seriestmp]

Power series around y=∞

Define the power series ansatz. Note that we require the perturbation to vanish at the centre to avoid conical singularities.

poweransatzRule = (Subscript[M, 2]) -> Function[{y,μ}, Evaluate[Sum[(Subscript[M, 2]^b)[n,μ]/y^n,{n,0,4}]]]

We only consider the term up to (((y-1))^2). We find that (Subscript[M, 2])'(1,μ) is arbitrary. The leading order term is ~O(1) and serves to solve for (Subscript[M, 2])''(1,μ).

seriestmp = Series[(KexprMExplicit - G[μ] /. poweransatzRule), {y,1,2}];
PSSNeatInf = Solve[{SeriesCoefficient[seriestmp,{y,1,0}],SeriesCoefficient[seriestmp,{y,1,1}],SeriesCoefficient[seriestmp,{y,1,2}]} == 0,
{(Subscript[M, 2]^c)[2,μ],(Subscript[M, 2]^c)[3,μ],(Subscript[M, 2]^c)[4,μ]}] // Flatten // FullSimplify
Clear[seriestmp]

Linear perturbation

PDE system of perturbed variables

Change to analytic variable (g, M, ϱ, 𝒱)

In terms of dim-full coordinates/constants

Non-evaluable.

A posteriori, the variable V is not analytic at the center. The problem can be seen in the (Subscript[M, ,t]) and (Subscript[ϱ, ,r]) equations. For non-zero V, we have non-squared appearances of R(r), which is not analytic at the center (although (R^2) is).
To make the expansion of the PDEs analytic, and the expansion of the spacetime analytic, we need V to go like V ~ (Sqrt[y-1]) + .... This is the same expansion of R and therefore V/R (or VR) has a regular expansion. 
Thus, define new variable 𝒱 = (V/R). Note: 𝒱 is then a dimension-full constant.

ruletmp = {V -> Function[{t,r}, 𝒱[t,r] R[r]]};
(exprIngMϱ𝒱Ofgr = Simplify[D[g[t,r],r] /. Flatten[Solve[(D[g[t,r],r] - metricMatterEqnSolgr /. ruletmp) == 0,D[g[t,r],r]]]]) /. pp
(exprIngMϱ𝒱OfMr = Simplify[D[M[t,r],r] /. Flatten[Solve[(D[M[t,r],r] - metricMatterEqnSolMr /. ruletmp) == 0,D[M[t,r],r]]]]) /. pp
(exprIngMϱ𝒱OfMt = Simplify[D[M[t,r],t] /. Flatten[Solve[(D[M[t,r],t] - metricMatterEqnSolMt /. ruletmp) == 0,D[M[t,r],t]]]]) /. pp
(exprIngMϱ𝒱Ofϱr = Simplify[D[ϱ[t,r],r] /. Flatten[Solve[(D[ϱ[t,r],r] - metricMatterEqnSolϱr /. ruletmp) == 0,D[ϱ[t,r],r]]]]) /. pp
(exprIngMϱ𝒱Of𝒱r = Simplify[Factor[D[𝒱[t,r],r] /. Flatten[Solve[(D[V[t,r],r] - metricMatterEqnSolVr /. ruletmp) == 0,D[𝒱[t,r],r]]]]]) /. pp
Clear[ruletmp]

In terms of dim-less variables

Here, define expressions in terms of dim-less variables instead: x = R/s, y = r/s, T = t/s, μ = -Λ (s^2), 𝒱 = (V/x). This is effectively the same equations as above, but just replace the variable with the corresponding dim-less one (as if s = 1).
We then express the full PDE system in terms of these dimensionless variables/constants.

ruletmp = {g -> Function[{t,r}, g[t/s,r/s]],R -> Function[r,x[r/s] s],M-> Function[{t,r}, M[t/s,r/s]],
		ϱ-> Function[{t,r}, ϱ[t/s,r/s]],V -> Function[{t,r}, 𝒱[t/s,r/s] x[r/s]], r -> y s, t -> T s, Λ -> -μ/s^2};
(exprIngMϱ𝒱Ofgy = Simplify[D[g[T,y],y] /. Flatten[Solve[(D[g[t,r],r] - metricMatterEqnSolgr /. ruletmp) == 0,D[g[T,y],y]]]]) /. pp
(exprIngMϱ𝒱OfMy = Simplify[D[M[T,y],y] /. Flatten[Solve[(D[M[t,r],r] - metricMatterEqnSolMr /. ruletmp) == 0,D[M[T,y],y]]]]) /. pp
(exprIngMϱ𝒱OfMT = Simplify[D[M[T,y],T] /. Flatten[Solve[(D[M[t,r],t] - metricMatterEqnSolMt /. ruletmp) == 0,D[M[T,y],T]]]]) /. pp
(exprIngMϱ𝒱Ofϱy = Simplify[D[ϱ[T,y],y] /. Flatten[Solve[(D[ϱ[t,r],r] - metricMatterEqnSolϱr /. ruletmp) == 0,D[ϱ[T,y],y]]]]) /. pp
(exprIngMϱ𝒱Of𝒱y = Simplify[Factor[D[𝒱[T,y],y] /. Flatten[Solve[(D[V[t,r],r] - metricMatterEqnSolVr /. ruletmp) == 0,D[𝒱[T,y],y]]]]]) /. pp
Clear[ruletmp]

Introduce perturbations for analysis

From the static solution, let us also consider the new variable y = r/s as well as x = R/s. We will work with this coordinate from now on.
The equations can easily be updated by simply replacing r -> y everywhere (or equivalently, by taking s = 1 in which case, r and y are the same. Can re-introduce scale s later).
Note that y ≥ 1 and x ≥ 0.
Similarly, we express Λ in terms of μ (see section on analytical static solution for Λ ≤ 0).

We now introduce the perturbations: We extract the linear term by differentiating wrt to ϵ and then setting ϵ = 0. 
Note: we make use of the fact the background velocity is just 0.
Note the extra factor in the expansion of all three variables. This is done a posteriori in that we want the perturbation to have a regular expansion at the surface and we find that near the surface, the perturbation of the density goes like (Subscript[ϱ, 0]).

VariablesgMϱ𝒱LinearPerturbationRule = {g -> Function[{T,y},(Subscript[g, 0])[y]+ϵ (Subscript[g, 0])[y] (Subscript[g, 1])[T,y]],M -> Function[{T,y},(Subscript[M, 0])[y]+ϵ (Subscript[M, 0])[y] (Subscript[M, 1])[T,y]], ϱ -> Function[{T,y},(Subscript[ϱ, 0])[y]+ϵ (Subscript[ϱ, 0])[y] (Subscript[ϱ, 1])[T,y]],𝒱 -> Function[{T,y},ϵ (Subscript[𝒱, 1])[T,y]]};

(Subscript[𝒱, 1]) is the only one which can be readily found:

exprIngMϱ𝒱Of𝒱1y = D[exprIngMϱ𝒱Of𝒱y /.VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;

For (Subscript[M, 1]), (Subscript[ϱ, 1]) and (Subscript[g, 1]), this is a bit more subtle, because of the extra factors in the perturbations. We then need to do the LHS and RHS separately.

lhsg   = D[D[g[T,y],y] /. VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
rhsg   = D[exprIngMϱ𝒱Ofgy /.VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
lhsϱ   = D[D[ϱ[T,y],y] /. VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
rhsϱ   = D[exprIngMϱ𝒱Ofϱy /.VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
lhsMx = D[D[M[T,y],y] /. VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
rhsMx = D[exprIngMϱ𝒱OfMy /.VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
lhsMT = D[D[M[T,y],T] /. VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;
rhsMT = D[exprIngMϱ𝒱OfMT /.VariablesgMϱ𝒱LinearPerturbationRule,ϵ] /. ϵ -> 0 // Simplify;

For the lhs, we use the ODE for the static variables.

exprg0PrimeRule = (Subscript[g, 0])'[y] -> metricMatterEqnReducedStaticSolgrΛ /. R -> x /. r -> y /. Λ -> -μ /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])};
exprϱ0PrimeRule = (Subscript[ϱ, 0])'[y] -> metricMatterEqnReducedStaticSolϱrΛ /. R -> x /. r -> y /. Λ -> -μ /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])};
exprM0PrimeRule = (Subscript[M, 0])'[y] -> metricMatterEqnReducedStaticSolMrΛ /. R -> x /. r -> y /. Λ -> -μ /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])};

lhsg   = lhsg /.exprg0PrimeRule // Simplify;
lhsϱ   = lhsϱ /.exprϱ0PrimeRule // Simplify;
lhsMx = lhsMx /.exprM0PrimeRule // Simplify;
lhsMT = lhsMT /.exprM0PrimeRule // Simplify;

exprIngMϱ𝒱Ofg1y = D[(Subscript[g, 1])[T,y],y] /. Flatten[Simplify[Solve[lhsg == rhsg,D[(Subscript[g, 1])[T,y],y]]]];
exprIngMϱ𝒱Ofϱ1y = D[(Subscript[ϱ, 1])[T,y],y] /. Flatten[Simplify[Solve[lhsϱ == rhsϱ,D[(Subscript[ϱ, 1])[T,y],y]]]];
exprIngMϱ𝒱OfM1y = D[(Subscript[M, 1])[T,y],y] /. Flatten[Simplify[Solve[lhsMx == rhsMx,D[(Subscript[M, 1])[T,y],y]]]];
exprIngMϱ𝒱OfM1T = D[(Subscript[M, 1])[T,y],T] /. Flatten[Simplify[Solve[lhsMT == rhsMT,D[(Subscript[M, 1])[T,y],T]]]];
Clear[lhsg,rhsg,lhsϱ,rhsϱ,lhsMx,rhsMx,lhsMT,rhsMT]

Check compatibility condition

Need to check that (∂_y) (∂_T) M = (∂_T) (∂_y) M.

tmpexprM1yT = D[exprIngMϱ𝒱OfM1y,T] /. D[(Subscript[M, 1])[T,y],T] -> Evaluate[exprIngMϱ𝒱OfM1T];
tmpexprM1Ty = D[exprIngMϱ𝒱OfM1T,y] /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. D[(Subscript[𝒱, 1])[T,y],y] -> Evaluate[exprIngMϱ𝒱Of𝒱1y];
Simplify[tmpexprM1Ty-tmpexprM1yT]
Clear[tmpexprM1Ty,tmpexprM1yT]

Introduce perturbations for shooting

A posteriori, it turns out that it might be a better idea to consider the full perturbed variables, i.e. (Subscript[f, p]) = (Subscript[f, 0]) (Subscript[f, 1]) and not just (Subscript[f, 1]), for the shooting. There are a few reasons alluded to in the analysis but it is also that while (Subscript[f, 1])' might be singular somewhere, (Subscript[f, 0])(Subscript[f, 1])' might not be,
and that is the most important part in the end.

VariablesgMϱ𝒱LinearPerturbationRuleShooting = {g -> Function[{T,y},(Subscript[g, 0])[y]+ϵ (Subscript[g, 1])[T,y]],M -> Function[{T,y},(Subscript[M, 0])[y]+ϵ (Subscript[M, 1])[T,y]], ϱ -> Function[{T,y},(Subscript[ϱ, 0])[y]+ϵ (Subscript[ϱ, 1])[T,y]],𝒱 -> Function[{T,y},ϵ (Subscript[𝒱, 1])[T,y]]};

exprIngMϱ𝒱Ofg1yShooting  = D[exprIngMϱ𝒱Ofgy /.VariablesgMϱ𝒱LinearPerturbationRuleShooting,ϵ] /. ϵ -> 0 // Simplify;
exprIngMϱ𝒱OfM1yShooting  = D[exprIngMϱ𝒱OfMy /.VariablesgMϱ𝒱LinearPerturbationRuleShooting,ϵ] /. ϵ -> 0 // Simplify;
exprIngMϱ𝒱OfM1TShooting  = D[exprIngMϱ𝒱OfMT /.VariablesgMϱ𝒱LinearPerturbationRuleShooting,ϵ] /. ϵ -> 0 // Simplify;
exprIngMϱ𝒱Ofϱ1yShooting  = D[exprIngMϱ𝒱Ofϱy /.VariablesgMϱ𝒱LinearPerturbationRuleShooting,ϵ] /. ϵ -> 0 // Simplify;
exprIngMϱ𝒱Of𝒱1yShooting = D[exprIngMϱ𝒱Of𝒱y /.VariablesgMϱ𝒱LinearPerturbationRuleShooting,ϵ] /. ϵ -> 0 // Simplify;

Check compatibility condition

Need to check that (∂_y) (∂_T) M = (∂_T) (∂_y) M.

tmpexprM1yT = D[exprIngMϱ𝒱OfM1yShooting,T] /. D[(Subscript[M, 1])[T,y],T] -> Evaluate[exprIngMϱ𝒱OfM1TShooting];
tmpexprM1Ty = D[exprIngMϱ𝒱OfM1TShooting,y] /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. D[(Subscript[𝒱, 1])[T,y],y] -> Evaluate[exprIngMϱ𝒱Of𝒱1yShooting];
Simplify[tmpexprM1Ty-tmpexprM1yT]
Clear[tmpexprM1Ty,tmpexprM1yT]

Boundary asymptotics for μ = 0

Re-write equations with x coordinate and μ = 0

g1yRule = Flatten[Solve[exprIngMϱ𝒱Ofg1y == D[(Subscript[g, 1])[T,y],y],D[(Subscript[g, 1])[T,y],y]]] // Simplify;
M1yRule = Flatten[Solve[exprIngMϱ𝒱OfM1y == D[(Subscript[M, 1])[T,y],y],D[(Subscript[M, 1])[T,y],y]]] // Simplify;
M1TRule = Flatten[Solve[exprIngMϱ𝒱OfM1T == D[(Subscript[M, 1])[T,y],T],D[(Subscript[M, 1])[T,y],T]]] // Simplify;
ϱ1TRule = Flatten[Solve[exprIngMϱ𝒱Of𝒱1y == D[(Subscript[𝒱, 1])[T,y],y],D[(Subscript[ϱ, 1])[T,y],T]]] // Simplify;
𝒱1TRule = Factor[Flatten[Solve[exprIngMϱ𝒱Ofϱ1y == D[(Subscript[ϱ, 1])[T,y],y],D[(Subscript[𝒱, 1])[T,y],T]]]] // Simplify;

Simplify[g1yRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[M1yRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[M1TRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[ϱ1TRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[𝒱1TRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp

At the center x = 0

We easily find that to leading order:
1) ((Subscript[dM, 1])/dx) ~ O(x ((Subscript[M, 1])-(Subscript[ϱ, 1])))
2) ((Subscript[dg, 1])/dx) ~ O(x ((Subscript[M, 1]) -(Subscript[ϱ, 1])))
3) ((Subscript[dM, 1])/dT) ~ O((x^2)(Subscript[𝒱, 1]))
4) ((Subscript[dϱ, 1])/dT) ~ O((Subscript[𝒱, 1])+x(((Subscript[d𝒱, 1]) )/dx)+(x^2) (Subscript[𝒱, 1]))
5) ((Subscript[d𝒱, 1])/dT)~ O((Subscript[ϱ, 1])+(Subscript[M, 1])+ (1/x)((Subscript[dϱ, 1])/dx))
From 1) and 5), the only sensible expansion is if (Subscript[ϱ, 1]) and (Subscript[M, 1]) have both an even expansion in x. Then, from 2) and 4), (Subscript[g, 1]) and (Subscript[𝒱, 1]) also need an even expansion.
This is also consistent with 3) and in fact both of the mass PDEs imply that (Subscript[M, 1])(T, x=0) = constant. We then impose no conical singularity which then requires (Subscript[M, 1])(T,0) = 0. This is also the only choice possible when considering eigenmodes (Subscript[M, 1])(T,x) = (e^(λt))(Subscript[M, 1,λ]) (x).
This is also understood from the point of view that a, α are scalars and since in Cartesian coordinates “(R^2) = (x^2)+(y^2)" is regular, the expansion of a and α are functions of (R^2)  or equivalently (x^2) (i.e. even expansion in R).
V is odd and thus as an odd expansion in R, or 𝒱 has an even expansion in R.
Finally, the leading order power of 4) and 5) induce a condition on the leading coefficients of the variables. This removes 2 d.o.f.
So, we are left with 2 d.o.f: (Subscript[g, 1])(0) (gauge) and either one of (Subscript[𝒱, 1])(0), (Subscript[ϱ, 1])(0).

At the surface x = (Subscript[x, ⋆])

We find that (see analysis of the static Λ=0 solution section),
	1) ((Subscript[dg, 1])/dx) ~  (((Subscript[M, 1])-(Subscript[ϱ, 1]))/((Subscript[x, ⋆])-x))
	2) ((Subscript[dM, 1])/dx) ~  (1/((Subscript[x, ⋆])-x)) ((Subscript[M, 1])-(Subscript[ϱ, 1]))
	3) ((Subscript[dM, 1])/dT) ~  (Subscript[𝒱, 1])
	4) ((Subscript[dϱ, 1])/dT) ~ {(1+((Subscript[x, ⋆])-x))(Subscript[𝒱, 1]) +((Subscript[x, ⋆])-x) ((Subscript[d𝒱, 1])/dx)}
	5) ((Subscript[d𝒱, 1])/dT) = {(Subscript[ϱ, 1])-(Subscript[M, 1])+((Subscript[x, ⋆])-x) ((Subscript[dϱ, 1])/dx)}

If we take the leading order expression of variable f (representing all 4 variables) to be ~ ((((Subscript[x, ⋆])-x))^(Subscript[p, f])), we find that in fact: (Subscript[g, 1]) ~ (Subscript[M, 1]) ~ (Subscript[ϱ, 1]) ~ (Subscript[𝒱, 1]) ~ ((((Subscript[x, ⋆])-x))^p), for some p.
Presumable, when we look for exponentially growing modes, we are left with 3 ODEs (can solve 3) algebraically). The leading order terms then, for p≠0, only involve leading order coefficients and p. This fixes all but one d.o.f.

ODE system for eigenmodes solutions

For analysis

Eigenmode ansatz and equations

Look for eigenmode solution of the form (Subscript[f, 1])(T,y) = (e^(λT))(Subscript[f, 1]^EM)(y). Note that in the below, we will drop the “EM” superscript. Note that t has dimension length, so we scale it so that λ is dimensionless.
The ODEs are then functions of dim-less qtes and the scale factor s does not explicitly appear as it shouldn’t.
Note: this λ has of course nothing to do with the λ from the general static solution!
Note: the matter equations for the linear perturbations do not depend on the linear perturbation of g and therefore do not depend on α!!

Variablesg1M1ϱ1𝒱1EMRule = {(Subscript[g, 1]) -> Function[{T,y},(Subscript[g, 1])[y] Exp[λ T]], (Subscript[M, 1]) -> Function[{T,y},(Subscript[M, 1])[y] Exp[λ T]], (Subscript[ϱ, 1]) -> Function[{T,y},(Subscript[ϱ, 1])[y] Exp[λ T]],(Subscript[𝒱, 1]) -> Function[{T,y},(Subscript[𝒱, 1])[y] Exp[λ T]]};
(ODEIngMϱ𝒱Ofg1EMy = Simplify[D[(Subscript[g, 1])[y],y] /. Flatten[Solve[D[(Subscript[g, 1])[T,y],y] - exprIngMϱ𝒱Ofg1y == 0 /.Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[g, 1])[y],y]]]]) /. pp
(ODEIngMϱ𝒱OfM1EMy = Simplify[D[(Subscript[M, 1])[y],y] /. Flatten[Solve[D[(Subscript[M, 1])[T,y],y] - exprIngMϱ𝒱OfM1y == 0 /.Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[M, 1])[y],y]]]]) /. pp
(algEqnIngMϱ𝒱OfM1EM = Simplify[Exp[-λ T](D[(Subscript[M, 1])[T,y],T] - exprIngMϱ𝒱OfM1T  /. Variablesg1M1ϱ1𝒱1EMRule)]) /. pp
(ODEIngMϱ𝒱Ofϱ1EMy = Simplify[Factor[D[(Subscript[ϱ, 1])[y],y] /. Flatten[Solve[D[(Subscript[ϱ, 1])[T,y],y] - exprIngMϱ𝒱Ofϱ1y == 0 /. Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[ϱ, 1])[y],y]]]]]) /. pp
(ODEIngMϱ𝒱Of𝒱1EMy = Simplify[D[(Subscript[𝒱, 1])[y],y] /. Flatten[Solve[D[(Subscript[𝒱, 1])[T,y],y] - exprIngMϱ𝒱Of𝒱1y == 0 /. Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[𝒱, 1])[y],y]]]]) /. pp

Reduced system

Notice that we get an algebraic equation for (Subscript[M, 1]). This has to be consistent with the (Subscript[M, 1,y]) equation. This is checked below.

From the algebraic equation, we can solve for the mass (Subscript[M, 1]) or (Subscript[𝒱, 1]). We choose to solve it for the latter, because otherwise the case λ=0 is degenerate. Note that the correction in the mass only depends on the correction in the velocity.
Plugging this into the other ODEs, we get a system of 3 ODEs for (Subscript[M, 1]), (Subscript[g, 1]), (Subscript[ϱ, 1]). 
We compile the Reduced system equations for the perturbed variables, which will be used when shooting.

𝒱1SolRuletmp = Flatten[Simplify[Solve[algEqnIngMϱ𝒱OfM1EM == 0,(Subscript[𝒱, 1])[y]]]];
	   𝒱1SolRule = Block[{y}, (Subscript[𝒱, 1]) -> Function @@ List[{y},(Subscript[𝒱, 1])[y] /.  𝒱1SolRuletmp]];
	   ODEReducedg1EMM1EMϱ1EM = Table[0,{i,1,3}];
	    (ODEReducedg1EMM1EMϱ1EM[[1]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱Ofg1EMy /. 𝒱1SolRule)]] (Subscript[g, 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱Ofg1EMy /. 𝒱1SolRule)]]]) /. pp
	    (ODEReducedg1EMM1EMϱ1EM[[2]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱OfM1EMy /. 𝒱1SolRule)]] (Subscript[M, 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱OfM1EMy /. 𝒱1SolRule)]]]) /. pp
	    (ODEReducedg1EMM1EMϱ1EM[[3]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱Ofϱ1EMy /. 𝒱1SolRule)]] (Subscript[ϱ, 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱Ofϱ1EMy /. 𝒱1SolRule)]]]) /. pp
	   Clear[𝒱1SolRuletmp];

As mentioned above, we then find that (Subscript[𝒱, 1]) only depends on (Subscript[M, 1.])

(Subscript[𝒱, 1])[y] /. 𝒱1SolRule /. (staticSolgMϱVInTermsOfyRule /. M -> (Subscript[M, 0]) /. ϱ -> (Subscript[ϱ, 0]) /. g -> (Subscript[g, 0])) /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]// Simplify

Check that (∂_y)(Subscript[𝒱, 1]) ODE is identically satisfied

tmpRule = D[(Subscript[M, 1])[y],y] -> ODEIngMϱ𝒱OfM1EMy;
tmpLHS = D[(Subscript[𝒱, 1])[y],y] /. 𝒱1SolRule /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. tmpRule /. pp// Simplify;
tmpRHS = ODEIngMϱ𝒱Of𝒱1EMy /. 𝒱1SolRule /. pp // Simplify;
Simplify[tmpLHS == tmpRHS]
Clear[tmpRule,tmpLHS,tmpRHS]

Reduced system with μ = 0

In this case, we can actually express everything in terms of x, and not y, since x[y] is then invertible.
Note that the matter equations do not depend on spacetime perturbation (Subscript[g, 1]).

tmp = Flatten[Solve[ODEReducedg1EMM1EMϱ1EM == 0,{(Subscript[g, 1])'[y],(Subscript[M, 1])'[y],(Subscript[ϱ, 1])'[y]}]] // FullSimplify

(ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx =  Simplify[ODEReducedg1EMM1EMϱ1EM /. x -> Function[y,y] /. y -> x /. μ -> 0]) /. pp;

(reducedPerturbedODE = Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx == 0,{(Subscript[g, 1])'[x],(Subscript[M, 1])'[x],(Subscript[ϱ, 1])'[x]}]] // Simplify) /. pp

Note: since the variable (Subscript[g, 1]) does not appear in the 2 matter ODEs, we can effectively only consider the latter 2 equations and solve for them. We then find (Subscript[M, 1]) via algebraic equation and (Subscript[g, 1]) by integration.

Decouple matter equations into 2 2nd order ODEs

tmp = Flatten[Solve[((Subscript[M, 1])'[x] /. reducedPerturbedODE) == (Subscript[M, 1])'[x],(Subscript[ϱ, 1])[x]]];
exprM1pp = D[reducedPerturbedODE[[2,2]],x] /. reducedPerturbedODE // Simplify;
M1ppODE =(Subscript[M, 1])''[x] - (exprM1pp /. (exprM0PrimeRule /. x -> Function[y,y] /. y -> x) /. (exprϱ0PrimeRule /. x -> Function[y,y] /. y -> x) /. μ -> 0  /. tmp)// Simplify
Clear[tmp,exprM1pp]

Collect[M1ppODE,(Subscript[M, 1])'[x]]

The below is much more complicated as the above, so it is best, if possible to solve the above, then make use of the (Subscript[M, 1])' equation to find (Subscript[ϱ, 1]).

tmp = Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx == 0,{(Subscript[g, 1])'[x],(Subscript[M, 1])'[x],(Subscript[ϱ, 1])'[x]}]]  // Simplify;
tmp2 = Flatten[Solve[((Subscript[ϱ, 1])'[x] /. tmp) == (Subscript[ϱ, 1])'[x],(Subscript[M, 1])[x]]];
exprϱ1pp = D[tmp[[3,2]],x] /. tmp // Simplify;
ϱ1ppODE =(Subscript[ϱ, 1])''[x] - (exprϱ1pp /. (exprM0PrimeRule /. x -> Function[y,y] /. y -> x) /. (exprϱ0PrimeRule /. x -> Function[y,y] /. y -> x) /. 
(exprg0PrimeRule /. x -> Function[y,y] /. y -> x) /. μ -> 0  /. tmp2)// Simplify
Clear[tmp,tmp2,exprϱ1pp]

Analysis

As described above, we can only focus on the matter equations. Note that the ODE can be written as (Subscript[f, 1])’ = (Subscript[Af, 1]), since it is linear and A = A((Subscript[f, 0]);κ,λ). Evidently, (Subscript[f, 0]) and (Subscript[f, 1]) are the set of static and perturbed equations.
Now, to find a unique solution, the matrix A had better not be degenerate, i.e. det A ≠ 0. If we write A = ((Subscript[a, ij])), we find:

tmp = Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx == 0, {(Subscript[g, 1])'[x],(Subscript[M, 1])'[x],(Subscript[ϱ, 1])'[x]}]] // Simplify;
a11 = D[(Subscript[M, 1])'[x] /. tmp,(Subscript[M, 1])[x]] // Simplify;
a12 = D[(Subscript[M, 1])'[x] /. tmp,(Subscript[ϱ, 1])[x]] // Simplify;
a21 = D[(Subscript[ϱ, 1])'[x] /. tmp,(Subscript[M, 1])[x]] // Simplify;
a22 = D[(Subscript[ϱ, 1])'[x] /. tmp,(Subscript[ϱ, 1])[x]] // Simplify;
Simplify[a11 a22-a12 a21] // Simplify
Clear[tmp,a11,a12,a21,a22]

The condition then is: λ ≠ 0 (and κ ≠ 0 either). This corresponds to a perturbation of the static solution. See later when we discuss the gauge mode.

Analytical solution of the linear perturbation

Find (Subscript[M, 1])

First, we massage the ODE for (Subscript[M, 1]) a bit more. Substitute the expressions for the static variables.

M1ppODESimplifiedtmp = M1ppODE /. (Subscript[g, 0]) -> Function[x,Evaluate[g[x] /. staticSolgMϱVInTermsOfxRule]]/. (Subscript[M, 0]) -> Function[x,Evaluate[M[x] /. staticSolgMϱVInTermsOfxRule]] /.
 (Subscript[ϱ, 0]) -> Function[x,Evaluate[ϱ[x] /. staticSolgMϱVInTermsOfxRule]] // FullSimplify;
M1ppODESimplified = Numerator[M1ppODESimplifiedtmp]
Clear[M1ppODESimplifiedtmp]

We now express everything in terms of the variable z = 1-((x^2)/(Subscript[x, ⋆]^2)).

M1ppODESimplifiedInTermsOfz = M1ppODESimplified/(-(Subscript[x, ⋆])^2 x) /. (Subscript[M, 1]) -> Function[x,(Subscript[M, 1])[1-x^2/(Subscript[x, ⋆])^2]]/. x -> (Subscript[x, ⋆]) Sqrt[1-χ] // Simplify

This is equivalent to:

λTopRule = λ^2 -> 2 p (1+p) (1-κ);
M1ppODEIntegrable =  HoldForm[D[χ^2 (Subscript[M, 1])'[χ],χ]]-λ^2/(2 (1-κ)) (Subscript[M, 1])[χ]/(1-χ) /. λTopRule

M1zexprRule = Flatten[DSolve[ReleaseHold[M1ppODEIntegrable] == 0,(Subscript[M, 1])[χ],χ]] // Simplify

Re-absorb the -1 factors into the constants of integration.
Note the symmetry p-> - (1+p).
Note: The above solution is only true assuming that 2+2p is not an integer!!!!!!!!!!!!!!!!!

M1xexprtmp = (Subscript[M, 1])[χ] /.M1zexprRule /. χ -> 1-x^2/(Subscript[x, ⋆])^2 // Simplify;
M1xexpr = M1xexprtmp /. C[1] -> C[1] (-1)^(p-1) /. C[2] -> C[2] (-1)^(-p)
Clear[M1xexprtmp]

Find (Subscript[ϱ, 1]) and check consistency with other ODE

Making use of the equation for (Subscript[M, 1])' we can immediately find (Subscript[ϱ, 1]).

ϱ1xexprtmp = (Subscript[ϱ, 1])[x] /. Flatten[Solve[((Subscript[M, 1])'[x] /. reducedPerturbedODE) == (Subscript[M, 1])'[x],(Subscript[ϱ, 1])[x]]] // Simplify;
ϱ1xexprSubBackgroundtmp = ϱ1xexprtmp /. (Subscript[M, 0]) -> Function[x,Evaluate[M[x] /. staticSolgMϱVInTermsOfxRule]] /.
 (Subscript[ϱ, 0]) -> Function[x,Evaluate[ϱ[x] /. staticSolgMϱVInTermsOfxRule]] // Simplify;
ϱ1xexprtmp2 = ϱ1xexprSubBackgroundtmp /. (Subscript[M, 1]) -> Function[x,Evaluate[M1xexpr]] // FullSimplify;
Clear[ϱ1xexprtmp,ϱ1xexprSubBackgroundtmp ]

We can simplify a bit by making use of the Euler transformation for hypergeometric functions (see Wikipedia): F(a,b,c,x) = (((1-x))^(c-a-b)) F(c-a,c-b,c,x).
This new form also makes obvious the symmetry p -> -(1+p) (and relabelling the integration constants). Note that the first and third term are just (Subscript[M, 1]).

ϱ1xexpr = C[1] χ^(-1-p) (Hypergeometric2F1[-1-p,-p,-2 p,χ] - (1+p) (1-κ)/2 Hypergeometric2F1[-p,-p,-2 p,χ]) +
		C[2] χ^p (Hypergeometric2F1[p,1+p,2+2 p,χ] + p (1-κ)/2 Hypergeometric2F1[1+p,1+p,2+2 p,χ]) /. χ -> 1-x^2/(Subscript[x, ⋆])^2

Verify:

Simplify[ϱ1xexpr - ϱ1xexprtmp2] // FullSimplify
Clear[ϱ1xexprtmp2]

Now, check that the (Subscript[ϱ, 1]) ODE is satisfied. Made non-evaluable as it takes a bit of time.

shouldbeSatisfiedtmp = (Subscript[ϱ, 1])'[x] == ((Subscript[ϱ, 1])'[x] /. reducedPerturbedODE) /. (Subscript[g, 0]) -> Function[x,Evaluate[g[x] /. staticSolgMϱVInTermsOfxRule]]/. (Subscript[M, 0]) -> Function[x,Evaluate[M[x] /. staticSolgMϱVInTermsOfxRule]] /.
 (Subscript[ϱ, 0]) -> Function[x,Evaluate[ϱ[x] /. staticSolgMϱVInTermsOfxRule]] // Simplify;
FullSimplify[shouldbeSatisfiedtmp /. (Subscript[M, 1]) -> Function[x,Evaluate[M1xexpr]] /. (Subscript[ϱ, 1]) -> Function[x,Evaluate[ϱ1xexpr]] /. λTopRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]]
Clear[shouldbeSatisfiedtmp]

Find (Subscript[g, 1])

g1Primexexprtmp= (Subscript[g, 1])'[x] - ((Subscript[g, 1])'[x] /. reducedPerturbedODE) /. (Subscript[g, 1]) -> Function[x,(Subscript[g, 1])[1-x^2/(Subscript[x, ⋆])^2]] /. (Subscript[M, 0]) -> Function[x,Evaluate[M[x] /. staticSolgMϱVInTermsOfxRule]] /.
 (Subscript[ϱ, 0]) -> Function[x,Evaluate[ϱ[x] /. staticSolgMϱVInTermsOfxRule]] /. (Subscript[ϱ, 1])[x] -> ϱ1xexpr  /. (Subscript[M, 1])[x] -> M1xexpr /. x -> (Subscript[x, ⋆]) Sqrt[1-χ] // Simplify

g1PrimexexprRule = Solve[g1Primexexprtmp == 0,(Subscript[g, 1])'[χ]] // Simplify // Flatten
Clear[g1Primexexprtmp]

Again, the symmetry property is clear.
Note:  (Subscript[g, 1]) is defined up to a constant!!

g1xexpr = Integrate[(Subscript[g, 1])'[χ] /. g1PrimexexprRule,χ]  /. χ -> 1-x^2/(Subscript[x, ⋆])^2// FunctionExpand // Simplify
Clear[g1PrimexexprRule]

Note that the above expression for (Subscript[g, 1]) (up to a constant) is equal to (Subscript[M, 1]) up to a multiple

Simplify[M1xexpr - 2/(1-κ) g1xexpr]

Analysis of the solution

The solutions should be regular everywhere, notable at the center and surface. IN order for this to still be a star, we want the mass perturbation to be 0 at both ends.
First, focusing at the center χ = 1, we need

Solve[Limit[M1xexpr /. x -> (Subscript[x, ⋆]) Sqrt[1-χ], χ -> 1] == 0, C[1]] // FunctionExpand

This is assuming that p ≠ 1/2, 3/2, 5/2, etc. This can be assumed by symmetry that p ≤ -1/2. If not, we would solve for C[2] instead. This regularizes (Subscript[g, 1]) immediately since it is proportional to (Subscript[M, 1]).
For (Subscript[ϱ, 1]), the part that makes up (Subscript[M, 1]) is regularized and we can check that the 2nd and 4th term are:

Limit[ -(1+p) (1-κ)/2 C[1] Hypergeometric2F1[-p,-p,-2 p,χ] + p (1-κ)/2 C[2] Hypergeometric2F1[1+p,1+p,2+ 2 p,χ], χ -> 1]

This blows up, except if the term in parenthesis is 0, which turns out to be the very same condition. So making (Subscript[M, 1]) = 0 at the center makes all the other terms regular at the center.

Solve[((1+p) C[1] Gamma[-2 p] Gamma[1+p]^2-p C[2] Gamma[-p]^2 Gamma[2 (1+p)]) == 0,C[1]] // FunctionExpand

Note that as particular cases, if p = -2,-3,-4,etc, then C[1] = 0 and the solution is then much simpler. In either cases, the velocity blows up at the surface.
On the other hand, at the surface χ = 0, we need, that p ∈ [-1,0], which comes from (Subscript[g, 1]) and is the must stringent of all constraints. In particular, this means that the only modes that give rise to a regular perturbation
(if we forget about the fact that velocity perturbation blows up at the surface), are purely oscillating modes (or the scaling modes).

Re-write equation as hypergeometric equation

M1ppODEHG = ReleaseHold[M1ppODEIntegrable] (-1+χ) χ^(-1-p) /. (Subscript[M, 1]) -> Function[χ, χ^p (Subscript[(OverBar[M]), 1])[χ]] // Simplify

Power series solution of (Subscript[M, 1]) ODE

Near the center χ = 1

M1ExpansionOrderχ1 = 30;
M1Expansionχ1 = (Subscript[(OverBar[M]), 1]) -> Function[χ,Evaluate[Sum[(Subscript[(OverBar[M]), 1]^c)[n] (1-χ)^n,{n,1,M1ExpansionOrderχ1}]]]; (*(Subscript[M, 1])(0)=0 for regularity.*)

M1ODEPSχ1 = Series[M1ppODEHG /. M1Expansionχ1,{χ,1,M1ExpansionOrderχ1-1}];
M1Coefficientsχ1 = Table[(Subscript[(OverBar[M]), 1]^c)[n],{n,2,M1ExpansionOrderχ1}];

tabletmp = FullSimplify[Table[SeriesCoefficient[M1ODEPSχ1,{χ,1,n}],{n,0,M1ExpansionOrderχ1-1}]];
M1Expansionχ1Sol = Flatten[Solve[tabletmp == 0,M1Coefficientsχ1]] // Simplify;
Clear[tabletmp]

tmp1 = (Subscript[(OverBar[M]), 1]^c)[4]/(Subscript[(OverBar[M]), 1]^c)[5] /. M1Expansionχ1Sol;
tmp2 = (Subscript[(OverBar[M]), 1]^c)[9]/(Subscript[(OverBar[M]), 1]^c)[10] /. M1Expansionχ1Sol;
tmp3 = (Subscript[(OverBar[M]), 1]^c)[14]/(Subscript[(OverBar[M]), 1]^c)[15] /. M1Expansionχ1Sol;
tmp4 = (Subscript[(OverBar[M]), 1]^c)[19]/(Subscript[(OverBar[M]), 1]^c)[20] /. M1Expansionχ1Sol;
tmp5 = (Subscript[(OverBar[M]), 1]^c)[24]/(Subscript[(OverBar[M]), 1]^c)[25] /. M1Expansionχ1Sol;
tmp6 = (Subscript[(OverBar[M]), 1]^c)[29]/(Subscript[(OverBar[M]), 1]^c)[30] /. M1Expansionχ1Sol;
tmp7 = (Subscript[(OverBar[M]), 1]^c)[34]/(Subscript[(OverBar[M]), 1]^c)[35] /. M1Expansionχ1Sol;

We see that the more terms we have, the flatter ((Subscript[a, n])/(Subscript[a, n+1])) gets as n -> ∞ and it tends to 1 for all p. By convergence test, if we consider ∑(Subscript[a, n]) (((1-χ))^n), then ratio test requires |1-χ| < (Subscript[lim, n -> ∞]) ((Subscript[a, n])/(Subscript[a, n+1])) and therefore χ > 0. 
In other words, χ is allowed to go up until the surface χ=0 consistent with the analytical solution in terms of hypergeometric functions as it is known that the radius of convergence of χ (around 0) is 1.

Plot[Evaluate[{tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7}],{p,-0.5,3}]
Clear[tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]

Near the surface χ = 0

Note: from the below, remark that in the expansion, we have the extra (χ^p). Because of the symmetry of the system, a second possible solution would instead have (χ^(-1-p)). Here, we therefore choose to ignore this second solution.
THe full solution is really a linear combination of these two mentioned solutions, but we take the integration constant of the second term to be 0.

M1ExpansionOrderχ0 = 30; (*takes too long higher than 30*)
M1Expansionχ0 = (Subscript[(OverBar[M]), 1]) -> Function[χ,Evaluate[Sum[(Subscript[(OverBar[M]), 1]^s)[n] χ^(n),{n,0,M1ExpansionOrderχ0}]]];

Note that below, need the “-2” because above is a second order ODE, so solution is expected to depend on (Subscript[M, 1]) and (Subscript[M, 1])' at the center. The former is fixed for regularity,
so the solution only depends on (Subscript[M, 1])(χ=1).

M1ODEPSχ0 = Series[Simplify[M1ppODEHG /. M1Expansionχ0],{χ,0,M1ExpansionOrderχ0-1}];
M1Coefficientsχ0 = Table[(Subscript[(OverBar[M]), 1]^s)[n],{n,1,M1ExpansionOrderχ0}];

tabletmp = Simplify[Table[SeriesCoefficient[M1ODEPSχ0,{χ,0,n}],{n,0,M1ExpansionOrderχ0-1}]];
M1Expansionχ0Sol = Flatten[Solve[tabletmp == 0,M1Coefficientsχ0]] // Simplify;
Clear[tabletmp]

tmp1 = (Subscript[(OverBar[M]), 1]^s)[4]/(Subscript[(OverBar[M]), 1]^s)[5] /. M1Expansionχ0Sol;
tmp2 = (Subscript[(OverBar[M]), 1]^s)[9]/(Subscript[(OverBar[M]), 1]^s)[10] /. M1Expansionχ0Sol;
tmp3 = (Subscript[(OverBar[M]), 1]^s)[14]/(Subscript[(OverBar[M]), 1]^s)[15] /. M1Expansionχ0Sol;
tmp4 = (Subscript[(OverBar[M]), 1]^s)[19]/(Subscript[(OverBar[M]), 1]^s)[20] /. M1Expansionχ0Sol;
tmp5 = (Subscript[(OverBar[M]), 1]^s)[24]/(Subscript[(OverBar[M]), 1]^s)[25] /. M1Expansionχ0Sol;
tmp6 = (Subscript[(OverBar[M]), 1]^s)[29]/(Subscript[(OverBar[M]), 1]^s)[30] /. M1Expansionχ0Sol;
tmp7 = (Subscript[(OverBar[M]), 1]^s)[34]/(Subscript[(OverBar[M]), 1]^s)[35] /. M1Expansionχ0Sol;

We see that the more terms we have, the flatter ((Subscript[a, n])/(Subscript[a, n+1])) gets as n -> ∞ and it tends to about 1.05 for all p. By convergence test, if we consider ∑(Subscript[a, n]) (χ^n), then ratio test requires |χ| < (Subscript[lim, n -> ∞]) ((Subscript[a, n])/(Subscript[a, n+1])) and therefore χ < 1.1. 
Because we cannot go very far in the expansion, we expect the real limit to be instead = 1, instead of 1.05 and so we get again consistency.

Plot[Evaluate[{tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7}],{p,-2.5,5}]
Clear[tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]

Plots

M1AtCenter = (Subscript[(OverBar[M]), 1])[χ] /. M1Expansionχ1 /. M1Expansionχ1Sol;
M1AtSurface = (Subscript[(OverBar[M]), 1])[χ] /. M1Expansionχ0 /. M1Expansionχ0Sol;

Note that for p < 0, the velocity perturbation is singular at the surface. 
The mass on the other hand inst if p is not too negative because perturbation is ~ (Subscript[M, 0])(Subscript[M, 1]).

mypPlot = {-0.5,0,0.5,1};
Plot[Evaluate[M1AtCenter /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1 /. p -> mypPlot],{χ,1,0}]
Plot[Evaluate[M1AtSurface  /. (Subscript[(OverBar[M]), 1]^s)[0] -> 1 /. p -> mypPlot],{χ,1,0}]

Resolve mismatch at the midpoint

Since both power series have a radius of convergence of about 1, we can make them match at the midpoint χ = 0.5.
We note that p is negative in all instances. this is for 20 terms in expansion

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/4 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify
mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 3/4 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/2 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify

This is for 30 terms :

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ], -5 < p < 5} /. χ -> 1/2 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/4 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify
mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/2 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify
mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 3/4 /. (Subscript[(OverBar[M]), 1]^c)[1] -> 1,{(Subscript[(OverBar[M]), 1]^s)[0],p},Reals] // Simplify

The below was doing the same, but for the original system, which is not the standard hypergeometric equation.

This is with 35 terms and restrict domain

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ], -6 < p < -2} /. χ -> 1/2 /. (Subscript[M, 1]^c)[1] -> 1,{(Subscript[M, 1]^s)[0],p},Reals] // Simplify

This is with 30 terms and higher WP:

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/2 /. (Subscript[M, 1]^c)[1] -> 1,{(Subscript[M, 1]^s)[0],p},Reals,WorkingPrecision->10] // Simplify

This is with 30 terms:

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/2 /. (Subscript[M, 1]^c)[1] -> 1,{(Subscript[M, 1]^s)[0],p},Reals] // Simplify

This was was 20 terms:

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/2 /. (Subscript[M, 1]^c)[1] -> 1,{(Subscript[M, 1]^s)[0],p},Reals] // Simplify

The below was for 15 terms:

mismatchM1sSol = NSolve[{M1AtCenter == M1AtSurface, D[M1AtCenter,χ] == D[M1AtSurface,χ]} /. χ -> 1/2 /. (Subscript[M, 1]^c)[1] -> 1,{(Subscript[M, 1]^s)[0],p},Reals] // Simplify

Plot with mismatch resolution

Show[Plot[Evaluate[χ^(2/(1-1/2)) M1AtCenter /. (Subscript[M, 1]^c)[1] -> 1 /. mismatchM1sSol],{χ,1,1/2}],
Plot[Evaluate[χ^(2/(1-1/2)) M1AtSurface /. (Subscript[M, 1]^c)[1] -> 1 /. mismatchM1sSol],{χ,0,1/2}],PlotRange -> {{0,1},{0,1}}]

Show[Plot[Evaluate[χ^(2/(1-1/2)) M1AtCenter /. (Subscript[M, 1]^c)[1] -> 1 /. (Subscript[M, 1]^s)[0] -> 1 /. p -> -2],{χ,1,1/2}],
Plot[Evaluate[χ^(2/(1-1/2)) M1AtSurface /. (Subscript[M, 1]^c)[1] -> 1 /. (Subscript[M, 1]^s)[0] -> 1 /. p -> -2],{χ,0,1/2}],PlotRange -> {{0,1},{0,0.2}}]

For shooting

Eigenmode ansatz and equations

Look for eigenmode solution of the form (Subscript[f, 1])(T,y) = (e^(λT))(Subscript[f, 1]^EM)(y). Note that in the below, we will drop the “EM” superscript. Note that t has dimension length, so we scale it so that λ is dimensionless.
The ODEs are then functions of dim-less qtes and the scale factor s does not explicitly appear as it shouldn’t.
Note: this λ has of course nothing to do with the λ from the general static solution!
Note: the matter equations for the linear perturbations do not depend on the linear perturbation of g and therefore do not depend on α!!

Variablesg1M1ϱ1𝒱1EMRule = {(Subscript[g, 1]) -> Function[{T,y},(Subscript[g, 1])[y] Exp[λ T]], (Subscript[M, 1]) -> Function[{T,y},(Subscript[M, 1])[y] Exp[λ T]], (Subscript[ϱ, 1]) -> Function[{T,y},(Subscript[ϱ, 1])[y] Exp[λ T]],(Subscript[𝒱, 1]) -> Function[{T,y},(Subscript[𝒱, 1])[y] Exp[λ T]]};
(ODEIngMϱ𝒱Ofg1EMyShooting = Simplify[D[(Subscript[g, 1])[y],y] /. Flatten[Solve[D[(Subscript[g, 1])[T,y],y] - exprIngMϱ𝒱Ofg1yShooting == 0 /.Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[g, 1])[y],y]]]]) /. pp
(ODEIngMϱ𝒱OfM1EMyShooting = Simplify[D[(Subscript[M, 1])[y],y] /. Flatten[Solve[D[(Subscript[M, 1])[T,y],y] - exprIngMϱ𝒱OfM1yShooting == 0 /.Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[M, 1])[y],y]]]]) /. pp
(algEqnIngMϱ𝒱OfM1EMShooting = Simplify[Exp[-λ T](D[(Subscript[M, 1])[T,y],T] - exprIngMϱ𝒱OfM1TShooting  /. Variablesg1M1ϱ1𝒱1EMRule)]) /. pp
(ODEIngMϱ𝒱Ofϱ1EMyShooting = Simplify[Factor[D[(Subscript[ϱ, 1])[y],y] /. Flatten[Solve[D[(Subscript[ϱ, 1])[T,y],y] - exprIngMϱ𝒱Ofϱ1yShooting == 0 /. Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[ϱ, 1])[y],y]]]]]) /. pp
(ODEIngMϱ𝒱Of𝒱1EMyShooting = Simplify[D[(Subscript[𝒱, 1])[y],y] /. Flatten[Solve[D[(Subscript[𝒱, 1])[T,y],y] - exprIngMϱ𝒱Of𝒱1yShooting == 0 /. Variablesg1M1ϱ1𝒱1EMRule,D[(Subscript[𝒱, 1])[y],y]]]]) /. pp

Reduced system

Notice that we get an algebraic equation for (Subscript[M, 1]). This has to be consistent with the (Subscript[M, 1,y]) equation. This is checked below.

From the algebraic equation, we can solve for the mass (Subscript[M, 1]) or (Subscript[𝒱, 1]). We choose to solve it for the latter, because otherwise the case λ=0 is degenerate. Note that the correction in the mass only depends on the correction in the velocity.
Plugging this into the other ODEs, we get a system of 3 ODEs for (Subscript[M, 1]), (Subscript[g, 1]), (Subscript[ϱ, 1]). 
We compile the Reduced system equations for the perturbed variables, which will be used when shooting.

𝒱1SolRuletmp = Flatten[Simplify[Solve[algEqnIngMϱ𝒱OfM1EMShooting == 0,(Subscript[𝒱, 1])[y]]]];
	   𝒱1SolRuleShooting = Block[{y}, (Subscript[𝒱, 1]) -> Function @@ List[{y},(Subscript[𝒱, 1])[y] /.  𝒱1SolRuletmp]];
	   ODEReducedg1EMM1EMϱ1EMShooting = Table[0,{i,1,3}];
	    (ODEReducedg1EMM1EMϱ1EMShooting[[1]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱Ofg1EMyShooting /. 𝒱1SolRuleShooting)]] (Subscript[g, 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱Ofg1EMyShooting /. 𝒱1SolRuleShooting)]]]) /. pp
	    (ODEReducedg1EMM1EMϱ1EMShooting[[2]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱OfM1EMyShooting /. 𝒱1SolRuleShooting)]] (Subscript[M, 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱OfM1EMyShooting /. 𝒱1SolRuleShooting)]]]) /. pp
	    (ODEReducedg1EMM1EMϱ1EMShooting[[3]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱Ofϱ1EMyShooting /. 𝒱1SolRuleShooting)]] (Subscript[ϱ, 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱Ofϱ1EMyShooting /. 𝒱1SolRuleShooting)]]]) /. pp
	   Clear[𝒱1SolRuletmp];

As mentioned above, we then find that (Subscript[𝒱, 1]) only depends on (Subscript[M, 1.])

(Subscript[𝒱, 1])[y] /. 𝒱1SolRuleShooting /. pp // Factor

Check that (∂_y)(Subscript[𝒱, 1]) ODE is identically satisfied

tmpRule = D[(Subscript[M, 1])[y],y] -> ODEIngMϱ𝒱OfM1EMy;
tmpLHS = D[(Subscript[𝒱, 1])[y],y] /. 𝒱1SolRule /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. tmpRule /. pp// Simplify;
tmpRHS = ODEIngMϱ𝒱Of𝒱1EMy /. 𝒱1SolRule /. pp // Simplify;
Simplify[tmpLHS == tmpRHS]
Clear[tmpRule,tmpLHS,tmpRHS]

Reduced system with μ = 0

In this case, we can actually express everything in terms of x, and not y, since x[y] is then invertible.
Note that the matter equations do not depend on spacetime perturbation (Subscript[g, 1]).

(ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxShooting =  Simplify[ODEReducedg1EMM1EMϱ1EMShooting /. x -> Function[y,y] /. y -> x /. μ -> 0]) /. pp;

Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxShooting == 0,{(Subscript[g, 1])'[x],(Subscript[M, 1])'[x],(Subscript[ϱ, 1])'[x]}]] /.pp// Simplify

Note: since the variable (Subscript[g, 1]) does not appear in the 2 matter ODEs, we can effectively only consider the latter 2 equations and solve for them. We then find (Subscript[M, 1]) via algebraic equation and (Subscript[g, 1]) by integration.

Analysis

As described above, we can only focus on the matter equations. Note that the ODE can be written as (Subscript[f, 1])’ = (Subscript[Af, 1]), since it is linear and A = A((Subscript[f, 0]);κ,λ). Evidently, (Subscript[f, 0]) and (Subscript[f, 1]) are the set of static and perturbed equations.
Now, to find a unique solution, the matrix A had better not be degenerate, i.e. det A ≠ 0. If we write A = ((Subscript[a, ij])), we find:

tmp = Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxShooting == 0, {(Subscript[g, 1])'[x],(Subscript[M, 1])'[x],(Subscript[ϱ, 1])'[x]}]] // Simplify;
a11 = D[(Subscript[M, 1])'[x] /. tmp,(Subscript[M, 1])[x]] // Simplify;
a12 = D[(Subscript[M, 1])'[x] /. tmp,(Subscript[ϱ, 1])[x]] // Simplify;
a21 = D[(Subscript[ϱ, 1])'[x] /. tmp,(Subscript[M, 1])[x]] // Simplify;
a22 = D[(Subscript[ϱ, 1])'[x] /. tmp,(Subscript[ϱ, 1])[x]] // Simplify;
Simplify[a11 a22-a12 a21] // Simplify
Clear[tmp,a11,a12,a21,a22]

The condition then is: (λ^2) ≠ ((2 (1+κ))/κ)(x^2). Thus, (λ^2) ∉ [0, 4((1+κ)/(1-κ))].

Boundary asymptotics for eigenmodes, μ = 0

At the center x = 0

At the center, both matter equation for (Subscript[ϱ, 1]) and (Subscript[𝒱, 1]) and (Subscript[g, 1]) are singular (denominator goes to 0).

Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx == 0,{(Subscript[g, 1])'[x],(Subscript[M, 1])'[x],(Subscript[ϱ, 1])'[x]}]] /.pp // Simplify

We easily find that:
1) ((Subscript[dM, 1])/dx)   ~   O{x ((Subscript[M, 1]) - (Subscript[ϱ, 1]))}
2) ((Subscript[dg, 1])/dx)   ~   ((Subscript[dM, 1])/dx)
3) ((Subscript[dϱ, 1])/dx)   ~   O{((Subscript[M, 1])/x) + x ((Subscript[M, 1]) - (Subscript[ϱ, 1]))}
From 3), doing a regular expansion wee see that the leading term will be ~ (1/x). This term needs to vanish, inducing a regularity condition (Subscript[M, 1])(0)=0, which is good as this means no conical singularity at the center.
As for which expansion to consider, since (x^2) is regular in y, we expect each of these variables to have an expansion as a function (x^2) (not just x as it is not regular in y).
This is also understood from the point of view that a,α are scalars and since in Cartesian coordinates “(R^2) = (x^2)+(y^2)" is regular, the expansion of a and α are functions of (R^2) (i.e. even expansion in R).
V is odd and thus as an odd expansion in R, or 𝒱 has an even expansion in R and thus x. This is also consistent with the above asymptotics. Since from 2) and 3), we need (Subscript[M, 1]) ~ (Subscript[ϱ, 1]) and from 2), we need (Subscript[g, 1])~(Subscript[M, 1])~(Subscript[ϱ, 1]).
Anyway, we are left with 2 d.o.f: (Subscript[g, 1])(0) (gauge since from above, can shift (Subscript[g, 1]) arbitrarily) and (Subscript[ϱ, 1])(0).
IMPORTANT: as stated from above, (Subscript[M, 1]^c)[0]=0 is needed from 4), however this is true only for λ ≠ 0!!! Indeed, if λ=0 then the term ~(((Subscript[M, 1]) )/x) in 3) actually vanishes!! This can also be made clear from the the shooting later, where we can
shoot from the surface all the way to the center without problem and in fact we find that (Subscript[M, 1])(0) > 0. This is clear from gauge analysis below as well, where if λ=0 then p=0 and then the full perturbation term is like ~ - x (∂_x)(Subscript[M, 0]) which is non-zero at the center.

At the surface x = (Subscript[x, ⋆])

We find that (see analysis of the static Λ=0 solution section. We mostly use the fact that (Subscript[M, 0]) ~ (Subscript[ϱ, 0]) (Subscript[g, 0])):
	1)    ((Subscript[dM, 1])/dx)   ~    (((Subscript[M, 1])-(Subscript[ϱ, 1]))/((Subscript[x, ⋆])-x))
	2)    ((Subscript[dg, 1])/dx)    ~   ((Subscript[dM, 1])/dx)
	3)    ((Subscript[dϱ, 1])/dx)    ~   (((Subscript[M, 1])-(Subscript[ϱ, 1]))/((Subscript[x, ⋆])-x)).

This is of course in-line with the more general analysis done before looking for exponential growing mode solutions.

Power ansatz and regularity condition

From the above, and using the fact that since we are describing a star, we do not expect the perturbations to be analytic at the surface. This was tried explicitly before and yielding the trivial solution only.
So, we will instead consider an expansion of the type (Subscript[ϱ, 1]) = ∑ (Subscript[ϱ, 1])[n] (x-(Subscript[x, ⋆]))^(p+n) , (Subscript[M, 1]) = ∑ (Subscript[M, 1])[n] (x-(Subscript[x, ⋆]))^(p+n). Then 1) suggests that we take  (Subscript[g, 1]) = ∑ (Subscript[g, 1])[n] (x-(Subscript[x, ⋆]))^(p+n). p needs to be found.
Since the to matter equations decouple from metric (Subscript[g, 1]), we can look at first order term. From 2) and 3) this then fixes p and one of the d.o.f..
To leading order, we have that,
((Subscript[dϱ, 1])/dx) = -((1+κ)/((1-κ) λ)) (1/(x-(Subscript[x, ⋆]))) {((λ^2) -4 ((1+κ)/(1-κ))) (Subscript[𝒱, 1]) + λ (Subscript[ϱ, 1])}                                       = (1/(x-(Subscript[x, ⋆]))) ((Subscript[B, 1]) (Subscript[𝒱, 1]) +(Subscript[B, 2]) (Subscript[ϱ, 1]))
((Subscript[d𝒱, 1])/dx) = -(1/((1+κ)(Subscript[x, ⋆]))) { 2 (1+κ) (Subscript[𝒱, 1])  - ((Subscript[x, ⋆])/(2 (x-(Subscript[x, ⋆])))) ( -4 ((1+κ)/(1-κ))(Subscript[𝒱, 1]) + λ (Subscript[ϱ, 1]))}     =  (Subscript[A, 1]) (Subscript[𝒱, 1]) + (1/(x-(Subscript[x, ⋆]))) ((Subscript[A, 2]) (Subscript[𝒱, 1]) +(Subscript[A, 3]) (Subscript[ϱ, 1])). This one is old because now, we use ((Subscript[dM, 1])/dx) instead, but I am not doing the analysis again....
((Subscript[dg, 1])/dx) = ((2 (1-κ))/(λ (Subscript[x, ⋆]))) ( ((4 (1+κ))/(((1-κ))^2)) (Subscript[𝒱, 1]) -(λ/(1-κ)) (Subscript[ϱ, 1]) +((λ (Subscript[x, ⋆]))/(2 (1-κ) (x-(Subscript[x, ⋆])))) (Subscript[g, 1]))
To leading order, we then find for the matter equations,
(p-(Subscript[A, 2])) (Subscript[𝒱, 1])[0] = (Subscript[A, 3]) (Subscript[ϱ, 1])[0]
(p-(Subscript[B, 2])) (Subscript[ϱ, 1])[0] = (Subscript[B, 3]) (Subscript[𝒱, 1])[0]
Leading to a 2nd order algebraic equation for p: (p-(Subscript[B, 2])) (p-(Subscript[A, 2])) = (Subscript[A, 3]) (Subscript[B, 1]). Can solve for p. Note that only positive root p = (SubPlus[p]) is acceptable since we want p > 0 (perturbation does not blow up at surface). Note that (SubPlus[p]) ≥ (1/2).
This result can then be tested in the code later if it agrees.

overallfactor = (1+κ)/((1-κ) λ) // Simplify;
B1 = overallfactor (λ^2-4 (1+κ)/(1-κ));
B2 = overallfactor λ;
overallfactor = -1/((Subscript[x, ⋆]) (1+κ));
A1 = overallfactor 2 (1+κ);
A2 = - overallfactor/(-2/(Subscript[x, ⋆])) 4 (1+κ)/(1-κ);
A3 = overallfactor/(-2 /(Subscript[x, ⋆])) λ;
Flatten[Solve[(p-B2) (p-A2) == A3 B1,p]] //Simplify

Case μ = 0 in coordinate x

Power series solution at the surface

Power series ansatz near x = (Subscript[x, ⋆])

Staring sufficiently at the ODEs and using the results in the boundary asymptotics, we note the following
1) (Subscript[M, 0]) ~ (Subscript[ϱ, 0])(Subscript[g, 0]) implying that we should do an expansion of the form: (Subscript[M, 0]) =: (((Subscript[ϱ, 0]) (Subscript[g, 0]))/(Subscript[Σ, 0])). Easy to check that (Subscript[Σ, 0]) = -((x^2)/((Subscript[x, ⋆]^2) (1-κ))) = -((x^2)/(2 κ)). 
2) Doing so will make the ODEs independent on (Subscript[ϱ, 0]).
This nice feature explains why in the perturbation we put as the perturbation of ϱ to have that extra (Subscript[ϱ, 0]) factor.

Let’s then re-write the equations in that respect:

(ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxRegularAtSurfaceShooting = Simplify[{(Subscript[Σ, 0])[x]^2/(Subscript[ϱ, 0])[x]/(Subscript[g, 0])[x],1,(Subscript[Σ, 0])[x]^2/(Subscript[ϱ, 0])[x]^2/(Subscript[g, 0])[x]^2}ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxShooting /. (Subscript[M, 0])[x] -> (Subscript[ϱ, 0])[x] (Subscript[g, 0])[x]/ (Subscript[Σ, 0])[x],(Subscript[ϱ, 0])[x] > 0]) /. pp
(ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxRegularAtSurface = Simplify[{(Subscript[Σ, 0])[x]^2/(Subscript[ϱ, 0])[x]^2/(Subscript[g, 0])[x],(Subscript[Σ, 0])[x]/(Subscript[ϱ, 0])[x],(Subscript[Σ, 0])[x]^3/(Subscript[ϱ, 0])[x]^3/(Subscript[g, 0])[x]^3}ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx /. (Subscript[M, 0])[x] -> (Subscript[ϱ, 0])[x] (Subscript[g, 0])[x] /(Subscript[Σ, 0])[x],(Subscript[ϱ, 0])[x] > 0]) /. pp

The expansion for (Subscript[g, 0]) can be done immediately as the expansion terminates at 2nd order.
Side note: if we picked instead to expand under ((((Subscript[x, ⋆])-x))^(p+n)) instead, we expect to get a factor ~ (Subscript[x, ⋆]^(-p)) lurking around. If you do this, you will see that this is not the case and the reason is that the free parameter is rescaled to “hide” this factor.
For example, considering the ODE (1-(x/(Subscript[x, ⋆]))) f' = f. The solution is f = (Subscript[f, 0]) (((1-(x/(Subscript[x, ⋆]))))^(-(Subscript[x, ⋆]))). Now, if we re-consider the ODE and make two ansätze: f = c  (((1-(x/(Subscript[x, ⋆]))))^p) and f = (OverBar[c])  ((((Subscript[x, ⋆])-x))^p). We see that both ansätze require p = -(Subscript[x, ⋆]).  Of course, c and (OverBar[c]) are related by ~ (Subscript[x, ⋆]^p).
However, if we were to be a bit hand wavy and write c instead of (OverBar[c]), one would get the impressions that the constant factor in both ansätze is the same, although it isn’t.

PS1OrderSurface = 1; (*Indicates upt to which order we expand. Possible to go higher order. To order for it to work although it takes ~ 30 seconds.*)
PS0OrderSurface = PS1OrderSurface+2; (*Making sure there are enough up coefficients for the background variables.*)
PS0AnsatzSurfaceRule = 
{(Subscript[g, 0]) -> Function[x,Evaluate[g[x] /. staticSolgMϱVInTermsOfxRule]],
(Subscript[Σ, 0]) -> Function[x,Evaluate[-x^2 / ((Subscript[x, ⋆])^2 (1-κ))]]}; 
PS1AnsatzSurfaceRule = 
{(Subscript[g, 1]) -> Function[x,Evaluate[Sum[(Subscript[g, 1]^s)[n] (1-x^2/(Subscript[x, ⋆])^2)^(p+n),{n,0,PS1OrderSurface}]]],
(Subscript[M, 1]) -> Function[x,Evaluate[Sum[(Subscript[M, 1]^s)[n] (1-x^2/(Subscript[x, ⋆])^2)^(p+n),{n,0,PS1OrderSurface}]]], 
(Subscript[ϱ, 1]) -> Function[x,Evaluate[Sum[(Subscript[ϱ, 1]^s)[n] (1-x^2/(Subscript[x, ⋆])^2)^(p+n),{n,0, PS1OrderSurface}]]],
(Subscript[𝒱, 1]) -> Function[x,Evaluate[Sum[(Subscript[𝒱, 1]^s)[n] (1-x^2/(Subscript[x, ⋆])^2)^(p+n),{n,0,PS1OrderSurface}]]]}; (*used to find terms of (Subscript[M, 1]) via algebraic equation*)

Also, we write down at each order, which variables we will solve for: A posteriori, the only free parameter is/can be made to be (Subscript[ϱ, 1]^s)[0]. We solve for p, (Subscript[𝒱, 1]^s)[0] and (Subscript[ϱ, 1]^s)[0] explicitly so we don’t put them here.

PS1UnknownSurface = {Table[(Subscript[g, 1]^s)[n],{n,1,PS1OrderSurface}], Table[(Subscript[M, 1]^s)[n],{n,1,PS1OrderSurface}],Table[(Subscript[ϱ, 1]^s)[n],{n,1,PS1OrderSurface}]};

Check PS expressions for background solution

We check here that the expansions for the background variables (Subscript[g, 0]) and (Subscript[Σ, 0]) are correct.

Table[SeriesCoefficient[({(Subscript[g, 0])[x],1/(Subscript[Σ, 0])[x]} /. PS0AnsatzSurfaceRule) - 
(Evaluate[Simplify[{g[x],M[x]/(ϱ[x] g[x])} /. staticSolgMϱVInTermsOfxRule]]),{x,(Subscript[x, ⋆]),n}],{n,1,PS0OrderSurface}]

The physical mode

We have a physical mode (i.e. a specific value of p as it turns out) because the static solution is scale invariant, i.e. there is a 1-parameter family of static solution, parametrizes by the scale s.
If we perturb the scale as s -> s’ := s (1+ϵ), then one can check that the static solution can be written as: (Subscript[f, 0])(x') = (Subscript[f, 0])(x)-ϵ x (∂_x) (Subscript[f, 0])(x) + O((ϵ^2)), where x := (R/s), x' = (R/(s')) and of course f stands for all 4 static variables. 
See below for example with g and M.
So, we see that in this case, our “perturbation” is (Subscript[f, 1]) = -x (∂_x)(Subscript[f, 0]). Thus, in the eigenmode solution, this comes up if we take λ = 0. 
This is then automatically a solution to the linear EFE and belongs to the family of static solution. This is then a physical mode.
Compared to our ansatz, this means that taking λ=0 and (Subscript[f, 1]) = -x (∂_x) log (Subscript[f, 0]), for f = g,M,ϱ and (Subscript[𝒱, 1]) = 0, we should satsify the linear ODEs.

Check perturbation is (Subscript[f, 1]) = -x (∂_x)(Subscript[f, 0]) as advertised. We check explicitly only for g and M.

mygR = g[x] /. staticSolgMϱVInTermsOfxRule/. x -> R/s;
mygRPert = Series[mygR /. s -> (Subscript[s, 0]) (1+ϵ),{ϵ,0,1}] // Simplify;
SeriesCoefficient[mygRPert /. R -> x (Subscript[s, 0]),{ϵ,0,1}] // Simplify
-x D[g[x] /. staticSolgMϱVInTermsOfxRule,x]

myMR = M[x] /. staticSolgMϱVInTermsOfxRule/. x -> R/s;
myMRPert = Series[myMR /. s -> (Subscript[s, 0]) (1+ϵ),{ϵ,0,1}] // Simplify;
SeriesCoefficient[myMRPert /. R -> x (Subscript[s, 0]),{ϵ,0,1}] // Simplify
-x D[M[x] /. staticSolgMϱVInTermsOfxRule,x] // Simplify

How to find the value of p corresponding to this physical mode? Well, near the surface, we find that, -x (∂_x) (Subscript[g, 0]) = 2 -2(Subscript[g, 0]). That is, to leading order, the perturbation goes to some  non-zero constant (=2 in the present case).
Now, from our ansatz, the perturbation is (Subscript[g, 0])(x) (Subscript[g, 1])(T,x). Consider exponential modes and take λ=0 for which then (Subscript[g, 1]) = (Subscript[g, 1])(x). At leading order near the surface, we took (Subscript[g, 1])(x) = (Subscript[g, 1])[0]  (((1-((x^2)/(Subscript[x, ⋆]^2))))^p) = (Subscript[g, 1])[0] (Subscript[g, 0]^p).
But then to leading order near surface, the perturbation is just ~(Subscript[g, 0]^(1+p)). Since (Subscript[g, 0])((Subscript[x, ⋆]))=0, the only way we get a non-zero answer is if p=-1. This is the physical mode.

Check linear equations are satisfied

First, let us write down the linear equation in the present case.
We straight away choose the gauge where x is the coordinate. Algebraic equation and equation for velocity perturbation are satisfied.

Variablesg1M1ϱ1𝒱1EMRuleGauge = {(Subscript[g, 1]) -> Function[{T,y},(Subscript[g, 1])[y]], (Subscript[M, 1]) -> Function[{T,y},(Subscript[M, 1])[y]], (Subscript[ϱ, 1]) -> Function[{T,y},(Subscript[ϱ, 1])[y]],(Subscript[𝒱, 1]) -> Function[{T,y},0]};
(tmpg1M1ϱ1EMxGauge = Simplify[Flatten[Solve[ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx  == 0 /. λ -> 0,{(Subscript[g, 1])'[x],(Subscript[M, 1])'[x], (Subscript[ϱ, 1])'[x]}]]]) /. pp
Simplify[(D[(Subscript[M, 1])[T,y],T] == exprIngMϱ𝒱OfM1T  /. Variablesg1M1ϱ1𝒱1EMRuleGauge /. μ -> 0)] /. pp
D[(Subscript[𝒱, 1])[T,y],y] == exprIngMϱ𝒱Of𝒱1y /. Variablesg1M1ϱ1𝒱1EMRuleGauge /. μ -> 0
Clear[ Variablesg1M1ϱ1𝒱1EMRuleGauge]

Note that the above could be solve algebraically. We plug in the expressions for the background static solution.

tmpg1EMxRHS = ((Subscript[g, 1])'[x] /. tmpg1M1ϱ1EMxGauge) /. (staticSolgMϱVInTermsOfxRule /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])}) // Simplify
tmpM1EMxRHS = ((Subscript[M, 1])'[x] /. tmpg1M1ϱ1EMxGauge) /. (staticSolgMϱVInTermsOfxRule /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])}) // Simplify
tmpϱ1EMxRHS = ((Subscript[ϱ, 1])'[x] /. tmpg1M1ϱ1EMxGauge)/. (staticSolgMϱVInTermsOfxRule /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])}) // Simplify
Clear[tmpg1EMxGauge, tmpg1M1ϱ1EMxGauge, tmpg1M1ϱ1EMxGauge]

g1Gauge = -x D[Log[(Subscript[g, 0])[x]],x]/. (staticSolgMϱVInTermsOfxRule /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])}) // Simplify;
M1Gauge = -x D[Log[(Subscript[M, 0])[x]],x]/. (staticSolgMϱVInTermsOfxRule /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])}) // Simplify;
ϱ1Gauge = -x D[Log[(Subscript[ϱ, 0])[x]],x]/. (staticSolgMϱVInTermsOfxRule /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])}) // Simplify;
tmpLHSRule = {(Subscript[g, 1]) -> Function[x,Evaluate[g1Gauge]],(Subscript[M, 1]) -> Function[x,Evaluate[M1Gauge]],(Subscript[ϱ, 1]) -> Function[x,Evaluate[ϱ1Gauge]]}

Now check that LHS and RHS agree.

Simplify[(tmpg1EMxRHS /. tmpLHSRule) == D[g1Gauge,x]] // Simplify
Simplify[(tmpM1EMxRHS /. tmpLHSRule) == D[M1Gauge,x]] // Simplify
Simplify[(tmpϱ1EMxRHS /. tmpLHSRule) == D[ϱ1Gauge,x]] // Simplify
Clear[tmpg1EMxRHS,tmpM1EMxRHS,tmpϱ1EMxRHS,g1Gauge,M1Gauge,ϱ1Gauge,tmpLHSRule]

Reduced ODEs PS solution

Structure of equations

By inspection, the 3 leading order equations of the three unknowns are all 3 equations for (Subscript[g, 1]^s)[0], (Subscript[𝒱, 1]^s)[0], (Subscript[ϱ, 1]^s)[0] and p already, so no rescaling is necessary.

PSSurfaceg1M1ϱ1 = Table[SeriesCoefficient[Simplify[{1/(1-x^2/(Subscript[x, ⋆])^2)^p,1/(1-x^2/(Subscript[x, ⋆])^2)^p,1/(1-x^2/(Subscript[x, ⋆])^2)^p} ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxRegularAtSurface /.
PS0AnsatzSurfaceRule /. PS1AnsatzSurfaceRule], {x,(Subscript[x, ⋆]),n}],{n,0,PS1OrderSurface}] // Simplify;
	MatrixPlot[PSSurfaceg1M1ϱ1]

Condition for a non-trivial solution

The first order algebraic equation can be written in a linear form, Av = 0, for v = ((Subscript[M, 1])[0],(Subscript[ϱ, 1])[0]) and A = ((Subscript[a, ij])) is a 2x2 matrix depending only on κ, p and λ. For non-trivial solution, we then require det A = 0.
We will obtain this result also in the next section by just solving the leading order equation, but this is the “proper” way to do this as it shows what this relation λ = λ(p) really means.
Did a bit of hack so that the output is in a nice form.

a11 = D[PSSurfaceg1M1ϱ1[[1,2]],(Subscript[M, 1]^s)[0]] /. (Subscript[x, ⋆])^2 -> 2 κ/(1-κ) // Simplify;
a12 = D[PSSurfaceg1M1ϱ1[[1,2]],(Subscript[ϱ, 1]^s)[0]] /. (Subscript[x, ⋆])^2 -> 2 κ/(1-κ) // Simplify;
a21 = D[PSSurfaceg1M1ϱ1[[1,3]],(Subscript[M, 1]^s)[0]] /. (Subscript[x, ⋆])^2 -> 2 κ/(1-κ) // Simplify;
a22 = D[PSSurfaceg1M1ϱ1[[1,3]],(Subscript[ϱ, 1]^s)[0]] /. (Subscript[x, ⋆])^2 -> 2 κ/(1-κ) // Simplify;
det = Simplify[a11 a22-a12 a21];
Flatten[Simplify[Solve[det == 0 /. λ^2 -> ω, ω] /.  ω -> λ^2 /. κ -> -κ] /. κ -> -κ]
Clear[a11,a12,a21,a22,det]

Plot[Evaluate[2 p (1+p) (1-κ)] /. κ -> 0.5,{p,-2,2}]

Solve the system

For definiteness, we will first solve the leading order equations for p, (Subscript[𝒱, 1]^s)[0] and (Subscript[g, 1]^s)[0]. The little HACK for which we take (Subscript[ϱ, 1]^s)[0] and λ > 0 is irrelevant as we just want the root for which p > 0.
	We see that the solution is p = (Subscript[p, ±]) = (1/2)(-1±(Sqrt[1+((2 (λ^2))/(1-κ))])) ≥ (1/2). Also, make use of a trick to force Mathematica to simplify. Expressions inside square root needs to be positive (p has to be real to make any sense), so there are possible negative values of (λ^2)!!
	This means complex values for λ, corresponding to oscillations.

pg1M1AtSurfaceSolRuletmp = FullSimplify[Solve[PSSurfaceg1M1ϱ1[[1]] == 0 /.(Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /.λ^2 -> ω,{ω, (Subscript[g, 1]^s)[0], (Subscript[M, 1]^s)[0]}],{(Subscript[ϱ, 1]^s)[0] > 0, 0 < κ < 1}];
pg1M1AtSurfaceSolRule = Simplify[pg1M1AtSurfaceSolRuletmp[[1]]]/. ω -> λ^2 // Simplify
Clear[pg1M1AtSurfaceSolRuletmp]

We now solve for the other higher order terms. We also plug in the expressions for (λ^2) only.

PSSurfaceg1M1ϱ1SolRule = Flatten[Simplify[Solve[Map[# == 0&,PSSurfaceg1M1ϱ1[[2;;-1]]],Flatten[PS1UnknownSurface]]/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /. pg1M1AtSurfaceSolRule]]

The fact that (Subscript[g, 1]^s)[0] seems to be actually fixed and not free makes it look like we actually fixed the residual gauge freedom at some point.
The reason is that, as in KHA, we still have a residual gauge freedom for α and thus g. We cannot do that at the surface, because α blows up there and so the ODE that fixes the gauge is singular.
Specifically, if t = (t’ + ϵ f(t’)) is a new coordinate, then, α is modified as: (Subscript[α, 1]^new)(t',r) = (Subscript[α, 1])(t',r) + (Subscript[α, 0])(r) (OverDot[f])(t'). If we want the LHS to be 0 at some r = (Subscript[r, 0]), we see that there is a problem at the surface. Similar for the g variable, which is exactly
the same as before, just replacing α -> g everywhere. We can however gauge fix it at the center. This might seem odd, but do notice that the matter equations decouple from g equation! This means that we can really only study
the reduced 2x2 system in the shooting instead. With the gauge fix, we are left with 3 parameters to fix all in all (1 from center, and 2 from surface: (Subscript[ϱ, 1]^s)[0]and p), one of the free coefficients can be fixed by linearity,
so left with 2 “true” d.o.f. for a 2x2 system, so this works out.

Algebraic Equation for mass 𝒱

From the above, we can now find the expansion for the mass.

lhs = Series[(Subscript[𝒱, 1])[x]/(1-x^2/(Subscript[x, ⋆])^2)^p /. 𝒱1SolRule /. PS1AnsatzSurfaceRule /. (Subscript[M, 0])[x] -> (Subscript[ϱ, 0])[x] (Subscript[g, 0])[x] (Subscript[Σ, 0])[x] /. PS0AnsatzSurfaceRule,{x,(Subscript[x, ⋆]),PS1OrderSurface}] // Simplify;
	rhs = (Subscript[𝒱, 1])[x]/(1-x^2/(Subscript[x, ⋆])^2)^p /. PS1AnsatzSurfaceRule// Simplify;
	PSSurface𝒱1SolRule = Flatten[Solve[lhs==rhs, Table[(Subscript[𝒱, 1]^s)[n],{n,0,PS1OrderSurface}]]] /. staticSolgMϱVInTermsOfxRule /. pg1M1AtSurfaceSolRule /. PSSurfaceg1M1ϱ1SolRule//FullSimplify

Power series solution at the origin

Power series ansatz near x = 0

From discussing in the boundary analysis, we need each of the variables to have an even expansion in R and therefore x.
Recall the gauge freedom to rescale the time coordinate. For the background, we used it to fix α(0)=g(0)=1. For the perturbed ones, we have a remaining gauge freedom at this order and fixing it means fixing (Subscript[g, 1])((Subscript[x, 1])) for some (Subscript[x, 1]).
With our choice of perturbed variable, we will see that the solution near the center is completely independent of (Subscript[g, 1])(0).
As already stated in the analysis, a condition is that (Subscript[M, 1])(0)=0. This can also be verified from the equation by looking at the power series, but in the case, we will just take this as given in the expansion.
Note that this makes sure that there is no conical singularity at the center.

PS1OrderOrigin = 4; (*Indicates up to what order to expand.*)
PS0OrderOrigin = PS1OrderOrigin+2; (*Making sure there are enough up coefficients for the background variables. We definitiely need +1, so just made it +2 to be on the safe side.*)
xOriginExpansion = x -> Function[y,Evaluate[Sqrt[y-1] Sum[(x^c)[n] (y-1)^(n-1),{n,1, PS0OrderOrigin}]]]; (*notice the unusual expansion. (x^2) has a regular expansion though. Not needed here*)
PS0AnsatzOriginRule = 
{(Subscript[g, 0]) -> Function[x,Evaluate[1+Sum[(Subscript[g, 0]^c)[n] x^n,{n,2,PS0OrderOrigin,2}]]],
(Subscript[M, 0]) -> Function[x,Evaluate[-1+Sum[(Subscript[M, 0]^c)[n] x^n,{n,2,PS0OrderOrigin,2}]]], 
(Subscript[ϱ, 0]) -> Function[x,Evaluate[Sum[(Subscript[ϱ, 0]^c)[n] x^n,{n,2, PS0OrderOrigin,2}]]]};
PS1AnsatzOriginRule = 
{(Subscript[g, 1]) -> Function[x,Evaluate[(1-x^2/(Subscript[x, ⋆])^2)^p Sum[(Subscript[g, 1]^c)[n] x^n,{n,0,PS1OrderOrigin,2}]]], (*gauge fix*)
(Subscript[M, 1]) -> Function[x,Evaluate[(1-x^2/(Subscript[x, ⋆])^2)^p Sum[(Subscript[M, 1]^c)[n] x^n,{n,2,PS1OrderOrigin,2}]]], (*(Subscript[M, 1])(0)=0 is a regularity condition*)
(Subscript[ϱ, 1]) -> Function[x,Evaluate[(1-x^2/(Subscript[x, ⋆])^2)^p Sum[(Subscript[ϱ, 1]^c)[n] x^n,{n,0, PS1OrderOrigin,2}]]], (*See boundary asymptotics*)
(Subscript[𝒱, 1]) -> Function[x,Evaluate[(1-x^2/(Subscript[x, ⋆])^2)^p Sum[(Subscript[𝒱, 1]^c)[n] x^n,{n,0,PS1OrderOrigin,2}]]]}; (*Not needed, although used to find its coefficients via algebraic equation.*)

Also, we write down at each order, which variables we will solve for.  A posteriori, see that (Subscript[ϱ, 1]^c)[0] is free parameter.

PS0UnknownOrigin = {Table[(Subscript[g, 0]^c)[n],{n,2,PS0OrderOrigin,2}],Table[(Subscript[M, 0]^c)[n],{n,2,PS0OrderOrigin,2}], Table[(Subscript[ϱ, 0]^c)[n],{n,2,PS0OrderOrigin,2}]};
PS1UnknownOrigin = {Table[(Subscript[g, 1]^c)[n],{n,2,PS1OrderOrigin,2}], Table[(Subscript[M, 1]^c)[n],{n,2,PS1OrderOrigin,2}],Table[(Subscript[ϱ, 1]^c)[n],{n,2,PS1OrderOrigin,2}]};

Find PS expressions for background solution

For later use, we will need to plug in the known values of the static solution. Since the below will express everything in terms of PS expansion at the origin y = 1, need to find the relevant expressions for the static solution.
For x eqn, we use a HACK. Since expansion is in terms of square root, there is then a bug when using SeriesCoefficient. We multiply expressions with that square root to make a usual expansion.

tabletmp = Table[SeriesCoefficient[({(Subscript[g, 0])[x],(Subscript[M, 0])[x],(Subscript[ϱ, 0])[x]} /. PS0AnsatzOriginRule) - 
({g[x],M[x],ϱ[x]} /. staticSolgMϱVInTermsOfxRule),{x,0,n}],{n,1,PS0OrderOrigin}];
backgroundPSOrigin = Simplify[Flatten[Solve[tabletmp == 0,Flatten[PS0UnknownOrigin]]]/.  (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]]
Clear[tabletmp]

Reduced ODEs PS solution

Structure of equations

In the below, the “missing” equation at quadratic order in (Subscript[ϱ, 1]) is satisfied thanks to (Subscript[M, 1])(0)=0.

MatrixPlot[Simplify[Table[SeriesCoefficient[{1/(1-x^2/(Subscript[x, ⋆])^2)^p,1/(1-x^2/(Subscript[x, ⋆])^2)^p,1/(1-x^2/(Subscript[x, ⋆])^2)^p}ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx /.
PS0AnsatzOriginRule /. PS1AnsatzOriginRule, {x,0,n}] ,{n,0,PS1OrderOrigin}]]]

Rescale equations

We rescale such that leading order of each equation is of the same order and solving it fixes the leading order term in the expansion etc.
In this case, need, to “push” the equations for (Subscript[ϱ, 1]) up.

PSOriging1M1ϱ1 = Simplify[Table[SeriesCoefficient[{1/(1-x^2/(Subscript[x, ⋆])^2)^p,1/(1-x^2/(Subscript[x, ⋆])^2)^p,1/(1-x^2/(Subscript[x, ⋆])^2)^p/x^2}ODEReducedg1EMM1EMϱ1EMμ0InTermsOfx /.
PS0AnsatzOriginRule /. PS1AnsatzOriginRule, {x,0,n}] ,{n,0,PS1OrderOrigin}]];

Solve the system

Solve system and plug in the known expansion expressions for the background terms. Again, the fixation of (Subscript[𝒱, 1])(0) is needed for regularity at the center.

PSOriging1M1ϱ1SolRuletmp2 = Flatten[Simplify[Solve[Map[# == 0&,PSOriging1M1ϱ1],Flatten[PS1UnknownOrigin]]]]; 	
	PSOriging1M1ϱ1SolRuletmp = FullSimplify[PSOriging1M1ϱ1SolRuletmp2 /. backgroundPSOrigin /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]]
Clear[PSOriging1M1ϱ1SolRuletmp2]

PSOriging1M1ϱ1SolRule = PSOriging1M1ϱ1SolRuletmp /. λ -> Sqrt[ω] /. ω -> (λ^2 /. pg1M1AtSurfaceSolRule) // FullSimplify
Clear[PSOriging1M1ϱ1SolRuletmp]

Now, plug in the values for λ in terms of p, from the power series solution near the surface:

Recall the gauge freedom to rescale the time coordinate. For the background, we used it to fix α(0)=g(0)=1. For the perturbed ones, we have a remaining gauge freedom at this order and fixing it means fixing (Subscript[g, 1])((Subscript[x, 1])) for some (Subscript[x, 1]).
Here, we could just take (Subscript[g, 1])(0) = 0. This would completely fix the gauge freedom and thus we have a 1-parameter family of solution near the center, parametrized by (Subscript[ϱ, 1]^c)[0].

Algebraic Equation for mass (Subscript[𝒱, 1])

From the above, we can now find the expansion for (Subscript[𝒱, 1]). Note that (Subscript[𝒱, 1])[n] ~ (Subscript[M, 1])[n+2], so it is always “one step behind”.

lhs = Series[(Subscript[𝒱, 1])[x] /. 𝒱1SolRule /. PS1AnsatzOriginRule /. PS0AnsatzOriginRule,{x,0,PS1OrderOrigin-2}];
	rhs = (Subscript[𝒱, 1])[x] /. PS1AnsatzOriginRule;
	PSOrigin𝒱1SolRuletmp = Flatten[Solve[lhs==rhs, Table[(Subscript[𝒱, 1]^c)[n],{n,0,PS1OrderOrigin-2,2}]]] /. backgroundPSOrigin //FullSimplify;
	PSOrigin𝒱1SolRule = PSOrigin𝒱1SolRuletmp /. PSOriging1M1ϱ1SolRule // Simplify

Shooting for perturbed fields for μ = 0

Initial conditions and parameter set up

EM parameter

Since the reduced equations only depend on (λ^2), we take as new variable ω = (λ^2).

ωEMRule = ω -> λ^2 /. pg1M1AtSurfaceSolRule

Parameters

Note: cannot make precision all that better than this.

κRule = κ -> 1/2;
ϵLRule = ϵL -> 10^(-6);
ϵRRule = ϵR -> 10^(-4);
precisionLRule = precisionL -> 8;
accuracyLRule = accuracyL-> 8;
precisionRRule = precisionR -> 8;
accuracyRRule = accuracyR-> 8;
paraRule = SetPrecision[{ϵLRule, ϵRRule, κRule,precisionLRule,accuracyLRule,precisionRRule,accuracyRRule},Infinity]

midpoint = 1;

IC at origin x = 0

ICOrigin[ϱ0_,κpara_,ppara_,ϵpara_] := SetPrecision[{(Subscript[M, 0])[x] ((1-x^2/(Subscript[x, ⋆])^2)^p x^2 (Subscript[M, 1]^c)[2]),(Subscript[ϱ, 0])[x] ((1-x^2/(Subscript[x, ⋆])^2)^p (Subscript[ϱ, 1]^c)[0]+(1-x^2/(Subscript[x, ⋆])^2)^p x^2 (Subscript[ϱ, 1]^c)[2])} /.( staticSolgMϱVInTermsOfxRule /. M -> (Subscript[M, 0]) /. ϱ -> (Subscript[ϱ, 0])) /. 
PSOriging1M1ϱ1SolRule /. λ -> Sqrt[ω] /. ωEMRule /. {p -> ppara, x -> ϵpara, (Subscript[ϱ, 1]^c)[0] -> ϱ0},Infinity]/. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /.  κ -> κpara

IC at surface x = (Subscript[x, ⋆])

ICSurface[ϱs_,κpara_,ppara_,ϵpara_] := {(Subscript[M, 0])[x] ((Subscript[M, 1]^s)[0] (1-x^2/(Subscript[x, ⋆])^2)^p + (1-x^2/(Subscript[x, ⋆])^2)^(1+p) (Subscript[M, 1]^s)[1]),(Subscript[ϱ, 0])[x] ((Subscript[ϱ, 1]^s)[0] (1-x^2/(Subscript[x, ⋆])^2)^p + (1-x/(Subscript[x, ⋆]))^(1+p) (Subscript[ϱ, 1]^s)[1])} /. PSSurfaceg1M1ϱ1SolRule /. 
( staticSolgMϱVInTermsOfxRule /. M -> (Subscript[M, 0]) /. ϱ -> (Subscript[ϱ, 0])) /. pg1M1AtSurfaceSolRule /. λ -> Sqrt[ω] /. ωEMRule /. {p -> ppara, x -> (Subscript[x, ⋆])  - ϵpara, (Subscript[ϱ, 1]^s)[0] -> ϱs} /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /.  κ -> κpara

ICSurface2[ϱs_,κpara_,ppara_,ϵpara_] := {(Subscript[M, 1]^s)[0] (1-x^2/(Subscript[x, ⋆])^2)^p + (1-x^2/(Subscript[x, ⋆])^2)^(1+p) (Subscript[M, 1]^s)[1],(Subscript[ϱ, 1]^s)[0] (1-x^2/(Subscript[x, ⋆])^2)^p + (1-x/(Subscript[x, ⋆]))^(1+p) (Subscript[ϱ, 1]^s)[1]} /. PSSurfaceg1M1ϱ1SolRule /. 
 pg1M1AtSurfaceSolRule /. λ -> Sqrt[ω] /. ωEMRule /. {p -> ppara, x -> (Subscript[x, ⋆])  - ϵpara, (Subscript[ϱ, 1]^s)[0] -> ϱs} /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /.  κ -> κpara

Left and right shootings and mismatch resolution

Plug in background solution and re-write equations

To simplify the shooting, we will plug in the known analytic solution of the background fields. We also rescale the equations of superfluous factors.
Note that we only consider the (Subscript[M, 1])’ and (Subscript[ϱ, 1])’ equation, since (Subscript[g, 1]) is found by integrating (Subscript[g, 1])’ ODE and (Subscript[𝒱, 1]) is found algebraically from (Subscript[M, 1]). We also plug in the expression for λ in terms of p, from the surface analysis.

gΣRule = {(Subscript[Σ, 0]) -> Function[x,Evaluate[Simplify[ϱ[x] g[x]/M[x] /. staticSolgMϱVInTermsOfxRule]]],(Subscript[g, 0]) -> Function[x,Evaluate[g[x] /. staticSolgMϱVInTermsOfxRule]]};
ODESimplifiedForShooting = Simplify[{(Subscript[x, ⋆])^2/(2 κ) (-1+κ),(Subscript[x, ⋆])^2/2 (1-κ)} ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxRegularAtSurfaceShooting[[2;;3]]/. gΣRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]/. λ -> Sqrt[ω] /. ωEMRule]
Clear[ODESimplifiedForShootingtmp,gΣRule]

gΣRule = {(Subscript[Σ, 0]) -> Function[x,Evaluate[Simplify[ϱ[x] g[x]/M[x] /. staticSolgMϱVInTermsOfxRule]]],(Subscript[g, 0]) -> Function[x,Evaluate[g[x] /. staticSolgMϱVInTermsOfxRule]]};
ODESimplifiedForShooting2 = Simplify[{(Subscript[x, ⋆])^2 (-1+κ)/x,(Subscript[x, ⋆])^2/2 (1-κ)/x^2} ODEReducedg1EMM1EMϱ1EMμ0InTermsOfxRegularAtSurface[[2;;3]]/. gΣRule /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)]/. λ -> Sqrt[ω] /. ωEMRule]
Clear[ODESimplifiedForShootingtmp,gΣRule]

Left expansion shooting, x = 0

PerturbationLeftShootingRule[evaluation_?NumericQ,ϱ0_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, ϵLpara_?NumericQ, precisionLpara_?IntegerQ, accuracyLpara_?IntegerQ] := Flatten[NDSolve[
{ODESimplifiedForShooting[[1]] == 0 /. κ -> κpara /. p -> ppara,
ODESimplifiedForShooting[[2]] == 0 /. κ -> κpara /. p -> ppara,
(Subscript[M, 1])[ϵLpara] == ICOrigin[ϱ0,κpara,ppara,ϵLpara][[1]],
(Subscript[ϱ, 1])[ϵLpara] == ICOrigin[ϱ0,κpara,ppara,ϵLpara][[2]]},{(Subscript[M, 1]),(Subscript[ϱ, 1])},{x,ϵLpara,evaluation},AccuracyGoal->precisionLpara,PrecisionGoal->accuracyLpara,
Method->{"ExplicitRungeKutta","DifferenceOrder"->8},InterpolationOrder->All,MaxSteps->Infinity,MaxStepSize->10^(-4), StartingStepSize->10^(-10)]]
PerturbationLeftShootingAtMidPoint[evaluation_?NumericQ,ϱ0_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, ϵLpara_?NumericQ, precisionLpara_?IntegerQ, accuracyLpara_?IntegerQ] := 
	{(Subscript[M, 1])[evaluation],(Subscript[ϱ, 1])[evaluation]} /. PerturbationLeftShootingRule[evaluation,ϱ0, κpara, ppara, ϵLpara, precisionLpara, accuracyLpara]

Seems to be sensitive to where the transition from the power series to numerics is, i.e. what the value of ϵL is, if you take ϵL < (10^(-6)).

midpointtmp = 1.414;
tmp = PerturbationLeftShootingRule[midpointtmp,-10,κ,1.9,ϵL,precisionL,accuracyL] /. paraRule;
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmp],{x,ϵL /. paraRule,midpointtmp},PlotLegends->{"(Subscript[M, 1])","(Subscript[ϱ, 1])"}, PlotRange->All]
Clear[tmp,midpointtmp]

midpointtmp = 1.414;
tmp = PerturbationLeftShootingRule[midpointtmp,-10,κ,2,ϵL,precisionL,accuracyL] /. paraRule;
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmp],{x,ϵL /. paraRule,midpointtmp},PlotLegends->{"(Subscript[M, 1])","(Subscript[ϱ, 1])"}, PlotRange->All]
Clear[tmp,midpointtmp]

midpointtmp = 1.41;
tmp = PerturbationLeftShootingRule[midpointtmp,-10,κ,3,ϵL,precisionL,accuracyL] /. paraRule;
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmp],{x,ϵL /. paraRule,midpointtmp},PlotLegends->{"(Subscript[M, 1])","(Subscript[ϱ, 1])"}, PlotRange->Automatic]
Clear[tmp,midpointtmp]

midpointtmp = 1.4;
tmp = PerturbationLeftShootingRule[midpointtmp,-10,κ,-0.3,ϵL,precisionL,accuracyL] /. paraRule;
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmp],{x,ϵL /. paraRule,midpointtmp},PlotLegends->{"(Subscript[M, 1])","(Subscript[ϱ, 1])"}]
Clear[tmp,midpointtmp]

Right expansion shooting, x = (Subscript[x, ⋆])

Slight hack when putting initial data.

PerturbationRightShootingRule[evaluation_?NumericQ, ϱs_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, ϵRpara_?NumericQ, precisionRpara_?IntegerQ, accuracyRpara_?IntegerQ] := Flatten[NDSolve[
{ODESimplifiedForShooting[[1]] == 0 /. κ -> κpara /. p -> ppara,
ODESimplifiedForShooting[[2]] == 0 /. κ -> κpara /. p -> ppara, 
(Subscript[M, 1])[Sqrt[2 κ/(1-κ)]-ϵRpara /. κ -> κpara] == ICSurface[ϱs,κpara,ppara,ϵRpara][[1]],
(Subscript[ϱ, 1])[Sqrt[2 κ/(1-κ)]-ϵRpara/. κ -> κpara] == ICSurface[ϱs,κpara,ppara,ϵRpara][[2]]},{(Subscript[M, 1]),(Subscript[ϱ, 1])},{x,Sqrt[2 κ/(1-κ)]-ϵRpara/. κ -> κpara,evaluation},
Method->{"ExplicitRungeKutta","DifferenceOrder"->8},MaxSteps->Infinity,MaxStepSize->10^(-4), StartingStepSize->10^(-10),
AccuracyGoal->accuracyRpara,PrecisionGoal->precisionRpara]]
PerturbationRightShootingAtMidPoint[evaluation_?NumericQ,ϱs_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, ϵRpara_?NumericQ, precisionRpara_?NumericQ, accuracyRpara_?NumericQ] := 
	{(Subscript[M, 1])[evaluation],(Subscript[ϱ, 1])[evaluation]} /. PerturbationRightShootingRule[evaluation,ϱs, κpara, ppara, ϵRpara, precisionRpara, accuracyRpara]

PerturbationRightShootingRule2[evaluation_?NumericQ, ϱs_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, ϵRpara_?NumericQ, precisionRpara_?IntegerQ, accuracyRpara_?IntegerQ] := Flatten[NDSolve[
{ODESimplifiedForShooting2[[1]] == 0 /. κ -> κpara /. p -> ppara,
ODESimplifiedForShooting2[[2]] == 0 /. κ -> κpara /. p -> ppara, 
(Subscript[M, 1])[Sqrt[2 κ/(1-κ)]-ϵRpara /. κ -> κpara] == ICSurface2[ϱs,κpara,ppara,ϵRpara][[1]],
(Subscript[ϱ, 1])[Sqrt[2 κ/(1-κ)]-ϵRpara/. κ -> κpara] == ICSurface2[ϱs,κpara,ppara,ϵRpara][[2]]},{(Subscript[M, 1]),(Subscript[ϱ, 1])},{x,Sqrt[2 κ/(1-κ)]-ϵRpara/. κ -> κpara,evaluation},
AccuracyGoal->accuracyRpara,PrecisionGoal->precisionRpara]]
PerturbationRightShootingAtMidPoint[evaluation_?NumericQ,ϱs_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, ϵRpara_?NumericQ, precisionRpara_?NumericQ, accuracyRpara_?NumericQ] := 
	{(Subscript[M, 1])[evaluation],(Subscript[ϱ, 1])[evaluation]} /. PerturbationRightShootingRule2[evaluation,ϱs, κpara, ppara, ϵRpara, precisionRpara, accuracyRpara]

PerturbationRightShootingAtMidPoint[midpoint,1,κ,-0.7,ϵR,precisionR,accuracyR] /. paraRule

Note: for ϱs “small” (say 1), get oscillations?? Maybe because of precision.

Again, sensitive to ϵR if too small (I find ϵR < (10^(-4))).

tmpmidpoint = 0.01;
tmp = PerturbationRightShootingRule[tmpmidpoint,10,κ,-0.7,ϵR,precisionR,accuracyR] /. paraRule;
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmp],{x,tmpmidpoint,Sqrt[2 κ/(1-κ)]-ϵR /. paraRule}]
Clear[tmp,tmpmidpoint]

tmpmidpoint = 0.00001;
tmp = PerturbationRightShootingRule2[tmpmidpoint,3,κ,-0.3,ϵR,precisionR,accuracyR] /. paraRule;
Plot[Evaluate[{(Subscript[M, 0])[x] (Subscript[M, 1])[x],(Subscript[ϱ, 0])[x] (Subscript[ϱ, 1])[x]} /. ( staticSolgMϱVInTermsOfxRule /. M -> (Subscript[M, 0]) /. ϱ -> (Subscript[ϱ, 0])) /. tmp /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] /. paraRule],{x,tmpmidpoint,Sqrt[2 κ/(1-κ)]-ϵR /. paraRule}]
Clear[tmp,tmpmidpoint]

Both shooting together

Note: in perturbation, if (Subscript[M, 1]) > 0, then perturbation is negative -> reducing mass. Logically, this means that density needs to decrease. From plots, this is only the case up to a certain point.

from numerics, find (Subscript[λ, num]) = 7.118. From our definition, with T = t/s, we then have that (Subscript[λ, Math]) = s (Subscript[λ, num]). From numerics, the scale has been defined to be (s^2) = ((Subscript[R, max]^2)/(4 (Subscript[x, ⋆]^2))) -> s = 0.441942. Then: (Subscript[λ, Math]) = 3.14574, or p = 2.68111 (other value is: p = -3.68111).

Trying to find mismatch manually.

evalpoint = 1.;
myϱ0 = -0.1;
myϱs = 60;
myp =  2.68111;
myϵL = 10^(-6);
myprecisionL = 8;
myaccuracyL = 8;
myϵR = 10^(-4);
myprecisionR = 8;
myaccuracyR = 8;
tmpL = PerturbationLeftShootingRule[evalpoint,myϱ0,κ,myp,ϵL,precisionL,accuracyL] /. paraRule;
tmpR = PerturbationRightShootingRule[evalpoint,myϱs,κ,myp,ϵR,precisionR,accuracyR] /. paraRule;
Show[{Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmpL],{x,ϵL /. paraRule,evalpoint}],
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmpR],{x,evalpoint,Sqrt[2 κ/(1-κ)]-ϵR /. paraRule},PlotLegends->{"(Subscript[M, 1])","(Subscript[ϱ, 1])"}]},PlotRange ->{{0,1.5},{-2,2}}]
Clear[tmpL,tmpR]

evalpoint = 0.85;
myϱ0 = -1;
myϱs = -1;
myp = -0.72; (* Some kind of sign switch for p = -0.71 and -0.72 ?? Can also be seen in det(mismatch later)*)
myϵL = 10^(-6);
myprecisionL = 8;
myaccuracyL = 8;
myϵR = 10^(-4);
myprecisionR = 8;
myaccuracyR = 8;
tmpL = PerturbationLeftShootingRule[evalpoint,myϱ0,κ,myp,ϵL,precisionL,accuracyL] /. paraRule;
tmpR = PerturbationRightShootingRule[evalpoint,myϱs,κ,myp,ϵR,precisionR,accuracyR] /. paraRule;
Show[{Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmpL],{x,ϵL /. paraRule,evalpoint}],
Plot[Evaluate[{(Subscript[M, 1])[x],(Subscript[ϱ, 1])[x]} /. tmpR],{x,evalpoint,Sqrt[2 κ/(1-κ)]-ϵR /. paraRule},PlotLegends->{"(Subscript[M, 1])","(Subscript[ϱ, 1])"}]},PlotRange ->Automatic]
Clear[tmpL,tmpR]

Mismatch resolution

We will solve it via the determinant method. As we are considering a linear system, the mismatch is of the form m := A(λ)*f, where A is a 3x3 matrix only depending on frequency λ and the vector f is the vector of the 3 free parameters.
The reason that it is like that is because of the scale invariant property of the linear system.
Finding a non-trivial solution to m = 0 thus requires det A = 0, which is a highly non-linear equation for λ. Said differently, the A needs to have an eigenvalue = 0.

Define mismatch matrix at “midpoint”

MismatchAtMidPoint[evaluation_?NumericQ,ϱ0_?NumericQ, ϱs_?NumericQ, κpara_?NumericQ, ppara_?NumericQ, 
ϵLpara_?NumericQ, precisionLpara_?IntegerQ, accuracyLpara_?IntegerQ,ϵRpara_?NumericQ, precisionRpara_?IntegerQ, accuracyRpara_?IntegerQ] := 
PerturbationLeftShootingAtMidPoint[evaluation,ϱ0, κpara, ppara, ϵLpara, precisionLpara, accuracyLpara] - 
PerturbationRightShootingAtMidPoint[evaluation,ϱs, κpara, ppara, ϵRpara, precisionRpara, accuracyRpara]

Testing that this works:

MismatchAtMidPoint[1,1,1,0.5,-0.7,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR]

MisMatchMatrix[evaluation_?NumericQ,ppara_?NumericQ, ϵLpara_?NumericQ, precisionLpara_?IntegerQ, accuracyLpara_?IntegerQ,ϵRpara_?NumericQ, precisionRpara_?IntegerQ, accuracyRpara_?IntegerQ] := Transpose[
		{MismatchAtMidPoint[evaluation,1,0,κ,ppara,ϵLpara, precisionLpara, accuracyLpara,ϵRpara, precisionRpara, accuracyRpara] /. paraRule,
		MismatchAtMidPoint[evaluation,0,1,κ,ppara,ϵLpara, precisionLpara, accuracyLpara,ϵRpara, precisionRpara, accuracyRpara] /. paraRule}];
MisMatchMatrixdet[evaluation_?NumericQ,ppara_?NumericQ, ϵLpara_?NumericQ, precisionLpara_?IntegerQ, accuracyLpara_?IntegerQ,ϵRpara_?NumericQ, precisionRpara_?IntegerQ, accuracyRpara_?IntegerQ] := 
Det[MisMatchMatrix[evaluation,ppara,ϵLpara, precisionLpara, accuracyLpara,ϵRpara, precisionRpara, accuracyRpara]]

MisMatchMatrixdet[midpoint,-0.1,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule

MisMatchMatrixdetRoot[ppara_] := MisMatchMatrixdet[midpoint,ppara,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule

FindRoot[MisMatchMatrixdetRoot[p],{p,-.9}]

Plots of det(mismatch)

Assuming κ = 1/2 here!!!

ϵLPlot = 10^(-6);
ϵRPlot = 10^(-4);
precisionLPlot = 8;
accuracyLPlot = 8;
precisionRPlot =8;
accuracyRPlot = 8;

Plot[MisMatchMatrixdet[midpoint,p,ϵLPlot,precisionLPlot,accuracyLPlot,ϵRPlot,precisionRPlot,accuracyRPlot],{p,-0.99,-0.01}, PlotRange->{{-1,0},{-1,0.1}}]

Plot[MisMatchMatrixdet[midpoint,p,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule,{p,0,2}, PlotRange->{{0,2},{-0.1,0.1}}]

Plot[MisMatchMatrixdet[midpoint,p,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule,{p,0,12}, PlotRange->{{0,12},{-10,1}}]

Plot[MisMatchMatrixdet[midpoint,p,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule,{p,0,12}, PlotRange->Full]

Plot[MisMatchMatrixdet[midpoint,p,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule,{p,10,20}, PlotRange->Full]

The below is with MAxstepSize = 10^(-4):

Plot[MisMatchMatrixdet[midpoint,p,ϵLPlot,precisionLPlot,accuracyLPlot,ϵRPlot,precisionRPlot,accuracyRPlot],{p,-0.99,-0.01}, PlotRange->{{-1,0},{-0.1,0.1}}]

Plot[MisMatchMatrixdet[midpoint,p,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule,{p,0,12}, PlotRange->Full]

Plot[MisMatchMatrixdet[midpoint,p,myϵL,myprecisionL,myaccuracyL,myϵR,myprecisionR,myaccuracyR] /. paraRule,{p,10,20}, PlotRange->Full]

DumpSave

TimeUsed[]

With[{context = $Context},DumpSave[FileNameJoin[{NotebookDirectory[],StringDelete[Last[FileNameSplit[NotebookFileName[]]],".nb"]}] <> ".mx",   
		{context,NotationMakeBoxes,NotationMakeExpression}]]

Other Dump methods

The below are equivalent methods.  I keep them for posterity For clarity, we will call the file path simply “file”. Made it unevaluable of course.

With[{context = Context[]},DumpSave["file", {context,NotationMakeBoxes,NotationMakeExpression}]]

Function[x,DumpSave["file",x]]@$Context

DumpSave["file",{"Global`",NotationMakeBoxes,NotationMakeExpression}]

The above assumes that the current context is in fact Global`!

DumpSave["file",#]&@$Context

DumpSave["file",Evaluate@$Context]

Function[x,DumpSave["file",x]]@$Context

DumpSave["file",Evaluate[{Context[],NotationMakeBoxes,NotationMakeExpression}]]

Or succinctly using the @ shortcut to mean that RHS is the argument of LHS. Or that LHS is “applied” to RHS. Actual Apply uses two: @@ instead.

DumpSave["file",Evaluate@{Context[],NotationMakeBoxes,NotationMakeExpression}]

Note on the last two, the need to put Evaluate at the very front. This is because DumpSave has attribute HoldRest, making it not read/evaluate the arguments at level 2 or lower.
				In this case, the 1st level argument of interest would be {...}. The stuff inside is at “2nd level”. I.e., DumbSave sees its 2nd argument: {...} but because of HoldRest does not “dig deeper”. 
				This is overridden by putting Evaluate on the 1st level (and therefore {...} is now 2nd level and the stuff inside 3rd).

Solve HG non-analytically

Near the center χ = 1

Try a non-analytic ansatz as it is suggested by the known power series solution of the HG ODE.

M1ExpansionOrderχ1 = 4;
M1Expansionχ1 = (Subscript[(OverBar[M]), 1]) -> Function[χ,Evaluate[Sum[(Subscript[(OverBar[M]), 1]^nac)[n] Log[1-χ] (1-χ)^n + (Subscript[(OverBar[M]), 1]^ac)[n] (1-χ)^n,{n,1,M1ExpansionOrderχ1}]]]; (*(Subscript[M, 1])(0)=0 for regularity.*)

We now need to split the ODE into two parts, one in terms of log and the other without it.

M1LogTerms = Series[D[M1ppODEHG /. M1Expansionχ1,Log[1-χ]],{χ,1,M1ExpansionOrderχ1-1}];
M1AnalyticTerms = Series[(M1ppODEHG /. M1Expansionχ1 /. Log[1-χ] -> 0),{χ,1,M1ExpansionOrderχ1-1}];
M1CoefficientsLog = Table[{(Subscript[(OverBar[M]), 1]^nac)[n]},{n,2,M1ExpansionOrderχ1}];

tableLogtmp = FullSimplify[Table[SeriesCoefficient[M1LogTerms,{χ,1,n}],{n,0,M1ExpansionOrderχ1-1}]];
tableAnalytictmp = FullSimplify[Table[SeriesCoefficient[M1AnalyticTerms,{χ,1,n}],{n,0,M1ExpansionOrderχ1-1}]];
tabletmp = {tableLogtmp, tableAnalytictmp} // Flatten;
M1Expansionχ1Sol = Flatten[Solve[tabletmp == 0,M1Coefficientsχ1]] // Simplify;
Clear[tabletmp]

tmp1 = (Subscript[(OverBar[M]), 1]^c)[4]/(Subscript[(OverBar[M]), 1]^c)[5] /. M1Expansionχ1Sol;
tmp2 = (Subscript[(OverBar[M]), 1]^c)[9]/(Subscript[(OverBar[M]), 1]^c)[10] /. M1Expansionχ1Sol;
tmp3 = (Subscript[(OverBar[M]), 1]^c)[14]/(Subscript[(OverBar[M]), 1]^c)[15] /. M1Expansionχ1Sol;
tmp4 = (Subscript[(OverBar[M]), 1]^c)[19]/(Subscript[(OverBar[M]), 1]^c)[20] /. M1Expansionχ1Sol;
tmp5 = (Subscript[(OverBar[M]), 1]^c)[24]/(Subscript[(OverBar[M]), 1]^c)[25] /. M1Expansionχ1Sol;
tmp6 = (Subscript[(OverBar[M]), 1]^c)[29]/(Subscript[(OverBar[M]), 1]^c)[30] /. M1Expansionχ1Sol;
tmp7 = (Subscript[(OverBar[M]), 1]^c)[34]/(Subscript[(OverBar[M]), 1]^c)[35] /. M1Expansionχ1Sol;

We see that the more terms we have, the flatter ((Subscript[a, n])/(Subscript[a, n+1])) gets as n -> ∞ and it tends to 1 for all p. By convergence test, if we consider ∑(Subscript[a, n]) (((1-χ))^n), then ratio test requires |1-χ| < (Subscript[lim, n -> ∞]) ((Subscript[a, n])/(Subscript[a, n+1])) and therefore χ > 0. 
In other words, χ is allowed to go up until the surface χ=0 consistent with the analytical solution in terms of hypergeometric functions as it is known that the radius of convergence of χ (around 0) is 1.

Plot[Evaluate[{tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7}],{p,-0.5,3}]
Clear[tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]

Near the surface χ = 0

Note: from the below, remark that in the expansion, we have the extra (χ^p). Because of the symmetry of the system, a second possible solution would instead have (χ^(-1-p)). Here, we therefore choose to ignore this second solution.
THe full solution is really a linear combination of these two mentioned solutions, but we take the integration constant of the second term to be 0.

M1ExpansionOrderχ0 = 20; (*takes too long higher than 30*)
M1Expansionχ0 = (Subscript[(OverBar[M]), 1]) -> Function[χ,Evaluate[Sum[(Subscript[(OverBar[M]), 1]^s)[n] χ^(n),{n,0,M1ExpansionOrderχ0}]]];

Note that below, need the “-2” because above is a second order ODE, so solution is expected to depend on (Subscript[M, 1]) and (Subscript[M, 1])' at the center. The former is fixed for regularity,
so the solution only depends on (Subscript[M, 1])(χ=1).

M1ODEPSχ0 = Series[Simplify[M1ppODEHG /. M1Expansionχ0],{χ,0,M1ExpansionOrderχ0-1}];
M1Coefficientsχ0 = Table[(Subscript[(OverBar[M]), 1]^s)[n],{n,1,M1ExpansionOrderχ0}];

tabletmp = Simplify[Table[SeriesCoefficient[M1ODEPSχ0,{χ,0,n}],{n,0,M1ExpansionOrderχ0-1}]];
M1Expansionχ0Sol = Flatten[Solve[tabletmp == 0,M1Coefficientsχ0]] // Simplify;
Clear[tabletmp]

tmp1 = (Subscript[(OverBar[M]), 1]^s)[4]/(Subscript[(OverBar[M]), 1]^s)[5] /. M1Expansionχ0Sol;
tmp2 = (Subscript[(OverBar[M]), 1]^s)[9]/(Subscript[(OverBar[M]), 1]^s)[10] /. M1Expansionχ0Sol;
tmp3 = (Subscript[(OverBar[M]), 1]^s)[14]/(Subscript[(OverBar[M]), 1]^s)[15] /. M1Expansionχ0Sol;
tmp4 = (Subscript[(OverBar[M]), 1]^s)[19]/(Subscript[(OverBar[M]), 1]^s)[20] /. M1Expansionχ0Sol;
tmp5 = (Subscript[(OverBar[M]), 1]^s)[24]/(Subscript[(OverBar[M]), 1]^s)[25] /. M1Expansionχ0Sol;
tmp6 = (Subscript[(OverBar[M]), 1]^s)[29]/(Subscript[(OverBar[M]), 1]^s)[30] /. M1Expansionχ0Sol;
tmp7 = (Subscript[(OverBar[M]), 1]^s)[34]/(Subscript[(OverBar[M]), 1]^s)[35] /. M1Expansionχ0Sol;

We see that the more terms we have, the flatter ((Subscript[a, n])/(Subscript[a, n+1])) gets as n -> ∞ and it tends to about 1.05 for all p. By convergence test, if we consider ∑(Subscript[a, n]) (χ^n), then ratio test requires |χ| < (Subscript[lim, n -> ∞]) ((Subscript[a, n])/(Subscript[a, n+1])) and therefore χ < 1.1. 
Because we cannot go very far in the expansion, we expect the real limit to be instead = 1, instead of 1.05 and so we get again consistency.

Plot[Evaluate[{tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7}],{p,-2.5,5}]
Clear[tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7]

DSolve[M1ppODEHG == 0,(Subscript[(OverBar[M]), 1])[χ],χ] /. C[2] -> C[2] (-1)^(-1+2 p)// Flatten // Simplify

myp = 3;
tmp = DSolve[M1ppODEHG == 0 /. p -> myp,(Subscript[(OverBar[M]), 1])[χ],χ] // Flatten // FunctionExpand // Simplify;
sol = (Subscript[(OverBar[M]), 1])[χ] /. tmp /. Log[-1+χ] -> Log[1-χ];
Limit[Simplify[χ^myp sol], χ -> 0, Direction->"FromAbove"]
Limit[sol, χ -> 1]
Numerator[sol] /. χ -> 0;
tmpp = Solve[(Numerator[sol] /. χ -> 0) == 0,C[1]] // Flatten // Simplify;
sol2 = sol /. tmpp// Simplify;
Limit[χ^myp sol2, χ -> 0]
Limit[sol2, χ -> 1]

myp = 0.5;
tmp = DSolve[M1ppODEHG == 0 /. p -> myp,(Subscript[(OverBar[M]), 1])[χ],χ] // Flatten // FunctionExpand // Simplify;
Fundexpr1 = D[(Subscript[(OverBar[M]), 1])[χ] /. tmp,C[1]];
Fundexpr2 = D[(Subscript[(OverBar[M]), 1])[χ] /. tmp,C[2]];
Limit[χ^myp Fundexpr1,χ -> 0]
Limit[χ^myp Fundexpr2,χ -> 0.000001]
Limit[Fundexpr1,χ -> 1]
Fundexpr2 /. χ -> 0.99999

Linear perturbation with μ ~ ϵ

Introduce perturbations for analysis

In general, we would consider a perturbation of the type f = (Subscript[f, 0]) + ϵ (Subscript[f, 0]) (Subscript[f, 1])[T,y] + μ (Subscript[f, 0]) (Subscript[(OverBar[f]), 1])[T,y]. But, first μ ~ ϵ, so that, f = (Subscript[f, 0]) + ϵ (Subscript[f, 0])((Subscript[f, 1])[T,y] + (Subscript[(OverBar[f]), 1])[T,y]). Secondly, when we consider the decomposition of (Subscript[f, 1]) and (Subscript[(OverBar[f]), 1]) into frequencies:
(Subscript[f, 1])(T,y) = (e^(λT))(Subscript[f, 1])(y), (Subscript[(OverBar[f]), 1])(T,y) = (e^((OverBar[λ])T))(Subscript[(OverBar[f]), 1])(y), we note that for consistency, we better have that λ = (OverBar[λ]). So, the part that only depends on y can be combined again.
Thus, it suffices to look for perturbation of the type: f = (Subscript[f, 0]) + ϵ (Subscript[f, 0]) (Subscript[f, 1])[T,y] and (Subscript[f, 1])[T,y] = (e^(λT))(Subscript[f, 1])(y). Compare this with the contracting solution and the reason this is nicer is because in the contracting solution, we could have done the same if S(T) was an exponential.
This was however 2nd order perturbation and therefore it was not required. On the other hand, this is linear theory and so we can do that.
It is clear that the perturbation will only introduce an inhomogeneous term into the equations. So, it is nonetheless easier to split the perturbation into two parts.

VariablesgMϱ𝒱LinearPerturbationμPertRule = {g -> Function[{T,y},(Subscript[g, 0])[y]+ϵ (Subscript[g, 0])[y] (Subscript[g, 1])[T,y] + μ (Subscript[g, 0])[y] (Subscript[(OverBar[g]), 1])[T,y]],M -> Function[{T,y},(Subscript[M, 0])[y]+ϵ (Subscript[M, 0])[y] (Subscript[M, 1])[T,y] + μ (Subscript[M, 0])[y] (Subscript[(OverBar[M]), 1])[T,y]], 
ϱ -> Function[{T,y},(Subscript[ϱ, 0])[y]+ϵ (Subscript[ϱ, 0])[y] (Subscript[ϱ, 1])[T,y] + μ (Subscript[ϱ, 0])[y] (Subscript[(OverBar[ϱ]), 1])[T,y]],𝒱 -> Function[{T,y},ϵ (Subscript[𝒱, 1])[T,y] + μ (Subscript[(OverBar[𝒱]), 1])[T,y]]};

(Subscript[𝒱, 1]) is the only one which can be readily found:
Note: The j we use below is NOT THE SAME as the one for the contracting solution perturbation.

exprIngMϱ𝒱Of𝒱1yμPert = D[exprIngMϱ𝒱Of𝒱y /.VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 /. j -> 0 // Simplify;
exprIngMϱ𝒱Of𝒱bar1yμPert = D[D[exprIngMϱ𝒱Of𝒱y /.VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0, j] /. j -> 0 // Simplify;

For (Subscript[M, 1]), (Subscript[ϱ, 1]) and (Subscript[g, 1]), this is a bit more subtle, because of the extra factors in the perturbations. We then need to do the LHS and RHS separately.

lhsg   = D[D[g[T,y],y] /. VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
rhsg  = D[exprIngMϱ𝒱Ofgy /.VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
lhsϱ   = D[D[ϱ[T,y],y] /. VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
rhsϱ   = D[exprIngMϱ𝒱Ofϱy /.VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
lhsMx = D[D[M[T,y],y] /. VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
rhsMx = D[exprIngMϱ𝒱OfMy /.VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
lhsMT = D[D[M[T,y],T] /. VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;
rhsMT = D[exprIngMϱ𝒱OfMT /.VariablesgMϱ𝒱LinearPerturbationμPertRule /. μ -> j ϵ,ϵ] /. ϵ -> 0 // Simplify;

For the lhs, we use the ODE for the static variables. NOte that since we consider μ as a perturbation of the Λ = 0 case, we replace derivative of the background variables with μ = 0.
This is consistent since we are considering ϵ ~ μ term here and so each background variable (Subscript[f, 0]) is reattached to a (Subscript[f, 1]). So, (Subscript[f, 0]) to linear order cannot have a term ~ μ as this would only appear at second order.

exprg0PrimeRule = (Subscript[g, 0])'[y] -> metricMatterEqnReducedStaticSolgrΛ /. R -> x /. r -> y /. Λ -> 0 /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])};
exprϱ0PrimeRule = (Subscript[ϱ, 0])'[y] -> metricMatterEqnReducedStaticSolϱrΛ /. R -> x /. r -> y /. Λ -> 0 /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])};
exprM0PrimeRule = (Subscript[M, 0])'[y] -> metricMatterEqnReducedStaticSolMrΛ /. R -> x /. r -> y /. Λ -> 0 /. {g -> (Subscript[g, 0]), ϱ -> (Subscript[ϱ, 0]), M -> (Subscript[M, 0])};

lhsg   = lhsg /.exprg0PrimeRule // Simplify;
lhsϱ   = lhsϱ /.exprϱ0PrimeRule // Simplify;
lhsMx = lhsMx /.exprM0PrimeRule // Simplify;
lhsMT = lhsMT /.exprM0PrimeRule // Simplify;

exprIngMϱ𝒱Ofg1yμPert        = D[(Subscript[g, 1])[T,y],y] /. Flatten[Simplify[Solve[lhsg == rhsg /. j -> 0,D[(Subscript[g, 1])[T,y],y]]]];
exprIngMϱ𝒱Ofgbar1yμPert = D[(Subscript[(OverBar[g]), 1])[T,y],y] /. Flatten[Simplify[Solve[D[lhsg == rhsg,j],D[(Subscript[(OverBar[g]), 1])[T,y],y]]]];
exprIngMϱ𝒱Ofϱ1yμPert        = D[(Subscript[ϱ, 1])[T,y],y] /. Flatten[Simplify[Solve[lhsϱ == rhsϱ /. j -> 0,D[(Subscript[ϱ, 1])[T,y],y]]]];
exprIngMϱ𝒱Ofϱbar1yμPert = D[(Subscript[(OverBar[ϱ]), 1])[T,y],y] /. Flatten[Simplify[Solve[D[lhsϱ == rhsϱ,j],D[(Subscript[(OverBar[ϱ]), 1])[T,y],y]]]];
exprIngMϱ𝒱OfM1yμPert        = D[(Subscript[M, 1])[T,y],y] /. Flatten[Simplify[Solve[lhsMx == rhsMx /. j -> 0,D[(Subscript[M, 1])[T,y],y]]]];
exprIngMϱ𝒱OfMbar1yμPert = D[(Subscript[(OverBar[M]), 1])[T,y],y] /. Flatten[Simplify[Solve[D[lhsMx == rhsMx,j],D[(Subscript[(OverBar[M]), 1])[T,y],y]]]];
exprIngMϱ𝒱OfM1TμPert        = D[(Subscript[M, 1])[T,y],T] /. Flatten[Simplify[Solve[lhsMT == rhsMT /. j -> 0,D[(Subscript[M, 1])[T,y],T]]]];
exprIngMϱ𝒱OfMbar1TμPert = D[(Subscript[(OverBar[M]), 1])[T,y],T] /. Flatten[Simplify[Solve[D[lhsMT == rhsMT,j],D[(Subscript[(OverBar[M]), 1])[T,y],T]]]];
Clear[lhsg,rhsg,lhsϱ,rhsϱ,lhsMx,rhsMx,lhsMT,rhsMT]

Check compatibility condition

Need to check that (∂_y) (∂_T) M = (∂_T) (∂_y) M.

tmpexprM1yT = D[exprIngMϱ𝒱OfM1yμPert,T] /. D[(Subscript[M, 1])[T,y],T] -> Evaluate[exprIngMϱ𝒱OfM1TμPert];
tmpexprM1Ty = D[exprIngMϱ𝒱OfM1TμPert,y] /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. D[(Subscript[𝒱, 1])[T,y],y] -> Evaluate[exprIngMϱ𝒱Of𝒱1yμPert];
Simplify[tmpexprM1Ty-tmpexprM1yT]
tmpexprMbar1yT = D[exprIngMϱ𝒱OfMbar1yμPert,T] /. D[(Subscript[(OverBar[M]), 1])[T,y],T] -> Evaluate[exprIngMϱ𝒱OfMbar1TμPert];
tmpexprMbar1Ty = D[exprIngMϱ𝒱OfMbar1TμPert,y] /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. D[(Subscript[(OverBar[𝒱]), 1])[T,y],y] -> Evaluate[exprIngMϱ𝒱Of𝒱bar1yμPert];
Simplify[tmpexprMbar1Ty-tmpexprMbar1yT]
Clear[tmpexprM1Ty,tmpexprM1yT,tmpexprMbar1Ty,tmpexprMbar1yT]

Boundary asymptotics for μ = 0

Re-write equations with x coordinate

g1yμPertRule = Flatten[Solve[exprIngMϱ𝒱Ofg1yμPert == D[(Subscript[g, 1])[T,y],y],D[(Subscript[g, 1])[T,y],y]]] // Simplify;
gbar1yμPertRule = Flatten[Solve[exprIngMϱ𝒱Ofgbar1yμPert == D[(Subscript[(OverBar[g]), 1])[T,y],y],D[(Subscript[(OverBar[g]), 1])[T,y],y]]] // Simplify;
M1yμPertRule = Flatten[Solve[exprIngMϱ𝒱OfM1yμPert == D[(Subscript[M, 1])[T,y],y],D[(Subscript[M, 1])[T,y],y]]] // Simplify;
Mbar1yμPertRule = Flatten[Solve[exprIngMϱ𝒱OfMbar1yμPert == D[(Subscript[(OverBar[M]), 1])[T,y],y],D[(Subscript[(OverBar[M]), 1])[T,y],y]]] // Simplify;
M1TμPertRule = Flatten[Solve[exprIngMϱ𝒱OfM1TμPert == D[(Subscript[M, 1])[T,y],T],D[(Subscript[M, 1])[T,y],T]]] // Simplify;
Mbar1TμPertRule = Flatten[Solve[exprIngMϱ𝒱OfMbar1TμPert == D[(Subscript[(OverBar[M]), 1])[T,y],T],D[(Subscript[(OverBar[M]), 1])[T,y],T]]] // Simplify;
ϱ1TμPertRule = Flatten[Solve[exprIngMϱ𝒱Of𝒱1yμPert == D[(Subscript[𝒱, 1])[T,y],y],D[(Subscript[ϱ, 1])[T,y],T]]] // Simplify;
ϱbar1TμPertRule = Flatten[Solve[exprIngMϱ𝒱Of𝒱bar1yμPert == D[(Subscript[(OverBar[𝒱]), 1])[T,y],y],D[(Subscript[(OverBar[ϱ]), 1])[T,y],T]]] // Simplify;
𝒱1TμPertRule = Factor[Flatten[Solve[exprIngMϱ𝒱Ofϱ1yμPert == D[(Subscript[ϱ, 1])[T,y],y],D[(Subscript[𝒱, 1])[T,y],T]]]] // Simplify;
𝒱bar1TμPertRule = Factor[Flatten[Solve[exprIngMϱ𝒱Ofϱbar1yμPert == D[(Subscript[(OverBar[ϱ]), 1])[T,y],y],D[(Subscript[(OverBar[𝒱]), 1])[T,y],T]]]] // Simplify;

Simplify[g1yμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[M1yμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[M1TμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[ϱ1TμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[𝒱1TμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[gbar1yμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[Mbar1yμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[Mbar1TμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[ϱbar1TμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp
Simplify[𝒱bar1TμPertRule /. x -> Function[y,y] /. y -> x /. μ -> 0] /. pp

Eigenmode solutions

For analysis

Eigenmode ansatz and equations

Look for eigenmode solution of the form (Subscript[f, 1])(T,y) = (e^(λT))(Subscript[f, 1]^EM)(y). Note that in the below, we will drop the “EM” superscript. Note that t has dimension length, so we scale it so that λ is dimensionless.
The ODEs are then functions of dim-less qtes and the scale factor s does not explicitly appear as it shouldn’t.
Note: this λ has of course nothing to do with the λ from the general static solution!
Note: the matter equations for the linear perturbations do not depend on the linear perturbation of g and therefore do not depend on α!!
Note: for the perturbation of μ, the perturbation should only depend on x. The reason is that the μ (being of order ϵ) will always be re-attached to background variables. 
So, the inhomogeneous part will only depend on x and so the correction of the perturbation should also.

Variablesg1M1ϱ1𝒱1EMμPertRule = {(Subscript[g, 1]) -> Function[{T,y},(Subscript[g, 1])[y] Exp[λ T]], (Subscript[(OverBar[g]), 1]) -> Function[{T,y},(Subscript[(OverBar[g]), 1])[y]],(Subscript[M, 1]) -> Function[{T,y},(Subscript[M, 1])[y] Exp[λ T]], (Subscript[(OverBar[M]), 1]) -> Function[{T,y},(Subscript[(OverBar[M]), 1])[y]],
 (Subscript[ϱ, 1]) -> Function[{T,y},(Subscript[ϱ, 1])[y] Exp[λ T]], (Subscript[(OverBar[ϱ]), 1]) -> Function[{T,y},(Subscript[(OverBar[ϱ]), 1])[y]],(Subscript[𝒱, 1]) -> Function[{T,y},(Subscript[𝒱, 1])[y] Exp[λ T]], (Subscript[(OverBar[𝒱]), 1]) -> Function[{T,y},(Subscript[(OverBar[𝒱]), 1])[y]]};
(ODEIngMϱ𝒱Ofg1μPertEMy = Simplify[D[(Subscript[g, 1])[y],y] /. Flatten[Solve[D[(Subscript[g, 1])[T,y],y] - exprIngMϱ𝒱Ofg1yμPert == 0 /.Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[g, 1])[y],y]]]]) /. pp
(ODEIngMϱ𝒱OfM1μPertEMy = Simplify[D[(Subscript[M, 1])[y],y] /. Flatten[Solve[D[(Subscript[M, 1])[T,y],y] - exprIngMϱ𝒱OfM1yμPert == 0 /.Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[M, 1])[y],y]]]]) /. pp
(algEqnIngMϱ𝒱OfM1μPertEM = Simplify[Exp[-λ T](D[(Subscript[M, 1])[T,y],T] - exprIngMϱ𝒱OfM1TμPert  /. Variablesg1M1ϱ1𝒱1EMμPertRule)]) /. pp
(ODEIngMϱ𝒱Ofϱ1μPertEMy = Simplify[Factor[D[(Subscript[ϱ, 1])[y],y] /. Flatten[Solve[D[(Subscript[ϱ, 1])[T,y],y] - exprIngMϱ𝒱Ofϱ1yμPert == 0 /. Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[ϱ, 1])[y],y]]]]]) /. pp
(ODEIngMϱ𝒱Of𝒱1μPertEMy = Simplify[D[(Subscript[𝒱, 1])[y],y] /. Flatten[Solve[D[(Subscript[𝒱, 1])[T,y],y] - exprIngMϱ𝒱Of𝒱1yμPert == 0 /. Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[𝒱, 1])[y],y]]]]) /. pp
(ODEIngMϱ𝒱Ofgbar1μPertEMy = Simplify[D[(Subscript[(OverBar[g]), 1])[y],y] /. Flatten[Solve[D[(Subscript[(OverBar[g]), 1])[T,y],y] - exprIngMϱ𝒱Ofgbar1yμPert == 0 /.Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[(OverBar[g]), 1])[y],y]]]]) /. pp
(ODEIngMϱ𝒱OfMbar1μPertEMy = Simplify[D[(Subscript[(OverBar[M]), 1])[y],y] /. Flatten[Solve[D[(Subscript[(OverBar[M]), 1])[T,y],y] - exprIngMϱ𝒱OfMbar1yμPert == 0 /.Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[(OverBar[M]), 1])[y],y]]]]) /. pp
(algEqnIngMϱ𝒱OfMbar1μPertEM = Simplify[(D[(Subscript[(OverBar[M]), 1])[T,y],T] - exprIngMϱ𝒱OfMbar1TμPert  /. Variablesg1M1ϱ1𝒱1EMμPertRule)]) /. pp
(ODEIngMϱ𝒱Ofϱbar1μPertEMy = Simplify[Factor[D[(Subscript[(OverBar[ϱ]), 1])[y],y] /. Flatten[Solve[D[(Subscript[(OverBar[ϱ]), 1])[T,y],y] - exprIngMϱ𝒱Ofϱbar1yμPert == 0 /. Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[(OverBar[ϱ]), 1])[y],y]]]]]) /. pp
(ODEIngMϱ𝒱Of𝒱bar1μPertEMy = Simplify[D[(Subscript[(OverBar[𝒱]), 1])[y],y] /. Flatten[Solve[D[(Subscript[(OverBar[𝒱]), 1])[T,y],y] - exprIngMϱ𝒱Of𝒱bar1yμPert == 0 /. Variablesg1M1ϱ1𝒱1EMμPertRule,D[(Subscript[(OverBar[𝒱]), 1])[y],y]]]]) /. pp

Reduced system

From the lag eqn for (Subscript[M, ,t]) we need the velocity to be 0.

𝒱bar1SolRuletmp = Flatten[Simplify[Solve[algEqnIngMϱ𝒱OfMbar1μPertEM == 0,(Subscript[(OverBar[𝒱]), 1])[y]]]];
	   𝒱bar1SolRule = Block[{y}, (Subscript[(OverBar[𝒱]), 1]) -> Function @@ List[{y},(Subscript[(OverBar[𝒱]), 1])[y] /.  𝒱bar1SolRuletmp]];
	   ODEReducedgbar1EMMbar1EMϱbar1EM = Table[0,{i,1,3}];
	    (ODEReducedgbar1EMMbar1EMϱbar1EM[[1]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱Ofgbar1μPertEMy /. 𝒱bar1SolRule)]] (Subscript[(OverBar[g]), 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱Ofgbar1μPertEMy /. 𝒱bar1SolRule)]]]) /. pp;
	    (ODEReducedgbar1EMMbar1EMϱbar1EM[[2]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱OfMbar1μPertEMy /. 𝒱bar1SolRule)]] (Subscript[(OverBar[M]), 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱OfMbar1μPertEMy /. 𝒱bar1SolRule)]]]) /. pp;
	    (ODEReducedgbar1EMMbar1EMϱbar1EM[[3]] = Simplify[Denominator[Factor[(ODEIngMϱ𝒱Ofϱbar1μPertEMy /. 𝒱bar1SolRule)]] (Subscript[(OverBar[ϱ]), 1])'[y] - Numerator[Factor[(ODEIngMϱ𝒱Ofϱbar1μPertEMy /. 𝒱bar1SolRule)]]]) /. pp;
	   Clear[ 𝒱bar1SolRuletmp];

ODEReducedgbar1EMMbar1EMϱbar1EM = ODEReducedgbar1EMMbar1EMϱbar1EM /. x -> Function[y,y] /. y -> x;

(Subscript[(OverBar[𝒱]), 1])[y] /. 𝒱bar1SolRule

(reducedPerturbedODEμbar = Flatten[FullSimplify[Solve[ODEReducedgbar1EMMbar1EMϱbar1EM == 0, {(Subscript[(OverBar[g]), 1])'[x], (Subscript[(OverBar[M]), 1])'[x],(Subscript[(OverBar[ϱ]), 1])'[x]}]]]) /. pp

Check that (∂_y)(Subscript[𝒱, 1]) ODE is identically satisfied

tmpRule = D[(Subscript[(OverBar[M]), 1])[y],y] -> ODEIngMϱ𝒱OfMbar1μPertEMy;
tmpLHS = D[(Subscript[(OverBar[𝒱]), 1])[y],y] /. 𝒱bar1SolRule /. exprg0PrimeRule /. exprϱ0PrimeRule /. exprM0PrimeRule /. Λ -> 0 /. tmpRule /. pp// Simplify;
tmpRHS = ODEIngMϱ𝒱Of𝒱bar1μPertEMy /. 𝒱bar1SolRule /. pp // Simplify;
Simplify[tmpLHS == tmpRHS]
Clear[tmpRule,tmpLHS,tmpRHS]

Decouple equations

Here, we find the second order ODE that (Subscript[(OverBar[M]), 1]) must obey.

ϱbar1InTermsofMbar1Prime = Flatten[Solve[((Subscript[(OverBar[M]), 1])'[x] /. reducedPerturbedODEμbar) == (Subscript[(OverBar[M]), 1])'[x],(Subscript[(OverBar[ϱ]), 1])[x]]];
exprM1pp = D[reducedPerturbedODEμbar[[2,2]],x] /. reducedPerturbedODEμbar // Simplify;
Mbar1ppODE =(Subscript[(OverBar[M]), 1])''[x] - (exprM1pp /. (exprM0PrimeRule /. x -> Function[y,y] /. y -> x /. Λ -> 0) /. (exprϱ0PrimeRule /. x -> Function[y,y] /. y -> x /. Λ -> 0) /. μ -> 0  /. ϱbar1InTermsofMbar1Prime)// Simplify
Clear[exprM1pp]

Mbar1ppODESimplifiedtmp = Mbar1ppODE /. (Subscript[g, 0]) -> Function[x,Evaluate[g[x] /. staticSolgMϱVInTermsOfxRule]]/. (Subscript[M, 0]) -> Function[x,Evaluate[M[x] /. staticSolgMϱVInTermsOfxRule]] /.
 (Subscript[ϱ, 0]) -> Function[x,Evaluate[ϱ[x] /. staticSolgMϱVInTermsOfxRule]] // FullSimplify;
Mbar1ppODESimplified = Numerator[Mbar1ppODESimplifiedtmp]
Clear[Mbar1ppODESimplifiedtmp]

Note: we rescale the ODE.

Mbar1ppODESimplifiedInTermsOfχ = Mbar1ppODESimplified (1-κ)^2 κ χ^2/(2 (-1+χ)) /. (Subscript[(OverBar[M]), 1]) -> Function[x,(Subscript[(OverBar[M]), 1])[1-x^2/(Subscript[x, ⋆])^2]] /. x -> (Subscript[x, ⋆]) Sqrt[1-χ] /. (Subscript[x, ⋆]) -> Sqrt[2 κ/(1-κ)] // FullSimplify

Find (Subscript[(OverBar[M]), 1])

tmpRule = DSolve[Mbar1ppODESimplifiedInTermsOfχ == 0,(Subscript[(OverBar[M]), 1])[χ],χ] // Simplify // Flatten
Mbar1xexprtmp = (Subscript[(OverBar[M]), 1])[χ] /. tmpRule;
Clear[tmpRule]

Mbar1ppODESimplifiedInTermsOfχ /. (Subscript[(OverBar[M]), 1]) -> Function[χ, a + b/χ + 1/(κ (1-κ)) χ^(-2/(1-κ)) ((1+κ) χ-2 κ^2)] // Simplify

Now, need to make sure that everything is finite.

atthecenter = Limit[Mbar1xexprtmp, χ -> 1] // Simplify
C2Rule = Solve[atthecenter == 0, C[2]] // Flatten;
Clear[atthecenter]

Mbar1xexpr = Collect[Mbar1xexprtmp /. C2Rule,C[1],Simplify] /. χ -> 1-x^2/(Subscript[x, ⋆])^2
Clear[Mbar1xexprtmp,C2Rule]

For the full perturbation, we need to multiply with a factor of (Subscript[M, 0]). Notice then that the ~ C[1] term is the scaling mode.
Notice also that the full perturbation will not vanish at the surface but will in fact contribute to adding to the total mass by a factor μ (Subscript[x, ⋆]) > 0.

Limit[-χ^(2/(1-κ)) Mbar1xexpr /. x -> (Subscript[x, ⋆]) Sqrt[1-χ], χ-> 0,Assumptions->{0 < κ < 1}]

Plot[-χ^(2/(1-κ)) Mbar1xexpr /. x -> (Subscript[x, ⋆]) Sqrt[1-χ] /. C[1] -> 0 /. κ  -> 1/2,{χ,0,1},AxesLabel->{"χ","(Subscript[M, 0])(Subscript[(OverBar[M]), 1])"}]

In progress for perturbation with generic μ

tmp = ODEReducedg1EMM1EMϱ1EM /. (staticΩ0SolInTermsOfyRule /. g -> (Subscript[g, 0]) /. ϱ -> (Subscript[ϱ, 0]) /. M -> (Subscript[M, 0])) // Simplify;
reducedPerturbedODEμ = Solve[tmp == 0, {(Subscript[g, 1])'[y],(Subscript[M, 1])'[y],(Subscript[ϱ, 1])'[y]}] // Simplify // Flatten
Clear[tmp]

tmp = Flatten[Solve[((Subscript[M, 1])'[y] /. reducedPerturbedODEμ) == (Subscript[M, 1])'[y],(Subscript[ϱ, 1])[y]]];
exprM1pp = D[reducedPerturbedODEμ[[2,2]],y] /. reducedPerturbedODEμ // Simplify;
M1ppODEμ =(Subscript[M, 1])''[y] - exprM1pp /. tmp// Simplify
Clear[tmp,exprM1pp]

Try in terms of χ = (y^(-((1-κ)/κ))), which is the same as for Λ = 0. One of the advantage is that it more clearly shows the regular singular point at y = 1 and also puts y = ∞ at χ = 0, which is easier for power series expansions.

M1ppODEμInTermsOfχ = Simplify[M1ppODEμ/. (Subscript[M, 1]) -> Function[y,(Subscript[M, 1])[y^(-(1-κ)/κ)]] /. y -> χ^(-κ/(1-κ)),{χ > 0, 0 < κ < 1}]

Check here we get back what we should if μ = 0.

check = M1ppODEμ /. μ -> 0 // Simplify
Simplify[check /. (Subscript[M, 1]) -> Function[y,(Subscript[M, 1])[y^(-(1-κ)/κ)]] /. y -> χ^(-κ/(1-κ)),{χ > 0, 0 < κ < 1}]
Clear[check]

Here, we only take the leading order correction in μ. Note that it is probably the case that this does not work close to y -> ∞ (χ = 0) because there, potential (μ^2) terms etc would blow up and therefore not be negligeable.

tmp = Simplify[Series[M1ppODEμ, {μ,0,1}]];
Simplify[tmp /. (Subscript[M, 1]) -> Function[y,(Subscript[M, 1])[y^(-(1-κ)/κ)]] /. y -> χ^(-κ/(1-κ)),{χ > 0, 0 < κ < 1}]

This is a second order ODE with 3 regular singular point and therefore a change of variable should be possible to re-write it in terms of Euler’s hypergeometric differential equation.

tmp2 = Collect[tmp,(Subscript[M, 1])[y],FullSimplify]

theODEForM = Simplify[tmp2 /. (Subscript[M, 1]) -> Function[y,(Subscript[M, 1])[y^(-(1-κ)/κ)]] /. y -> χ^(-κ/(1-κ)),{0 < κ < 1, χ > 0}]

theODEForMSimplified = Collect[χ^(-2/(1-κ)) theODEForM,(Subscript[M, 1])'[χ],Simplify]
Clear[theODEForM]

Multiplying the equation by 4 (κ^(2 ))(χ^2), the ODE reads,

M1pptmp = 4 (1-κ)^2 χ^2 (Subscript[M, 1])''[χ];
M1ptmp = 8 χ^(1-m) ((1-κ)^2 χ^m - μ (1+κ)^2 χ + 4 μ κ) (Subscript[M, 1])'[χ];
M1tmp = 4 κ^2(- (1-κ) λ^2/(2 κ^2 (1-χ)) - μ χ^(1-m)/(4 κ^3 (1-κ) (1-χ)^2) (16 κ^2 (1+κ) / χ - 8 κ (1+κ) (1+5 κ) + 16 κ (1+κ) (1+2 κ) χ - 8 κ (1+κ)^2 χ^2 + (1-κ)^2 λ^2 (- (1-κ) χ + (1+κ) χ^(m-1)-2 κ χ^m))) (Subscript[M, 1])[χ];
theODEForMCondensed = Collect[M1tmp + M1ptmp + M1pptmp,μ,Simplify]
Clear[M1tmp,M1ptmp,M1pptmp]

Verify that this is indeed equivalent to previous ODE,

FullSimplify[4 κ^2 χ^2 theODEForMSimplified-theODEForMCondensed /. m -> 2/(1-κ)]

Very schematically, this ODE looks like (after suppressing all the factors, except for (λ^2), in front of each terms in the numerators),

Collect[λ^2 (Subscript[M, 1])/(χ-1) + χ (Subscript[M, 1])' + χ^2 (Subscript[M, 1])'' + μ χ^(1-m) ((λ^2 (χ+χ^m + χ^(m-1)) + 1/χ + 1 + χ + χ^2) (Subscript[M, 1])/(1-χ)^2 + (1-χ) (Subscript[M, 1])'),μ]

Can also try μ small directly from the linearized equations right away!

Series[(Subscript[g, 1])'[y] /. reducedPerturbedODEμ,{μ,0,1}] // Simplify
Series[(Subscript[M, 1])'[y] /. reducedPerturbedODEμ,{μ,0,1}]// Simplify
Series[(Subscript[ϱ, 1])'[y] /. reducedPerturbedODEμ,{μ,0,1}]// Simplify