MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

double loop do

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112858] double loop do
  • From: maria giovanna dainotti <mariagiovannadainotti at yahoo.it>
  • Date: Mon, 4 Oct 2010 06:04:10 -0400 (EDT)

Dear Mathgroup,

I have a problem with a double loop. Formally it doesn't give any error message but it doesn't let Om variate in the loop, it takes only the first value 0.1. 

This is the code
ckms=299792.5HubE[z_,Om_]=(Om*(1+z)^3+(1-Om))^1/2dL[z_,Om_,h_]:=3.0856*1018*106*ckms/(100*h)*(1+z)*NIntegrate[1/HubE[xh=0.71TabOmegaM=Table[j,{j,0.0,1.0,0.01}]

LxOmegaM={};
Do[
Om=TabOmegaM[[j]];
DataGood={};
Do[
logTarest=DataGRB[[i,7]];
logTaErrrest=DataGRB[[i,8]];
Fx=DataGRB[[i,3]];
FxErr=DataGRB[[i,4]];
idGRB=DataGRB[[i,1]];
DataGRB[[i,2]];
class=DataGRB[[i,12]];
beta=DataGRB[[i,5]];
dbeta=DataGRB[[i,6]];
Lx=4*dLx=Lx*\[Sqrt]((FxErr/Fx)2+(Log[1+z])2*dbeta2);
logLx=Log[10,Lx];
dlogLx=dLx/(Lx*Log[10]);
If[\[Sqrt]((dlogLx)2+(logTaErrrest)2)<4 ,
AppendTo[DataGood,{logTarest,logTaErrrest,logLx,dlogLx,beta,dbeta,z,idGRB,class,Om}]],{i,1,Length[DataGRB]},{j,1,Length[TabOmegaM]}];

CLxTa=N[SpearmanRankCorrelation[DataGood[[All,1]],DataGood[[All,3]]]];
AppendTo[LxOmegaM,{CLxTa,logLx,Om,Length[DataGood]}],{j,1,Length[TabOmegaM]}]

Then I tried putting in Lx Om[[j]] to let Om variate, but in this case I got the following error message:Part::partd: Part specification 0.[[NIntegrate::inumr: 
The integrand 1/[1/HubE[x,Om],{x,0,z},MaxRecursion ->100] has evaluated to 
non-numerical values for all sampling points in the region with boundaries]{{0,1.29}}

I would be really very grateful if you could help me.

Cheers,

Maria


  • Prev by Date: Re: PSE Example 8.6 via Reduce
  • Next by Date: What assumptions to use to check for orthogonality under integration?
  • Previous by thread: Re: PSE Example 8.6 via Reduce
  • Next by thread: Re: double loop do