Integrating min and max function

조회 수: 10 (최근 30일)
Hao Liang
Hao Liang 2020년 9월 17일
댓글: Burak Kurtulan 2020년 12월 23일
I learn how to evaluate a integral using the int() function in MATLAB, but if there is an integral whose integrant involves a min or max function, like , can we use some method to find an analytical formula?
  댓글 수: 1
Burak Kurtulan
Burak Kurtulan 2020년 12월 23일
Hello, I need to learn that as well. I have a highly complicated function which cannot be seperated. How did you solve your problem? Could you share with me?

댓글을 달려면 로그인하십시오.

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2020년 9월 17일
This might not be the most elegant solution to this, but it's a first stab. Take a quick-look at what the function looks like:
[X,Y] = meshgrid(linspace(0,1,1001));
figure
imagesc(X(1,:),Y(:,1),max(X,Y))
Then you see that it should be possible to divide the region you want to integrate over in two triangular parts, one where the function takes the value of X and one where it takes a value of Y. Those functions over those regions should be simple enough to integrate over. That aproach kind of works for simlpe cases like in your example where we get one or a couple of separate regions where the function is smooth and well-behaved. In this example direct numerical integration works both on your initial function over the 0<x<=1, 0<y<=1 region, just follow the examples in the help of integral2.
HTH
  댓글 수: 3
Hao Liang
Hao Liang 2020년 9월 18일
Thanks for helping. Actually I wonder if we can do it in MATLAB? Since some of the integrals I am trying to calculate is so complicated (like the one ), It is too hard for my to calculate it by pencil :(
Bjorn Gustavsson
Bjorn Gustavsson 2020년 9월 18일
Well, I'm not sure that the symbolic int-function handles this too well. My suggestion is that you start by having a look at the function in different slices for some values of x3, then x2 and x1 - that way you might start to figure out how to partition the region of integration, once you have some analytical expressions for the integration-limits then you have separated the integral into a sum of smaller and simpler integrals that should be easier for int to handle.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by