Ask Your Question

extract components from exterior derivative result

asked 2018-03-14 18:25:02 +0200

danielvolinski gravatar image

Given the following code:

R2 = Manifold(2, 'R2', latex_name=r'\mathbb{R}^2')
cartesian2d.<x,y> = R2.chart()
R1 = Manifold(1, 'R1', start_index=1, latex_name=r'\mathbb{R}')
cartesian1d.<t> = R1.chart()
omega = R2.diff_form(1, 'omega', latex_name=r'\omega')
omega[:] = (4*y^2+exp(x^2)*sin(x^3), 6*x*y+log(5+y))
print omega
domega = omega.exterior_derivative()
domega.set_name('domega', r'\mathrm{d}\omega')
print domega

I don't know how to extract the elements of domega, namely -2 y for further use, like an integration.

I tried:

domega.display_comp(coordinate_labels=True, only_nonzero=True, only_nonredundant=True)

But I don't get the value -2 y to be used in an integral.

There is no expr() method to domega

I tried domega[x,y], domega[x][y] with errors.

I tried domega.comp() and I get just a message, no components.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-15 01:21:28 +0200

eric_g gravatar image

It suffices to use square brackets filled with the indices (as integers, not as x or y) of the component you are interested in:

sage: domega[0,1]

Notice that the result is a coordinate function. To get the underlying symbolic expression (to be used for instance in some integration) you have to apply the method expr() atop of it:

sage: domega[0,1].expr()
edit flag offensive delete link more


Thanks, Eric

danielvolinski gravatar imagedanielvolinski ( 2018-03-15 09:33:00 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-14 18:25:02 +0200

Seen: 166 times

Last updated: Mar 15 '18