(* Algunas rutinas utiles en Cosmologia *)

HZero:=1/(9.78*10^9) (* Años*)

EdadUniverso[OmegaLambda_,OmegaM_, OmegaR_,h_]:=1/h/HZero*NIntegrate[1/x/Sqrt[OmegaLambda +OmegaM/x^3+OmegaR/x^4+(1-OmegaR-OmegaLambda-OmegaM)/x^2],{x,0,1}]

EdadUniverso[0.75,0.25,0,0.68]

EdadUniversoRedShift[OmegaLambda_,OmegaM_, OmegaR_,h_,z_]:=1/h/HZero*NIntegrate[1/x/Sqrt[OmegaLambda +OmegaM/x^3+OmegaR/x^4+(1-OmegaR-OmegaLambda-OmegaM)/x^2],{x,0,1/(1+z)}]

EdadUniversoRedShift[0.75,0.25,0,0.68,1500]

RedShiftKZero[OmegaLambda_,OmegaM_, OmegaR_,h_,z_]:=NIntegrate[1/x^2/Sqrt[OmegaLambda +OmegaM/x^3+OmegaR/x^4],{x,1/(1+z),1}]*(1+z)*3*10^8/h

Plot[5*Log[RedShiftKZero[0.76,0.24,0,0.64,z]]/Log[10],{z,0.004,1}] (* m-M versus z *)