Why the proper Z function fails to show convergence

We will here investigate why the function called "properZ" fails to give convergence.

Initialize


In [1]:
%matplotlib notebook

from IPython.display import display

from sympy import init_printing
from sympy import S, Eq, Limit
from sympy import sin, cos, tanh, pi
from sympy import symbols

from boutdata.mms import x, z


init_printing()

The function called "proper Z" (as it )


In [2]:
Lx=symbols('Lx')
# We multiply with cos(6*pi*x/(2*Lx)) in order to give it a modulation, and to get a non-zero value at the boundary
s = 0.15
c = 50
w = 30
f = ((1/2) - (1/2)*(tanh(s*(x-(c - (w/2))))))*cos(6*pi*x/(2*Lx))*sin(2*z)
display(Eq(symbols('f'),f))

In [3]:
theLimit = Limit(f,x,0,dir='+')
display(Eq(theLimit, theLimit.doit()))
theLimit = Limit(f,x,0,dir='-')
display(Eq(theLimit, theLimit.doit()))

We see that the function is multivalued in the origin. Thus the function is not smooth in this point, hence we cannot expect convergence of this function.