divide by zero error

divide by zero error - Poruke

#1 Objavljeno: 31. 1. 2020. 09:46:08
Ale16595

Ale16595

0 svidjanja u 35 postova.

Grupa: 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) preuzeto 1223 put(ova).
#2 Objavljeno: 31. 1. 2020. 10:11:20
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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 Objavljeno: 31. 1. 2020. 12:14:51
Ale16595

Ale16595

0 svidjanja u 35 postova.

Grupa: 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) preuzeto 1307 put(ova).
#4 Objavljeno: 31. 1. 2020. 12:54:54
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

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

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: 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) preuzeto 1307 put(ova).


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 Objavljeno: 31. 1. 2020. 14:30:34
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: 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) preuzeto 1227 put(ova).
  • Novi postovi
  • Nema novih postova