Using Matlab, set up a computer program as described in Problem 6.C2, on page 407 in Beer and Johnston Mechanics of Materials, second edition. However, only work Problems 6.8 and 6.66 which you did for homework. Begin by copying the previous program to a new file name. As before use an input statement to get the above three values: sigx, sigy, and tauxy
Make a table to show the three original stresses and the principal stresses and maximum shear for the three problems.
As usual, put your name, date, and subject in the program with lines such as:
% print the results fprintf('\n Plane Stress, Problem 6.') fprintf('\n Your name, ES 302, ') disp(date)
Copy the output from Matlab and paste it into the bottom of your Matlab program. Include the while loop so you can several several problems easily. Attach the regular solutions to the problems.
Be sure that you use the Matlab atan2 function, not the atan function because the latter will fail when sigx equals sigy.
When the program is running satisfactorily, add an if statement to find the maximum shear stress. This step is more complicated since you have to find if both principal stresses have the same sign. Hint: see if the product of the principal stresses is negative. If so, the maximum shear stress is just the radius. Then check to see if the maximum normal stress is positive. If so, the maximum shear is just half of the normal stress. Otherwise, it is half the negative of the other.
if sigxr*sigyr < 0 taumax = % tau max is in plane elseif sigxr > 0 % tau max is out of plane taumax = else taumax = end
Your results should look like this:
Principal Stresses, Problem 6. Your name, ES 302, 19-Oct-1998 Rotation angle -63.435 degrees Sigma X Sigma Y Tau XY Angle Ksi Ksi Ksi Degrees Original -9.00 -6.00 -2.00 Rotated -5.00 -10.00 2.50 -63.43 (in plane) Maximum shear= 5.00Make sure each problem printout is identified. Better yet, add another string input line to read and print the problem number.
Home, index -- ES Problems -- Matlab Help -- Axial Problem -- Torsion Problem -- Plane Stress -- Search
Last revised: March 17, 2000