• 神经网络预测应力应变-单轴实验


    1、内容简介


    492-可以交流、咨询、答疑

    2、内容说明

    clear
    clc
    close all
    %% ------------ 提取数据 ------------
    % 单轴实验.xlsx
    data_C50_0 = xlsread('单轴实验.xlsx','Sheet1','A4:B58');
    data_6_02_0 = xlsread('单轴实验.xlsx','Sheet1','C4:D66');
    data_6_04_0 = xlsread('单轴实验.xlsx','Sheet1','E4:F61');
    data_6_06_0 = xlsread('单轴实验.xlsx','Sheet1','G4:H62');

    data_12_02_0 = xlsread('单轴实验.xlsx','Sheet1','I4:J59');
    data_12_04_0 = xlsread('单轴实验.xlsx','Sheet1','K4:L57');
    data_12_06_0 = xlsread('单轴实验.xlsx','Sheet1','M4:N61');

    data_18_02_0 = xlsread('单轴实验.xlsx','Sheet1','O4:P50');
    data_18_04_0 = xlsread('单轴实验.xlsx','Sheet1','Q4:R62');
    data_18_06_0 = xlsread('单轴实验.xlsx','Sheet1','S4:T60');

    % 5MPa.xlsx
    data_C50_5 = xlsread('5MPa.xlsx','Sheet1','A3:B34');
    data_6_02_5 = xlsread('5MPa.xlsx','Sheet1','C3:D52');
    data_6_04_5 = xlsread('5MPa.xlsx','Sheet1','E3:F55');
    data_6_06_5 = xlsread('5MPa.xlsx','Sheet1','G3:H35');

    data_12_02_5 = xlsread('5MPa.xlsx','Sheet1','I3:J33');
    data_12_04_5 = xlsread('5MPa.xlsx','Sheet1','K3:L51');
    data_12_06_5 = xlsread('5MPa.xlsx','Sheet1','M3:N39');

    data_18_02_5 = xlsread('5MPa.xlsx','Sheet1','O3:P35');
    data_18_04_5 = xlsread('5MPa.xlsx','Sheet1','Q3:R42');
    data_18_06_5 = xlsread('5MPa.xlsx','Sheet1','S3:T42');

    % 10MPa.xlsx
    data_C50_10 = xlsread('10MPa.xlsx','Sheet1','A3:B40');
    data_6_02_10 = xlsread('10MPa.xlsx','Sheet1','C3:D57');
    data_6_04_10 = xlsread('10MPa.xlsx','Sheet1','E3:F44');
    data_6_06_10 = xlsread('10MPa.xlsx','Sheet1','G3:H57');

    data_12_02_10 = xlsread('10MPa.xlsx','Sheet1','I3:J42');
    data_12_04_10 = xlsread('10MPa.xlsx','Sheet1','K3:L58');
    data_12_06_10 = xlsread('10MPa.xlsx','Sheet1','M3:N42');

    data_18_02_10 = xlsread('10MPa.xlsx','Sheet1','O3:P38');
    data_18_04_10 = xlsread('10MPa.xlsx','Sheet1','Q3:R44');
    data_18_06_10 = xlsread('10MPa.xlsx','Sheet1','S3:T53');

    % 15MPa.xlsx
    data_C50_15 = xlsread('5MPa.xlsx','Sheet1','A3:B62');
    data_6_02_15 = xlsread('15MPa.xlsx','Sheet1','C3:D50');
    data_6_04_15 = xlsread('15MPa.xlsx','Sheet1','E3:F49');
    data_6_06_15 = xlsread('15MPa.xlsx','Sheet1','G3:H55');

    data_12_02_15 = xlsread('15MPa.xlsx','Sheet1','I3:J52');
    data_12_04_15 = xlsread('15MPa.xlsx','Sheet1','K3:L59');
    data_12_06_15 = xlsread('15MPa.xlsx','Sheet1','M3:N40');

    data_18_02_15 = xlsread('15MPa.xlsx','Sheet1','O3:P54');
    data_18_04_15 = xlsread('15MPa.xlsx','Sheet1','Q3:R57');
    data_18_06_15 = xlsread('15MPa.xlsx','Sheet1','S3:T52');

    %% 数据融合处理,生成BP需要的数据量
    pressure = [];
    fibre_length = [];
    volume_percentage = [];
    x = [];
    y = [];
    %------------------单轴数据------------------------------------------
    pressure = [pressure zeros(length(data_C50_0),1)];
    fibre_length = [fibre_length zeros(length(data_C50_0),1)];
    volume_percentage = [volume_percentage zeros(length(data_C50_0),1)];
    x = [x data_C50_0(:,1)];
    y = [y data_C50_0(:,2)];

    pressure = [pressure; zeros(length(data_6_02_0),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_02_0),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_0),1)];
    x = [x; data_6_02_0(:,1)];
    y = [y; data_6_02_0(:,2)];
    pressure = [pressure; zeros(length(data_6_04_0),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_04_0),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_0),1)];
    x = [x; data_6_04_0(:,1)];
    y = [y; data_6_04_0(:,2)];
    pressure = [pressure; zeros(length(data_6_06_0),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_06_0),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_0),1)];
    x = [x; data_6_06_0(:,1)];
    y = [y; data_6_06_0(:,2)];

    pressure = [pressure; zeros(length(data_12_02_0),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_02_0),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_0),1)];
    x = [x; data_12_02_0(:,1)];
    y = [y; data_12_02_0(:,2)];
    pressure = [pressure; zeros(length(data_12_04_0),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_04_0),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_0),1)];
    x = [x; data_12_04_0(:,1)];
    y = [y; data_12_04_0(:,2)];
    pressure = [pressure; zeros(length(data_12_06_0),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_06_0),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_0),1)];
    x = [x; data_12_06_0(:,1)];
    y = [y; data_12_06_0(:,2)];

    pressure = [pressure; zeros(length(data_18_02_0),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_02_0),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_0),1)];
    x = [x; data_18_02_0(:,1)];
    y = [y; data_18_02_0(:,2)];
    pressure = [pressure; zeros(length(data_18_04_0),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_04_0),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_0),1)];
    x = [x; data_18_04_0(:,1)];
    y = [y; data_18_04_0(:,2)];
    pressure = [pressure; zeros(length(data_18_06_0),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_06_0),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_0),1)];
    x = [x; data_18_06_0(:,1)];
    y = [y; data_18_06_0(:,2)];

    %------------------5MPa数据------------------------------------------
    pressure = [pressure; 5*ones(length(data_C50_5),1)];
    fibre_length = [fibre_length; zeros(length(data_C50_5),1)];
    volume_percentage = [volume_percentage; zeros(length(data_C50_5),1)];
    x = [x; data_C50_5(:,1)];
    y = [y; data_C50_5(:,2)];

    pressure = [pressure; 5*ones(length(data_6_02_5),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_02_5),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_5),1)];
    x = [x; data_6_02_5(:,1)];
    y = [y; data_6_02_5(:,2)];
    pressure = [pressure; 5*ones(length(data_6_04_5),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_04_5),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_5),1)];
    x = [x; data_6_04_5(:,1)];
    y = [y; data_6_04_5(:,2)];
    pressure = [pressure; 5*ones(length(data_6_06_5),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_06_5),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_5),1)];
    x = [x; data_6_06_5(:,1)];
    y = [y; data_6_06_5(:,2)];

    pressure = [pressure; 5*ones(length(data_12_02_5),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_02_5),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_5),1)];
    x = [x; data_12_02_5(:,1)];
    y = [y; data_12_02_5(:,2)];
    pressure = [pressure; 5*ones(length(data_12_04_5),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_04_5),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_5),1)];
    x = [x; data_12_04_5(:,1)];
    y = [y; data_12_04_5(:,2)];
    pressure = [pressure; 5*ones(length(data_12_06_5),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_06_5),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_5),1)];
    x = [x; data_12_06_5(:,1)];
    y = [y; data_12_06_5(:,2)];

    pressure = [pressure; 5*ones(length(data_18_02_5),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_02_5),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_5),1)];
    x = [x; data_18_02_5(:,1)];
    y = [y; data_18_02_5(:,2)];
    pressure = [pressure; 5*ones(length(data_18_04_5),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_04_5),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_5),1)];
    x = [x; data_18_04_5(:,1)];
    y = [y; data_18_04_5(:,2)];
    pressure = [pressure; 5*ones(length(data_18_06_5),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_06_5),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_5),1)];
    x = [x; data_18_06_5(:,1)];
    y = [y; data_18_06_5(:,2)];

    %------------------10MPa数据------------------------------------------
    pressure = [pressure; 10*ones(length(data_C50_10),1)];
    fibre_length = [fibre_length; zeros(length(data_C50_10),1)];
    volume_percentage = [volume_percentage; zeros(length(data_C50_10),1)];
    x = [x; data_C50_10(:,1)];
    y = [y; data_C50_10(:,2)];

    pressure = [pressure; 10*ones(length(data_6_02_10),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_02_10),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_10),1)];
    x = [x; data_6_02_10(:,1)];
    y = [y; data_6_02_10(:,2)];
    pressure = [pressure; 10*ones(length(data_6_04_10),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_04_10),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_10),1)];
    x = [x; data_6_04_10(:,1)];
    y = [y; data_6_04_10(:,2)];
    pressure = [pressure; 10*ones(length(data_6_06_10),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_06_10),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_10),1)];
    x = [x; data_6_06_10(:,1)];
    y = [y; data_6_06_10(:,2)];

    pressure = [pressure; 10*ones(length(data_12_02_10),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_02_10),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_10),1)];
    x = [x; data_12_02_10(:,1)];
    y = [y; data_12_02_10(:,2)];
    pressure = [pressure; 10*ones(length(data_12_04_10),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_04_10),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_10),1)];
    x = [x; data_12_04_10(:,1)];
    y = [y; data_12_04_10(:,2)];
    pressure = [pressure; 10*ones(length(data_12_06_10),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_06_10),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_10),1)];
    x = [x; data_12_06_10(:,1)];
    y = [y; data_12_06_10(:,2)];

    pressure = [pressure; 10*ones(length(data_18_02_10),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_02_10),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_10),1)];
    x = [x; data_18_02_10(:,1)];
    y = [y; data_18_02_10(:,2)];
    pressure = [pressure; 10*ones(length(data_18_04_10),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_04_10),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_10),1)];
    x = [x; data_18_04_10(:,1)];
    y = [y; data_18_04_10(:,2)];
    pressure = [pressure; 10*ones(length(data_18_06_10),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_06_10),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_10),1)];
    x = [x; data_18_06_10(:,1)];
    y = [y; data_18_06_10(:,2)];

    %------------------15MPa数据------------------------------------------
    pressure = [pressure; 15*ones(length(data_C50_15),1)];
    fibre_length = [fibre_length; zeros(length(data_C50_15),1)];
    volume_percentage = [volume_percentage; zeros(length(data_C50_15),1)];
    x = [x; data_C50_15(:,1)];
    y = [y; data_C50_15(:,2)];

    pressure = [pressure; 15*ones(length(data_6_02_15),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_02_15),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_6_02_15),1)];
    x = [x; data_6_02_15(:,1)];
    y = [y; data_6_02_15(:,2)];
    pressure = [pressure; 15*ones(length(data_6_04_15),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_04_15),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_6_04_15),1)];
    x = [x; data_6_04_15(:,1)];
    y = [y; data_6_04_15(:,2)];
    pressure = [pressure; 15*ones(length(data_6_06_15),1)];
    fibre_length = [fibre_length; 6*ones(length(data_6_06_15),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_6_06_15),1)];
    x = [x; data_6_06_15(:,1)];
    y = [y; data_6_06_15(:,2)];

    pressure = [pressure; 15*ones(length(data_12_02_15),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_02_15),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_12_02_15),1)];
    x = [x; data_12_02_15(:,1)];
    y = [y; data_12_02_15(:,2)];
    pressure = [pressure; 15*ones(length(data_12_04_15),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_04_15),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_12_04_15),1)];
    x = [x; data_12_04_15(:,1)];
    y = [y; data_12_04_15(:,2)];
    pressure = [pressure; 15*ones(length(data_12_06_15),1)];
    fibre_length = [fibre_length; 12*ones(length(data_12_06_15),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_12_06_15),1)];
    x = [x; data_12_06_15(:,1)];
    y = [y; data_12_06_15(:,2)];

    pressure = [pressure; 15*ones(length(data_18_02_15),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_02_15),1)];
    volume_percentage = [volume_percentage; 0.2*ones(length(data_18_02_15),1)];
    x = [x; data_18_02_15(:,1)];
    y = [y; data_18_02_15(:,2)];
    pressure = [pressure; 15*ones(length(data_18_04_15),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_04_15),1)];
    volume_percentage = [volume_percentage; 0.4*ones(length(data_18_04_15),1)];
    x = [x; data_18_04_15(:,1)];
    y = [y; data_18_04_15(:,2)];
    pressure = [pressure; 15*ones(length(data_18_06_15),1)];
    fibre_length = [fibre_length; 18*ones(length(data_18_06_15),1)];
    volume_percentage = [volume_percentage; 0.6*ones(length(data_18_06_15),1)];
    x = [x; data_18_06_15(:,1)];
    y = [y; data_18_06_15(:,2)];

    % 准备BP神经网络的输入数据
    input = [pressure, fibre_length, volume_percentage, x];
    output = y;
    % 打乱数据
    flagTrain = length(output);
    order = randperm(flagTrain);
    nbertrain = round(0.7*flagTrain);% 提取训练和验证数据 70% 训练,30% 验证
    XTrain = input(order(1:nbertrain),:);
    YTrain = output(order(1:nbertrain));
    XValidation = input(order(nbertrain+1:flagTrain),:);
    YValidation = output(order(nbertrain+1:flagTrain));

    3、仿真分析

     

     

     

     

     

     

    4、参考论文


     

  • 相关阅读:
    web前端练习一
    【ai】李沐 动手深度学学v2 环境安装:anaconda3、pycharm、d2
    数据结构与算法—双链表
    Cisco ASA防火墙——远程控制与多安全区域
    第01章 Tableau数据可视化概述
    利用 Window bat 脚本方便日常开发
    【06】FISCOBCOS中的节点前置服务
    SQL常用数据过滤---IN操作符
    面试题:集群高并发环境下如何保证分布式唯一全局ID生成?
    利用Nginx实现免上传安装zabbix agent
  • 原文地址:https://blog.csdn.net/qingfengxd1/article/details/126236956