Ask Your Question

extracting info from diff_map definition

asked 2018-03-07 21:15:24 +0100

danielvolinski gravatar image

I've defined the following diff_map

R2 = Manifold(2, 'R2', start_index=1, latex_name=r'\mathbb{R}^2')
cartesian2d.<x, y> = R2.chart()
R1 = Manifold(1, 'R1', start_index=1, latex_name=r'\mathbb{R}^1')
cartesian1d.<t> = R1.chart()
h = R1.diff_map(R2, [1-t, sqrt(2*t-t^2)])

I would like to extract the elements of the diff_map, namely 1-t and sqrt(2*t-t^2) for propose of plotting the resulting curve or for other manipulations. How can I do that?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-07 23:38:02 +0100

tmonteil gravatar image

Given the Sage object h you can see which methods apply to it, with the tab completion:

sage: h.<TAB>

You will see that there is an expression method:

sage: h.expression()
(-t + 1, sqrt(-t^2 + 2*t))

This is a tuple, and you can get its entrie as follows:

sage: h.expression()[0]
-t + 1
sage: h.expression()[1]
sqrt(-t^2 + 2*t)
edit flag offensive delete link more


By the same method I also found h.coord_functions()[0]


danielvolinski gravatar imagedanielvolinski ( 2018-03-08 11:03:33 +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


Asked: 2018-03-07 21:15:24 +0100

Seen: 166 times

Last updated: Mar 07 '18