Check Member End Forces

This notebook reads files describing a structure, and the files output by Frame2D after an analysis, and checks that the member end forces computed here from the displacements and member loads agree with those computed by Frame2D.

It does this in the simplest way possible, using quite different logic than Frame2D, resulting in a higher degree of confidence in the results. It would have been better had someone else programmed it, but oh well ...


In [31]:
dir = 'KG82'
dir = 'l22x6'
#dir = 'l22x6pd'

def filename(basename):
    return dir + '.d/' + basename + '.csv'

def Warn(msg):
    print('!!!!! Warning: {}'.format(msg))

In [32]:
import pandas as pd
import math

In [33]:
class Node(object):
    
    def __init__(self,id,x,y):
        self.id = id
        self.x = x
        self.y = y
        self.deltaX = 0.
        self.deltaY = 0.
        self.thetaZ = 0.

In [34]:
ntable = pd.read_csv(filename('nodes'))
NODES = {}
for i,n in ntable.iterrows():
    if n.ID in NODES:
        Warn("Node '{}' is multiply defined.".format(n.ID))
    NODES[n.ID] = Node(n.ID,float(n.X),float(n.Y))

In [35]:
dtable = pd.read_csv(filename('displacements'))
for i,n in dtable.iterrows():
    node = NODES[n.ID]
    node.deltaX = float(n.DX)
    node.deltaY = float(n.DY)
    node.thetaZ = float(n.RZ)

In [36]:
pd.DataFrame([vars(v) for v in NODES.values()]).set_index('id')


Out[36]:
deltaX deltaY thetaZ x y
id
G18 1261.515500 -114.721841 -0.004758 61000 100000
D8 661.558314 -76.727193 -0.004854 30500 45000
F1 123.991246 -5.869691 -0.008457 50500 6500
D12 934.096619 -101.534680 -0.005189 30500 67000
G3 282.310397 -34.956735 -0.005785 61000 17500
A4 360.844280 -10.702247 -0.009122 0 23000
D11 869.445397 -96.096207 -0.005147 30500 61500
G9 732.776879 -82.079298 -0.006335 61000 50500
G15 1111.425020 -108.212272 -0.005477 61000 83500
A16 1165.450014 -43.282470 -0.009982 0 89000
D0 0.000000 0.000000 -0.027871 30500 0
B13 996.453286 -123.823354 -0.008417 10500 72500
E4 360.234046 -60.335418 -0.006478 40500 23000
C1 123.894307 -6.382178 -0.009361 20500 6500
B14 1055.681677 -128.151405 -0.008317 10500 78000
B22 1426.052803 -144.063303 -0.007066 10500 123500
C11 869.593613 -54.685538 -0.008357 20500 61500
A0 0.000000 0.000000 0.000000 0 0
G21 1381.506854 -117.586534 -0.003892 61000 116500
E5 437.343893 -72.586625 -0.006579 40500 28500
B8 661.876083 -92.622165 -0.008287 10500 45000
G4 360.135914 -44.443560 -0.006010 61000 23000
E13 996.014741 -141.994615 -0.006125 40500 72500
E1 124.656634 -18.467054 -0.005491 40500 6500
F0 0.000000 0.000000 0.000000 50500 0
C13 996.266350 -62.068449 -0.008104 20500 72500
E0 0.000000 0.000000 -0.026021 40500 0
B19 1305.553170 -141.604026 -0.007420 10500 105500
A9 733.531258 -25.572205 -0.010366 0 50500
A20 1345.896579 -48.752431 -0.009149 0 111000
F14 1055.172055 -62.049517 -0.007641 50500 78000
E15 1111.528213 -152.000275 -0.005739 40500 83500
F13 995.948199 -58.864812 -0.007828 50500 72500
A7 588.874387 -19.596029 -0.010061 0 39500
D18 1261.726897 -123.592802 -0.005004 30500 100000
A14 1055.923519 -39.035189 -0.010273 0 78000
D4 360.323278 -43.681250 -0.004002 30500 23000
E8 661.463491 -104.419254 -0.006651 40500 45000
D14 1055.340209 -110.895839 -0.005202 30500 78000
E6 513.439346 -84.008157 -0.006640 40500 34000
E21 1381.731437 -166.676338 -0.004166 40500 116500
C16 1165.015440 -71.008767 -0.007544 20500 89000
D2 204.174055 -23.998888 -0.003461 30500 12000
B7 588.640876 -84.283174 -0.008105 10500 39500
C10 802.485140 -50.625247 -0.008439 20500 56000
F9 732.811029 -43.717803 -0.008290 50500 50500
D1 124.709626 -13.359463 -0.001817 30500 6500
G17 1214.713030 -112.984478 -0.005010 61000 94500
A2 204.771635 -5.180087 -0.008137 0 12000
F16 1164.688773 -67.558907 -0.007206 50500 89000
F22 1424.696343 -75.846488 -0.005793 50500 123500
C15 1111.784430 -68.339135 -0.007752 20500 83500
C3 282.621786 -17.072995 -0.007950 20500 17500
D17 1214.922272 -121.168912 -0.005077 30500 94500
G7 588.136389 -68.908610 -0.006346 61000 39500
E16 1164.757114 -155.997952 -0.005518 40500 89000
F5 437.279567 -25.645419 -0.008128 50500 28500
C5 437.568839 -27.391732 -0.008298 20500 28500
F8 661.398685 -39.425985 -0.008317 50500 45000
C14 1055.493108 -65.352526 -0.007939 20500 78000
... ... ... ... ...

