import matplotlib.pyplot as plt
import numpy as np
# Simulated data
time = np.arange(0, 10, 0.5)
hydrogen_rate = np.random.normal(loc=2.0, scale=0.2, size=len(time))
energy_consumption = np.random.normal(loc=50, scale=5, size=len(time))
voltage = np.random.normal(loc=1.8, scale=0.05, size=len(time))
efficiency = 100 / energy_consumption # Simplified efficiency metric
# Create subplots
fig, axs = plt.subplots(2, 2, figsize=(12, 8))
fig.suptitle('Hydrogen Production Data Overview')
# Chart 1: Hydrogen Production Rate Over Time
axs[0, 0].plot(time, hydrogen_rate, marker='o', color='green')
axs[0, 0].set_title('Hydrogen Production Rate Over Time')
axs[0, 0].set_xlabel('Time (hours)')
axs[0, 0].set_ylabel('H₂ Rate (Nm³/h)')
# Chart 2: Energy Consumption per kg of H₂
axs[0, 1].plot(time, energy_consumption, marker='s', color='blue')
axs[0, 1].set_title('Energy Consumption per kg H₂')
axs[0, 1].set_xlabel('Time (hours)')
axs[0, 1].set_ylabel('Energy (kWh/kg)')
# Chart 3: Voltage vs Time
axs[1, 0].plot(time, voltage, marker='x', color='red')
axs[1, 0].set_title('Cell Voltage Over Time')
axs[1, 0].set_xlabel('Time (hours)')
axs[1, 0].set_ylabel('Voltage (V)')
# Chart 4: Efficiency Over Time
axs[1, 1].plot(time, efficiency, marker='^', color='purple')
axs[1, 1].set_title('Efficiency Over Time')
axs[1, 1].set_xlabel('Time (hours)')
axs[1, 1].set_ylabel('Efficiency (kg H₂/kWh)')
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
plt.show()