for loop less exact or some other issue?

for loop less exact or some other issue? - Messages

#1 Posted: 1/15/2010 12:06:43 PM
Raketenolli

Raketenolli

0 likes in 3 posts.

Group: User

I find that doing a for loop and placing results of a function as elements in a vector, using vector elements as input, does not yield the same results as doing the calculation outside of the for loop:



Is there an accuracy issue or am I completely missing something?

ca[i is not modifying cA. I might as well put 1.1584 for cA, it will give the same results.

Oliver
#2 Posted: 1/15/2010 12:56:54 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Please, can you provide us a file you are working on? I need it because I don't know how you calculate "bF", why "y" is a vector and etc.
#3 Posted: 1/15/2010 12:59:20 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

I can not reproduce this, and do not see anything wrong in your picture (although it is not complete).
Here is the picture:

And the file:
download

Is there any covered region that could not be seen maybe?
Try to delete complete for loop and type it again.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#4 Posted: 1/18/2010 10:36:09 AM
Raketenolli

Raketenolli

0 likes in 3 posts.

Group: User

Reopening the file today, I found that there were parentheses around the 1+\frac{4 SF}{pi bF t[i} that are not visible in the screenshot above.

Now everything works fine.

Oliver
#5 Posted: 1/18/2010 12:06:39 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

I think there might be a bug here. Please look at the picture. It might be a bug or something which is hard to deal with.

I saved and reopened the file but parenthesis did not appear.
On the other hand, if we are not careful with selecting operands we might get the same on the screen but the different results. Here is an example:
This one is:
range(1,3)*2=mat(2,4,6,3,1)
on the screen:
[MATH]range(1;3)*2=mat(2;4;6;3;1)[/MATH]
This one is:
range(1,3*2)=mat(1,2,3,4,5,6,6,1)
on the screen:
[MATH]range(1;3*2)=mat(1;2;3;4;5;6;6;1)[/MATH]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • New Posts New Posts
  • No New Posts No New Posts