Mathematica 9 is now available
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 1995

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

Search the Archive

Problems with DO and TABLE...

  • To: mathgroup at
  • Subject: [mg2092] Problems with DO and TABLE...
  • From: lfreitas at (Luciene Pontes Freitas)
  • Date: Fri, 29 Sep 1995 01:14:31 -0400

Dear Wizards,

I've been tried to evaluate a function I've been called B[n,t,x] with fixed 
n,x and  the parameter 'a', and the variable t in the range [t1,t2] with a 
step st. I tried to do that using two different methods: 
1) The Do command, as you can see in the function P[x,t,t1,t2,st]; 
2) Using a Table, as showed in the function P1[n_,x_,t1_,t2_,st_].

The results I've been found were:

***********   RESULTS   ***************
In[2]:= a:=3.1

In[3]:= P[4,.7,1,2,.2]
B1[4,1,0.7] = {0.79 Second, 0.758841}
B1[4,1.2,0.7] = {0.79 Second, 1.33161}
B1[4,1.4,0.7] = {0.79 Second, 2.49627}
B1[4,1.6,0.7] = {0.79 Second, 4.97146}
B1[4,1.8,0.7] = {0.78 Second, 10.4205}
B1[4,2.,0.7] = {0.78 Second, 22.7483}

In[9]:= P1[4,.7,1,2,.2]

Out[9]= {{0.79 Second, 0.758841}, 
	{0.79 Second, 1.33161},
	{0.79 Second, 2.49627}, 
	{0.8 Second, 4.97146}, 
	{0.79 Second,10.4205},
	{0.78 Second, 22.7483}}

But if I calculate the function B[n,t,x] for each t in the same points 
I've done to the functions P[...] and P1[...] the results are different 
of those ones.
Example: In[3]:= B1[4,1,0.7]
	 Out[3]= {0.85 Second, 0.651}

	 In[4]:= B1[4,1.6,0.7]
	 Out[4]= {0.84 Second, 0.841106}

Which problem could be happening in this calculation?
I'm sure the results above (given by B1[...]) are right.

				Thanks in advance

*********  The definitions used    ******************************









" defining a value to variable 'a', example a:=3.1 "



P[n_,x_,t1_,t2_,st_]:=Do[Print["B1[",n,",",t,",",x,"]"," = ",



  • Prev by Date: strange Integrate[] behavior
  • Next by Date: Re: histogram
  • Previous by thread: strange Integrate[] behavior
  • Next by thread: Is this rule-based solution efficient?