Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Loop and Lost values - The Sequel

  • To: mathgroup at
  • Subject: [mg65542] Re: Loop and Lost values - The Sequel
  • From: "Valeri Astanoff" <astanoff at>
  • Date: Thu, 6 Apr 2006 06:53:21 -0400 (EDT)
  • References: <e108u4$lia$>
  • Sender: owner-wri-mathgroup at

To my mind the trouble is that, implicitly,
you test floating point values for equality,
which is usually not recommended.

Assuming the equation depends on t1,
you could, for example, proceed this way :

t1[i_Integer] = 94.8+0.001*i;

Do[eq = {x'[t]==0.001*x[t]*t1[i], x[0]==1};
   sol = NDSolve[eq,{x},{t,0,10}];
   xt[i] = Interpolation[Table[{t,x[t]/.sol//First},{t,0,10}]],

Do[Print[{t1[i], xt[i][3.2]}], {i,0,9}]




  • Prev by Date: Re: Count Function
  • Next by Date: Sphere
  • Previous by thread: Loop and Lost values - The Sequel
  • Next by thread: Re: Transformstion to canonical form