Ask Your Question
0

extract components from exterior derivative result

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

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
omega.display()
domega = omega.exterior_derivative()
domega.set_name('domega', r'\mathrm{d}\omega')
print domega
domega.display()

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.

Daniel

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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]
-2*y

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()
-2*y
edit flag offensive delete link more

Comments

Thanks, Eric

danielvolinski gravatar imagedanielvolinski ( 2018-03-15 09:33:00 +0100 )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

Stats

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

Seen: 190 times

Last updated: Mar 15 '18