anays机械参数化仿真+matlab响应面拟合.zip

  • Blessedhy
    了解作者
  • matlab
    开发工具
  • 9.8MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2022-03-23 21:33
    上传日期
文件中在ansys workbench用拉丁超立方抽样,得到二次响应面法需要的拟合样本数据; 在matlab中用ansys workbench 仿真的样本数据来构建二次响应面函数,并用蒙特卡洛方法计算了可靠度; 是一个做机械可靠性非常好的入门算例。 开发平台是:matlab建立响应面、ansys workbench完成机械结构仿真
anays机械参数化仿真+matlab响应面拟合.zip
内容介绍
clc clear all %% data input load('D2.2.mat') y1 = St; y2 = De; x1 = T; x2 = L; x3 = M; x4 = F; %% do not include cross terms for deformation simulation X1=[ones(size(y1)) x1 x2 x3 x4 x1.^2 x2.^2 x3.^2 x4.^2 ]; [b1,bint1,r1,rint1,stats1] = regress(y2,X1); Yp=b1(1)+b1(2)*x1 + b1(3)*x2 + b1(4)*x3 + b1(5)*x4 + b1(6)*x1.^2 +... b1(7)*x2.^2 + b1(8)*x3.^2 +b1(9)*x4.^2; %% including cross terms for stress simulation % X1=[ones(size(y1)) x1 x2 x3 x4 x1.*x2 x1.*x3 x1.*x4 x2.*x3... % x2.*x4 x3.*x4 ]; % [b1,bint1,r1,rint1,stats1] = regress(y1,X1); % % Yp=b1(1)+b1(2)*x1 + b1(3)*x2 + b1(4)*x3 + b1(5)*x4 + b1(6)*x1.*x2 +... % b1(7)*x1.*x3 + b1(8)*x1.*x4 + b1(9)*x2.*x3 + b1(10)*x2.*x4 + b1(11)*x3.*x4; %% visualization subplot(1,2,1) plot(y2,'-b*','MarkerSize',8) hold on plot(Yp,'-bo','MarkerSize',8) legend('Real output','Estimate output') %% reliability carculation based on monte carlo simulation number = 100000;% 抽样次数 TMC = 0.03 + 0.0004*randn(number,1); x1 = TMC; LMC = 0.3 + 0.006*randn(number,1); x2 = LMC; MMC = 12391 + 247.82*randn(number,1); x3 = MMC; FMC = 43341 + 866.82*randn(number,1); x4 = FMC; YMCp=b1(1)+b1(2)*x1 + b1(3)*x2 + b1(4)*x3 + b1(5)*x4 + b1(6)*x1.^2 +... b1(7)*x2.^2 + b1(8)*x3.^2 +b1(9)*x4.^2;%deformation prediction % YMCp=b1(1)+b1(2)*x1 + b1(3)*x2 + b1(4)*x3 + b1(5)*x4 + b1(6)*x1.*x2 +... % b1(7)*x1.*x3 + b1(8)*x1.*x4 + b1(9)*x2.*x3 + b1(10)*x2.*x4 + b1(11)*x3.*x4;%stress prediction subplot(1,2,2) histfit(YMCp,75) Ya = 270e6;%allowable value for stress Yaa = 9e-4;%allowable value for deformation R = sum(YMCp<Yaa)/number
评论
    相关推荐