Double Integral Fail Error. Numerical Integration Fails.
Show older comments
Hi All,
I am trying to solve an equation with double integral but it is giving me error as 'The integration was unsuccessful' , Infinite or Not-a-Number value encountered. However, when i use Mathematica for the same equation, it is giving me answer. My question is, isn't Matlab also supposed to give the answer same as Mathematica?
Here is the equation I am trying to solve and the Matlab code. Could you check where i am doing it wrong?

eta = 0.9;
psplit = 0.3;
PsN0dB = 0:5:45;
PsN0 = 10.^(PsN0dB/10);
v1 = 1;
v2 = 0.0625;
v3 = 0.0625;
v4 = 1;
a1 = 0.2;
a2 = 0.8;
for p = 1: length(PsN0)
lim1 = a2 ./ a1;
M_2 = @(m,n)((m .* n) ./ ((1 + n) .* ((1 - psplit) .* PsN0(p) .* (a2 - (n .* a1))).^2)) ...
.* exp(-(v2 - ((v1 .* v3) ./ (v4 .* n))) .* (n ./ ((1 - psplit) .* PsN0(p) .* ...
(a2 - (n .* a1)))) .* ( m - ((v4 .* (1 - psplit) .* PsN0(p) .* ...
(a2 - (n .* a1))) ./ (eta .* psplit .* PsN0(p) .* m)))) .* ...
expint((v1 .* ((n .* v4) + (m .* v3))) ./ (v4 .* (1 - psplit) .* PsN0(p) .* (a2 - (n .* a1))));
G(p)= (1 ./ (2 .* log(2))) .* ((v3 .* v2 .* v1)./ v4) .* integral2(M_2,0,lim1,1,Inf);
end
3 Comments
Ameer Hamza
on 5 Jun 2020
What is the correct value of integral? As it is currently written, it is not a simple 2D integral. The 'm' term outside the inner integral will not be integrated, and the final solution will be a function of 'm', not a constant.
Glorit P.
on 5 Jun 2020
Ameer Hamza
on 5 Jun 2020
Can you show the solution given by Mathematica?
Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!