필터 지우기
필터 지우기

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 CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by