21 lines
720 B
Python
21 lines
720 B
Python
|
import numpy as np
|
||
|
from roman_schenk_S1_Aufg2 import roman_schenk_Aufg2, plot_function, showPlot
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
#coefficients_task_1 = np.array([-105, 29, 110, -30, -5, 1]) #falsches Format
|
||
|
#coefficients_task_1 = np.array([[-105, 29, 110, -30, -5, 1]]) #Zeilenvektor
|
||
|
coefficients_task_1 = np.array([[-105], [29], [110], [-30], [-5], [1]]) #Spalten Vektor
|
||
|
xmin = -10
|
||
|
xmax = 10
|
||
|
[x,p,dp,pint] = roman_schenk_Aufg2(coefficients_task_1, xmin, xmax)
|
||
|
|
||
|
print("x:\n", x)
|
||
|
print("p:\n", p)
|
||
|
print("dp:\n", dp)
|
||
|
print("pint:\n", pint)
|
||
|
|
||
|
plot_function(x, p, 'f(x)')
|
||
|
plot_function(x, dp, 'f\'(x)')
|
||
|
plot_function(x, pint, 'F(x)')
|
||
|
|
||
|
showPlot(xmin, xmax, abs(xmax/100.0))
|