for loop less exact or some other issue?

for loop less exact or some other issue? - Poruke

#1 Objavljeno: 15. 1. 2010. 12:06:43
Raketenolli

Raketenolli

0 svidjanja u 3 postova.

Grupa: 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 Objavljeno: 15. 1. 2010. 12:56:54
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: 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 Objavljeno: 15. 1. 2010. 12:59:20
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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 Objavljeno: 18. 1. 2010. 10:36:09
Raketenolli

Raketenolli

0 svidjanja u 3 postova.

Grupa: 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 Objavljeno: 18. 1. 2010. 12:06:39
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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!"
  • Novi postovi
  • Nema novih postova