Units don't match - but units not used?

Units don't match - but units not used? - Some kind of peculiar behavior with units - Сообщения

#1 Опубликовано: 08.05.2013 03:27:34
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello,

I would like someone to try to reproduce this (v.096 Stable and Night Build).

-Open both files "No_units_used.sm" and "Units_dont_mathc.sm" in the same instance of SMath using File|Open (not doubleclick on them)
-Then just recalculate. The strange "Units don't match" error will appear on the "Units_dont_mathc.sm". Look at the pictures please.
-If you open only the "Units_dont_mathc.sm" then everything is OK.
-If you just open only "Units_dont_mathc.sm" everything is Ok. Therefore, it seems that "No_units_used.sm" is the cause of problem.

In those files there are no units used (or at least I am not aware of that)

Regards,
Radovan
Units_dont_match-wrong.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Davide Carpi 23.05.2013 07:46:00
#2 Опубликовано: 23.05.2013 06:30:56
Davide Carpi

Davide Carpi

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

Группа: Moderator

Just to update this thread...

Here there is a file made with SMath 0.95 (1st screenshot) by omorr; the example show the bug directly (no needs to open a couple of files) in the root() function (SMath 0.96.4884 - 2nd screenshot) but I've noticed the same issue trying solving this problem using my Nonlinear Solvers, so I suppose it's something deep outside the root() code...


best regards,

w3b5urf3r
Primer44w-1.sm (30 КиБ) скачан 61 раз(а).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 пользователям понравился этот пост
Radovan Omorjan 23.05.2013 06:53:00, ioan92 23.05.2013 08:34:00
#3 Опубликовано: 23.05.2013 14:44:12
Davide Carpi

Davide Carpi

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

Группа: Moderator

Wrote

I've noticed the same issue trying solving this problem using my Nonlinear Solvers



After a little "debug session" using the Nonlinear Solvers Broyden() function as reference, seems that the issue is related to the eval function ...

I attach here a screenshot of the code.. at the first loop the variables are those shown in the 2nd screenshot; the stack function doesn't cause issues, but enabling/disabling the eval the error disappear (at least for this piece of code)...

Hope this will be useful for Andrey


best regards,

w3b5urf3r
SMath Studio - [Primer44w-1.sm].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Опубликовано: 23.05.2013 14:53:34
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Hello w3b5urf3r,

Try this please.

- Use the recent v0.96.4884. Open the sm file from this post ( broyden-method.sm ). Everything should be fine. Than close it.

- Open the above mentioned file ( Primer44w-1.sm ), then open ( broyden-method.sm ). Now, ( broyden-method.sm ) will fail with "Units don't match" (units wern't used).

- Now,without closing either of the two files, remove eval() from ( broyden-method.sm ) in the function definition - three commands

[MATH=eng]h:eval(-B*f(x0))[/MATH]

[MATH=eng]z:eval(f(x)-f(x0))[/MATH]

[MATH=eng]B:eval(B-{(B*z-h)*transpose(h)*B}/el((transpose(h)*B*z),1))[/MATH]

Now, function call will work and the results will be obtained. But, strangely, you can not get the numerical values of the function f(), only symbolical - see the first picture please.

Save the corrected ( broyden-method.sm )and close SMath. Reopen SMath and open just ( broyden-method.sm ). Now, everyrhing is fine (the second picture)

Regards,
Radovan
Broyden-fine.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Опубликовано: 23.05.2013 16:49:40
Davide Carpi

Davide Carpi

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

Группа: Moderator

Confirmed (by opening the files in the same instance of SMath using File|Open or by dragging the 2nd file on the canvas); this confirms in some way the eval() role in this bug...

best regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Radovan Omorjan 24.05.2013 00:53:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений