Why there are two plots here when I ran the following code?

1 回表示 (過去 30 日間)
Abdallah Qaswal
Abdallah Qaswal 2022 年 6 月 21 日
編集済み: Sam Chak 2022 年 6 月 21 日
Hi every one,
when I run the following code, I get an extra line (circled in red). This line is not expected to occur but I think that this part of the code (215.6*0.5*(w.^(1/2)-(r.*16+0.21).^(1/2))) is responsible of this extra line becuase if it is deleted , the extra line will be removed. This extra line means that there are two values for a single x value on the x axis, which is wrong. How can I remove this extra line without deleting that part?
V1 = @(r,w) -acosh(10*(w/(1600*r + 21))^(1/2))/20000000000
V2 = @(r,w) acosh(10*(w/(1600*r + 21))^(1/2))/20000000000
% Define function to be integrated
fun = @(x,r,w)2.3*r.*0.0018./((w./((cosh(10^10.*x./0.5)).^2)-(r.*16+0.21)).^(1/2));
www = @(w,r)5.124+6.4*10^-6.*215.6*0.5*(w.^(1/2)-(r.*16+0.21).^(1/2)).*exp(-215.6*0.5*(w.^(1/2)-(r.*16+0.21).^(1/2)))./(integral(@(x)fun(x,r,w),V1(r,w),V2(r,w)))-(exp(-37.45.*r).*(70.31));
fimplicit(www,[0 5 0.001 0.075],'MeshDensity',500, 'LineWidth',1.5),grid
  11 件のコメント
Abdallah Qaswal
Abdallah Qaswal 2022 年 6 月 21 日
I am sorry, but this code also did not solve my issue unfortunately!
Sam Chak
Sam Chak 2022 年 6 月 21 日
編集済み: Sam Chak 2022 年 6 月 21 日
Hi @Abdallah Qaswal, take it easy. You need be mathematically competent in order to solve this complex problem, because we don't know what your equations do as we can only tell you what's wrong with the code, or the limitations of the code. You are the expert in your own field.
Can you identify the specfic mathematical components in your equations that cause the unwanted issue in the plot?
Once identified, I think the MATLAB MVPs can probably help or advise on the coding part, or check if there is a workaround or trade-off that you can make without taking compromise on the performance or the accuracy of the result.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by