ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 02 May 2021 21:59:27 +0200Integrating differential formshttps://ask.sagemath.org/question/56906/integrating-differential-forms/ I'd like to integrate `dx /\ dy` over the unit square. Naively, I would expect the following to work:
E.<x,y> = EuclideanSpace(2)
phi = E.diff_form(2)
phi[1, 2] = 1
show(integrate(integrate(phi, x, 0, 1), y, 0, 1))
but it fails with:
TypeError: unable to convert 2-form on the Euclidean plane E^2 to a symbolic expression
and I can't find anything about integration in the DiffFormFreeModule documentation. What is the right way to do this?Sun, 02 May 2021 21:42:54 +0200https://ask.sagemath.org/question/56906/integrating-differential-forms/Answer by eric_g for <p>I'd like to integrate <code>dx /\ dy</code> over the unit square. Naively, I would expect the following to work:</p>
<pre><code>E.<x,y> = EuclideanSpace(2)
phi = E.diff_form(2)
phi[1, 2] = 1
show(integrate(integrate(phi, x, 0, 1), y, 0, 1))
</code></pre>
<p>but it fails with:</p>
<pre><code>TypeError: unable to convert 2-form on the Euclidean plane E^2 to a symbolic expression
</code></pre>
<p>and I can't find anything about integration in the DiffFormFreeModule documentation. What is the right way to do this?</p>
https://ask.sagemath.org/question/56906/integrating-differential-forms/?answer=56909#post-id-56909Indeed, integration of differential forms is not implemented yet. Meanwhile, you can pass the symbolic expression representing the component $\phi_{12}$, which is returned by `phi[1,2].expr()`, to `integrate`: from your example, we get
sage: integrate(integrate(phi[1,2].expr(), x, 0, 1), y, 0, 1)
1
Sun, 02 May 2021 21:59:27 +0200https://ask.sagemath.org/question/56906/integrating-differential-forms/?answer=56909#post-id-56909