how to use multiple variable in fsolve and plot the corresponding result

1 回表示 (過去 30 日間)
jayash
jayash 2015 年 2 月 20 日
コメント済み: jayash 2015 年 2 月 20 日
I want to plot between 'n0' and 'U'. First I have to get 'n0' in terms of 'U' (for which I used fsolve)
eq = @(q) 2*(1 - cos(2*Pi*q));
hq =@(q) ((eq)^2 + 2*U*n0*(eq))^(1/2);
ha = @(q) (((eq) + (U*n0))/hq) - 1;
a = -0.5;
b = 0.5;
v = @(U,n0) quad(ha,a,b);
vv = @(U,n0) n0+(0.5*v)-1;
options = optimset('Display', 'iter');
n = @(U) fsolve(vv,n0,0.1);
U = 0:0.1:20;
plot(U,n(U))
How can I do this? Thanks.

回答 (2 件)

Torsten
Torsten 2015 年 2 月 20 日
Please write down the equation you are trying to solve in a mathematical notation.
Maybe then someone can help you to solve your problem.
Nobody has the time to put the pieces of your above puzzle-code together.
Best wishes
Torsten.

Torsten
Torsten 2015 年 2 月 20 日
Your integral does not exist since the denominator is 0 at q=0 and hw proportional to q in a neighborhood of q=0.
Best wishes
Torsten.
  1 件のコメント
jayash
jayash 2015 年 2 月 20 日
Do you any method to overcome this singularity, I mean is there any way to exclude "'\hbar\omega = 0" ?

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

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by