How to Integrate Lognormal PDF multiplied by a function.
Mostra commenti meno recenti
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 Commenti
Tommy
il 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
il 3 Apr 2020
Yes, and place you code in a proper code block.
Mudaga Andrew Nomuoja
il 5 Apr 2020
Tommy
il 5 Apr 2020
Thanks - how about t?
Risposta accettata
Più risposte (1)
Mudaga Andrew Nomuoja
il 5 Apr 2020
0 voti
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!