[sage-support] Re: plot3d and expression evaluation

2010-03-12 Thread stefan
I think I've got a vague idea what happens here... The same thing also happens when I define the max() function myself: sage: def my_max(x,y): sage: if(x>y): return x sage: else: return y sage: fermi2(x,y,d,L) = 1 - 1/( exp( ( my_max(abs(x),abs(y))-L) /d) + 1) sage: fermi2 (x, y, d, L)

[sage-support] Re: plot3d and expression evaluation

2010-03-12 Thread stefan
On Mar 12, 5:47 pm, Harald Schilly wrote: > I'm not sure but there might be a bug or problem evaluating the > expression. Anyways, going the "pure" python way works: > > sage: def fermi(x,y,d,L): return  1 - 1/( exp( ( max(abs(x),abs(y))- > L) /d)  + 1) > > sage: plot3d(lambda x,y : fermi(x,y,0.

[sage-support] Re: plot3d and expression evaluation

2010-03-12 Thread Harald Schilly
On Mar 12, 5:39 pm, stefan wrote: > I have encountered a somewhat strange problem ... Ah, I got it, the max function is evaluated during the definition of the function, look: sage: fermi(x,y,d,L) = 1 - 1/( exp( ( max(abs(x),abs(y))-L) /d) + 1) sage: fermi (x, y, d, L) |--> -1/(e^(-(L - abs(x))/

[sage-support] Re: plot3d and expression evaluation

2010-03-12 Thread Harald Schilly
On Mar 12, 5:39 pm, stefan wrote: > Basically, I am trying to plot this expression: > > #sage> fermi(x,y,d,L) = 1 - 1/( exp( ( max(abs(x),abs(y))-L) /d)  + 1) I'm not sure but there might be a bug or problem evaluating the expression. Anyways, going the "pure" python way works: sage: def fermi(