DIC压缩实验及数据后处理

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

@DIC压缩实验及数据后处理

一、拉伸机使用教程

二、DIC仪器使用教程

三、后处理

使用GOM Correlate 2019软件处理
在这里插入图片描述
软件的操作教程如下:
【1-使用 GOM 关联的 2D 图像关联】 https://www.bilibili.com/video/BV17a411z7Z8/?share_source=copy_web&vd_source=3e2b1df2b4751111517f684dd78d1e93
关于面应变的在08:00-14:00,关于线应变的在26分钟左右

每个试样尺寸须有此格式
在这里插入图片描述

3.2 运行z1_preprocess.m文件

%本代码将压缩机数据和dic数据进行统一

clc
clear
dir='240318loadanddis';%压缩机曲线的路径
idlist=[8,9,10,11,12,14,15,17,18,19,21,24];
for i=1:length(idlist)
    writenew(dir,idlist(i));
end


function writenew(dir,id)
%读取压缩机数据,第1列时间s,第二列位移mm,第三列力N
data1=xlsread( fullfile(dir,['id',num2str(id),'.is_comp_RawData'],'Specimen_RawData_1.csv') );
%读取dic后处理结果
%第一列为照片的张数,因为选择的是1s拍4张,所以每四行数据代表1s
%第二列为垂直于压缩方向的应变数据,第三列为压缩方向的应变数据
data2=xlsread( fullfile('postprocessing',['id',num2str(id),'.csv']) );
%读取试样尺寸信息,第一列为id编号,剩余3列为xyz尺寸mm
data3=xlsread('specimensize.xlsx');
row=find(data3(:,1)==id);
xsize=data3(row,2);
ysize=data3(row,3);
zsize=data3(row,4);


%对压缩机数据插值,获得与dic照片时间相匹配的力和位移
told=data1(:,1);
disold=data1(:,2);
fold=data1(:,3);
tnew=data2(:,1)/4;
disnew = interp1(told, disold, tnew, 'linear');
fnew = interp1(told, fold, tnew, 'linear');


% 写出结果
mkdir('newdata');
file=fullfile('newdata',['id',num2str(id),'.csv']) ;
delete(file)
column_names = {'dictime', 'dicstrainavgx', 'dicstrainavgy','strain','stress','machinetime','strainold','stressold'};
dictime=tnew;
dicstrainavgx=data2(:,2);
dicstrainavgy=-data2(:,3);%%%%%%因为压是负的应变,这里把它变成绝对值
strain=disnew/zsize;
stress=fnew/(xsize*ysize);
machinetime=told;
strainold=disold/zsize;
stressold=fold/(xsize*ysize);
% 写入数据和列名到 Excel 表格
xlswrite(file, column_names, 'Sheet1', 'A1');
xlswrite(file,dictime, 'Sheet1', 'A2');
xlswrite(file,dicstrainavgx, 'Sheet1', 'B2');
xlswrite(file,dicstrainavgy, 'Sheet1', 'C2');
xlswrite(file,strain,  'Sheet1', 'D2');
xlswrite(file,stress,  'Sheet1', 'E2');
xlswrite(file,machinetime,  'Sheet1', 'F2');
xlswrite(file,strainold,  'Sheet1', 'G2');
xlswrite(file,stressold,  'Sheet1', 'H2');
disp(['id',num2str(id),' cpmplete'])
end

3.3 运行z2_getproperty.m

close all
clc
clear
id='24';%%%idlist=[8,9,10,11,12,14,15,17,18,19,21,24];
data=xlsread( fullfile('newdata',['id',num2str(id),'.csv']) );
datadic=data(:,1:5);
datadic= datadic(~any(isnan(datadic), 2), :);%剔除NaN行
%column_names = {'dictime'1, 'dicstrainavgx'2, 'dicstrainavgy'3,'strain'4,'stress'5,'machinetime'6,'strainold'7,'stressold'8};
%% 测DIC杨氏模量,操作方法为先点一个点截取图像范围,再点两个点计算
close
strain=datadic(:,3);
stress=datadic(:,5);
plot(strain,stress)
xlabel('strain ')
ylabel('stress  [MPa]')
hold on

