フィルターのクリア

can't solve an equation

3 ビュー (過去 30 日間)
Amr Sadek
Amr Sadek 2014 年 9 月 29 日
コメント済み: SK 2014 年 9 月 29 日
Hello,
I'm trying to solve this equation:
Fun=@(T) 1-exp(-n.*S.*( integral(@(T) exp(-E./(k.*T)),Ti,T)) ) ;
Where E=1; k=8.6e-5; n=10; S=1e12; Ti=300;
For T=300:500, this function changes from Fun= [0:1]. So, this function has real values from 0 to 1 in this range of T. However, the matlab can solve this equation for only the values in the range of [0:0.49]. If, for example, Fun=0.5 or 0.6....0.99, the MATLAB gives: "Warning: Explicit solution could not be found."
Here is the details of my code:
The solution of the integral in the equation is given by:
(T.*exp(-E./(k.*T))- ( (E./k).*expint(E./(k.*T)) )) - (Ti.*exp(-E./(k.*Ti))- ( (E./k).*expint(E./(k.*Ti)) ))
So, the final form of the equation will be given as:
fun=1-exp(-n.*S.*( ((T.*exp(-E./(k.*T))- ( (E./k).*expint(E./(k.*T)) )) - (Ti.*exp(-E./(k.*Ti))- ( (E./k).*expint(E./(k.*Ti)) ))))) ;
Examples:
syms T
>> solve(fun==0.2)
ans =
345.05417496592632071516378454629
However,
solve(fun==0.5)
Warning: Explicit solution could not be found.
> In solve at 179
ans =
[ empty sym ]
can anyone help me in this?
Thank you

採用された回答

SK
SK 2014 年 9 月 29 日
Maybe you need to specify a rough domain where the solution lies or a starting point for the iteration? The solver may not be looking at high enough values of T and so gets stuck at the halfway inflexion point. You may need to ask it to look at the entire interval say 0 to 500. I don't see an option in Matlab to do this but the docs say that you can do it in the Mupad notebook.

その他の回答 (1 件)

Amr Sadek
Amr Sadek 2014 年 9 月 29 日
編集済み: Amr Sadek 2014 年 9 月 29 日
Thank you for your answer
I used the vpasolve built-in function instead of the "solve" function. This function allows me to use start point or searching region for the solution. I tested it and it worked very well.
Thank you.
  1 件のコメント
SK
SK 2014 年 9 月 29 日
welcome :)

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by