Re: [sage-support] Triple integrals in a specific region of space

2020-09-15 Thread Dima Pasechnik
Thanks, right, I forgot the meaning of "int" in latte_int, sorry.
Indeed, this looks like one can actually do better than Mathematica, if
latte_int is installed.


On Mon, Sep 14, 2020 at 2:23 AM slelievre  wrote:

>
>
> Le dimanche 13 septembre 2020 12:30:09 UTC+2, Dima Pasechnik a écrit :
>>
>>
>>
>> On Sun, Sep 6, 2020 at 10:03 AM Teodoro Coluccio 
>> wrote:
>>
>>> Can I perform triple integrals in a region of space I define? I'm trying
>>> to migrate from mathematica to sage, and in mathematica I could go and
>>> define a region of space (with various limitations) and then perform the
>>> integral of a function on it.
>>
>>
>> in general, there are no exact algorithms known for such a task.
>> Mathematica does implement some heuristics, it's not clear which ones.
>> In your example you're integrating a polynomial over a polytope, for this
>> case it's known how to do this exactly:
>> triangulate the region into simplices, then use an explicit formula for
>> each simplex. Perhaps that's
>> what Mathematica doing, they don't tell us.
>> https://arxiv.org/abs/0809.2083
>> Not implemented in Sage, but it would be a nice addition.
>>
>>
>>> Here is an explanatory image:
>>> [image: screen.png]
>>> Is there a way to easily perform this operation even in sage?
>>>
>>>
>>>
> Note: also asked on Ask Sage:
>
> - Triple integrals in a specific region of space
>   https://ask.sagemath.org/question/53419
>
> I posted an answer there.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/1304a60c-ea39-402a-a875-fed4437b5faao%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq2vvc2xJDSxJby3vmC2RUu2qgTKHWg7xJ%3DwgTyLnfdnhw%40mail.gmail.com.


Re: [sage-support] Triple integrals in a specific region of space

2020-09-13 Thread slelievre


Le dimanche 13 septembre 2020 12:30:09 UTC+2, Dima Pasechnik a écrit :
>
>
>
> On Sun, Sep 6, 2020 at 10:03 AM Teodoro Coluccio  > wrote:
>
>> Can I perform triple integrals in a region of space I define? I'm trying 
>> to migrate from mathematica to sage, and in mathematica I could go and 
>> define a region of space (with various limitations) and then perform the 
>> integral of a function on it. 
>
>
> in general, there are no exact algorithms known for such a task. 
> Mathematica does implement some heuristics, it's not clear which ones.
> In your example you're integrating a polynomial over a polytope, for this 
> case it's known how to do this exactly:
> triangulate the region into simplices, then use an explicit formula for 
> each simplex. Perhaps that's
> what Mathematica doing, they don't tell us.
> https://arxiv.org/abs/0809.2083
> Not implemented in Sage, but it would be a nice addition.
>  
>
>> Here is an explanatory image:
>> [image: screen.png]
>> Is there a way to easily perform this operation even in sage?
>>
>>
>>
Note: also asked on Ask Sage:

- Triple integrals in a specific region of space
  https://ask.sagemath.org/question/53419

I posted an answer there.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/1304a60c-ea39-402a-a875-fed4437b5faao%40googlegroups.com.


Re: [sage-support] Triple integrals in a specific region of space

2020-09-13 Thread Dima Pasechnik
On Sun, Sep 6, 2020 at 10:03 AM Teodoro Coluccio 
wrote:

> Can I perform triple integrals in a region of space I define? I'm trying
> to migrate from mathematica to sage, and in mathematica I could go and
> define a region of space (with various limitations) and then perform the
> integral of a function on it.


in general, there are no exact algorithms known for such a task.
Mathematica does implement some heuristics, it's not clear which ones.
In your example you're integrating a polynomial over a polytope, for this
case it's known how to do this exactly:
triangulate the region into simplices, then use an explicit formula for
each simplex. Perhaps that's
what Mathematica doing, they don't tell us.
https://arxiv.org/abs/0809.2083
Not implemented in Sage, but it would be a nice addition.


> Here is an explanatory image:
> [image: screen.png]
> Is there a way to easily perform this operation even in sage?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/2f4b4ec1-5661-490a-925d-6d038692bc0dn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq3TE%2Bvr5O20F1C%3DCBb%3DtCVgrqdqFBbtmOHQz-ouAnA0NQ%40mail.gmail.com.