161 rows × 5 columns


In [37]:
dtable


Out[37]:
ID DX DY RZ
0 A0 0.000000 0.000000 0.000000
1 B0 0.000000 0.000000 0.000000
2 C0 0.000000 0.000000 0.000000
3 D0 0.000000 0.000000 -0.027871
4 E0 0.000000 0.000000 -0.026021
5 F0 0.000000 0.000000 0.000000
6 G0 0.000000 0.000000 0.000000
7 A1 123.370764 -2.643462 -0.008879
8 B1 123.490711 -17.097697 -0.006515
9 C1 123.894307 -6.382178 -0.009361
10 D1 124.709626 -13.359463 -0.001817
11 E1 124.656634 -18.467054 -0.005491
12 F1 123.991246 -5.869691 -0.008457
13 G1 123.712633 -13.871469 -0.006113
14 A2 204.771635 -5.180087 -0.008137
15 B2 204.534867 -30.499116 -0.006214
16 C2 204.369509 -11.765516 -0.007562
17 D2 204.174055 -23.998888 -0.003461
18 E2 204.092545 -33.292118 -0.006223
19 F2 204.073508 -10.907055 -0.007420
20 G2 204.051104 -24.772147 -0.005541
21 A3 283.008782 -7.878852 -0.008662
22 B3 282.782355 -42.972380 -0.006703
23 C3 282.621786 -17.072995 -0.007950
24 D3 282.497674 -34.107490 -0.003686
25 E3 282.409606 -47.241254 -0.006336
26 F3 282.343209 -15.894497 -0.007752
27 G3 282.310397 -34.956735 -0.005785
28 A4 360.844280 -10.702247 -0.009122
29 B4 360.616399 -54.554999 -0.007167
30 C4 360.454617 -22.287679 -0.008140
31 D4 360.323278 -43.681250 -0.004002
32 E4 360.234046 -60.335418 -0.006478
33 F4 360.169891 -20.813686 -0.007963
34 G4 360.135914 -44.443560 -0.006010
35 A5 437.964745 -13.617342 -0.009505
36 B5 437.734792 -65.279904 -0.007550
37 C5 437.568839 -27.391732 -0.008298
38 D5 437.434723 -52.725991 -0.004270
39 E5 437.343893 -72.586625 -0.006579
40 F5 437.279567 -25.645419 -0.008128
41 G5 437.245835 -53.251827 -0.006173
42 A6 514.069903 -16.592207 -0.009817
43 B6 513.838092 -75.179025 -0.007861
44 C6 513.668636 -32.367521 -0.008409
45 D6 513.531598 -61.246061 -0.004500
46 E6 513.439346 -84.008157 -0.006640
47 F6 513.374897 -30.370722 -0.008240
48 G6 513.341056 -61.400510 -0.006284
49 A7 588.874387 -19.596029 -0.010061
50 B7 588.640876 -84.283174 -0.008105
51 C7 588.468174 -37.197096 -0.008475
52 D7 588.328496 -69.245332 -0.004695
53 E7 588.234915 -94.614093 -0.006664
54 F7 588.170307 -34.970592 -0.008301
55 G7 588.136389 -68.908610 -0.006346
56 A8 662.111153 -22.598994 -0.010242
57 B8 661.876083 -92.622165 -0.008287
58 C8 661.700415 -41.862249 -0.008501
59 D8 661.558314 -76.727193 -0.004854
... ... ... ...

