%CME434 Fall 2006, Homework #3 assigned 09/22/06 due on Monday, 10/02/06 %Open hw3.xls in excel. Note the format of the data and the nomenclature definitions. Subscripts are indicated as in M.e meaning M-sub-e. %Start MATLAB and begin by opening the workspace hw3.mat in the Workspace Window. %The workspace now has all the information needed for the 4 Bar 2D truss example given in lecture. %Do not assume that number of nodes or the number of elements will always be 4. %Do not use a litteral value when a value is available from the variables in the workspace. %Exception: for now, you may assume 2D space with 2 components of displacement per node. %Complete the following using MATLAB: %1 Write a script to calculate ns, the order of the system (total number of displacements). %2 Write a script to calculate bar lengths Lx, Ly, L, l=cos(theta) and m=sin(theta) for each of the ne elements. %Store the results in (1 x ne) row vectors [L.e], [l.e] and [m.e]. %3 Write a script to draw the truss by plotting each element (graph the endpoints) in the same figure. %4 Write a script to calculate k=AE/L for each element. %Store the results in (l x ne) row vector [k.e] %5 Write a script, given nf and FTAB, to initialize the column vector F with the specified applied forces. %Note: an applied force is zero unless some other value is specified. %6 Write a Script, given nq and QTAB, to initialize the column vector Q with the specified displacements. %Note: To create Q a value must be given. For now, let the Q(i) be zero except where another value is given. %7 Write a script to calculate Ke and Ge for each element. %Assemble the results in K using K=Sum(Ge'*Ke*Ge) %8 Write a script to apply the boundary conditions and solves for displacements. %Assume that Q(1) ... Q(nq) are the known displacements. Some may be non-zero. %Partition Q, K, and F, solve for the free displacements QF=inv(KF)*(FF-KEF'*QE. %9 Write a Script to calculate the Reactions FE=KE*QE+KEF*QF. %Complete Q and F by including the calculated values of QF and FE. %10 Write a script to open the input data file hw3data.txt and create an initial workspace like the one opened at the start of this assignment. %Turn in your MATLAB scripts as directed by the T.A.