Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2008-03-23, 14:21   #1
未注册
游客
 
帖子: n/a
默认 【求助】谁能帮帮我 标准的求四杆机构的程序

下面这个是标准的标准的求四杆机构的程序,求的是角三和角四,但我运行时为什么就能求出第一个值呢?谁能告诉我一下是为什么呢?
function [th3,th4]=possol4(th,rs)
%possol4 position solution of a 4-bar mechanism
%
%script used to implement Newton-raphanism
%method for solving nonliner
%position problem of a 4-bar mechanism.
%
%
%inputs of function
%
%th(1)=th-2
%th(2)=th-3-bar(starting guess)
%th(3)=th-4-bar(starting guess)
%
%rs(1)=r-1
%rs(2)=r-2
%rs(3)=r-3
%rs(4)=r-4
%
th2=th(1);
th3bar=th(2);
th4bar=th(3);
%
%set condition for convergence
%
epsilon=1.0E-6;
%intialize the f-vetor
%
%compute the function as a two-element vector:
%
f=[rs(3)*cos(th3bar)-rs(4)*cos(th4bar)+rs(2)*cos(th2)-rs(1);
rs(3)*sin(th3bar)-rs(4)*sin(th4bar)+rs(2)*sin(th2)];
%
%repetedly compute the correction factors
%as per equaion(3-11)
%
while norm(f)>epsilon
j=[-rs(3)*sin(th3bar) rs(4)*sin(th4bar);
rs(3)*cos(th3bar) -rs(4)*cos(th4bar)];
dth=inv(j)*(-1.0*f);
th3bar=th3bar+dth(1);
th4bar=th4bar+dth(2);
f=[rs(3)*cos(th3bar)-rs(4)*cos(th4bar)+rs(2)*cos(th2)-rs(1);
rs(3)*sin(th3bar)-rs(4)*sin(th4bar)+rs(2)*sin(th2)];
norm(f);
end;
th3=th3bar;
th4=th4bar;
  回复时引用此帖
 

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码


相似的主题
主题 主题作者 版面 回复 最后发表
【求助】dataread的问题 gladiator MATLAB论坛 1 2007-07-12 09:02


所有时间均为北京时间。现在的时间是 19:51


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.