Question to: Infinite or Not-a-Number value encountered

2 ビュー (過去 30 日間)
Karsten Gros
Karsten Gros 2017 年 1 月 8 日
コメント済み: Karsten Gros 2017 年 1 月 10 日
Hi, I have a question regarding my matlab-code. Basically, the code should calculate the heat-transfer for drop-wise condensation. At first, the program worked just fine, but I received a unexpected solution, so I searched for mistakes. At line 64, I noticed that I wrote a / instead of * (kJ to J is obviously *1000 not /1000 ;) ) So after I corrected that mistake, the Warning: "Infinite or Not-a-Number value encountered" occurred (at the matlab-function integral, line 106 to 108). I attached the file, so if anyone is willing to help me, you would make me very happy :) I guess the problem is, that at line 64, h_fg gets too big (from /1000 to *1000, so factor 10^6), any ideas how I could get the program fixed? Thanks in advance and best regards, Karsten

採用された回答

Jordan Ross
Jordan Ross 2017 年 1 月 10 日
Hello,
This is a result of your function have a discontinuity and trying to integrate between points where the discontinuity exists. If you plot the function "start" you will see that the function is undefined around R = 0 and R = -2.
>> figure; fplot(start);
Furthermore, if you try and evaluate the function "start" at R=R_stern you will get that the value is "NaN" leading to the integral giving you this error.
>> start(R_stern)
ans =
NaN
  1 件のコメント
Karsten Gros
Karsten Gros 2017 年 1 月 10 日
Thanks, I guess the problem is on the function n (R) I guess... But how can the function work with h_fg=h_fg/M_w/1000, but not with h_fg=h_fg/M_w*1000? (line 65) Any idea?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by