can't solve an equation
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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.
0 个评论
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!