Re: integration of piecewise convex bivariate function with 6 parameters
- To: mathgroup at smc.vnet.net
- Subject: [mg78934] Re: integration of piecewise convex bivariate function with 6 parameters
- From: dh <dh at metrohm.ch>
- Date: Fri, 13 Jul 2007 06:01:47 -0400 (EDT)
- References: <f74t0t$91f$1@smc.vnet.net>
Hi Michael,
you have syntax errors, abs should be Abs, max should be Max.
hope this helps, Daniel
Michael Chen wrote:
> Dear there,
>
> I spent roughly one week to manually integrate a piecewise convex function
> with 6 parameters, and I can't imagine how happy I would be if Mathematica
> can do it for me too. Following is the function, and the Mathematica command
> I tried.
>
> f(h1,h1)= if (h1 - x1 <= 0 or h2 - x2 <= 0) then | h1 - x1| + | h2 - x2 |
> else max( h1 - x1, h2 - x2), where x1, x2 are real parameters. And I
> integrate the function f(h1, h2) over rectangular region {h1, B1, U1}, {h2,
> B2, U2}, where B1, U1, B2, U2 are reals, and B1 < U1, B2 < U2.
>
> I tried this in Mathematica 6.0:
>
> g[x1_Real, x2_Real] := Integrate[
> If [h1 - x1 <= 0 || h2 - x2 <= 0, abs[h1 - x1] + abs[h2 - x2] ,
> max[h1 - x1, h2 - x2]], {h1, B1, U1}, {h2, B2, U2},
> Assumptions ->
> Im[B1] == 0 && Im[B2] == 0 && Im[U1] == 0 && Im[U2] == 0 &&
> Im[h1] == 0 && Im[h2] == 0 && B1 < U1 && B2 < U2 ];
>
> However there is simply no response from Mathematica 6.0 after I press
> Shift+Enter. Could anybody give me any suggestions? Thanks a lot.
>
> ( The example on
> http://reference.wolfram.com/mathematica/tutorial/IntegralsOverRegions.html,
> [image: Click for copyable input] <javascript:input('i_9')>, seems very
> close to what I am doing. And Mathematica gives back a piecewise function
> in a as answer. I know the integral of my function f(h1,h2) is a
> piecewise function of (x1,x2) too.)
>
> Michael Chen
>
>