Tuesday, August 7, 2012

Matlab solution of Craig's 2nd. ed. Prob. 2.3-4.


% This Matlab program solves problem 2.3-4 of Craig's
% Mechanics of Materials, 2nd. ed., 2000, USA
% ___________________________________________________ 

% Pro_2_3_4.m
% Pedro Vargas and Ricardo Avila, August 6, 2012
clc
clear
disp(' ')


disp('The angle from pi/4 to pi/2 is divided into ')

disp('a number N of subdivisions to work this problem')

disp(' ')
N = input ('Select number of subdivisions: ' );
delta_theta = pi/(4*N);
theta = (pi/4: delta_theta : pi/2)';
L = 1;
delta_x = L * (1/sqrt(2)-cos(theta));
delta_y = L * (sin(theta)-1/sqrt(2));

% L_final: extended length of extensible link
L_final = ( (L + delta_x) .* (L + delta_x) + (delta_y.*delta_y) ).^0.5;


% Calculation of strain
epsilon = (L_final - L) / L;

% Conversion of angle in radians, to degrees
theta = theta * 180/pi;

% Display results
title('Problem 2.3-4');
plot(theta, epsilon);

grid

xlabel('theta, radians')

ylabel('strain, epsilon')

title('Solution of Problem 2.3-4, Craig''s Mechanics of Materials 2nd. ed')

disp('_________________________________ ')

disp('*** Successful run of program ***')

% end of Matlab program

No comments:

Post a Comment