How can I make this plot smooth?

a=5.51*(10^-10);
h=6.62*(10^-34)
E=linspace(100,1.6e-16,200)
m=9.11e-31
h=6.62*(10^-34);
A=sqrt(2*m*E)/h;
f=(16*(sin(A*a)./(A*a)))+cos(A*a);
plot(A,f)

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 4 日

0 投票

You have
E=linspace(100,1.6e-16,200)
which is 200 values linearly decreasing from 100 to 1.6E-16. You calculate A proportional to sqrt(E) so A will be proportional to 10 to about 1.26E-8 in sqrt-linear steps. You then divide by A. But dividing by sqrt-linear does not give linear or sqrt-linear: the distance between adjacent 1/A for small A near 1E-8 is going to be much much greater than the distance between adjacent 1/A for large A near 10.
The only way to make the resulting plot smooth is to use E values such that after transformation are linear. For example,
maxE = 100;
minE = 1E-16;
Ar_maxE = 1 ./ (sqrt(2*m*maxE) ./ h);
Ar_minE = 1 ./ (sqrt(2*m*minE) ./ h);
Ar = linspace(Ar_maxE, Ar_minE, 200);
A = 1 ./ Ar;
f = 16 * sin(A .* a) ./ a .* Ar + cos(A .* a);

2 件のコメント

Walter Roberson
Walter Roberson 2017 年 12 月 4 日
I did not divide by Ar, I multiplied by Ar, which is constructed to be a linearly smooth version between the extremes of 1/A.
SHEREEN AHMED
SHEREEN AHMED 2017 年 12 月 5 日
編集済み: SHEREEN AHMED 2017 年 12 月 5 日
So, what's wrong with it? Note: It has to produce like a decaying cosine wave with different range.

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

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2017 年 12 月 4 日

編集済み:

2017 年 12 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by