Question: Your Task Write the function assembleGlobalForceVector ( ) that takes five input arguments n _ load, force _ node, force _ val, n _ dof,
Your Task
Write the function assembleGlobalForceVector that takes five input arguments nload, forcenode, forceval, ndof, eqnum and returns one output pf:
Input arguments:
nload: the integer number of nonzero nodal forces.
forcenode: a D NumPy array of length nload containing the node numbers of the nodes that have nonzero forces on them.
forceval: a D NumPy array of length nload containing the corresponding force values.
ndof: an integer representing the number of nodes with free displacement ie the number of nodes without prescribed displacement
eqnum: a D NumPy array of length nnode that determines how you should reorder your system of equations.
Output:
pf: a D NumPy array that stores corresponding force values in the order specified by eqnum.
Remember:
Node numbers are indexed but NumPy arrays are indexed.
pf is an array of float values.
Algorithm to create the array pf:
pf stores the force values for all the nodes that do not have prescribed displacement. What should be the size of this array?
Initialize this array with zeros.
pf may include zero entries, corresponding to the nodes that do not have either prescribed force or displacement.
The nonzero entries of pf are initially stored in forceval.
For each node where a force is applied node number in forcenode the corresponding equation number is identified from the eqnum array.
The force value for that node value in forceval is then assigned to the position in the force vector pf corresponding to this equation number. Note that this position is based on node numbers.
This process continues until all applied forces in forceval are mapped to their respective positions in pf
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
