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

90 views
Message has been deleted

Dima Pasechnik

Sep 6, 2020, 4:09:53 AM9/6/20
to sage-support
[Technical warning]
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

On Sun, Sep 6, 2020 at 8:25 AM Teodoro Coluccio
<teodoro....@gmail.com> 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...@googlegroups.com.
Message has been deleted

Teodoro Coluccio

Sep 12, 2020, 7:23:56 AM9/12/20
to sage-support
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:

David Joyner

Sep 12, 2020, 8:05:17 AM9/12/20
to SAGE support
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
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...@googlegroups.com.

Dima Pasechnik

Sep 13, 2020, 6:30:09 AM9/13/20
to sage-support
On Sun, Sep 6, 2020 at 10:03 AM Teodoro Coluccio <teodoro....@gmail.com> 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.
Not implemented in Sage, but it would be a nice addition.

Here is an explanatory image:

Is there a way to easily perform this operation even in sage?

--

slelievre

Sep 13, 2020, 9:23:38 PM9/13/20
to sage-support

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 <teodoro...@gmail.com> 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.
Not implemented in Sage, but it would be a nice addition.

Here is an explanatory image:

Is there a way to easily perform this operation even in sage?

- Triple integrals in a specific region of space