for loop less exact or some other issue?

for loop less exact or some other issue? - Сообщения

#1 Опубликовано: 15.01.2010 12:06:43
Raketenolli

Raketenolli

0 сообщений из 3 понравились пользователям.

Группа: 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 Опубликовано: 15.01.2010 12:56:54
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3730 понравились пользователям.

Группа: 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 Опубликовано: 15.01.2010 12:59:20
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 18.01.2010 10:36:09
Raketenolli

Raketenolli

0 сообщений из 3 понравились пользователям.

Группа: 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 Опубликовано: 18.01.2010 12:06:39
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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!"
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений