2022-09-24 19:18:32 +02:00
|
|
|
import numpy as np
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
2022-09-24 19:22:58 +02:00
|
|
|
def fun_f(x):
|
|
|
|
return x ** 5 - 5 * x ** 4 - 30 * x ** 3 + 110 * x ** 2 + 29 * x - 105
|
2022-09-24 19:18:32 +02:00
|
|
|
|
|
|
|
def plot_f(xmin, xmax, xsteps):
|
|
|
|
x = np.arange(xmin, xmax + xsteps, xsteps)
|
2022-09-24 19:22:58 +02:00
|
|
|
f = np.array(fun_f(x))
|
2022-09-24 19:18:32 +02:00
|
|
|
plt.plot(x, f)
|
|
|
|
plt.xlim(-11, 11)
|
2022-09-24 19:22:58 +02:00
|
|
|
plt.xticks(np.arange(xmin, xmax + xsteps, 1.0))
|
2022-09-24 19:18:32 +02:00
|
|
|
plt.ylim(-1300, 1300)
|
|
|
|
plt.grid(markevery=1)
|
|
|
|
plt.show()
|
|
|
|
|
2022-09-24 19:22:58 +02:00
|
|
|
#plot_f(-10, 10, 0.1)
|