• 主页

# Matlab求救！！！分段函数积分问题

lovec001 2014-05-04 07:20:58
[code=text][code=c][code=text]
R=5, Nt=4, alpha=pi/6; % Parameters about the mill
ar=7.5, ap=5, ft=0.1; % Cutting parameters
kts=500, krs=500, kas=500; % Sheer cutting force coefficient in tangential, radial, axial direction, respectively
ktp=500, krp=500, kap=500; % Plough cutting force coefficient in tangential, radial, axial direction, respectively
delta=2*pi/Nt; % The tooth space angle
phi0=acos((R-ar)/R); % Milling angle, which equals ?ex minus ?st
phi_st=pi-phi0, phi_ex=pi; % Start and exit cutting angle
syms theta; % Cutting edge position

% Force elements of x,y,z direction
dFx=(ft*sin(theta)*cos(theta)*kts+ft*(sin(theta))^2*krs+cos(theta)*ktp+sin(theta)*krp)*R/tan(alpha);
dFy=(-ft*(sin(theta)^2)*kts+ft*sin(theta)*cos(theta)*krs-sin(theta)*ktp+cos(theta)*krp)*R/tan(alpha);
dFz=(ft*sin(theta)*kas+kap)*R/tan(alpha);

angle=0:0.01:2*pi;
N=length(angle);
% Fx1=zeros(size(theta));Fx2=zeros(size(theta));Fx3=zeros(size(theta));
% Fy1=zeros(size(theta));Fy2=zeros(size(theta));Fy3=zeros(size(theta));
% Fz1=zeros(size(theta));Fz2=zeros(size(theta));Fz3=zeros(size(theta));
% Integrate the functions above% Find the interation limits of Fx,y,z
for k=1:N
if angle(k)>= phi_st && angle(k)< phi_st + delta
Fx1=int(dFx,theta,theta-phi_st,phi_st);
Fy1=int(dFy,theta,theta-phi_st,phi_st);
Fz1=int(dFz,theta,theta-phi_st,phi_st);
elseif angle(k)>= phi_st + delta && angle(k)< phi_ex
Fx2=int(dFx,theta,phi_st+delta,phi_ex);
Fy2=int(dFx,theta,phi_st+delta,phi_ex);
Fz2=int(dFx,theta,phi_st+delta,phi_ex);
elseif angle(k)>= phi_ex && angle(k)<= phi_ex + delta
Fx3=int(dFx,theta,phi_ex,phi_ex+delta);
Fy3=int(dFy,theta,phi_ex,phi_ex+delta);
Fz3=int(dFz,theta,phi_ex,phi_ex+delta);
end
end
Fx=Fx1+Fx2+Fx3;
Fy=Fy1+Fy2+Fy3;
Fz=Fz1+Fz2+Fz3;
% Display the graphs of Fx,y,z
theta=0:pi/10:2*pi;
plot(theta,Fx)
hold on
plot(theta,Fy)
hold on
plot(theta,Fz)
[/code][/code][/code]

x=-3:0.01:3;
% y1=zeros(size(x));
% y2=zeros(size(x));
% y3=zeros(size(x));
N=length(x);
for k=1:N
if x(k)<-1&x(k)>=-3;
y1(k)=(-x(k).^2-4*x(k)-3)/2;
elseif x(k)>=-1&x(k)<1 ;
y2(k)=-x(k).^2+1;
else x(k)<=3&x(k)>=1 ;
y3(k)=(-x(k).^2+4*x(k)-3)/2;
end
end
y=y1+y2+y3;
plot(x,y)
...全文
464 点赞 收藏 回复

1921

2925