24小时热门版块排行榜    

查看: 620  |  回复: 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的回帖

taokaijoshua

铜虫 (小有名气)

2楼2014-12-02 11:11:36
已阅   关注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的回帖

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的回帖
相关版块跳转 我要订阅楼主 2012200838 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +8 Tide man 2026-08-11 8/400 2026-08-12 17:30 by Vivilian
[基金申请] 不应该看fileCode +5 且听虎啸 2026-08-12 6/300 2026-08-12 16:26 by Tide man
[基金申请] filecode +13 documentary 2026-08-10 15/750 2026-08-12 15:56 by 云上清扬
[论文投稿] 职称评审,求友友推荐见刊最快的期刊 +4 工厂打螺丝 2026-08-08 4/200 2026-08-12 09:18 by hansi2025
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 10/500 2026-08-12 09:12 by 布布和一二
[基金申请] 是这周出结果还是下周出结果? +3 yuleib84 2026-08-11 3/150 2026-08-11 21:53 by jnhyjjm
[基金申请] 听说今天filecode变了 +26 布布和一二 2026-08-06 49/2450 2026-08-11 13:18 by WH3796
[基金申请] 我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人 +8 家与远方 2026-08-10 13/650 2026-08-11 09:49 by 家与远方
[基金申请] 基金中了 +15 laoda193707 2026-08-06 15/750 2026-08-11 00:11 by jiafei2190
[基金申请] 静等基金结果 +5 gjjjzhong 2026-08-10 16/800 2026-08-10 17:19 by Tide man
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] filecode与中标关系的预测 +5 布布和一二 2026-08-07 5/250 2026-08-09 16:15 by 袁向阳007
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[基金申请] 化学口download_prp&fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
信息提示
请填处理意见