Integrating min and max function

19 次查看(过去 30 天)
Hao Liang
Hao Liang 2020-9-17
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 中查找有关 Logical 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by