How to Integrate Lognormal PDF multiplied by a function.
Show older comments
Hi,
I am trying to ∫ D(V)*F(V)dV eq1
min=_(0.8e-26) and max=(1.35e-26)
D(t,V)=2*Ps*(1-exp(-(t)./(Vo*exp((Ps*10000000-Wb)*V/(Kb*300))))) and F(V)= Lognormal PDF=(1./(V.*sigma.*sqrt(2.*pi)).*exp(-log(V)-mu).^2/(2.*sigma^2)).*V
Find below, the code I wrote to compute the integral of eq1:
Dp=@(V)(1./(V.*sigma.*sqrt(2.*pi)).*exp(-log(V)-mu).^2/(2.*sigma^2)).*V.*2*Ps*(1-exp(-(t)./(Vo*exp((Ps*10000000-Wb)*V/(Kb*300)))))
Dp =
function_handle with value:
@(V)(1./(V.*sigma.*sqrt(2.*pi)).*exp(-log(V)-mu).^2/(2.*sigma^2)).*V.*2*Ps*(1-exp(-(t)./(Vo*exp((Ps*10000000-Wb)*V/(Kb*300)))))
>> integral(Dp,0.8e-26,1.35e-26)
Error message I got were:
Matrix dimensions must agree.
Error in
@(V)(1./(V.*sigma.*sqrt(2.*pi)).*exp(-log(V)-mu).^2/(2.*sigma^2)).*V.*2*Ps*(1-exp(-(t)./(Vo*exp((Ps*10000000-Wb)*V/(Kb*300)))))
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Please can anyone kindly assist me or advice me?
Thank you
4 Comments
Tommy
on 3 Apr 2020
Would you be able to provide all of your code, or at least the values you are using for all variables (sigma, mu, Ps, t, Vo, Wb, Kb)?
David Hill
on 3 Apr 2020
Yes, and place you code in a proper code block.
Mudaga Andrew Nomuoja
on 5 Apr 2020
Tommy
on 5 Apr 2020
Thanks - how about t?
Accepted Answer
More Answers (1)
Mudaga Andrew Nomuoja
on 5 Apr 2020
0 votes
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!