24小时热门版块排行榜    

查看: 881  |  回复: 2

guofucheng07

金虫 (正式写手)


[交流] matlab 旋轮线轨迹模拟 程序错误

从网上下载一个程序,想看看,可惜有错误,大神给修改一下呗,多谢啦

% 旋轮线轨迹模拟
% 圆锥齿轮传动参数
m=2;z7=11;z8=36;
dt7=10.5;dt8=35;
bt=65.25;            % 行星轮轴线与XOY平面夹角
% 搅拌杆外点旋转半径
l=65;
hd=pi/180;
% 圆锥齿轮几何尺寸
r7=0.5*m*z7;
% r7v=r7/cos(dt7*hd);
r8=0.5*m*z8;
% r8v=r8/cos(dt8*hd);
k1=r7+r8;
k2=(r7+r8)/r7;
% 1----二维旋轮线参数计算
for i=1:1:360
    x=k1*cos(i*hd)+l*cos(k2*i*hd);
    y=k1*sin(i*hd)+l*sin(k2*i*hd);
    xl1(i,=[i x y];
end
for i=1:1:720
    x=k1*cos(i*hd)+l*cos(k2*i*hd);
    y=k1*sin(i*hd)+l*sin(k2*i*hd);
    xl2(i,=[i x y];
end
for i=1:1:1080
    x=k1*cos(i*hd)+l*cos(k2*i*hd);
    y=k1*sin(i*hd)+l*sin(k2*i*hd);
    xl3(i,=[i x y];
end
for i=1:1:1440
    x=k1*cos(i*hd)+l*cos(k2*i*hd);
    y=k1*sin(i*hd)+l*sin(k2*i*hd);
    xl4(i,=[i x y];
end
% 绘制二维旋轮线
figure(1);                % 生成第1个图形窗口
subplot(2,2,1);           % 选择第1个子窗口
plot(xl1(:,2),xl1(:,3))
grid                      % 绘制网格线
title('二维旋轮线(\theta =360度)')
subplot(2,2,2);           % 选择第2个子窗口
plot(xl2(:,2),xl2(:,3))
grid                      % 绘制网格线
title('二维旋轮线(\theta =720度)')
subplot(2,2,3);           % 选择第3个子窗口
plot(xl3(:,2),xl3(:,3))
grid                      % 绘制网格线
title('二维旋轮线(\theta =1080度)')
subplot(2,2,4);           % 选择第4个子窗口
plot(xl4(:,2),xl4(:,3))
grid                      % 绘制网格线
title('二维旋轮线(\theta =1440度)')
% 2----三维旋轮线参数计算
for i=1:1:360
    x=(k1*cos(i*hd)+l*cos(k2*i*hd))*cos(bt*hd);
    y=(k1*sin(i*hd)+l*sin(k2*i*hd))*cos(bt*hd);
    z=sqrt(x^2+y^2)*tan(bt*hd);
    xlx1(i,=[i x y z];
end
for i=1:1:720
    x=(k1*cos(i*hd)+l*cos(k2*i*hd))*cos(bt*hd);
    y=(k1*sin(i*hd)+l*sin(k2*i*hd))*cos(bt*hd);
    z=sqrt(x^2+y^2)*tan(bt*hd);
    xlx2(i,=[i x y z];
end
for i=1:1:1080
    x=(k1*cos(i*hd)+l*cos(k2*i*hd))*cos(bt*hd);
    y=(k1*sin(i*hd)+l*sin(k2*i*hd))*cos(bt*hd);
    z=sqrt(x^2+y^2)*tan(bt*hd);
    xlx3(i,=[i x y z];
end
for i=1:1:1440
    x=(k1*cos(i*hd)+l*cos(k2*i*hd))*cos(bt*hd);
    y=(k1*sin(i*hd)+l*sin(k2*i*hd))*cos(bt*hd);
    z=sqrt(x^2+y^2)*tan(bt*hd);
    xlx4(i,=[i x y z];
end
% 矩阵cs(:,j)表示第j列的各行元素
% 绘制三维旋轮线
figure(2);                % 生成第2个图形窗口
subplot(2,2,1);           % 选择第1个子窗口
plot3(xlx1(:,2),xlx1(:,3),xlx1(:,4))
grid
title('三维旋轮线(\theta =360度)')
subplot(2,2,2);           % 选择第2个子窗口
plot3(xlx2(:,2),xlx2(:,3),xlx2(:,4))
grid
title('三维旋轮线(\theta =720度)')
subplot(2,2,3);           % 选择第3个子窗口
plot3(xlx3(:,2),xlx3(:,3),xlx3(:,4))
grid
title('三维旋轮线(\theta =1080度)')
subplot(2,2,4);           % 选择第4个子窗口
plot3(xlx4(:,2),xlx4(:,3),xlx4(:,4))
grid
title('三维旋轮线(\theta =1440度)')
% 输出数据
disp ' '
disp '          ==========   圆锥齿轮传动参数   ==========';
fprintf(1,'                   行星轮齿数    z7 = %3.0f \n',z7);
fprintf(1,'                   分度圆半径    r7 = %3.3f 度 \n',r7);
fprintf(1,'                   分度圆锥角   dt7 = %3.3f 度 \n',dt7);
fprintf(1,'                   中心轮齿数    z8 = %3.0f \n',z8);
fprintf(1,'                   分度圆半径    r8 = %3.3f 度 \n',r8);
fprintf(1,'                   分度圆锥角   dt8 = %3.3f 度 \n',dt8);
fprintf(1,'   中心轮与行星轮当量半径之比    rb = %3.0f \n',r8/r7);
disp ' '
['  行星轮公转',' 动点x坐标',' 动点y坐标',' 动点z坐标']
[xlx1(:,1),xlx1(:,2),xlx1(:,3),xlx1(:,4)]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

guofucheng07

金虫 (正式写手)


程序m代码

» 本帖附件资源列表

  • 欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
    本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:xiaomuchong@tal.com
  • 附件 1 : 07-搅拌机工作头旋轮轨迹分析与仿真-1.m
  • 2014-01-03 17:28:25, 3.35 K
2楼2014-01-03 17:28:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
简单回复
2014-01-25 10:04   回复  
引用回帖:
2楼: Originally posted by guofucheng07 at 2014-01-03 17:28:44 程序m代码

谢谢分享
相关版块跳转 我要订阅楼主 guofucheng07 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考博] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 EZ67DG6CvcKL 2026-08-31 5/250 2026-09-01 05:45 by o3EMxHUAQDtS
[公派出国] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 wsYGJnURYvm6 2026-08-31 3/150 2026-09-01 01:52 by o3EMxHUAQDtS
[基金申请] 投票:  有多少人是今天查系统知道结果的? +17 爱看书的可乐 2026-08-26 19/950 2026-08-31 21:30 by xiangy672
[基金申请] 基金未中,这种答复是模板吗? +6 zhaosm1982 2026-08-27 7/350 2026-08-31 21:18 by qdxxmc
[基金申请] 面上意见出来了 +12 黄鸟于飞Chao 2026-08-29 23/1150 2026-08-31 18:57 by 黄鸟于飞Chao
[基金申请] 基金不中,共勉 +12 eulota 2026-08-26 12/600 2026-08-31 08:42 by ZJTJZ
[基金申请] 有没有仍没收到信息的 +7 德尚中行 2026-08-27 8/400 2026-08-30 20:52 by purplejack
[考博] 找导师 +6 yuanjiabao 2026-08-29 7/350 2026-08-30 14:40 by 生科新手
[基金申请] 麻烦专家们看看评委们的意见(F口面上) +6 gdd2018 2026-08-28 11/550 2026-08-30 08:58 by 超级无敌华子
[基金申请] 国自然面上复盘~欢迎讨论 (金币+15) +15 晴天加油 2026-08-26 16/800 2026-08-29 18:28 by symmetry
[基金申请] 国自然评审意见 +13 wangmingqi 2026-08-28 19/950 2026-08-29 10:22 by Poppy1104
[基金申请] 2026年叶企孙基金 +4 bud_bud 2026-08-27 7/350 2026-08-29 07:23 by foolishmani
[基金申请] 基金系统什么内容也没有 30+4 winsaint 2026-08-27 9/450 2026-08-28 11:06 by maolC
[基金申请] 怎么查啊 +6 huang1991js 2026-08-26 6/300 2026-08-28 08:42 by winsaint
[基金申请] 看板上这么多中的,有点像50人群里49个人都是骗子的那种感觉…… +5 a089 2026-08-26 6/300 2026-08-27 14:05 by jonewore
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 出来了 +9 trojank 2026-08-26 9/450 2026-08-26 14:25 by 宝贝虫子
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 今天务委会开完了,明天出结果吗 +19 angus9576 2026-08-25 23/1150 2026-08-26 10:03 by zp519
信息提示
请填处理意见