24小时热门版块排行榜    

CyRhmU.jpeg
查看: 914  |  回复: 3

fishfly80

铁虫 (小有名气)

[求助] matlab 问题求助,是否计算结果错误,如何改正?


>> format long;
b = 1.64984e-5;
f = @(v)8.314* 298.15 / (v-b) - 0.023758/ (v^2+2*v*b - b^2) - 1e+4;
v = fsolve(f,1.0);
v

v=
Optimization terminated: first-order optimality is less than options.TolFun.

v =

   0.247888826178237

??? v=
      |
Error: Expression or statement is incomplete or incorrect.
回复此楼

» 本帖已获得的红花(最新10朵)

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
format long;
b = 1.64984e-5;
f = @(v)8.314* 298.15 / (v-b) - 0.023758/ (v^2+2*v*b - b^2) - 1e+4;
v = fsolve(f,1.0);

Equation solved.

fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.



>> v

v =

   0.247888826178237

>> f(v)

ans =

   -1.818989403545857e-012
好像没啥错
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2012-03-22 15:53:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

fishfly80

铁虫 (小有名气)

送鲜花一朵
谢谢,没错就好。
3楼2012-03-22 16:43:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ldoop

铁杆木虫 (著名写手)


【答案】应助回帖

感谢参与,应助指数 +1
答案应该没有错,你可以画一下f的图,plot(v,f),看一下图就明白了
4楼2012-03-22 16:44:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 fishfly80 的主题更新
信息提示
请填处理意见