Calculation error with vector and for loop

Calculation error with vector and for loop - Messages

#1 Posted: 2/7/2025 1:21:47 AM
Chia

Chia

0 likes in 1 posts.

Group: User

Hello, I'm having a problem with this file.

The value of Mab(x) within the Mab vector is different from the same Mab(x) outside the vector.
What could be the reason? I tried both manually creating the vector and with "for" loop iteration.

I've attached an screenshot and the .sm file.

Thanks!

calculation error smath mab.sm (194 KiB) downloaded 64 time(s).

Captura de pantalla 2025-02-06 141701.png
#2 Posted: 2/8/2025 12:05:59 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hola Julián. Hovering over an expression shows the result that SMath stores. So, this is the value of Ma, which depends on Re, which is defined later.

Ma.png


So this is what is stored in Ma(x).

Mab(x).png

Apparently there would be some kind of recurrence since Ma(x) depends on Ma, which depends on Re and Re depends on Ray and ... well, I don't see the problem with recurrence, but SMath evidently has some kind of problem, which I don't know what it could be, but I guess that there is some "unstable" recurrence there.

If you define Ma after Re, the problems would be solved:

Ma2.png

Mab(x)2.png

end.png

calculation error smath mab 2.sm (192 KiB) downloaded 60 time(s).

Best regards.
Alvaro.
  • New Posts New Posts
  • No New Posts No New Posts