divide by zero error

divide by zero error - Messaggi

#1 Pubblicato: 31/01/2020 09:46:08
Ale16595

Ale16595

0 apprezzamenti in 35 post.

Gruppo: 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,83 KiB) scaricato 1195 volta(e).
#2 Pubblicato: 31/01/2020 10:11:20
Radovan Omorjan

Radovan Omorjan

325 apprezzamenti e 1 disapprezzamenti in 2.052 post.

Gruppo: 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 Pubblicato: 31/01/2020 12:14:51
Ale16595

Ale16595

0 apprezzamenti in 35 post.

Gruppo: 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,07 KiB) scaricato 1284 volta(e).
#4 Pubblicato: 31/01/2020 12:54:54
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

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

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: 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,07 KiB) scaricato 1284 volta(e).


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.

Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#6 Pubblicato: 31/01/2020 14:30:34
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: 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,94 KiB) scaricato 1200 volta(e).
  • Nuovi post
  • Nessun nuovo post