Question: # MPC - Master-Slave Method # MFC: u2-u6 = 1/5 - slave: u6 import numpy as np def MasterStiffnessOfSixElementBar(kbar): K = np.zeros((7, 7)) for (i,

 # MPC - Master-Slave Method # MFC: u2-u6 = 1/5 -slave: u6 import numpy as np def MasterStiffnessOfSixElementBar(kbar): K = np.zeros((7, 7))for (i, row) in enumerate(K): if i == 0: row[i:i+2] = [kbar,

# MPC - Master-Slave Method # MFC: u2-u6 = 1/5 - slave: u6 import numpy as np

def MasterStiffnessOfSixElementBar(kbar): K = np.zeros((7, 7)) for (i, row) in enumerate(K): if i == 0: row[i:i+2] = [kbar, -kbar] elif i+1 == 7: row[i-1:i+1] = [-kbar, kbar] else: row[i-1:i+2] = [-kbar, 2*kbar, -kbar] return K

def FixLeftEndOfSixElementBar(Khat, fhat): Kmod = np.asarray(Khat) fmod = np.asarray(fhat) fmod[0] = 0 Kmod[0,0] = 1 Kmod[0,1] = Kmod[1,0] = 0 return Kmod, fmod

K = MasterStiffnessOfSixElementBar(100) print("Stiffness K: {0} ".format(K))

f = np.array([1,2,3,4,5,6,7]) print("Applied forces: {0} ".format(f))

T = np.array([[1,0,0,0,0,0], [0,1,0,0,0,0], [0,0,1,0,0,0], [0,0,0,1,0,0], [0,0,0,0,1,0], [0,1,0,0,0,0], [0,0,0,0,0,1]]) print("Transformation matrix T: {0} ".format(T))

g = np.array([0,0,0,0,0,-1./5.,0]) print("Constraint gap vector g: {0} ".format(g))

Khat = np.dot(np.dot(T.T, K), T) fhat = np.dot(T.T, (f - np.dot(K, g)))

Kmod, fmod = FixLeftEndOfSixElementBar(Khat, fhat) # fix left end print("Modified Stiffness upon fixing node 1: {0} ".format(Kmod)) print("Modified RHS upon fixing node 1: {0} ".format(fmod))

umod = np.linalg.solve(Kmod, fmod) print("Computed umod (lacks slave u6): {0} ".format(umod))

u = np.dot(T, umod) + g print("Complete solution u: {0} ".format(u))

fu = np.dot(K, u) print("Recovered forces K.u with reactions: {0}".format(fu))

Exercise 4 (IFEM Ex. 8.2) [C+N:20] The example structure of Figure 5 has ESA-L"-100 for each elenente = 1.. Con- sequently, Kil-K77 = 100), K22-...-K66 = 200, Ki2 = K23-...-K67 =-100. The applied node forces are taken to be fi = 1.h = 2, f3 = 3, f4 = 4, f5-5, f6 6, and fr = 7, which are easy to remember. The structure is subjected to one support condition: (afixed left end), and to one 6 Figure 5: A one-dimensional problem discretized with six bar finite elements. The seven nodes may move only along the x direction. Subscript r is omitted from the u's and f 's to reduce clutter Solve this problem using the master-slave method to process the MFC, taking u as slave. Upon forming the modified system (IFEM 8.27) apply the left-end support u0 using the placeholder method of IFEM $3.4. Solve the equations and verify that the displacement solution and the recovered node forces including reactions are u=10 0.270 0.275 0.250 0.185 0.070 0.140 Ku-27 26.5 3 4 5 -18.5 7 The solution procedure is outlined in the pseudo-code in Figure 6. This can be readily translated to any high-level matrix language such as Matlab, Mathematica, or Octave. For example, an implementation in Python is shown in Listing 1 and Mathematica is shown in IFEM Figure E8.2 Exercise 4 (IFEM Ex. 8.2) [C+N:20] The example structure of Figure 5 has ESA-L"-100 for each elenente = 1.. Con- sequently, Kil-K77 = 100), K22-...-K66 = 200, Ki2 = K23-...-K67 =-100. The applied node forces are taken to be fi = 1.h = 2, f3 = 3, f4 = 4, f5-5, f6 6, and fr = 7, which are easy to remember. The structure is subjected to one support condition: (afixed left end), and to one 6 Figure 5: A one-dimensional problem discretized with six bar finite elements. The seven nodes may move only along the x direction. Subscript r is omitted from the u's and f 's to reduce clutter Solve this problem using the master-slave method to process the MFC, taking u as slave. Upon forming the modified system (IFEM 8.27) apply the left-end support u0 using the placeholder method of IFEM $3.4. Solve the equations and verify that the displacement solution and the recovered node forces including reactions are u=10 0.270 0.275 0.250 0.185 0.070 0.140 Ku-27 26.5 3 4 5 -18.5 7 The solution procedure is outlined in the pseudo-code in Figure 6. This can be readily translated to any high-level matrix language such as Matlab, Mathematica, or Octave. For example, an implementation in Python is shown in Listing 1 and Mathematica is shown in IFEM Figure E8.2

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 Databases Questions!