Closed robbievanleeuwen closed 2 years ago
This solution passes all tests in the repo, but not sure if it breaks anything else?
Reference tests:
import pycba as cba L = [10] EI = [30 * 600e7 * 1e-6] R = [-1, 0, -1, 0] LM = [[1, 4, 10, 5, 0]] beam_analysis = cba.BeamAnalysis(L, EI, R, LM) beam_analysis.analyze() beam_analysis.plot_results()
main branch:
_end_momentfix branch:
import pycba as cba L = [10] EI = [30 * 600e7 * 1e-6] R = [-1, 0, -1, 0] LM_1 = [[1, 4, 10, 0, 0]] LM_2 = [[1, 4, 10, 10, 0]] beam_analysis = cba.BeamAnalysis(L, EI, R, LM_1) beam_analysis.analyze() beam_analysis.plot_results() beam_analysis = cba.BeamAnalysis(L, EI, R, LM_2) beam_analysis.analyze() beam_analysis.plot_results()
import pycba as cba import numpy as np L = [32] EI = [32.8 * 49.9e9 * 1e-6] R = [-1, 0, -1, 0] LM = np.array([ [1, 4, 34695095.91380897, 0.0, 0], [1, 4, -34695095.91380897, 32000.0, 0], [1, 4, 34695095.91380897, 0.0, 0], [1, 4, -34695095.91380897, 32000.0, 0], [1, 4, 34695095.91380897, 0.0, 0], [1, 4, -34695095.91380897, 32000.0, 0], [1, 4, 42820095.91380897, 0.0, 0], [1, 4, -42820095.91380897, 32000.0, 0], [1, 4, 42820095.91380897, 0.0, 0], [1, 4, -42820095.91380897, 32000.0, 0], [1, 4, 42820095.91380897, 0.0, 0], [1, 4, -42820095.91380897, 32000.0, 0], [1, 4, 42820095.91380897, 0.0, 0], [1, 4, -42820095.91380897, 32000.0, 0], [1, 4, 42820095.91380897, 0.0, 0], [1, 4, -42820095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0], [1, 4, 50945095.91380897, 0.0, 0], [1, 4, -50945095.91380897, 32000.0, 0] ]) LM[:,2] *= 1e-6 LM[:,3] *= 1e-3 LM = LM.tolist() LM.append([1, 1, 7.695090745199957, 0, 0]) beam_analysis = cba.BeamAnalysis(L, EI, R, LM) beam_analysis.analyze() beam_analysis.plot_results()
Thank you so much @robbievanleeuwen ! That's a lovely fix. We might need to extend it to use np.isclose for comparison of floats but looks fine now. Thanks!
np.isclose
This solution passes all tests in the repo, but not sure if it breaks anything else?
Reference tests:
main branch:
_end_momentfix branch:
main branch:
_end_momentfix branch:
main branch:
_end_momentfix branch: