% FEAcomp. Solution of Example 5.2.
% J.A. Mayugo & E. J. Barbero (c) 2006, 2007, 2013
clc; clear all; close all;

b=10;

% Ansys results OPEN I FILES
n_file = 'FEAcomp_Ex52';
fidinp = fopen([n_file,'.txt'],'r');   
label  = (fscanf(fidinp,'%s %s %s',[3 1]));
results = (fscanf(fidinp,'%g %g %g',[3 inf]));
fclose(fidinp);

y_b=results(1,:)/b;
s_z=results(2,:);
s_yz=results(3,:);

linetxt1 = ['\leftarrow \delta_{0}= Th/100'];
linewth  = 2.8;

figure1 = figure;
plot(y_b,s_yz,'LineWidth',linewth)
hold on
plot(y_b,s_z,'--','LineWidth',linewth)
plot([0,1],[0,0])
%text(results2(2,120)+2.2,results2(1,120),linetxt1,'HorizontalAlignment','left','Fontsize',16)
xlabel('y/b','Fontsize',16);ylabel('\sigma [MPa]','Fontsize',16);
legend('\sigma_{yz}','\sigma_{z}','Location','SouthWest');legend('boxoff');
axis([0 1 -20 20]) 
set(gca,'Fontsize',16);
hold off
     