% 从图形中获取用户点击的点
[x, y] = ginput(1);
% 计算用户点击的点与数据中所有点的距离
distances = sqrt((strain - x).^2 + (stress - y).^2);
% 找到距离最近的点的索引
[~, index] = min(distances);
strain=strain(1:index);
stress=stress(1:index);
close

plot(strain,stress)
xlabel('strain ')
ylabel('stress  [MPa]')
hold on
[gx,gy]=ginput(2);
n=size(strain,1);
num_down=1;%拟合数据起始点编号
num_up=1;%拟合数据终止点编号
for i=1:n
    if strain(i)<=gx(1)
        num_down=i;
    else
        num_down=num_down;
    end
    if strain(i)<=gx(2)
        num_up=i;
    else
        num_up=num_up;
    end
end
p=polyfit(strain(num_down:num_up),stress(num_down:num_up),1);
% x1=strain(num_down:num_up);
% y1 = polyval(p,x1);
plot([strain(num_down),strain(num_up)],[stress(num_down),stress(num_up)],'--o')
hold on
disp('DIC杨氏模量MPa')
disp(p(1)*100)%%%%因为之前strain的单位是%
% 保存图像为 PNG 格式
saveas(gcf, fullfile('newdata','pic',['id',num2str(id),'dicE.png']));
%% 测DIC泊松比,操作方法为先点一个点截取图像范围,再点两个点计算
close
strain=datadic(:,3);
stress=datadic(:,2);
plot(strain,stress)
xlabel('y ')
ylabel('x')
hold on

% 从图形中获取用户点击的点
[x, y] = ginput(1);
% 计算用户点击的点与数据中所有点的距离
distances = sqrt((strain - x).^2 + (stress - y).^2);
% 找到距离最近的点的索引
[~, index] = min(distances);
strain=strain(1:index);
stress=stress(1:index);
close

plot(strain,stress)
xlabel('y ')
ylabel('x')
hold on
[gx,gy]=ginput(2);
n=size(strain,1);
num_down=1;%拟合数据起始点编号
num_up=1;%拟合数据终止点编号
for i=1:n
    if strain(i)<=gx(1)
        num_down=i;
    else
        num_down=num_down;
    end
    if strain(i)<=gx(2)
        num_up=i;
    else
        num_up=num_up;
    end
end
p=polyfit(strain(num_down:num_up),stress(num_down:num_up),1);
% x1=strain(num_down:num_up);
% y1 = polyval(p,x1);
plot([strain(num_down),strain(num_up)],[stress(num_down),stress(num_up)],'--o')
hold on
disp('DIC泊松比')
disp(p(1))
% 保存图像为 PNG 格式
saveas(gcf, fullfile('newdata','pic',['id',num2str(id),'dicv.png']));

%% 测压缩机杨氏模量和强度,操作方法为先点一个点截取图像范围,再点两个点计算
close
strain=data(:,7);
stress=data(:,8);
plot(strain,stress)
xlabel('strain ')
ylabel('stress  [MPa]')
hold on

% 从图形中获取用户点击的点
[x, y] = ginput(1);
% 计算用户点击的点与数据中所有点的距离
distances = sqrt((strain - x).^2 + (stress - y).^2);
% 找到距离最近的点的索引
[~, index] = min(distances);
strain=strain(1:index);
stress=stress(1:index);
close

plot(strain,stress)
xlabel('strain ')
ylabel('stress  [MPa]')
hold on
[gx,gy]=ginput(2);
n=size(strain,1);
num_down=1;%拟合数据起始点编号
num_up=1;%拟合数据终止点编号
for i=1:n
    if strain(i)<=gx(1)
        num_down=i;
    else
        num_down=num_down;
    end
    if strain(i)<=gx(2)
        num_up=i;
    else
        num_up=num_up;
    end
end
p=polyfit(strain(num_down:num_up),stress(num_down:num_up),1);
% x1=strain(num_down:num_up);
% y1 = polyval(p,x1);
plot([strain(num_down),strain(num_up)],[stress(num_down),stress(num_up)],'--o')
hold on
disp('机器杨氏模量MPa')
disp(p(1))

[strength,I]=max(stress);
hold on
scatter(strain(I),strength,'*')
disp('强度MPa')
disp(strength)
% 保存图像为 PNG 格式
saveas(gcf, fullfile('newdata','pic',['id',num2str(id),'machineEandS.png']));

未完待续…

  • 11
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值