File:2 cfs coincide over a finite interval.svg
Summary
| Description |
English: Example of 2 characteristic functions which coincide over the region [-1,1] but are different elsewhere. |
| Source | Own work |
| Author | Stpasha |
| SVG development | |
| Source code | Python code# Author: Ika, 2013-07-23
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
X = np.arange(-5, 5, 0.01)
plt.clf()
plt.figure(figsize=(4,3.2))
plt.axes([0.17,0.13,0.79,0.8])
plt.hold(True)
Q = []
Y = np.exp(-np.abs(X))
a = plt.plot(X, Y, '-', color='blue', lw=2)
Q.append(a)
Y = []
for x in X:
if np.exp(-np.abs(x)) > 2/(np.exp(1)*(1+np.abs(x))):
Y.append(np.exp(-np.abs(x)))
else:
Y.append(2/(np.exp(1)*(1+np.abs(x))))
a = plt.plot(X, Y, '-', color='purple', lw=2)
Q.append(a)
plt.xlabel("$t$")
plt.ylabel(r"$\mathrm{Cf}(t)$")
bx = plt.legend(Q, (r"$\varphi_1 = e^{-┃t┃}$", r"$\max\{\varphi_1,\frac{2}{(1+┃t┃)e}\}$"),\
numpoints=1, handlelen=0.05, handletextpad=0.4,\
loc="upper right", prop={'size':10})
bx.draw_frame(False)
plt.xlim(-5,5)
plt.savefig("cfs_coincide_over_a_finite_interval.pdf")
plt.savefig("cfs_coincide_over_a_finite_interval.eps")
plt.savefig("cfs_coincide_over_a_finite_interval.svg")
|
Licensing
| I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |