Re: double loop
- To: mathgroup at smc.vnet.net
- Subject: [mg113013] Re: double loop
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Mon, 11 Oct 2010 05:15:27 -0400 (EDT)
- References: <i8s5f9$93p$1@smc.vnet.net>
Well, a few bugs and/or omissions: 1. SQRT should be Sqrt and be using square brackets and no parenthesis 2. Dataspectrum is undefined 3. AppendTo[DataGood, {EisonewOm, Lx, z, idGRB, Om, O}], contains a undefined variable O which is also a reserved Mathematica symbol 4. AppendTo[LxOmegaM, {Om, Ol, CLxEiso}], contains the undefined variable Ol 5. second to last line: Flatten[LxOmegalambda, 2] doesn't do anything because you don't assign the results to a variable Cheers -- Sjoerd On Oct 10, 12:44=C2 pm, maria giovanna dainotti <mariagiovannadaino... at yahoo.it> wrote: > Dear All, > I cleared up the notebook but when I plot the picture I don't recover the > contour plot desidered.=C2 The colours should be the different correla= tion > coefficient and it is not the case. > I will be grateful if you could help > Maria > =C2 > h=0.71 > ckms=299792.5 > HubE[z_,Om_,Ol_]:=SQRT(Om*(1+z)^3+Ol)dL[z_,Om_,Ol_,h_]:=3.0856*1018*1= 06*ckms/(100*h)*(1+z)*NIntegrate[1/HubE[z,Om,Ol],{z,0,z},MaxRecursion > > ->100] > TabOmegalambda=Table[i,{i,0.1,1.1,0.05}] > TabOmegaM=Table[i,{i,0.0,1.0,0.05}] > LxOmegalambda={}; > Do[ > Ol=TabOmegalambda[[k]]; > LxOmegaM={}; > Do[ > Om=TabOmegaM[[j]]; > DataGood={}; > Do[ > idGRB=Dataspectrum[[i,1]]; > z=Dataspectrum[[i,2]]; > Espectrum=Dataspectrum[[i,3]]; > Fx=Dataspectrum[[i,4]]; > beta=Dataspectrum[[i,5]]; > EisonewOm=4*p*dL[z,Om,Ol,h]2*(1+z)-2*Espectrum; > Lx=4*p*dL[z,Om,Ol,h]2*(1+z)-(1+beta)*Fx; > AppendTo[DataGood,{EisonewOm,Lx,z,idGRB,Om,O=EF=81=AC}],{i,1,Length[Datas= pectrum]}]; > CLxEiso=N[Correlation[DataGood[[All,1]],DataGood[[All,2]]]]; > AppendTo[LxOmegaM,{Om,Ol,CLxEiso}],{j,1,Length[TabOmegaM]}]; > If[Ol+Om<2.2,AppendTo[LxOmegalambda,{LxOmegaM}]],{k,1,Length[TabOmegalamb= da]}] > Flatten[LxOmegalambda,2] > ListContourPlot[Flatten[LxOmegalambda,2],PlotRange > ->All,FrameLabel > ->{"Omega_M ","Omega_lambda"}]