161 rows × 4 columns


In [38]:
class Member(object):
    
    E = 200000.
    
    def __init__(self,id,nodej,nodek):
        self.id = id
        self.nodej = nodej
        self.nodek = nodek
        
        dx = nodek.x - nodej.x
        dy = nodek.y - nodej.y
        self.L = L = math.sqrt(dx*dx + dy*dy)
        self.cosx = dx/L
        self.cosy = dy/L
        
        self.Ix = 0.
        self.A = 0.
        self.loads = []
        self.releases = set()
        
        for a in 'FXJ FXK FYJ FYK MZJ MZK'.split():
            setattr(self,a,0.)

In [39]:
table = pd.read_csv(filename('members'))
MEMBERS = {}
for i,m in table.iterrows():
    if m.ID in MEMBERS:
        Warn("Member '{}' is multiply defined.".format(m.ID))
    MEMBERS[m.ID] = Member(m.ID,NODES[m.NODEJ],NODES[m.NODEK])

In [40]:
import sst
SST = sst.SST()
table = pd.read_csv(filename('properties'))
defIx = defA = None
for i,row in table.iterrows():
    if not pd.isnull(row.SIZE):
        defIx,defA = SST.section(row.SIZE,'Ix,A')
    memb = MEMBERS[row.ID]
    memb.Ix = float(defIx if pd.isnull(row.Ix) else row.Ix)
    memb.A = float(defA if pd.isnull(row.A) else row.A)
    if not pd.isnull(row.Ix):
        defIx = row.Ix
    if not pd.isnull(row.A):
        defA = row.A

In [41]:
table = pd.read_csv(filename('member_loads'))
for i,row in table.iterrows():
    memb = MEMBERS[row.ID]
    typ = row.TYPE
    w1 = None if pd.isnull(row.W1) else float(row.W1)
    w2 = None if pd.isnull(row.W2) else float(row.W2)
    a = None if pd.isnull(row.A) else float(row.A)
    b = None if pd.isnull(row.B) else float(row.B)
    c = None if pd.isnull(row.C) else float(row.C)
    memb.loads.append((typ,w1,w2,a,b,c))

In [42]:
table = pd.read_csv(filename('releases'))
for i,row in table.iterrows():
    memb = MEMBERS[row.ID]
    memb.releases.add(row.R.upper())

In [43]:
t = pd.DataFrame([vars(v) for v in MEMBERS.values()]).set_index('id')
del t['nodej']
del t['nodek']
del t['loads']
t


