In an effort to further learn the uses of MATLAB, today Helena and I explored using it to investigate simple thermal systems. Using a guide created by Robert Bert and revised by our professor, Amy Banzart, Helena and I went through several heating and cooling simulations.
In the scenario we used, we sought to analyze the heating and cooling of a cup of coffee. In order to do this, we first needed to understand a couple of the equations used to model the heating/cooling of systems.
Heat Capacity (C)
Heat capacity (C) is the number of heat units needed to raise the system's temperature by one degree. It is defined by the ratio of dE/dT, which models the change in energy against the change in temperature (T).
C=dE/dT
dE = energy change of the system during time (dt)
dT = temperature change during time (dt)
Thermal Resistance (Rth)
Thermal Resistance is a measurement of a temperature difference by which an object or material resists a heat flow. This property is affected by the temperature difference between and the system's heat flow.
Rth = (T-Tair)/(dE/dt) = "effort"/"flow"
T= Temperature of the system at time (dt)
Tair = temperature of surrounding environment
dE = energy change of the system during time (dt)
dT = temperature change during time (dt)
dt = change in time/time step
Temperature Change (dT)
In order to model the heating/ cooling process of our system, we also needed to understand how to calculate the change in the system's temperature over time.
dT = (dE/C)= -((T-Tair)/Rth)/C*dt = (T-Tair)/(RthC)*dt
dt = change in time/time step
C= Specific heat capacity
dE = energy change of the system during time (dt)
T= Temperature of the system at time (dt)
Tair = temperature of surrounding environment
Rth = thermal resistance
Question 1: Varying Thermal Resistance and Heat Capacity
In order to better understand heating and cooling systems, we wanted to see how varying the MATLAB parameters of thermal resistance (Rth) and heat capacity (C) affected the cooling behavior of our "cup of coffee". By examining the temperature change equation detailed earlier, one can hypothesize that decreasing Rth or C will increase the cooling process (or dt), while increasing these values will decrease the change in temperature (dt), as Rth and C are both located in the denominators of the equation.
Using the below MATLAB code we then modified Rth and C, confirming our hypotheses
Original Code/Graph:
Using the below MATLAB code we then modified Rth and C, confirming our hypotheses
Increasing Rth or C resulted in a graph like the one below:
Question 2: Adding Thermal Energy to a System at a Constant Rate P
For this situation we added a heating element that would would allow our coffee to heat up to, and stay at, a temperature of 84C (357K). Before using the heating element, however, we needed to calculate the amount of power we would need to supply to the heater (P) to get to and maintain this temperature. In order to determine P, we used the below equation setting dT equal to zero, Tair to room temperature (293K), heat capacity (C) to 1000, and thermal resistance to 0.85.
The resulting P value, 75.3, was checked using the code below:
Feedback and Control
We then wanted to incorporate P-vaues into our thermal system codes to reflect a situation where a coffee pot was being heated to, and kept at, a specific temperature (in this case 84C).
Bang-Bang Control Heating
With bang-bang control heating, the coffee heats up to the desired temperature quickly, with the heating device on at a high power until that temperature is reached. Once that temperature is reached, the heater turns off completely, until the temperature falls below the desired level. This method of heating results in a wave-like pattern of heating around the desired temperature.
Proportional Control Heating
While bang-bang control is often easier to execute, in cases where temperature needs to be more precisely maintained (such as the storage of temperature sensitive chemicals) proportional control should be implemented. Proportional control not only allows the temperature to be more closely maintained, but also eliminates the need for the heater from constantly turning on and off, which might damage it. In the code below we implemented proportional control by setting the amount of energy supplied by the system to correspond to the current temperature of the system. The resulting graph was smoother and had no wavelike pattern around the desired temperature
Bang-Bang and Proportional Control Heating with Delay
In this final exercise we had to modify the previous two codes to account for a 5 second delay between the the time when the coffee reaches a given temperature, and when the sensor records that temperature.We addressed this situation by adjusting the time portion of the codes, allowing for the time of each temperature reading to reflect the actual time the coffee reached that temperature.
Bang-Bang Control:
Bang-Bang Control:
Proportional Control:
No comments:
Post a Comment