Re: [sage-support] Triple integrals in a specific region of space

2020-09-12 Thread David Joyner
On Sun, Sep 6, 2020 at 5:03 AM Teodoro Coluccio 
wrote:

> Can I perform triple integrals in a region of space I define? I'm trying
> to migrate from mathematica to sage, and in mathematica I could go and
> define a region of space (with various limitations) and then perform the
> integral of a function on it. Here is an explanatory image:
> [image: screen.png]
> Is there a way to easily perform this operation even in sage?
>


1) You have to integrate wrt z first, which I don't know whether Mma would
understand without being told.

sage: integral(integral(integral(x^*2*+*2**y*z, (z, y, (*2*-x-*2**y)/*3*)),
(y, x, (*2*-x)/*2*)), (x, -*1*, *2*))
1681/320

2) Using sympy (in sage, but I used https://live.sympy.org/):

>>> var("x,y,z")
(x, y, z)(x, y, z)
>>> integrate(x*x+2*y*z, (z, y, (2-x-2*y)/3), (y, x, (2-x)/2), (x, -1, 2))
1681/320

3) You can also do this in maxima (also included in sage). See
https://themaximalist.org/tag/triple-integration/
for an example of how to use the syntax.

4) Instead of reposting the same question 3 times , it would be helpful to
others with the same question just
to keep the question in one thread.

5) Is this a homework problem for a math class?



> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-support/2f4b4ec1-5661-490a-925d-6d038692bc0dn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAEQuuAVewrVAf-xJbjsp_9dng0BtS_tFx54KtTf0mqyAE3hBBA%40mail.gmail.com.


[sage-support] Triple integrals in a specific region of space

2020-09-12 Thread Teodoro Coluccio
Can I perform triple integrals in a region of space I define? I'm trying to 
migrate from mathematica to sage, and in mathematica I could go and define 
a region of space (with various limitations) and then perform the integral 
of a function on it. Here is an explanatory image:
[image: screen.png]
Is there a way to easily perform this operation even in sage?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/f5f31206-069d-41cf-8374-36c2665455f6n%40googlegroups.com.


[sage-support] Triple integrals in a specific region of space

2020-09-06 Thread Teodoro Coluccio
Can I perform triple integrals in a region of space I define? I'm trying to 
migrate from mathematica to sage, and in mathematica I could go and define 
a region of space (with various limitations) and then perform the integral 
of a function on it. Here is an explanatory image:
[image: screen.png]
Is there a way to easily perform this operation even in sage?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/2f4b4ec1-5661-490a-925d-6d038692bc0dn%40googlegroups.com.


Re: [sage-support] Triple integrals in a specific region of space

2020-09-06 Thread Dima Pasechnik
[Technical warning]
Please do not post links with ads here (in particular the sort of ads
that basically obscure the important part - after I opened your link I
thought it's pure spam, for a moment). You can attach images to your
messages, or find a service that does not do this kind of spam, e.g.
github's gists can be used
(https://remarkablemark.org/blog/2016/06/16/how-to-add-image-to-gist/).

On Sun, Sep 6, 2020 at 8:25 AM Teodoro Coluccio
 wrote:
>
> Can I perform triple integrals in a region of space I define? I'm trying to 
> migrate from mathematica to sage, and in mathematica I could go and define a 
> region of space (with various limitations) and then perform the integral of a 
> function on it. Here is an explanatory image:
> https://ibb.co/H74hgVS
> Is there a way to easily perform this operation even in sage?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/6692345e-f559-4637-9e4e-b679e9bbdc37n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq2c-XgKAVnVfoRyS0vdYuk-0nHGn3nwq%3D%2BnAFaDtGSvCQ%40mail.gmail.com.


[sage-support] Triple integrals in a specific region of space

2020-09-06 Thread Teodoro Coluccio
Can I perform triple integrals in a region of space I define? I'm trying to 
migrate from mathematica to sage, and in mathematica I could go and define 
a region of space (with various limitations) and then perform the integral 
of a function on it. Here is an explanatory image:
https://ibb.co/H74hgVS
Is there a way to easily perform this operation even in sage?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/6692345e-f559-4637-9e4e-b679e9bbdc37n%40googlegroups.com.