Question: 2 ) Assemble the global response arrays The second part of your task is to create a assembleGlobalArrays ( ) that assembles the global displacement

2) Assemble the global response arrays
The second part of your task is to create a assembleGlobalArrays() that assembles the global displacement Uur and force Pur vectors:
[]{}={}=[KppKpfKfpKff]{UpUf}={PpPf}KurUur=Pur
where the global arrays follow the node ascending ordering, i.e.,=[1,2,3,...,_]Uur=[u1,u2,u3,...,un_node] and ui is the displacement of node i.
Write the function assembleGlobalArrays() that takes six input arguments u_p, p_f, u_f, p_p, n_node, eq_num and returns two outputs u_ur, p_ur:
Input arguments:
u_p: a 1-D NumPy array that stores the known prescribed displacement values Up.
p_f: a 1-D NumPy array that stores the known force values Pf.
u_f: a 1-D NumPy array that stores the displacement values of the free nodes Uf.
p_p: a 1-D NumPy array that stores the reaction forces on the prescribed nodes Pp.
n_node: an integer that represents the number of nodes.
eq_num: a 1-D NumPy array that determines how you should reorder your system of equations, used for the Assemble module.
Outputs:
u_ur: a 1-D NumPy array that stores the displacement values of all nodes Uur in the original order (also called the unreduced global displacement vector).
p_ur: a 1-D NumPy array that stores the force values applied on all nodes Pur in the original order (also called the unreduced global force vector).
Algorithm to create the arrays p_ur and u_ur:
initialize the arrays u_ur and p_ur with zeros.
what should be the type of these arrays?
what is the shape of these arrays?
for each entry of u_ur, find the corresponding equation number (eq_num).
the value and sign of the equation number will tell you if the contributions are coming from u_f or u_p.
the same algorithm works to build p_ur
Remember:
Be aware that the node and equation numbers are 1-indexed but NumPy arrays are 0-indexed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!