File size: 1,688 Bytes
72c2001
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import matplotlib.pyplot as plt

class Plot:
    def plot_steam_load(self, time, steam_consumption):
        """

        Plots the variation of steam load with respect to time.

        :param time: List of time values.

        :param steam_consumption: List of steam consumption values.

        :return: Matplotlib figure object.

        """
        fig, ax = plt.subplots()
        ax.plot(time, steam_consumption, marker='o', linestyle='-', color='b', label='Steam Consumption')
        ax.set_xlabel("Time")
        ax.set_ylabel("Steam Consumption")
        ax.set_title("Steam Load Variation Over Time")
        ax.legend()
        ax.grid()
        return fig
    
    def plot_temperature_curve(self, time, initial_temp, final_temp, temp_gradient):
        """

        Plots the temperature variation over time.

        :param time: List of time values.

        :param initial_temp: List of initial temperatures at each time point.

        :param final_temp: List of final temperatures at each time point.

        :param temp_gradient: List of temperature gradients.

        :return: Matplotlib figure object.

        """
        fig, ax = plt.subplots()
        ax.plot(time, initial_temp, marker='s', linestyle='--', color='r', label='Initial Temperature')
        ax.plot(time, final_temp, marker='^', linestyle='-', color='g', label='Final Temperature')
        ax.plot(time, temp_gradient, marker='d', linestyle=':', color='m', label='Temperature Gradient')
        ax.set_xlabel("Time")
        ax.set_ylabel("Temperature")
        ax.set_title("Temperature Variation Over Time")
        ax.legend()
        ax.grid()
        return fig