divide by zero error

divide by zero error - Messages

#1 Posted: 1/31/2020 9:46:08 AM
Ale16595

Ale16595

0 likes in 35 posts.

Group: User

Hello to all.
I have a problem with the Smath function "dn_GearsBDF", it blocks the operation since giving me division by zero error.
psi.png

How can I overcome this problem? MANOVRA (con parametri moto).sm (78 KiB) downloaded 36 time(s).
#2 Posted: 1/31/2020 10:11:20 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

In dn_GearsBDF(init,0,end,100,D(x,Y)) replace zero with a small positive number (say 10^-10)

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 1/31/2020 12:14:51 PM
Ale16595

Ale16595

0 likes in 35 posts.

Group: User

Hi, thanks for the reply.
Instead if I have an error like: "value too big or too small for an Int32", how can I solve it?
Every time this error appears the program stops.
error.png

MANOVRA slalom (cinematica).sm (45 KiB) downloaded 29 time(s).
#4 Posted: 1/31/2020 12:54:54 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Always separate text from image or *.sm document,
as you did: can't reply quote !
#5 Posted: 1/31/2020 1:12:46 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Hi, thanks for the reply.
Instead if I have an error like: "value too big or too small for an Int32", how can I solve it?
Every time this error appears the program stops.
error.png

MANOVRA slalom (cinematica).sm (45 KiB) downloaded 29 time(s).


10^10 was probably too small, you have to see, how small x can be for your derivative ψ''(x) still being defined. 0.01 works.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Posted: 1/31/2020 2:30:34 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... doctoring starts at red ... observe removing 10^14 at some trig [0].
lot more cleanup below ... can you write λ instead of l

MANOVRA slalom (cinematica).sm (52 KiB) downloaded 32 time(s).
  • New Posts New Posts
  • No New Posts No New Posts