24小时热门版块排行榜    

查看: 539  |  回复: 4
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

2012200838

新虫 (正式写手)

[求助] 拟合式中有sinθ,图形怪异求帮助。。。。泪。。。。

CODE:
Fx=load('Fxx.txt');
Fy=load('Fyy.txt');

n=length(Fx);                %Fx,Fy数据数量
theta=zeros(n,1);
Ft=zeros(n,1);
Kt=zeros(n,1);
Ft_fit=zeros(n,1);

for k=1:n
    theta(k)=pi/n*k;
end
for k=1:n
    Ft(k)=-cos(theta(k))*Fx(k)+sin(theta(k))*Fy(k);
end
% Calculate Kt,Kr
ft=0.1;ap=3;
delta=70;
for k=1+delta:n-delta
%   Kt(k)=Ft(k)/(ft*ap);     %
    Kt(k)=Ft(k)/(ap*ft*sin(theta(k)));  
end
E=10;                                             %设定多项式拟合次数
a=polyfit(theta,Kt,E);                            %拟合多项式
Kt_fit=polyval(a,theta);
for k=1+delta:n-delta
%   Ft_fit(k)=ap*ft*Kt_fit(k);      %
    Ft_fit(k)=ap*ft*sin(theta(k))*Kt_fit(k);      %Ft的拟合表达式
end

% 结果输出
%-------------------------------------------------------------------------%
figure
set(gcf,'color','w')
plot(theta,Fx,'k')           % Fx
hold on
plot(theta,Fy,'b')           % Fy
grid on
legend('Fx,Fy')
%-------------------------------------------------------------------------%
figure
set(gcf,'color','w')
plot(theta,Ft,'r')          % Ft
hold on
plot(theta,Ft_fit,'g')      % Ft_fit
hold on
grid on
legend('Ft','Ft-fit')

拟合式中有sinθ,图形怪异求帮助。。。。泪。。。。
问题算法.png


拟合式中有sinθ,图形怪异求帮助。。。。泪。。。。-1
E=3.png


拟合式中有sinθ,图形怪异求帮助。。。。泪。。。。-2
E=5.png


拟合式中有sinθ,图形怪异求帮助。。。。泪。。。。-3
E=10.png
回复此楼
生命就是一场旅行,不要错过了路边的风景!
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

2012200838

新虫 (正式写手)

引用回帖:
2楼: Originally posted by taokaijoshua at 2014-12-02 11:11:36
顶顶

给点力啊,光顶不行!
生命就是一场旅行,不要错过了路边的风景!
3楼2014-12-02 11:17:34
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 5 个回答

2012200838

新虫 (正式写手)

这是修改后代码,出现报错,没有检查出来。。。。
CODE:
Fx=load('Fxx.txt');
Fy=load('Fyy.txt');

n     =length(Fx);                                     % Sample quantity of Fx,Fy
theta =zeros(n,1);                                     % Rotation angle
Ft    =zeros(n,1);                                     % Tangential force initialization

for k=1:n
    theta(k)=pi/n*k;                                   % Discretize the rotation angle
end
for k=1:n
    Ft(k)=-cos(theta(k))*Fx(k)+sin(theta(k))*Fy(k);    % Evaluate Ft
end

% Calculate Kt,Kr
ft          =0.1;                                      % Feed per tooth
ap          =3;                                        % Axial cutting depth
delta_theta =10;                                       % Set the angle-cut length at both ends (Unit: degree)
delta       =round(delta_theta/180*n);                 % Quantity of samples deserted   
theta_Mid   =zeros(n-2*delta,1);                       % Angle data for fitting initialization
Kt          =zeros(n-2*delta,1);                       % Coefficient of tangential force
Ft_fit      =zeros(n-2*delta,1);                       % Fitting of Tangential force initialization


for k=delta+1:n-delta
%   Kt(k)=Ft(k)/(ft*ap);      
    Kt(k)=Ft(k)/(ap*ft*sin(theta(k)));                 % Evaluate Kt within the given interval
