anaStruct
anaStruct copied to clipboard
Moment in hinge
In the following structure I have an hinge (between element 2 and 3) and the moment should be zero, which is not. Am I doing something wrong? Thanks
from anastruct import SystemElements import matplotlib.pyplot as plt plt.ion()
ss = SystemElements()
a = 4 b = 4 c = 2 d = 2 e = 4 h1 = 4 h2 = 3
F1 = 10
ss.add_element(location=[[0, 0], [a, 0]]) ss.add_element(location=[[a, 0], [a+b, 0]], string={2:0}) ss.add_element(location=[[a+b, 0], [a+b+c, 0]], string={1:0}) ss.add_element(location=[[a+b+c, 0], [a+b+c+d, 0]]) ss.add_element(location=[[a+b+c+d, 0], [a+b+c+d+e, 0]])
ss.add_truss_element(location=[[0, 0], [0, h1 + h2 ]]) ss.add_truss_element(location=[[a, 0], [a, h2]]) ss.add_truss_element(location=[[a+b+c+d, 0], [a+b+c+d, h2]]) ss.add_truss_element(location=[[a+b+c+d+e, 0], [a+b+c+d+e, h1 + h2 ]])
ss.add_truss_element(location=[[a, h2], [a+b+c+d, h2]]) ss.add_truss_element(location=[[0, h1+h2], [a+b+c+d+e, h1+h2]])
ss.add_truss_element(location=[[0, h1+h2], [a, h2]]) ss.add_truss_element(location=[[a+b+c+d, h2], [a+b+c+d+e, h1+h2]])
ss.add_support_roll(node_id=1, direction=2) ss.add_support_roll(node_id=6, direction=2) ss.add_support_roll(node_id=7, direction=1)
ss.point_load(Fx= 0.0, Fy=-F1, node_id=4)
ss.show_structure()
ss.solve()
ss.show_reaction_force()
ss.show_axial_force()
ss.show_shear_force()
ss.show_bending_moment()
print(ss.get_element_results(element_id=0, verbose=False))
And it happens also in a very simple structure such as the following. It computes the structure ignoring the hinge (between element 1 and element 2)
from anastruct import SystemElements ss = SystemElements() ss.add_element(location=[[0, 0], [4, 0]], string={2:0}) ss.add_element(location=[[4, 0], [7, 0]], string={1:0}) ss.add_support_hinged(node_id=1) ss.add_support_fixed(node_id=3) ss.q_load(element_id=1, q= -5) ss.show_structure() ss.solve() ss.show_reaction_force() ss.show_axial_force() ss.show_shear_force() ss.show_bending_moment()
Probably the same bug as #44 . There's definitely something wrong with the handling of internal hinges in the code.
Oh - @ggatti54 - actually, this isn't a bug. Your scripts have a typo. The parameter that creates the hinge is spring
, not string
. Replace the relevant lines in your code with this and you should see the hinge created:
ss.add_element(location=[[0, 0], [4, 0]], spring={2:0})
ss.add_element(location=[[4, 0], [7, 0]], spring={1:0})
Hi! Thanks for your reply. Sorry for the typo, but also with spring={} instead of string=[] the simple structure:
from anastruct import SystemElements ss = SystemElements() ss.add_element(location=[[0, 0], [4, 0]], spring={2:0}) ss.add_element(location=[[4, 0], [7, 0]], spring={1:0}) ss.add_support_hinged(node_id=1) ss.add_support_fixed(node_id=3) ss.q_load(element_id=1, q= -5) ss.show_structure() ss.solve() ss.show_reaction_force() ss.show_axial_force() ss.show_shear_force() ss.show_bending_moment()
gives a stability error, which shall not be the case. I have used a workaround, by putting a very short truss element instead of the hinge, and it gives the correct results:
from anastruct import SystemElements ss = SystemElements()
ss.add_element(location=[[0, 0], [4-0.0001, 0]]) ss.add_truss_element(location=[[4-0.0001,0], [4,0]]) ss.add_element(location=[[4, 0], [7, 0]])
ss.add_support_hinged(node_id=1) ss.add_support_fixed(node_id=4)
ss.q_load(element_id=1, q= -5)
ss.show_structure() ss.solve() ss.show_reaction_force() ss.show_axial_force() ss.show_shear_force() ss.show_bending_moment()
I have tried other examples and it works with the workaround approach but not with the spring={} qualifier.
Best regards
Hi @ggatti54 - sorry for the difficulty. However, could you make sure that you're synced with the most recent version of anaStruct from GitHub here? I'm able to run the top script you've quoted in your latest comment here with no error and at least looking like the correct results (though I haven't actually checked the math to verify numbers):
Hi!
Thanks. Very strange: I get the same results but only with the truss workaround. If I run the code with the spring={} qualifiers I get:
FEMException: ('StabilityError', 'The eigenvalues of the stiffness matrix are non zero, which indicates a instable structure. Check your support conditions')
I think I am using the latest instruct version, but I will check it now again.
Kind regards
On Tue, Jan 19, 2021 at 8:19 AM Brooks Smith [email protected] wrote:
Hi @ggatti54 https://github.com/ggatti54 - sorry for the difficulty. However, could you make sure that you're synced with the most recent version of anaStruct from GitHub here? I'm able to run the top script you've quoted in your latest comment here with no error and at least looking like the correct results (though I haven't actually checked the math to verify numbers): [image: image] https://user-images.githubusercontent.com/42363318/105000536-9101e180-5a82-11eb-995e-8fe6796fa9bc.png [image: image] https://user-images.githubusercontent.com/42363318/105000589-9f4ffd80-5a82-11eb-9132-950b55be1b2c.png [image: image] https://user-images.githubusercontent.com/42363318/105000605-a37c1b00-5a82-11eb-9bcf-24a97c3ab24d.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ritchie46/anaStruct/issues/69#issuecomment-762651803, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASJ7NU3RTYCMY5PT7C765TTS2UW6NANCNFSM4VPEWGWA .
-- Giuliano Gatti
I confirm that I am using the latest version.
Thanks
Closing due to being unable to reproduce. I suspect the difference might have been using the master
anastruct versus using the pypi version (which had not yet been updated). Please reopen if you can still reproduce this!