Out[43]:
A FXJ FXK FYJ FYK Ix L MZJ MZK cosx cosy releases
id
BD19E19 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CE7E8 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CC13C14 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CF15F16 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BE9F9 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
BB22C22 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
BD2E2 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CE2E3 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CB18B19 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CG17G18 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BD5E5 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
BC10D10 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CA10A11 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CD9D10 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BA2B2 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
CF17F18 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CC16C17 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BC16D16 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CB0B1 27600 0 0 0 0 712000000 6500 0 0 0 1 set([])
CG13G14 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BE18F18 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
CG19G20 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BA8B8 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
CC19C20 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CC11C12 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CE17E18 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BF9G9 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
CA14A15 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BE8F8 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
BC5D5 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CG10G11 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CA17A18 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BB14C14 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
BC22D22 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
BE20F20 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
BD1E1 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
BF16G16 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
BB13C13 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
CC5C6 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BA22B22 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
CA9A10 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CA12A13 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BE15F15 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
CA15A16 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CD15D16 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CC15C16 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CC7C8 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BB5C5 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([MZK, MZJ])
BC14D14 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CE6E7 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BF11G11 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
CD3D4 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BF4G4 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
BF2G2 28300 0 0 0 0 4080000000 10500 0 0 1 0 set([])
CC1C2 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CE19E20 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
BD10E10 28300 0 0 0 0 4080000000 10000 0 0 1 0 set([])
CA2A3 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CF6F7 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
CE1E2 27600 0 0 0 0 712000000 5500 0 0 0 1 set([])
... ... ... ... ... ... ... ... ... ... ... ...

286 rows × 12 columns


In [44]:
MEFS = pd.read_csv(filename('mefs')).set_index('ID')
MEFS


