Created
August 5, 2016 07:51
-
-
Save windstriver/50db5eb84099804690de5dae55749977 to your computer and use it in GitHub Desktop.
Test function in functional analysis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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