|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
非线性方程求解
ms = 5; ns = 20 ; n2 =100; alfarad = 20;
y2min = -300; y2max = -240; zpeak = -46.9846; angle0 = 90;
angle=angle0*pi/180;
alfa = alfarad * pi / 180; %将压力角转化为弧度制
rbs = 0.5 * ms * ns * cos(alfa); %计算小齿轮基圆半径
ras = 0.5 * ms * ns + ms; %计算小齿轮齿顶圆半径
q2s = ns /n2; %计算传动比
thetas0 = pi/(2*ns) - (tan(alfa) - alfa);%计算刀具齿槽对称线到渐开线起始点的角度参数:
y2 = linspace(y2min,y2max,10);
options = optimset('Display','off'); %fzeor函数显示设置:
y2=linspace(150,250,10);
syms eus us phistrans;
phi2trans = q2s * phistrans;
zmin = zpeak;
thetastrans = ((ras)^2 - (rbs)^2)^0.5 / rbs;
phithetatrans = phistrans + (thetas0 + thetastrans);
phistransmax = PhisTransMax(zmin,rbs,thetastrans,thetas0,angle,q2s);
phistranslimits(:,2) = phistransmax * ones(1,10);
Z2dot(1:10)=zpeak + 1/(1:10);
for k = 1:10
phistranslimits(k,1) = PhisTransMax(z2dot(k,10),rbs,thetastrans,thetas0,angle,q2s);
end
AA = sin(phithetatrans) - thetastrans * cos(phithetatrans);
BB = cos(phithetatrans) + thetastrans * sin(phithetatrans);
for k = 1:10
yf2trans = @(phistrans,eus)(subs(y2(k) + rbs * (AA * sin(phi2trans) + BB * cos(angle) * cos(phi2trans)) + eus * sin(angle) * cos(phi2trans)));
phistransnum(k,:) = linspace(phistranslimits(k,1),phistranslimits(k,2),10);
for m = 1:10
usnum(k,m) = fzero(yf2trans,0,options,phistransnum(k,m));
end
end
usnum
%子函数
function Key = PhisTransMax(z2star,rbs,thetastrans,thetas0,angle,q2s)
syms phithetatrans0;
Bb = cos(phithetatrans0) + thetastrans*sin(phithetatrans0);
us0 = rbs / (q2s * cos(phithetatrans0));
z2f=@(phithetatrans0)(subs(z2star + rbs * Bb * sin(angle) - us0 * cos(angle)));
options = optimset('Display','off');
z = fzero (z2f,0.5,options);
Key = z - (thetas0 + thetastrans);
求USNUM的值,不知道怎么的,老是出错,请各位大虾指点,谢谢了 |
|