Units don't match - but units not used?

Units don't match - but units not used? - Some kind of peculiar behavior with units - Messages

#1 Posted: 5/8/2013 3:27:34 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: 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 users liked this post
Davide Carpi 5/23/2013 7:46:00 AM
#2 Posted: 5/23/2013 6:30:56 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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 KiB) downloaded 61 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
Radovan Omorjan 5/23/2013 6:53:00 AM, ioan92 5/23/2013 8:34:00 AM
#3 Posted: 5/23/2013 2:44:12 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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 Posted: 5/23/2013 2:53:34 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: 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 Posted: 5/23/2013 4:49:40 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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 users liked this post
Radovan Omorjan 5/24/2013 12:53:00 AM
  • New Posts New Posts
  • No New Posts No New Posts