Loop and Lost values - The Sequel

• To: mathgroup at smc.vnet.net
• Subject: [mg65499] Loop and Lost values - The Sequel
• From: rondeau at uvic.ca
• Date: Wed, 5 Apr 2006 06:55:42 -0400 (EDT)
• Organization: University of Victoria
• Sender: owner-wri-mathgroup at wolfram.com

```A sequel to my previous message concerning lost values when I ran a For[]
loop.  I now run a similar program, but with a series of Do[] commands. This
time, I can list the results, but some of them will not show up when I try
to Print them. I really can't figure this out!

Do[sol1[t1]=NDSolve[{x'[t]?0.001*x[t],x[0]?1},{x},{t,0,10}],{t1,94.8,94.999,0.001}];
Do[xt[t1]=Interpolation[Table[Flatten[{t,x[t]/.sol1[t1]}],{t,0,10}]],{t1,94.8,94.999,0.001}];
Do[xt[t1][s],{t1,94.8,94.999,0.001}];

For[t1=94.8,t1<94.81,t1=t1+0.001,Print[{t1,xt[t1][3.2]}]];
{94.8,1.00321}
{94.801,1.00321}
{94.802,1.00321}
{94.803,1.00321}
{94.804,xt[94.804][3.2]}
{94.805,xt[94.805][3.2]}
{94.806,xt[94.806][3.2]}
{94.807,xt[94.807][3.2]}
{94.808,xt[94.808][3.2]}
{94.809,xt[94.809][3.2]}

Table[{t1,xt[t1][3.2]},{t1,94.8,94.81,0.001}]
{{94.8,1.00321},{94.801,1.00321},{94.802,1.00321},{94.803,1.00321},{94.804,1.00321},{94.805,1.00321},{94.806,1.00321},{94.807,1.00321},{94.808,1.00321},{94.809,1.00321},{94.81,1.00321}}

```

• Prev by Date: Re: StringForm bug?
• Next by Date: Re: Transformstion to canonical form
• Previous by thread: Re: StringForm bug?
• Next by thread: Re: Loop and Lost values - The Sequel