File:Alternate Solar Graph.png
Jump to navigation
Jump to search
Alternate_Solar_Graph.png (572 × 413 pixels, file size: 42 KB, MIME type: image/png)
Alternate Graph showing solar power data
import matplotlib.pyplot as plt
import numpy as np
x_day = np.linspace(0, 210, 210)
y_day = np.full_like(x_day, 60)
x_dusk = np.linspace(210, 294,84)
y_dusk = np.linspace(60, 0, 84)
x_night = np.linspace(294, 336, 42)
y_night = np.zeros_like(x_night)
x_dawn = np.linspace(336, 420, 84)
y_dawn = np.linspace(0, 60, 84)
x = np.concatenate([x_day, x_dusk, x_night, x_dawn])
y = np.concatenate([y_day, y_dusk, y_night, y_dawn])
accumulator = np.cumsum(y - 42) + 500
accumulator = np.clip(accumulator, 0, 5000)
accumulator = (accumulator / 5000) * 100
plt.plot(x, y, label="kW")
plt.plot (x, y - 42, label="Net kW @ 42kW")
plt.plot(x, accumulator, label="Accumulator %")
plt.legend()
plt.xticks(range(0, 425, 42))
plt.yticks(range(-50, 105, 10))
plt.grid()
negative_space = np.where(y-42 < 0)[0]
plt.plot(negative_space[0], 0, 'x')
plt.plot(negative_space[-1], 0, 'x')
plt.text(negative_space[0], 0, f"({negative_space[0]:.0f}, {0:.1f})")
plt.text(negative_space[-1], 0, f"({negative_space[-1]:.0f}, {0:.1f})")
plt.plot(np.argmax(accumulator), np.max(accumulator), 'o')
plt.text(np.argmax(accumulator), np.max(accumulator), f"({np.argmax(accumulator):.0f}, {np.max(accumulator):.1f})")
plt.plot(np.argmin(accumulator), np.min(accumulator), 'o')
plt.text(np.argmin(accumulator), np.min(accumulator), f"({np.argmin(accumulator):.0f}, {np.min(accumulator):.1f})")
print("Accumulators per Solar Panel: ", np.max((accumulator) - np.min(accumulator)) / 100)
#Check work
positive_trapezoid = ((420 - (negative_space[-1] - negative_space[0]) - 2) + 210) * 9 #Subtract 2 to avoid double ownership of indice.
negative_trapezoid = ((negative_space[-1] - negative_space[0]) + 42) * 21
print("Passed error check: ", negative_trapezoid == positive_trapezoid)
plt.show()
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 19:28, 27 May 2026 | 572 × 413 (42 KB) | GregFirehawk (talk | contribs) |
You cannot overwrite this file.
File usage
The following page uses this file:
