redefine new_frame with same variable name.

asked 2018-09-24 22:41:47 -0600

I encountered unexpected result while studying the usage of the new_frame method. The following script should reproduce the result I got. In this script I assign new_frame to variable f , twice. First assignment works as expected, however, second assignment does not give the expected result, which is shown using the other variable, h.

Is there anyway to update

%display latex ES = Manifold(2, 'ES', latex_name=r'\mathcal{ES}',structure="Riemannian") CC.<x,y> = ES.chart() g=ES.riemannian_metric('g') g[0,0]=1;g[1,1]=1 PC.<r,th> = ES.chart( coordinates=r"r:(0,+oo) th:(-pi,2pi):\theta") PC_to_CC = PC.transition_map(CC, [rcos(th), rsin(th)]) CC_to_PC = CC.transition_map(PC, [sqrt(xx+yy), atan2(y/r,x/r)]) PC_to_CC.set_inverse(sqrt(xx+yy), atan2(y/r,x/r)) CC_to_PC.set_inverse(rcos(th), r*sin(th))

change_frame = ES.automorphism_field() change_frame[CC.frame(),:,CC] = [[cos(th),-sin(th)],[sin(th),cos(th)]] f = CC.frame().new_frame(change_frame, 'f' ); show(f) show(g.display(f,CC)) show(f[0].display(CC.frame(),CC)) show(f[1].display(CC.frame(),CC)) show(f[0].display(e,PC)) show(f[1].display(e,PC)) change_frame_2 = ES.automorphism_field() change_frame_2[CC.frame(),:,CC] = [[cos(th),sin(th)],[-sin(th),cos(th)]] f = CC.frame().new_frame(change_frame_2, 'f') ; h = CC.frame().new_frame(change_frame_2, 'h') ; show(f) show(h) show(g.display(f,CC)) show(f[0].display(CC.frame(),PC)) show(f[1].display(CC.frame(),PC)) show(f[0].display(PC.frame(),PC)) show(f[1].display(PC.frame(),PC)) show(f[0].display(e,PC)) show(f[1].display(e,PC)) show(h[0].display(CC.frame(),PC)) show(h[1].display(CC.frame(),PC)) show(h[0].display(PC.frame(),PC)) show(h[1].display(PC.frame(),PC)) show(h[0].display(e,PC))

show(h[1].display(e,PC))

edit retag flag offensive close merge delete

Comments

Could you please reformat the code in your question (select it and click on the button 101010) to make it readable? I've tried to run it in a Jupyter notebook, but it turns out that the variable e that you are using is not defined. So it seems that some piece of code is missing.

eric_g gravatar imageeric_g ( 2018-09-26 06:45:13 -0600 )edit