Solver

Creates an instance of a Solver

System class methods

method

input

returns

description

__init__(…)

constructor.

addNode(newNode)

Node(…) object

add one Node() object to your list of elements (the model)

addElement(newElem)

Element(…) object

add one Element() object to your list of elements (the model)

solve()

assemble \([K_t]\) and \(\{P\}\), solve for \(\{u\} = [K_t]^{-1}\{P\}\), loop through nodes and update nodal displacement, compute unbalanced force \(\{R\} = \{P\} - \{F\}\)

plot(factor=1.0)

collect node info and send it to the plotter. Request the plot.

report()

print a summary report: list of nodal position, load, displacement, unbalanced force.

System class variables

name

type

description

nodes

List of Node() objects

holds all the nodes in the model

elements

List of Element() objects

holds all the elements in the model

disp

np.array([…])

system sized displacement vector

loads

np.array([…])

system sized load vector

Equations

  1. each element has node0 = elem.nodes[0] and node1 = elem.nodes[1]

  2. node indices i = node0.index and j = node1.index

  3. a local d.o.f. \(u\to k=0\) or \(v\to k=1\) of node \(i\) belongs at global index \(K = 4*i + k\)

  4. a local d.o.f. \(u\to m=0\) or \(v\to m=1\) of node \(j\) belongs at global index \(M = 4*j + m\)

Assembly:

  • \({\bf F}\): element force from elem.getForce()

  • \({\bf K_t}\): element stiffness from elem.getStiffness()

  • \({\bf R}_{sys}\): system force

  • \({\bf K_t}_{sys}\): system stiffness

  1. Loop over nodes: \({\bf R}_{sys}[K] = nodes[i].getLoad()[k]\) (this should return 0 if no load at this node and d.o.f.)

  2. Loop over elements: \({\bf R}_{sys}[K] = {\bf R}_{sys}[K] - {\bf F}[i][k]\)

  3. Loop over elements: \({\bf K_t}_{sys}[K,M] = {\bf K_t}_{sys}[K,M] + {\bf K_t}[i,j][k,m]\)

  4. Loop over nodes: if a d.o.f. at K is fixed, set \({\bf R}_{sys}[K] = 0\) and \({\bf K_t}_{sys}[K,K] = 1.0e20\).

  5. Solve system of equations: \({\bf U} = {\bf K_t}_{sys}^{-1}\,{\bf R}_{sys}\)

  6. Loop over nodes: \(nodes[i].setDisp(u,v)\) using \(u = {\bf U}[2*i]\) and \(v = {\bf U}[2*i+1]\)

  7. Recompute: \({\bf R}_{sys}\) as in steps 5 and 6 (do not repeat steps 7-11). If everything was done correctly, fixed d.o.f.s will contain the support reactions and free d.o.f.s should hold numeric zeros.