[Python] Is there a way to troubleshoot "nan" results for opensees nodeReaction(i); where...

Discussão em 'Python' iniciado por Stack, Maio 6, 2025.

  1. Stack

    Stack Membro Participativo

    Imports import openseespy.opensees as ops import opsvis as opsv import numpy as np import matplotlib.pyplot as plt

    Problem I keep receiving [Nan, Nan, ..., Nan] results for my opensees simple nonlinear analysis of the 3D model when I call ops.nodeReaction(i), where i=nodetag, even when ops.analyze(1) is successful with 0 output, and the model has been applied with a load.

    Materials definition ops.uniaxialMaterial('Steel02', 1, Fy, E0, b), ops.uniaxialMaterial('Concrete07', 2, fcu, epsc, Ec, ft, et, xp, xn, r) for the core portion of the fiber section, and ops.uniaxialMaterial('Concrete07', 3, fcu, epsc, Ec, ft, et, xp, xn, r) repeated with new matTag in case I will later choose to assign a different concrete material (parameters) for the cover portion of the fiber section. All arguments were assigned prior to calling the respective commands.

    Sections definition I set model builder with ops.model('basic', '-ndm', 3, '-ndf', 6)

    The fiber sections were used for both the ops.dispBeamColumn vertical element and ops.nonlinearBeamColumn horizontal elements, using ops.section('Fiber', secTag, '-GJ', GJ) followed by *ops.patch('quad', matTag, NfibCoreZp, NfibCoreYp, verticesCore) where secTag is 1 for vertical element, and 2, 3, 4 for the 3 horizontal elements (they mirror about the vertical element as they form the T shape), other arguments are declared before calling them, and matTag=2 for the core, and 3 for the concrete cover portion; followed by *ops.layer('straight', 1, NbarZp, Abar1, *start_botlayr, end_botlayr) for steel rebars part of the fiber section. All arguments were declared accordingly prior to calling the command. Geometric tranformations were defined with *ops.geomTransf('PDelta', transfTag, transfvect) accordingly for all the sections with transfTag of 1, 2, 3, and 4 for vertical element, and the three horizontal elements respectively. The transfvect were declared as [0, -1, 0] for vertical element, and [-1, 0, 0] for horizontal elements prior to calling the command *ops.geomTransf('PDelta', transfTag, transfvect).

    Model: nodes, elements and integration points The model is a simple two node vertical cantilever utilising the ops.dispBeamColumn element with one bottom node (nodeTag=1) applied with ops.fix(1, 1,1,1,1,1,1) and another top node (nodeTag=2) connected to ops.nonlinearBeamColumn horizontal beam elements (joining nodeTags [3,4], [4,5], [5,6]) through a *ops.rigidLink('beam', [2,3]) on one side, and to ops.nonlinearBeamColumn horizontal beam elements (joining nodeTags [7,8], [8,9], [9,10]) through a *ops.rigidLink('beam', [2,7]) on the other side, making a T shaped cantilever model. The three types of horizontal beam elements have different cross-sections. The ops.beamIntegration('Lobatto', 1, secTag, N) was used for the vertical ops.dispBeamColumn element with secTag=1, and N=4. For ops.nonlinearBeamColumn horizontal elements, numIntgrPts=4 was as well used in *ops.element('nonlinearBeamColumn', eleTag, ops.eleNodes, numIntgrPts, secTag, transfTag)

    Load The load was applied on nodeTag=2 as ops.load(2, 100.0, 0.0, 0.0, 0.0, 0.0, 0.0) after defining ops.timeSeries('Constant', 1), ops.pattern('Plain', 1, 1).

    Analysis I have also used the following for analysis: SOE ops.system('BandGen'), ops.numberer('RCM'), ops.constraints('Transformation'), ops.integrator('LoadControl', 1), ops.algorithm('Linear'), ops.analysis('Static'). I executed analyze(1) command and printed it and it was successful as it returned zero (0) output.

    However, when I tried to execute the command ops.nodeReaction(1) after calling ops.reactions() in a preceding line, and printed the results, I received [nan, nan, nan, nan, nan, nan].

    Examining my model I tried to plot the model with opsv.plot_model() and the model looked exactly how I expected. I even plotted the model in 3D with opsv.plot_extruded_shapes_3d(ele_shapes) with all the "ele_shapes dict" pre-assigned accordingly, followed with plt.axis('equal') and the extruded shape (3D) looked exactly how I expected.

    Even the fiber sections looked exactly how I expected when plotted with opsv.plot_fiber_section(fib_sec_list, fillflag=1, matcolor=matcolor) and plt.axis('equal') with all the parameters pre-declared.

    Any help? What can be wrong with my model? Any help?

    I commanded outcome = ops.analyze(1), then print(outcome), then commanded ops.reactions() then R1=ops.nodeReaction(1), then print(R1).

    Expected Output: 0 [a, b, c, d, e, f] where a, b, c, d, e, f are some float values

    Actual Resulted Output: 0 [nan, nan, nan, nan, nan, nan]

    Continue reading...

Compartilhe esta Página