2026-07-05 11:58:52 +02:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main() -> None:
|
|
|
|
|
percorso_csv = Path("dataset/run_0001.csv")
|
|
|
|
|
if not percorso_csv.exists():
|
|
|
|
|
raise FileNotFoundError(
|
|
|
|
|
"File CSV non trovato. Esegui prima `python simulate.py`."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
df = pd.read_csv(percorso_csv)
|
|
|
|
|
|
|
|
|
|
plt.figure()
|
|
|
|
|
plt.plot(df["tempo_s"], df["T_vera_lato_sensore_C"], label="Temperatura vera lato freddo")
|
|
|
|
|
plt.plot(df["tempo_s"], df["T_misurata_sensore_C"], label="Temperatura misurata dal sensore")
|
|
|
|
|
plt.xlabel("Tempo [s]")
|
|
|
|
|
plt.ylabel("Temperatura [°C]")
|
|
|
|
|
plt.title("Sensore fisso, induttore in moto")
|
|
|
|
|
plt.legend()
|
|
|
|
|
plt.grid(True)
|
|
|
|
|
plt.tight_layout()
|
|
|
|
|
plt.show()
|
|
|
|
|
|
|
|
|
|
plt.figure()
|
|
|
|
|
plt.plot(df["tempo_s"], df["flusso_termico_sorgente_W_m2"])
|
|
|
|
|
plt.xlabel("Tempo [s]")
|
|
|
|
|
plt.ylabel("Flusso termico efficace [W/m²]")
|
2026-07-05 19:20:47 +02:00
|
|
|
plt.title("Flusso termico nel punto x osservato dal sensore")
|
2026-07-05 11:58:52 +02:00
|
|
|
plt.grid(True)
|
|
|
|
|
plt.tight_layout()
|
|
|
|
|
plt.show()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|