-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParameterPlotter.py
70 lines (43 loc) · 991 Bytes
/
ParameterPlotter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import matplotlib.pyplot as plt
import numpy as np
data = [[5, 0.006],
[10, 0.034],
[15, 0.100],
[20, 0.229],
[25, 0.440],
[30, 0.735],
[35, 1.098],
[40, 1.507],
[45, 1.946],
[50, 2.392],
[60, 3.25],
[65, 3.64],
[70, 4.01],
[75, 4.33],
[80, 4.6],
[85, 4.83],
[90, 5.00],
[95, 5.14],
[100, 5.24]]
xvals = [i[0] for i in data]
yvals = [i[1] for i in data]
degree = 10
poly = np.polyfit(xvals, yvals, degree)
x_vals1 = np.arange(1, 101, 1)
function = np.polyval(poly, x_vals1)
print(poly)
# xlist = [i for i in range(0,100)]
# ylist = [function(float(xlist[i]) for i in xlist)]
# plt.figure(1)
# plt.plot(xvals, yvals)
# plt.xlabel('RL value (%)')
# plt.ylabel('interpolated Recorded Output Power (w)')
# plt.title(poly)
# plt.show(1)
plt.plot(x_vals1, function)
plt.plot(xvals, yvals)
plt.title('overlaid power graph')
plt.show()
# making table
table_Array = [x_vals1,function,[((100/5.24)*x) for x in function]]
np.savetxt('lookup.csv', table_Array, delimiter=',')