Model Ziemi (PREM) vs Lane-Emden

(* Wczytanie modelu Ziemi i f. Lane-Endena *)

ClearAll["`*"]

Import["http://th.if.uj.edu.pl/~odrzywolek/aa/Lane-Emden.m"]

prem=Import["http://ds.iris.edu/files/products/emc/data/PREM/PREM_1s.csv"];

ak=Import["http://ds.iris.edu/files/products/emc/data/AK135F/AK135F_AVG.csv"];

dens1=Table[{ak[[-1,1]]-ak[[i,1]],ak[[i,2]]},{i,1,Length[ak]}]//Reverse;

dens=prem[[;;,{1,3}]]//Reverse;

w1=ListPlot[{dens1,dens},Joined->True,PlotStyle->Black]

ρC=dens[[1,2]]

R=dens[[-1,1]]

Manipulate[Show[w1,Plot[ρC w[n][zero[n]r/R]^n,{r,0,R}],ImageSize->600],{{n,1},0,4.5,0.1}]

xt=Join[Table[{r,Rotate[ToString@r,Pi/2]},{r,0,R,1000}],{{6378,"(Subscript[R, ⊕])"}}];

Show[Plot[Evaluate@Table[ρC w[n][zero[n]r/R]^n,{n,1/4,1,1/4}],{r,0,R},PlotStyle->{Cyan,Red,Green,Blue},PlotLegends->{"n=0.25","n=0.5","n=0.75","n=1"}],w1,AxesLabel->{"r [km]","ρ [g/(cm^3)]"},BaseStyle->FontSize->18,Ticks->{xt,Automatic},ImageSize->600]