← Back to team overview

yade-users team mailing list archive

Re: [Question #289662]: ZeroDivisionError: float division by zero

 

Question #289662 on Yade changed:
https://answers.launchpad.net/yade/+question/289662

Jérôme Duriez proposed the following answer:
Hi Jabrane,

The error says "Division by 0" thus it means Yade has at one point to
divide by 0 and obviously it can not handle that. The error also says
this division by 0 happens when such operation is made:

E+=0.5*(i.phys.normalForce.squaredNorm()/i.phys.kn +
i.phys.shearForce.squaredNorm()/i.phys.ks)

=> Yade encountered either one zero i.phys.kn, or one zero i.phys.ks.

The solution is for you to modify your mechanical parameters to avoid this, or to modify the use of your elastic energy formula. An interaction with zero stifness has certainly zero force hence zero elastic energy. No need to try "0/0" to obtain 0.
You could check all this asking Yade to give you more details when it faces a zero kn or ks (which interaction ? between who and who ?...)


As a general remark, your problem has been without solutions for 2 weeks now, which might have been disappointing to you. If you would like to improve you chances getting help, please do your best to improve a lot your question compared with this one, in the "minimal working script" direction : honestly, I think very few Yade users test the script of others when they are more than few lines long. In any case, here with your scripts and this 20 000 lines long .sphere files, it seems noone did it. 

It would have been straightforward for you to remove all the commented
lines from the script, or everything what concerns colors, or also to
state directly that "identifBis.py" is taken directly from the trunk
version (or to state the differences, if any).


It would much much more entice people to give a close look to your problem (and make it much easier).

Jerome

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.