Forces in stack of axis (beam)

This notebook goes together with Basics : Forces

from DAVE import *
from DAVE.jupyter import *
Equilibrium-core version = 2.1
default resource folders:
c:\python\miniconda3\envs\book\lib\site-packages\DAVE\resources
C:\Users\beneden\DAVE_models
C:\data\Dave\Book\DAVE-book\DAVE-notebooks
Blender found at: C:\Program Files\Blender Foundation\Blender 2.93\blender.exe
embedWindow(verbose=True): could not load ipyvtk_simple try:
> pip install -U git+https://github.com/Kitware/ipyvtk-simple.git
s = Scene()
a = s.new_frame('axis_0')
for i in range(10):
    a = s.new_frame(f'axis_{i+1}', parent = a, position = (1,0,0))
p = s.new_point('point',parent=a)
f = s.new_force('force', parent = p)
f.force = (0,0,-5)
show(s, camera_pos = (7.120972238813686, -15.59726683922203, 0.7170462426406728), lookat = (5.597812229842809, 5.030382818599853, -0.31770605518614115))
../_images/force_traveling_through_a_beam_8_0.png
s.print_node_tree()
axis_0 [Frame]
 |-> axis_1 [Frame]
 |    |-> axis_2 [Frame]
 |    |    |-> axis_3 [Frame]
 |    |    |    |-> axis_4 [Frame]
 |    |    |    |    |-> axis_5 [Frame]
 |    |    |    |    |    |-> axis_6 [Frame]
 |    |    |    |    |    |    |-> axis_7 [Frame]
 |    |    |    |    |    |    |    |-> axis_8 [Frame]
 |    |    |    |    |    |    |    |    |-> axis_9 [Frame]
 |    |    |    |    |    |    |    |    |    |-> axis_10 [Frame]
 |    |    |    |    |    |    |    |    |    |    |-> point [Point]
 |    |    |    |    |    |    |    |    |    |    |    |-> force [Force]

Update() calculates the forces in the model

s.update()

Get all the axis-type nodes from the scene.

For each of them, obtain the global positon, shear and the moment about the y-axis.

From this we can plot the moment and shear lines of the beam.

x = []
my = []
fz = []

for a in s.nodes_of_type(Frame):
    x.append(a.global_position[0])
    fz.append(a.applied_force[2])# python is zero based, so 0=fx, 1=fy, 2=fz, 3=mx, 4=my
    my.append(a.applied_force[4])  

And now plot them

import matplotlib.pyplot as plt
plt.plot(x,my, label = 'my')
plt.plot(x,fz, label = 'fz')
plt.legend()
plt.xlabel('position [m]')
plt.ylabel('moment [kN*m] or force [kN]');
../_images/force_traveling_through_a_beam_16_0.png

The equilibrium error

Release the connection of axis_6 about the Y-axis

s['axis_6'].fixed = (True,True,True,True,   False,   True)

Updating the model will calculate the forces the for current positions and rotations but will not solve statics. So an equilibrium error will be present about the released dof of axis_6

s.update()
s['axis_6'].equilibrium_error
(0.0, 0.0, 0.0, 0.0, 20.0, 0.0)

If we solve the model then the geometry will be updated such that the equilibrium errors are all zero.

s.solve_statics()
Solved to 7.313e-05 kN
True
s['axis_6'].equilibrium_error
(0.0, 0.0, 0.0, 0.0, -7.313395007368939e-05, 0.0)
show(s, camera_pos = (7.120972238813686, -15.59726683922203, -2.7170462426406728), lookat = (5.597812229842809, 5.030382818599853, -2.31770605518614115), force_normalize = True, force_scale = 1.6, cog_scale = 0.25)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-19-4716286446f2> in <module>
----> 1 show(s, camera_pos = (7.120972238813686, -15.59726683922203, -2.7170462426406728), lookat = (5.597812229842809, 5.030382818599853, -2.31770605518614115), force_normalize = True, force_scale = 1.6, cog_scale = 0.25)

TypeError: show() got an unexpected keyword argument 'force_normalize'