def plot1(): yout = interpolate1(xinC1, xoutC1) x_values = np.linspace(-1, 1, 11) y_values = [f(x) for x in x_values.tolist()] pyplot.plot(x_values, y_values) pyplot.plot(xoutC1, yout) pyplot.show()
def plot4(): values = interpolate1(xinU2, xoutU2) x_values = np.linspace(-1, 1, 11) y_values = [f(x) for x in x_values.tolist()] pyplot.plot(x_values, y_values) pyplot.plot(xoutU2, values) pyplot.show()
def plot5(): youtU1 = interpolate1(xinU3, xoutU3) youtU2 = interpolate2(xinU3, xoutU3) values1 = [] values2 = [] for i in range(len(xoutU3)): val = 1.0e-18 + abs(youtU1[i] - f(xoutU3[i])) values1.append(val) for i in range(len(xoutU3)): val = 1.0e-18 + abs(youtU2[i] - f(xoutU3[i])) values2.append(val) pyplot.semilogy(xoutU3, values1) pyplot.semilogy(xoutU3, values2) pyplot.show()
def plot8(): youtC1 = interpolate1(xinC4, xoutC4) youtC2 = interpolate2(xinC4, xoutC4) values1 = [] values2 = [] for i in range(len(xoutC4)): val = 1.0e-18 + abs(youtC1[i] - f(xoutC4[i])) values1.append(val) for i in range(len(xoutC4)): val = 1.0e-18 + abs(youtC1[i] - f(xoutC4[i])) values2.append(val) pyplot.semilogy(xoutC4, values1) pyplot.semilogy(xoutC4, values2) pyplot.show()