%=====CME434 Fall 06: HW4 assigned on 10/5/06 is due on 10/13/06 %Begin with your script from HW3. %10 (Deferred from HW3) Write a script to open the input data file hw4data.txt (the same, for now, as hw3data.txt) and create an initial workspace like the one used at the start of HW3. Now you will start each problerm with a cleared workspace and create the initial workspace from a problem data file. Test your script to see that the initial workspace is correct. Append your HW3 script to this new script (delete the load() command if there is one). %11 Write a script to calculate the nodal forces for each element Fe=Ke*Qe %Save the bar force for each element in col. vector P. P(e)=sqrt(Fe2x^2+Fe2y^2) %12 Rework your part %3 graphing script to also display the node numbers and the deflected shape of the truss. Draw the truss as before. Use text() to show the node number on the graph at the coordinates of each node. Then superimpose the deformed truss using dash lines. For this, simply plot again, with displacements added to the original coordinates to locate the displaced coordinates. To be distinct, the displacements will need to be maginfied by a factor of about 32 (experiment to see what value you like) before adding them to the coordinates. Graduate students will also draw the deformed truss with tension members in green, compression members in red. %(Do not delete your original part%3 script) %draw original truss %Label nodes %draw deformed truss mag=32 %13 In general, hw4data.txt is a problem definition file for 2D trusses used to present data to your script. The download version of hw4data.txt was copied from hw3data.txt. Delete the current hw4data.txt, copy hw41data.txt and rename the copy hw4data.txt. Run your script on this new problem (chevron bracing in a building core to resist wind loads). Do the same with hw42data.txt (a bridge with a truck at midspan, landscape mode where y is up). Your script should solve all three problems without modification. If it does not, revise your script (most likely by substituting variables for literals) until the same script works on all three problems. % GRADUATE STUDENTS: Parts %14-%17 are to be included in HW4. %14 (Graduate students only): Write a script that creates a square similarity transform matrix T such that in a similsr system D=T*Q is the displacement vector, having all the displacements of Q but rearranged with all the essential displacements in the upper partition of D. D is simply a column vector of re-arranged displacements. The information needed to identify the nq essential displacements is found in QTAB. %15 (Graduate students only): Note: In the similar system the corresponding matrices are (stiffness) C=T'*K*T and (forces) H=T'*F Solve C*D=H for H by partitions, first solving HE=CE*DE+CEF*DF for DF. Find all of D and H. %16 (Graduate students only): Transform back to the original system via inv(T)*D=Q and inv(T')*H=F. %17 (Graduate students only): Incorporate %14 to %16 in a user defined MATLAB function called QF_Solver(). QTAB, Q, F and K should be global variables. Pass nq to the function as a parameter. Call your function from your main script to solve problems where the essential displacements are not in the upper partition of Q. Test your script on the problem given in hw43data.txt.