How can I solve this type of integration?

I know how to determine either double integration and summation alone, but how could I solve both together as shown in pic.

 Accepted Answer

This seems like a natural case for a for-loop. Something like this:
your_sum_of_integrals = 0;
for j1 = 1:100
your_sum_of_integrals = your_sum_of_integrals + (p-1)^2*integral2(@(theta,y) integrand_expr - etc;
end
A simple computational solution - there might be some clever way to figure out a closed-form solution of this, but this should be enough...
HTH

4 Comments

Dear @Bjorn Gustavsson thanks for your answer, but when I put the parameters I got a an error, here is the code
your_sum_of_integrals = 0;
for j1 = 1:100
for p=1:100;
your_sum_of_integrals = your_sum_of_integrals + (1-p)^2*integral2(@(phi,y)) exp(y/sin(phi))*cos(phi)^2*sin(phi)*phi); % integrand_expr - etc;
end
p=p+1;
end
If you change the integral-part to:
j1*p^(j1-1)*integral2(@(phi,y) exp(-j1*y./sin(phi)).*(1-y).^2.*cos(phi).^2.*sin(phi).*phi,0,pi/2,0,1);
Then that is evaluated. However, note that I inserted both the (1-y)^2 factor and the negative in the exponent. The function in the integral call needs to be vectorized (i.e. .*, .^ and ./ instead of * ^ and /). You'll have to sort out the looping part since your equation doesn't contain any sum over p, presumably you know what you're after.
HTH
Dear @Bjorn Gustavsson could do you help me to plot this function?
The way I understand your sum-of-integrals is that you integrate over y and θ and you sum such integrals over 100 values of p. That should leave you with one value for the sum without any independent variable it depends on. To make a graph you'd need some kind of variation to make it somewhat interesting, right? So what do you want to vary in this function? You could keep track of every term in the sums over p and j to make a 2-D surface/pseudo-color graph for example. But before I suggest something you'll have to explain what you want to plot...

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!