Integration of two exponential functions

3 次查看(过去 30 天)
Hello my friends, I have a problem with solving the following integral. It is a combination of two exponentials with different ratio in the attached picture.
I will be very grateful if you can help me with this. The derivation steps, if provided, will be much better to me as I have to apply this kind of integration in other problems I have.
If there is no closed form, can you please help me on how to integrate it using MATLAB with constants a, b, \lambda, and y to appear in the last answer.
Thanks in advance.. :)
  5 个评论
David Goodmanson
David Goodmanson 2017-4-3
Hi sharief, This doesn't look like a very tractable integral, but at least it's not oscillatory. If you make the substitution x -> x/b, dx -> dx /b then you end up with
C = (1/b) Integral{0,inf} exp((ay/b)/(1+x)) exp(-(lambda/b)x) dx
so this is really just a two-parameter integral, a function of ay/b and lambda/b. That's not so bad, so one approach would be to make a 2-d table by numerical integration and interpolate off of it, not forgetting to multiply by 1/b afterwards.
Michael Henry
Michael Henry 2017-4-3
Hello David.
I am really thankful for your idea. However, I am not interested in the value of integral itself. Actually, the next thing I am gonna do after this integration is to optimize a and b. Hence, what I am really interested at is to get a closed form for this integration. Can you please tell me if there is any way that I can use MATLAB to get a closed form expression for my integration above?

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2017-4-3
There does not appear to be an analytical solution. Constraining ‘a+b=1’ simply requires defining ‘a=1-b’, since ‘a’ only appears once.
This seems the best you can do:
syms b lambda x y
f(x) = exp(((1-b)/b)*y/(b*x+1)) * exp(-lambda*x);
F = int(f, x, 0, Inf);
F_fcn = matlabFunction(simplify(F,'Steps',10))
F_fcn =
function_handle with value:
@(b,lambda,y)integral(@(x)exp(-lambda.*x).*exp(-(y.*(b-1.0))./(b.*(b.*x+1.0))),0.0,Inf)
or more directly:
F_fcn = @(b,lambda,y) integral(@(x)exp(-lambda.*x).*exp(-(y.*(b-1.0))./(b.*(b.*x+1.0))),0.0,Inf);
  6 个评论
Michael Henry
Michael Henry 2017-4-4
Thank you so much for your help. I tried to run the code but I am getting the following errors
"
Error using mupadmex Error in MuPAD command: Can integrate only with respect to identifiers. [int]
Error in symfun/feval>evalScalarFun (line 69) y = mupadmex('symobj::zipargs',Ffun,inds{:});
Error in symfun/feval (line 33) y = evalScalarFun(F.fun, varargin);
Error in fplot (line 101) x = xmin; y = feval(fun,x,args{4:end});
Error in work (line 9) fplot(Fsym, [0 1E+2])
"
Can you please tell me what's wrong? I am sorry for my repeated questions but I am new with MATLAB and I need your experience please. Thank you..
Star Strider
Star Strider 2017-4-4
My pleasure.
I am not certain. The code I posted ran without error. The values of the parameters could be a problem, however I do not know the parameters you provided or the code you ran.

请先登录,再进行评论。

更多回答(1 个)

Michael Henry
Michael Henry 2017-4-4
My be the problem with MATLAB version I am using. Can you please tell me which version you are using so I can use it.
Thanks again.
  3 个评论
Michael Henry
Michael Henry 2017-4-4
Thank you so much. I am able to run the code now with no errors after I downloaded the 2017a version.
Best Regards.
Star Strider
Star Strider 2017-4-4
My pleasure.
I am happy that it works for you.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by