matlab fsolve不收敛,fsolve无法解出方程,试着减小Function tolerance也不行。

这个是我自己写的函数代码

cd=0.625;

ps=70e5;

kk=2e-12;

d=870;

xs=0.000004;

op1=(0.0000045+xs); %valve open area

op2=(0.0000045-xs);

if op1<0  % simulate the actual valve open area

Av1=0;

else

Av1=7.938e-3*pi*op1;

end

if op2<0;

Av2=0;

else

Av2=7.938e-3*pi*op2;

end

r=11.43/5.8;

p1fnc=@(p1)(cd*(2/d)^0.5*(Av1*(ps-p1)^0.5-Av2*(p1)^0.5)+kk*(p1-p1*r)*(r-1)-r*cd*(2/d)^0.5*(Av1*(p1*r)^0.5-Av2*(ps-r*p1)^0.5));

options=optimset;

options = optimset(options,'TolX',1e-16);

options = optimset(options,'TolFun',1e-20);

options = optimset(options,'MaxFunEvals',Inf);

y=fsolve(p1fnc,1e5,options);

运行结果总是:

Equation solved, fsolve stalled.

fsolve stopped because the relative size of the current step is less than the

selected value of the step size tolerance squared and the vector of function values

is near zero as measured by the selected value of the function tolerance.

自己画了一个p1fnc的图像,p1从1e5到1e6。图像如下,解是图中的红色点。已经减小了function tolerance可是还是不行啊。应该怎么设置呢。

1.png

(11.75 KB, 下载次数: 0)

2013-11-17 19:45 上传

442a53943febe9465fc072b4fbe10813.gif

b2a5a3e0dcc7d508e00275fe42fce1b5.gif

p1fnc vs p1

291ba15d635a501597d42ed4575d7559.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值