Augmented matrix - unexpected SMath behaviour

Augmented matrix - unexpected SMath behaviour - Miscalculation of augmented matrix? - Messages

#1 Posted: 7/19/2021 6:17:15 PM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Dear all,

I'm currently writing a basic cam profile generation program in SMath, see attachment below.
Today, I encountered a behaviour I can't explain:
* On the last page, I create some X and Y values
* For some reason, the calculated values in the augmented XY matrix are not correctly calculated
However, calculation is correct when I add an extra field that has nothing to do with the actual calculation (field marked in red)

What happens here?
* SMath error?
* Programming error on my side?

Thanks in advance for any feedback, I love SMath and I would like to finish the program.

Kind regards from Belgium,

Jan

Cam engine - problem.sm (73 KiB) downloaded 62 time(s).
#2 Posted: 7/19/2021 7:35:50 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Hi Jan. The problem is that SMath try to eval functions starting with if to true or false. You can prevent that behavior with line( ), as in the attached.

Cam engine - problem.sm (73 KiB) downloaded 67 time(s).

Best regards.
Alvaro.
1 users liked this post
janclaeys 7/20/2021 4:42:00 AM
#3 Posted: 7/20/2021 4:45:07 AM
Jan Claeys

Jan Claeys

2 likes in 25 posts.

Group: User

Hi Alvaro,

Thank you very much for your feedback!
This is certainly something I wouldn't have discovered by myself: muchly appreciated!

p.s. the program isn't ready: the formulas at the last page don't create the required cam profile yet, working on it ;-)

Kind regards,

Jan
  • New Posts New Posts
  • No New Posts No New Posts