Skip to content

Instantly share code, notes, and snippets.

@windstriver
Created August 5, 2016 07:51
Show Gist options
  • Save windstriver/50db5eb84099804690de5dae55749977 to your computer and use it in GitHub Desktop.
Save windstriver/50db5eb84099804690de5dae55749977 to your computer and use it in GitHub Desktop.
Test function in functional analysis.
import numpy as np
import matplotlib.pylab as plt
def phi(x):
y = np.zeros((len(x), ))
index = np.absolute(x) < 1
y[index] = np.exp(1/(x[index]**2-1))
return y
x = np.linspace(-2, 2, 1000)
y = phi(x)
plt.plot(x, y)
plt.axis('equal')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment