Ask Your Question

Revision history [back]

Here's how you can do substitution into the coefficients of a differential form, in a simple example:

sage: M = Manifold(2, 'M')
sage: U = M.open_subset('U')
sage: c_xy.<x,y> = U.chart()
sage: eU = c_xy.frame()
sage: f = M.diff_form(2)
sage: f[eU, 0, 1] = var('a')
sage: f.display(eU)
a dx/\dy
sage: f[eU, 0, 1] = f[eU, 0, 1].expr().subs({a : x^2})
sage: f.display(eU)
x^2 dx/\dy

Here's how you can do substitution into the coefficients of a differential form, in a simple example:

sage: M = Manifold(2, 'M')
sage: U = M.open_subset('U')
sage: c_xy.<x,y> = U.chart()
sage: eU = c_xy.frame()
sage: f = M.diff_form(2)
sage: var('a')
sage: f[eU, 0, 1] = var('a')
a
sage: f.display(eU)
a dx/\dy
sage: f[eU, 0, 1] = f[eU, 0, 1].expr().subs({a : x^2})
sage: f.display(eU)
x^2 dx/\dy

Here's how you can do substitution into the coefficients of a differential form, in a simple example:

sage: M = Manifold(2, 'M')
sage: U = M.open_subset('U')
sage: c_xy.<x,y> = U.chart()
sage: eU = c_xy.frame()
sage: f = M.diff_form(2)
sage: var('a')
var('a,b')
sage: f[eU, 0, 1] = a
a+b
sage: f.display(eU)
a (a + b) dx/\dy
sage: f[eU, 0, 1] = f[eU, 0, 1].expr().subs({a : x^2})
x^2, b : y^2})
sage: f.display(eU)
x^2 (x^2 + y^2) dx/\dy