Out[44]:
FXJ FYJ MZJ FXK FYK MZK
ID
CA0A1 2244909.634702 588097.363747 2.105832e+09 -2244909.634702 -588097.363747 1.716801e+09
CB0B1 14519890.365298 636651.974250 2.211842e+09 -14519890.365298 -636651.974250 1.926396e+09
CC0C1 5419941.959705 581603.210063 2.095291e+09 -5419941.959705 -581603.210063 1.685130e+09
CD0D1 11345267.399666 175620.334257 -4.470348e-08 -11345267.399666 -175620.334257 1.141532e+09
CE0E1 15682790.640630 138388.366032 1.192093e-07 -15682790.640630 -138388.366032 8.995244e+08
CF0F1 4984721.959798 600484.824260 2.136854e+09 -4984721.959798 -600484.824260 1.766297e+09
CG0G1 11780078.040203 646153.927400 2.233926e+09 -11780078.040203 -646153.927400 1.966075e+09
CA1A2 2545848.769446 355440.190027 9.582551e+08 -2545848.769446 -355440.190027 9.966659e+08
CB1B2 13450151.230554 472873.631957 1.292609e+09 -13450151.230554 -472873.631957 1.308195e+09
CC1C2 5402913.822300 348568.583511 9.119716e+08 -5402913.822300 -348568.583511 1.005156e+09
CD1D2 10678112.934625 667083.972831 1.877033e+09 -10678112.934625 -667083.972831 1.791929e+09
CE1E2 14878973.243076 485004.215740 1.352701e+09 -14878973.243076 -485004.215740 1.314822e+09
CF1F2 5055682.424713 374061.048812 1.001812e+09 -5055682.424713 -374061.048812 1.055524e+09
CG1G2 10940317.575287 495968.357129 1.349101e+09 -10940317.575287 -495968.357129 1.378725e+09
CA2A3 2708578.184209 329069.463515 9.185335e+08 -2708578.184209 -329069.463515 8.913485e+08
CB2B3 12518621.815791 438836.576290 1.219464e+09 -12518621.815791 -438836.576290 1.194137e+09
CC2C3 5326778.726014 365603.276390 1.015457e+09 -5326778.726014 -365603.276390 9.953607e+08
CD2D3 10145360.944625 602592.250079 1.662953e+09 -10145360.944625 -602592.250079 1.651304e+09
CE2E3 13999860.329362 449643.874980 1.239461e+09 -13999860.329362 -449643.874980 1.233580e+09
CF2F3 5005577.987687 375362.885512 1.040845e+09 -5005577.987687 -375362.885512 1.023651e+09
CG2G3 10221622.012314 483891.673242 1.337009e+09 -10221622.012314 -483891.673242 1.324395e+09
CA3A4 2833662.167804 297124.465112 8.290012e+08 -2833662.167804 -297124.465112 8.051833e+08
CB3B4 11624737.832196 407663.931625 1.133095e+09 -11624737.832196 -407663.931625 1.109057e+09
CC3C4 5233646.940351 344967.899015 9.535802e+08 -5233646.940351 -344967.899015 9.437433e+08
CD3D4 9608573.917963 582192.070330 1.609215e+09 -9608573.917963 -582192.070330 1.592841e+09
CE3E4 13141779.141687 437377.444661 1.206454e+09 -13141779.141687 -437377.444661 1.199122e+09
CF3F4 4937076.900665 355470.112298 9.830096e+08 -4937076.900665 -355470.112298 9.720761e+08
CG3G4 9521323.099335 466204.076965 1.287884e+09 -9521323.099335 -466204.076965 1.276239e+09
CA4A5 2925695.859358 265962.948283 7.413220e+08 -2925695.859358 -265962.948283 7.214743e+08
CB4B5 10763904.140642 376394.488943 1.044992e+09 -10763904.140642 -376394.488943 1.025178e+09
CC4C5 5122613.169074 327736.702073 9.053871e+08 -5122613.169074 -327736.702073 8.971647e+08
CD4D5 9077630.539235 558359.556097 1.542425e+09 -9077630.539235 -558359.556097 1.528553e+09
CE4E5 12295756.291691 423183.500480 1.166372e+09 -12295756.291691 -423183.500480 1.161137e+09
CF4F5 4849302.721429 337474.108120 9.323329e+08 -4849302.721429 -337474.108120 9.237747e+08
CG4G5 8840297.278571 447888.696010 1.235923e+09 -8840297.278571 -447888.696010 1.227464e+09
CA5A6 2985682.402866 235918.887187 6.568345e+08 -2985682.402866 -235918.887187 6.407194e+08
CB5B6 9935117.597134 346367.725373 9.605720e+08 -9935117.597134 -346367.725373 9.444505e+08
CC5C6 4993882.596821 309717.424424 8.545787e+08 -4993882.596821 -309717.424424 8.488671e+08
CD5D6 8551051.938214 533859.067688 1.474083e+09 -8551051.938214 -533859.067688 1.462142e+09
CE5E6 11463065.464966 408183.078695 1.124086e+09 -11463065.464966 -408183.078695 1.120921e+09
CF5F6 4742486.087709 319247.965701 8.808102e+08 -4742486.087709 -319247.965701 8.750536e+08
CG5G6 8178313.912291 429705.850938 1.184576e+09 -8178313.912291 -429705.850938 1.178806e+09
CA6A7 3014744.851657 206875.971926 5.752284e+08 -3014744.851657 -206875.971926 5.625895e+08
CB6B7 9137255.148343 317322.872903 8.789574e+08 -9137255.148343 -317322.872903 8.663184e+08
CC6C7 4847137.419226 291368.673081 8.029860e+08 -4847137.419226 -291368.673081 7.995417e+08
CD6D7 8028360.119112 508510.062650 1.403429e+09 -8028360.119112 -508510.062650 1.393376e+09
CE6E7 10644502.461663 392446.935349 1.079833e+09 -10644502.461663 -392446.935349 1.078625e+09
CF6F7 4616597.121115 301011.703033 8.293819e+08 -4616597.121115 -301011.703033 8.261825e+08
CG6G7 7535402.878885 411463.781064 1.133124e+09 -7535402.878885 -411463.781064 1.129927e+09
CA7A8 3013884.872493 178749.983374 4.962653e+08 -3013884.872493 -178749.983374 4.868596e+08
CB7B8 8369315.127507 289197.728457 7.999971e+08 -8369315.127507 -289197.728457 7.905904e+08
CC7C8 4682116.795703 272677.727222 7.505191e+08 -4682116.795703 -272677.727222 7.492084e+08
CD7D8 7509067.101460 482419.319703 1.330789e+09 -7509067.101460 -482419.319703 1.322517e+09
CE7E8 9840816.102838 376047.573224 1.033807e+09 -9840816.102838 -376047.573224 1.034455e+09
CF7F8 4471594.283626 282727.453066 7.779080e+08 -4471594.283626 -282727.453066 7.770930e+08
CG7G8 6911605.716374 393180.214959 1.081653e+09 -6911605.716374 -393180.214959 1.080838e+09
CA8A9 2984022.525863 151463.754693 4.197312e+08 -2984022.525863 -151463.754693 4.133194e+08
CB8B9 7630377.474137 261911.912890 7.234641e+08 -7630377.474137 -261911.912890 7.170514e+08
CC8C9 4498575.211495 253679.205959 6.972779e+08 -4498575.211495 -253679.205959 6.979578e+08
CD8D9 6992753.092047 455659.695764 1.256360e+09 -6992753.092047 -455659.695764 1.249768e+09
... ... ... ... ... ...

