

clear all
close all

%load 0806RUNStressStrain.mat
%load 0807RUNStepRes.mat
%alg = load('0806RUNStressStrain.mat');
%alg = load('0806RUNDeploy.mat');
alg = load('0807RUNStepRes.mat');
alg = alg.Data;

var2 = 9;   %pressure sensor
var3 = 10;  %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');

dt = 0.01;
figure('Position', [100 100 1000 600])
set(gcf,'color','white');

sample_start = 2880.02/dt;
sample_stop = sample_start+5/dt;

subplot(2,1,1),plot(ts,alg2);
set(gca,'FontName','times','FontSize',14);
%legend('Potentiometer');
%ylabel('Pressure, psi');
ylabel('Force, lbf');
subplot(2,1,2),plot(ts,alg3);
set(gca,'FontName','times','FontSize',14);
ylabel('Elongation, inches');

xlabel('time(s)');