

clear all
close all

%load 0806RUNStressStrain.mat
%load 0807RUNStepRes.mat
%alg = load('0806RUNStressStrain.mat');
%alg = load('0806RUNDeploy.mat');
data = load('Run_0001.mat');
alg = data.Data;

var2 = 10;   %pressure sensor
var3 = 11;  %potentiometer

alg2 = alg(:,var2)*250;   % pressure reading in pounds per square inch
alg3 = alg(:,var3)*15;    % strain in inches measured by potentiometer

csarea = 0.25*pi*(2.5^2 - 1.75^2);

alg2 = alg2*csarea;


time = length(alg3);%total sampling time

sf = 100; %sampling frequency in Hertz

st = 1/sf; 

delt= 0.01;

ts = st:delt:time*delt;



figure('Position', [100 100 1000 600])
set(gcf,'color','white');

plot(alg3,alg2);
set(gca,'FontName','times','FontSize',16);

xlabel('Elongation, inches');

%ylabel('Pressure, psi');
ylabel('Force, lbf');

figure('Position', [100 100 1000 600])
set(gcf,'color','white');

subplot(2,1,1),plot(ts,alg2);
set(gca,'FontName','times','FontSize',14);
%legend('Potentiometer');
%ylabel('Pressure, psi');
ylabel('Force, lbf');
aa = axis;
aa(1) = 1600;
aa(2) = 1700;
aa(3) = 500;
aa(4) = 2000;
%axis(aa);
subplot(2,1,2),plot(ts,alg3);
set(gca,'FontName','times','FontSize',14);
ylabel('Elongation, inches');
aa = axis;
aa(1) = 1600;
aa(2) = 1700;
aa(3) = 20;
aa(4) = 60;
%axis(aa);
xlabel('time(s)');