286 rows × 6 columns


In [45]:
cols = 'FXJ FXK FYJ FYK MZJ MZK'.split()
for m in MEMBERS.values():
    for a in cols:
        setattr(m,a,0.)
        
    # difference in end displacements, global coords
    dX = m.nodek.deltaX - m.nodej.deltaX
    dY = m.nodek.deltaY - m.nodej.deltaY
    
    # axial deformation / force:
    ldX = dX*m.cosx + dY*m.cosy
    T = m.E*m.A*ldX/m.L
    m.FXK += T
    m.FXJ += -T
    #print(m.id,ldX,T)
    
    # shear deformation / force:
    vdY = dY*m.cosx - dX*m.cosy
    M = -6.*m.E*m.Ix*vdY/(m.L*m.L)
    V = 2.*M/m.L
    m.MZJ += M
    m.MZK += M
    m.FYJ += V
    m.FYK += -V
    #print(m.id,vdY,M,V)
    
    # end rotations / moments:
    MJ = (m.E*m.Ix/m.L)*(4.*m.nodej.thetaZ + 2.*m.nodek.thetaZ)
    MK = (m.E*m.Ix/m.L)*(2.*m.nodej.thetaZ + 4.*m.nodek.thetaZ)
    VJ = (MJ+MK)/m.L
    m.MZJ += MJ
    m.MZK += MK
    m.FYJ += VJ
    m.FYK += -VJ
    #print(m.id,m.nodej.thetaZ,m.nodek.thetaZ,MJ,MK,VJ)
    
    # applied loads: fixed-end moments and shears:
    for ltype,w1,w2,a,b,c in m.loads:
        mj = mk = 0.
        vj = vk = 0.
        if ltype == 'PL':
            b = m.L - a
            P = w1
            mj = -P*a*b*b/(m.L*m.L)
            mk = P*b*a*a/(m.L*m.L)
            vj = (-P*b + nj + mk)/m.L
            vk = -P - vj
        elif ltype == 'UDL':
            mj = -w1*m.L**2/12.
            mk = -mj
            vj = -w1*m.L/2.
            vk = vj
        else:
            Warn("Load type '{}' not implemented here ...".format(ltype))
            continue
        m.MZJ += mj
        m.MZK += mk
        m.FYJ += vj
        m.FYK += vk
        
    # member end moment releases:
    relc = m.releases.copy()
    if 'MZJ' in m.releases:
        mj = -m.MZJ
        mk = 0. if 'MZK' in m.releases else 0.5*mj
        vj = (mj + mk)/m.L
        ##print(m.id,'MZJ',m.MZJ,m.MZK,mj,mk,rel)
        m.MZJ += mj
        m.MZK += mk
        m.FYJ += vj
        m.FYK += -vj
        relc.remove('MZJ')
    if 'MZK' in m.releases:
        mk = -m.MZK
        mj = 0. if 'MZJ' in m.releases else 0.5*mk
        vj = (mj + mk)/m.L
        ##print(m.id,'MZK',m.MZJ,m.MZK,mj,mk,rel)
        m.MZJ += mj
        m.MZK += mk
        m.FYJ += vj
        m.FYK += -vj
        relc.remove('MZK')
    if relc:
        Warn("Member end-releases not processed: {}".format(relc))

