查看单个帖子
旧 2009-04-03, 13:38   #2
laosam280
高级会员
 
注册日期: 2008-11-07
住址: 湖南长沙
帖子: 233
声望力: 21
laosam280 正向着好的方向发展
默认 回复: [求助]关于Explicit solution could not be found的问题

clear;
syms a b c t1 t2 t4;
[a,b,c]=solve('(a * cos(b) - 0.000)^2 + (a * sin(b) - 0.450)^2 = (a + c * t1(i))^2',
'(a * cos(b) - 0.300)^2 + (a * sin(b) - 0.450)^2 = (a + c * t2(i))^2 ',
'(a * cos(b) - 0.300)^2 + (a * sin(b) - 0.000)^2 = (a + c * t4(i))^2 ','a','b','c')
应该是这样些的,但是我求解出来没有显式解。估计要用牛顿法计算比较好。我这里有个函数文件,希望可以帮到你:
function [R,n]=newton_methods(x0,eps)
if nargin==1
eps=1.0e-4;
end

r=x0-myfun(x0)/dmyfun(x0);
n=1;
tol=1;
while tol>eps
x0=r;
R=x0-myfun(x0)/dmyfun(x0);
tol=norm(r-x0);
n=n+1;
if(n>100000)
disp('迭代步数太多,可能不收敛!');
return;
end
end
你需要自己编写myfun,就是你的方程。注意写成Equation=0的形式,但只需要Equation部分。
laosam280 当前离线   回复时引用此帖