First time here? Check out the FAQ!

Ask Your Question
1

setting components of differential form

asked 0 years ago

micron gravatar image

Hi, I don't understand how to set the components of a two-form.

M = Manifold(3, 'M', start_index=1)
U = M.open_subset('U')
X.<x,y,z> = M.chart()
basisframe = X.frame()
a = M.diff_form(2, name='a')

I just want to set a = dx wedge z^2 dy. I don't understand the format of examples in the main differential forms page on http://doc.sagemath.org. for example, this is one way they set one:

 a = M.diff_form(2, name='a')
 a[eU,0,1] = x*y^2 + 2*x

followed by an add_comp_by_continuation and I am not sure why or how that even works. I appreciate your help.

I was able to get a 1-form built on E3 with setting the components like

E.<x,y,z> = EuclideanSpace()
a = E.diff_form(1, name='a')
a[1]=1
a[2]= z^2

so I would have thought I could make a 2-form and set it a similar way but I am unsure what to do.. I'm also wondering how to access the basis forms for calculations. I couldn't see how to do a wedge product of my 1-form with dx, for example. I built it by setting the first component of a 1-form to 1 but is there an easier way?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 0 years ago

eric_g gravatar image

updated 0 years ago

You can easily get the 1-forms dx, dy and dz from X.coframe(), so to initialize the 2-form a=dx(z2dy), the simplest is to do

sage: M = Manifold(3, 'M', start_index=1)
sage: X.<x,y,z> = M.chart()
sage: dx, dy, dz = X.coframe()[:]
sage: a = dx.wedge(z^2*dy)
sage: a.set_name('a')
sage: a.display()
a = z^2 dxdy

Then, for instance:

sage: da = diff(a)
sage: da.display()
da = 2*z dxdydz

You may find more examples in the sections 1-forms and Differential forms and exterior calculus of the Manifold Tutorial.

Preview: (hide)
link

Comments

thank you. this is helpful.

micron gravatar imagemicron ( 0 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 0 years ago

Seen: 82 times

Last updated: Jan 30