In [46]:
computed = pd.DataFrame([{k:getattr(m,k) for k in ['id']+cols} 
                         for m in MEMBERS.values()]).set_index('id')
diff = (computed - MEFS[cols])
lim = 1E-12
for c in cols:
    biggest = MEFS[c].abs().max()
    diff[c][diff[c].abs() < biggest*lim] = 0
diff


Out[46]:
FXJ FXK FYJ FYK MZJ MZK
BA10B10 0 0 0 0 0 0
BA11B11 0 0 0 0 0 0
BA12B12 0 0 0 0 0 0
BA13B13 0 0 0 0 0 0
BA14B14 0 0 0 0 0 0
BA15B15 0 0 0 0 0 0
BA16B16 0 0 0 0 0 0
BA17B17 0 0 0 0 0 0
BA18B18 0 0 0 0 0 0
BA19B19 0 0 0 0 0 0
BA1B1 0 0 0 0 0 0
BA20B20 0 0 0 0 0 0
BA21B21 0 0 0 0 0 0
BA22B22 0 0 0 0 0 0
BA2B2 0 0 0 0 0 0
BA3B3 0 0 0 0 0 0
BA4B4 0 0 0 0 0 0
BA5B5 0 0 0 0 0 0
BA6B6 0 0 0 0 0 0
BA7B7 0 0 0 0 0 0
BA8B8 0 0 0 0 0 0
BA9B9 0 0 0 0 0 0
BB10C10 0 0 0 0 0 0
BB11C11 0 0 0 0 0 0
BB12C12 0 0 0 0 0 0
BB13C13 0 0 0 0 0 0
BB14C14 0 0 0 0 0 0
BB15C15 0 0 0 0 0 0
BB16C16 0 0 0 0 0 0
BB17C17 0 0 0 0 0 0
BB18C18 0 0 0 0 0 0
BB19C19 0 0 0 0 0 0
BB1C1 0 0 0 0 0 0
BB20C20 0 0 0 0 0 0
BB21C21 0 0 0 0 0 0
BB22C22 0 0 0 0 0 0
BB2C2 0 0 0 0 0 0
BB3C3 0 0 0 0 0 0
BB4C4 0 0 0 0 0 0
BB5C5 0 0 0 0 0 0
BB6C6 0 0 0 0 0 0
BB7C7 0 0 0 0 0 0
BB8C8 0 0 0 0 0 0
BB9C9 0 0 0 0 0 0
BC10D10 0 0 0 0 0 0
BC11D11 0 0 0 0 0 0
BC12D12 0 0 0 0 0 0
BC13D13 0 0 0 0 0 0
BC14D14 0 0 0 0 0 0
BC15D15 0 0 0 0 0 0
BC16D16 0 0 0 0 0 0
BC17D17 0 0 0 0 0 0
BC18D18 0 0 0 0 0 0
BC19D19 0 0 0 0 0 0
BC1D1 0 0 0 0 0 0
BC20D20 0 0 0 0 0 0
BC21D21 0 0 0 0 0 0
BC22D22 0 0 0 0 0 0
BC2D2 0 0 0 0 0 0
BC3D3 0 0 0 0 0 0
... ... ... ... ... ...

286 rows × 6 columns


In [47]:
diff.abs().max()


Out[47]:
FXJ    0
FXK    0
FYJ    0
FYK    0
MZJ    0
MZK    0
dtype: float64

Maximum relative differences


In [48]:
diff = (computed - MEFS[cols])
for c in cols:
    biggest = MEFS[c].abs().max()
    r = (diff[c]/biggest)
    idr = r.abs().idxmax()
    print(c,idr,r[idr])


FXJ BB19C19 3.06903553056e-13
FXK BB19C19 -3.06903553056e-13
FYJ CA14A15 -1.30617743168e-13
FYK CA14A15 1.0375935362e-13
MZJ CA14A15 -8.69057345777e-14
MZK CE14E15 7.2133084596e-14