




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Calculating flatness with least square method1. Matlab code:clcclearA=xlsread(flatness,1; for i=1:size(A,1 for j=1:size(A,2 if isnan(A(i,j A(i,j=0;endendend x,y,z=find(A; t=x,y; b=regress(z,t; X,Y=meshgrid(1:size(A,1,1:size(A,2; mesh(X,Y,b(1*X+b(2*Y; hold on plot3(x,y,z,k.;maxval,maxind=max(z-(b(1*x
2、+b(2*y; e=abs(maxval+abs(minval; 2.Graph of regressed plant and related points: 3 The numerical value of flatness (The conclusion calculate by matlab, the flatness is 11.5120 m The conclusion with least square method matches the result in jpg (The conclusion calculate with software, which is also 11
3、.5120 m Calculating flatness with Maximum straightness method clear clc A=xlsread(flatness,1;a=;b=;for i=1:size(A,1flag1=1;flag2=1;for j=2:size(A,2-1ifany(isnan(A(i,j=0 & any(isnan(A(i,j-1a=a,j; flag1=0; end if any(isnan(A(i,j=0 & any(isnan(A(i,j+1b=b,j; flag2=0; end end if flag1a=a 1; endif flag2b=
4、b,size(A,2;end endk=;f=;j=1;for i=1:size(A,1 k=k,(A(i,b(j-A(i,a(j/(b(j-a(j; maxval,maxind=max(A(i,a(j:b(j-myfun(a(j:b(j,k(j,b(j,A(i,b(j; minval,minind=min(A(i,a(j:b(j-myfun(a(j:b(j,k(j,b(j,A(i,b(j; f=f,abs(maxval+abs(minval; j=j+1;endf_final=max(f; The conclusion with this method is: (The mallab giv
5、es a result which is 7.215 umCalculating straightness with least square method1. Codeclcclear A=xlsread( e=; for i=1:2:3 a=A(i,:; b=A(i+1,:; d=regress(b,a;figure plot(a,c,r,a,b,b,100,k. .;enda=A(10,1:16;b=A(11,1:16; d=regress(b,a;maxval,maxind=max(b-c; minval,minind=min(b-c; figure plot(a,c,r,a,b,b,
6、100,k. . ; e=e abs(maxval+abs(minval;2. The numerical value of straightnessAccording to Matlab:e =0.0337 0.0312 0.0375 for three lines respectively.3.Theplot of three lines with related zone and curve:(The plot of first line (The plot of second line (The plot of third line II AB Straightness=AB+0=0.
7、0312um II AB Straightness=AB+0=0.0375um IABI BCStraightness=AB+BC=0.0337umCalculate straightness with two end points method1. Codeclearclc A=xlsread(straightness.xls,1; f=;for i=1:2:3 a=A(i,:; b=A(i+1,:; k=(b(1-b(length(b/(a(1-a(length(b; c=k*(a-a(1*ones(1,length(b+b(1*ones(1,length(b; maxval,maxind
8、=max(b-c;minval,minind=min(b-c;figureplot(a,c,r,a,b,b,a(maxind*ones(1,100,linspace(c(maxind,b(maxind,100,k. ,a(minind*ones(1,100,linspace(b(minind,c(minind,100,c. ,a,(k*(a-a(maxind*ones(1,length(b+b(maxind*ones(1,length(b,m. ,a,(k*(a-a(minind*ones(1,length(b+b(minind*ones(1,length(b,y;f=f abs(maxval
9、+abs(minval; enda=A(10,1:16;b=A(11,1:16;k=(b(1-b(length(b/(a(1-a(length(b;c=k*(a-a(1*ones(1,length(b+b(1*ones(1,length(b;maxval,maxind=max(b-c;minval,minind=min(b-c; figure plot(a,c,r,a,b,b,a(maxind*ones(1,100,linspace(c(maxind,b(maxind,100,k. ,a(minind*ones(1,100,linspace(b(minind,c(minind,100,c.,a
10、,(k*(a-a(maxind*ones(1,length(b+b(maxind*ones(1,length(b,m.,a,(k*(a-a(minind*ones(1,length(b+b(minind*ones(1,length(b,y;f=f abs(maxval+abs(minval;2.The numerical value of straightnessAccording to matlab: f =0.0226 0.0287 0.0333 for three lines separately.3.Theplot of three lines with related zone an
11、d curve:Import data from excel, and save it as A Calculate the inclines with two and points. And define lines with then. Finally calculate the vertical intercepts. Plot graph containing all required information. Save the straightness in F Save the straightness in F These process is a repeating of pr
12、eceding steps. ( No need to payattention toIIIIII ABStraightness=AB+0=0.0226um ABABStraightness=AB+0=0.0287umStraightness=AB+0=0.0333umCalculating cylindricity with regressive circle method clc,clear;A=xlsread(cgroup4_1.CSV;B=xlsread(cgroup4_2.CSV;C=xlsread(cgroup4_3.CSV;D=xlsread(cgroup4_4.CSV; n=l
13、ength(X(:,1;y=ones(n,1;b=rand(1*1000 rand(1 rand(1;fun=inline(X(:,1.2+X(:,2.2+a(1*X(:,1+a(2*X(:,2+a(3,a,X;a,r,J = nlinfit(X,y,fun,b ;vpa(a,10 ;X1 =-a(1/2;Y1 =-a(2/2;R =sqrt(a(12+a(22-4*a(3/2;X1=ones(n,1*X1;Y1=ones(n,1*Y1;maxval=max(sqrt(X(:,1-X1.2+(X(:,2-Y1.2;minval=min(sqrt(X(:,1-X1.2+(X(:,2-Y1.2;R
14、1=maxval-minval;The graph of cylinder:Calculating roughness with least squareRead the x,y coordinatefrom excels for differentheight and save then onA,B,C,D respectivelyProject all data to oneplane and regress all datato a specific circle.Find the Radius, centralcoordinates of regressed circle.Find t
15、he difference ofdistance between largestand smallest points fromcentral pointmethod1.Programing code clc;clear; A=xlsread(roughness.xlsx;z=find(isnan(A(:,3; for i=length(z:-1:1 A(z(i,:=;end Z=A(:,3; t=A(:,1,A(:,2,ones(size(A,1,1;b=regress(Z,t; f=abs(b(1*A(:,1+b(2*A(:,2-Z+b(3*ones(size(A,1,1/sqrt(b(1
16、2+b(22+(-12;Ra=mean(f;plot3(A(:,1,A(:,2,Z,k.;hold on X,Y=meshgrid(0:700,0:700; mesh(X,Y,b(1*X+b(2*Y+b(3*ones(size(X,1,size(X,2The conclusion:The Ra found by this method is:Ra= 0.1634 um, which matches the conclusion calculated by software: 3.The graph of regressed plane and measured points: Import the data from
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025设备租赁合同书范本
- 智慧树知到《走进故宫》(故宫研究院)章节测试答案
- 2025年中国质谱数据处理软件行业市场运行格局及投资前景预测分析报告
- 文化产业园产业集聚与服务体系中的文化产业发展路径创新报告
- 高铁通车后对全国高铁行业市场需求的评估研究报告
- 解读2025年建筑节能标准:被动式超低能耗建筑技术原理与节能指标报告
- 食堂管理工作总结模版
- 财富管理市场2025年客户需求研究报告:服务升级与客户满意度提升策略
- 教育质量评估与认证体系2025年行业创新模式探索报告
- 初三化学实验总结模版
- 2024年全国高考甲卷历史试题含答案解析
- 八年级数学下册 第4章 单元综合测试卷(北师版 2025年春)
- 《现代教育技术》教学设计公开课教案教学设计课件资料
- 人教版高中物理选择性必修第三册期末检测试卷
- 《射线检测》课件
- 2025年春新人教版语文一年级下册教学课件 15 一分钟
- 山东铁投集团笔试
- 《先兆流产中西医结合诊疗指南》
- CART细胞免疫疗法课件
- 下肢肌肉损伤-洞察分析
- 心肺复苏术-cpr课件
评论
0/150
提交评论