JWock82 / Pynite

A 3D structural engineering finite element library for Python.
MIT License
454 stars 93 forks source link

RuntimeWarning: divide by zero encountered in double_scalars #177

Closed omar-alzeer closed 10 months ago

omar-alzeer commented 10 months ago

Hello

When i want to display diagrams, it it gives this warning. I searched that this warning belongs to numpy library, so i don't know how to get rid of this annoying warning.

please help!

from PyNite import FEModel3D

beam = FEModel3D()

beam.add_node('N1', 0, 0, 0)
beam.add_node('N2', 168, 0, 0)

E = 29000       # Modulus of elasticity
G = 11200       # Shear modulus of elasticity
nu = 0.3        # Poisson's ratio
rho = 2.836e-4  # Density
beam.add_material('Steel', E, G, nu, rho)

beam.add_member('M1', 'N1', 'N2', 'Steel', 100, 150, 250, 20)

# Provide simple supports
beam.def_support('N1', True, True, True, False, False, False)
beam.def_support('N2', True, True, True, True, False, False)

beam.add_member_dist_load('M1', 'Fy', -200/1000/12,
-200/1000/12, 0, 168,"D")

beam.add_load_combo("my comb",{"D":1})

beam.analyze()

# Print the shear, moment, and deflection diagrams
beam.Members['M1'].plot_moment('Mz',"my comb")
beam.Members['M1'].plot_shear('Fy',"my comb")
beam.Members['M1'].plot_deflection('dy',"my comb")

print('Left Support Reaction:', beam.Nodes['N1'].RxnFY, 'kip')
print('Right Support Reacton:', beam.Nodes['N2'].RxnFY, 'kip')
JWock82 commented 10 months ago

I’ll have a look

omar-alzeer commented 10 months ago

I noticed that when i run it on "Windows" it doesn't give any warning. but when i run it on "Android" using Pydroid app (which support running matplotlib graphs and Tkinter GUI) it gives me this warning.

So don't worry i think this warning appears because of the difference in hardware between PCs and Phones.