马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
本帖最后由 东南小忽悠 于 2011-4-21 17:16 编辑
解一个复杂非线性方程组,MaxFunEvals,MaxIter值的设置我不太明白,随便设的。程序如下
function x=myfun1
x0 = [0;0.1;10;0.1;2000];
options=optimset('MaxFunEvals',2000000,'MaxIter',60000);
[x,fval] = fsolve(@f,x0,options) ;
function F=f(x)
k=2000
ga=300000
ei=500000000
p=5000
c=10000
h=180
ae=30
ea=100000000
F =[k*x(2)-ea*(((h-ae-x(2))^2+(x(1))^2)^0.5-h)*cos(x(3))/h;
x(1)-(h-ae-x(2))*x(3);
x(4)-((k*x(2)+p)*(ga+p)/(ei*ga))^0.5;
(x(5)*(1-cos(x(4)*h))-c*h)/(k*x(2)+p)+((k*x(2)+p)*(c-k*x(2)*tan(x(3)))+ga*c)*sin(x(4)*h)/(ga*x(4)*(k*x(2)+p))-x(1);
x(5)-(k*x(2)+p)*(1-cos(x(4)*h))*((ga+k*x(2)+p)*c/ga/x(4)/(k*x(2)+p)-k*x(2)/ga/x(4))/sin(x(4)*h)]
最后得出的结果
F =
1.0e+003 *
-0.0415
-1.6487
0.0001
-0.3674
0.0034
Optimizer appears to be converging to a point which is not a root.
Norm of relative change in X is less than max(options.TolX^2,eps) but
sum-of-squares of function values is greater than or equal to sqrt(options.TolFun)
Try again with a new starting guess.
试了很多初始值,不管多大多小,解出的结果总在初始值附近。
应该怎么解决。鄙人初学matlab,而且对数学的迭代法不太了解。望论坛的高手指点,谢谢! |