close all
clear all
clc

tic
load C:\School_work\Research\Strain_Data_From_Testing\Hoop_strain_exp_3
exp_data_load = toc
clear exp_data_load

SG_4_N_3497 = Hoop_strain_exp_3(4,:);

clear c*
clear d*
clear f*
clear h*
clear i*
clear p*
clear s*
clear t*
clear A*
clear F*
clear H*
clear P*
clear T*

tic
%load C:\School_work\ESM_4714\frf_3497_j7_k7
load C:\School_work\ESM_4714\frf_3497_sum
FE_data_load = toc
clear FE_data_load

 frf_3497_kj= A;
 clear A
 
% node_num = dlmread('C:\School_work\ESM_4714\corner_nodes_1row_no_repeat.txt','\t');

freq_range_EXP = (0:5E5/175259:4.99999E5);
freq=(0:0.5:2000);


interp_G4 = interp1(freq_range_EXP(1:702),SG_4_N_3497(1:702),freq,'cubic') ;

Amp_factor = interp_G4./frf_3497_kj(852,:);   

dim =size(frf_3497_kj)

for i=1:dim(1)
    A_frf_3497(i,:) = Amp_factor.*frf_3497_kj(i,:);
end

figure(2)
plot(freq,20*log10(abs(A_frf_3497(852,:))))
hold on
plot(freq_range_EXP(1:878), 20*log10(abs(SG_4_N_3497(1,1:878))),'-or', 'Markersize',4)

tic
for i=1:dim(1) 
[node_resp(i,:), time] = IFFT_time_resp(A_frf_3497(i,:), (0:0.5:2000));
end
resp_time = toc
clear resp_time

[SG_resp, time_1] = IFFT_time_resp(SG_4_N_3497(1,1:878), freq_range_EXP(1:878));

figure(3)
plot(time, node_resp(852,:),'-r');
hold on
plot(time_1, SG_resp);

 for i=1:50
    dlmwrite(sprintf('C:\\School_work\\ESM_4714\\H_Strain_FRFSUM_time_step_%d.txt',i),node_resp(:,i),'\t')
 end

