Closed sitadrost closed 4 years ago
Hmm.. this is a strange bug indeed. I noticed that at 43/ 44 elements the eigenvalues of the reduced system matrix suddenly become negative. I don't really understand how / why this happens? I would need some research or help on that part.
Thanks for getting back, sorry, I nearly forgot about this. I'd be happy to help if I can, what exactly do you need?
Need some help to understand why the eigenvalues become negative. Is this a bug in the code, or is this a property of a system matrix with too many nodes?
Ah, I see. I'll try to have a look when I have time
As one possible path to pursue, I've spotted this error before when elements are too small as an absolute length number. For example, note in the above script, if you replace:
ss.add_multiple_elements([[0, 0], [10, 0]], Ne)
with
ss.add_multiple_elements([[0, 0], [1000, 0]], Ne)
and run it again with 100 elements, it will run perfectly happily.
My wrapper script for running anaStruct limits the minimum size of elements, and we stopped encountering this. I'd suspect that there's a numerical instability, perhaps related to floating point roundoff error, occurring somewhere in the code? I have no idea where though - I can try to have a poke at some point as well.
Has it to do with the ratio of the element size and the force magnitudes? I can image that thos influence the final eigenvalues of the stiffness matrix. When it is a linear calculation, we can probably do a calculation with a unit load and upscale the results afterwards.
Ah - got it! It's specifically a bug with the add_multiple_elements()
function, and it is indeed hitting a floating point roundoff issue. That is that, with small float values, n*(length/n) == length
is not necessarily true.
Running sitadrost's original example with Ne=100
, there were actually 101 elements created in which the following occurred:
[el.l for el in ss.element_map.values()]
# [0.10000000149011612, ..., 0.10000000149011612, 1.9073486328125e-06]
That relatively much smaller element at the end there was causing the global stiffness matrix's condition number to explode (into the 1e17+ range), and the eigenvalues to go crazy.
@ritchie46 : I'll PR a fix to this momentarily. It also might be worth adding a warning if the condition number of the reduced system matrix becomes too large and/or if the relative lengths of elements varies too much.
Hi Ritchie,
I just installed anaStruct, and so far I like it a lot, so thanks for sharing! However, when playing around with a simple cantilever beam case, I'm running into a number of errors that I don't quite understand, so I was hoping you could give some explanation.
So here's my toy problem:
With the values of Ne and F_y used above, everything goes fine with the linear solver (I'll get to the geometrical_non_linear later on). However, if I increase Ne to, say, 100, ss.solve() gives me this error:
Solving the same problem (i.e. Ne = 10, Fy = 10) with geometrical_non_linear set to True results in the following error (independent of whether I add extra discretisation, e.g. discretize_kwargs=dict(n=20)):
Can you explain what's causing these errors?
Many thanks, Sita
P.S. I just noticed my code might be a bit unclear/misleading, so to clarify: I'm using either ss.solve() or ss.solve(geometrical_non_linear = True), not both in one go.