end

for k=1:n-2*delta
   theta_Mid(k)=theta(k+delta);                        % Cut angle data near 0 and pi
end

Degree=5;                                              % Set the polynomial degree
p_Ft=polyfit(theta_Mid,Kt,Degree);                     % Evaluate the coefficients
Kt_fit=polyval(p_Ft,theta_Mid);

for k=delta+1:n-delta
%   Ft_fit(k)=ap*ft*Kt_fit(k);      %
    Ft_fit(k)=ap*ft*sin(theta(k))*Kt_fit(k);           % Fitting expression of Ft
end

生命就是一场旅行,不要错过了路边的风景!
4楼2014-12-02 19:36:28
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

2012200838

新虫 (正式写手)

引用回帖:
2楼: Originally posted by taokaijoshua at 2014-12-02 11:11:36
顶顶

金币送给你都不行
“当前回帖不是应助回帖,您不能对此进行金币奖励哦”
生命就是一场旅行,不要错过了路边的风景!
5楼2014-12-03 08:36:43
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 317求调剂 +4 申子申申 2026-03-19 8/400 2026-03-20 11:20 by 申子申申
[考研] 一志愿武汉理工材料工程专硕调剂 +7 Doleres 2026-03-19 7/350 2026-03-20 10:39 by EBSD
[考研] 能源材料化学课题组招收硕士研究生8-10名 +5 脱颖而出 2026-03-16 14/700 2026-03-20 09:30 by kkcoco25
[考研] 材料学硕318求调剂 +5 February_Feb 2026-03-19 5/250 2026-03-19 23:51 by 23Postgrad
[考研] 一志愿 西北大学 ,070300化学学硕,总分287,双非一本,求调剂。 +3 晨昏线与星海 2026-03-19 3/150 2026-03-19 13:36 by houyaoxu
[考研] 328求调剂,英语六级551,有科研经历 +4 生物工程调剂 2026-03-16 12/600 2026-03-19 11:10 by 生物工程调剂
[考研] 311求调剂 +11 冬十三 2026-03-15 12/600 2026-03-18 14:36 by 星空星月
[考研] 304求调剂 +12 小熊joy 2026-03-14 13/650 2026-03-18 12:34 by Linda Hu
[考博] 环境领域全国重点实验室招收博士1-2名 +3 QGZDSYS 2026-03-13 5/250 2026-03-18 11:13 by QGZDSYS
[考研] 考研求调剂 +3 橘颂. 2026-03-17 4/200 2026-03-17 21:43 by 有只狸奴
[考研] 308求调剂 +4 是Lupa啊 2026-03-16 4/200 2026-03-17 17:12 by ruiyingmiao
[考研] 085601求调剂 +4 Du.11 2026-03-16 4/200 2026-03-17 17:08 by ruiyingmiao
[考研] 有没有道铁/土木的想调剂南林,给自己招师弟中~ +3 TqlXswl 2026-03-16 7/350 2026-03-17 15:23 by TqlXswl
[考研] 275求调剂 +4 太阳花天天开心 2026-03-16 4/200 2026-03-17 10:53 by 功夫疯狂
[考研] 302求调剂 +4 小贾同学123 2026-03-15 8/400 2026-03-17 10:33 by 小贾同学123
[考研] 274求调剂 +5 时间点 2026-03-13 5/250 2026-03-17 07:34 by 热情沙漠
[考研] 304求调剂 +5 素年祭语 2026-03-15 5/250 2026-03-16 17:00 by 我的船我的海
[考研] 一志愿211 0703方向310分求调剂 +3 努力奋斗112 2026-03-15 3/150 2026-03-16 16:44 by houyaoxu
[考研] 321求调剂 +5 大米饭! 2026-03-15 5/250 2026-03-16 16:33 by houyaoxu
[考研] 330求调剂 +3 ?酱给调剂跪了 2026-03-13 3/150 2026-03-14 10:13 by JourneyLucky
信息提示
请填处理意见