马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
程序如下
function x=myfun1
x0 = [10;5;0.3;0.02;4000];
options=optimset('MaxFunEvals',33000,'MaxIter',700000);
[x,fval] = fsolve(@f,x0,options) ;
function F=f(x)
k=3000
ga=10322.87553
ei=178892900.6
p=60000
c=1000
h=173
ae=0
ea=159299400
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))*1000;
(x(4)-((k*x(2)+p)*(ga+p)/(ei*ga))^0.5)*10000;
(1000*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);
1000*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 =
0
-0.0000
0
0.0000
0.0195
Optimization terminated: relative function value changing by less
than max(options.TolFun^2,eps) and sum-of-squares of function
values is less than sqrt(options.TolFun).
ans =
1.0e+003 *
0.0264
0
0.0002
0.0000
1.3118
有两项0.0000,0.0002 保留的有效位数不足,应该在程序中如何设置
|