First time here? Check out the FAQ!

Ask Your Question
0

L-infinity norm in multivariable function

asked 0 years ago

micron gravatar image

hi, thanks for your time. There's a few levels to what I am having trouble with.

I am learning homotopy and want to visualize a deformation retraction from the punctured torus (ie. torus but has one point missing) to the graph of two circles meeting in a point. they represent the meridian and longitudinal circles on the torus.

since torus is homeomorphic to the quotient space I^2/(opposite edges identified) for some interval I, I just would like to do a visualization of my explicit deformation retraction on the interval square. The main issue is my functions depend on the L-infinity or sup norm and I can't see how to define a multivariable function using it.

I want to be able to be like F(x,1) = x/x.norm('infinity') where x is in R2

or even F((x,y),1) = ...

I will just write my own norm function if it is not in sage but it seems odd to be missing to I am hoping someone enlightens me.. also, does sage already have a torus that can be represented as a specified square? Thanks for your time..

Preview: (hide)

Comments

The visualization should be done in 2D from the torus represented as I2 with boundary points identified as usual, I=[0,1], or by using a 3D model obtained e.g. by the rotation of the circle centered in (2,0) and radius 1? Define the homotopy as a function f(x,y;t) with x,y;tI for the 2D model or using a parametrization in 3D, and it is quickly implemented.

dan_fulea gravatar imagedan_fulea ( 0 years ago )

thanks, @dan_fulea, It's also ok to do it from any interval square, as they are all homeomorphic to the unit square. The question is how to implement the L-infinity norm. I have written a function to do it but parametric_plot seems to be unhappy that I have a function call inside my f(x,y,t) function.

micron gravatar imagemicron ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 0 years ago

micron gravatar image

I ended up simply writing a function

def LinfNorm(vec):
    norms = [abs(x) for x in vec]
    supnorm = max_symbolic(norms)
    return supnorm

and I just have that called in my other functions with a list of the variables as input. e.g.

x,y,s = var('x,y,s')
assume(x!=0)
assume(y!=0)

fsquare = [cos(s)/(LinfNorm([cos(s),sin(s)])), sin(s)/(LinfNorm([cos(s),sin(s)]))]
g1plot = parametric_plot(fsquare, (0,2*pi), aspect_ratio = 1, ymin=-1,ymax=1, color = 'black')
gplots = [parametric_plot((t*(x/(LinfNorm([x,y]))-x)+x, t*(y/(LinfNorm([x,y]))-y)+y,0),(x,-1,1), (y,-1,1)) for t in sxrange(0,1.1,.1)]

gstaticplots = [parametric_plot((t*cos(2*pi*s)/(LinfNorm([cos(2*pi*s),sin(2*pi*s)])), t*sin(2*pi*s)/(LinfNorm([cos(2*pi*s),sin(2*pi*s)]))), (t,0,1)) for s in sxrange(0,1.025,.025)]

animation = [g1plot + sum(gstaticplots) + parametric_plot((t*cos(s)/(LinfNorm([cos(s),sin(s)])), t*sin(s)/(LinfNorm([cos(s),sin(s)]))), (s,0,2*pi), color='green') for t in sxrange(0,1.025,.025)]

cc = animate(animation)
cc.show(delay=10,iterations=3)
Preview: (hide)
link

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: 194 times

Last updated: Mar 17