Answer to Question 1:
Using the above equation, we predicted that increasing the Rth will make dT less negative and make cooling slower.
Increasing C will also make dT less negative and make cooling slower.
Initially, we had Rth=0.85 and C=1000
As seen in the graph, the slope is less negative and the temperature decreases at a slower rate. At 1,500 seconds, the initial graph shows a temperature decrease of ~50K and the second graph shows a temperature decrease of ~35K.
Similarly, we increased C to 2000:
which also shows a decrease in cooling rate.
Decreasing Rth and C would have the inverse effect, and lead to faster cooling.
To make the comparison easier, I plotted multiple graphs representing different C values.
Changing C |
Starting from the topmost graph, C= 2500, 2000, 1500, 1000 and 500.
For a given time interval, there is less decrease in temperature for a higher C value.
Similarly, we can also plot a graph for different Rth values:
Changing Rth |
Starting from the topmost graph, Rth = 4.25, 3.4, 2.55, 1.7, and 0.85.
As we predicted, there is less temperature decrease at a given time interval for a higher Rth value.
Link to Changing C .m file
https://drive.google.com/file/d/0Bymp1CBCUUYRVmptQmFlZ2xkeVE/edit?usp=sharing
Link to Changing Rth .m file
https://drive.google.com/file/d/0Bymp1CBCUUYRNWFacFY1YUZWd0E/edit?usp=sharing
Answer to Question 2:
To figure out the good P value, we need to utilize the information about dT at 84 degrees.Since we want to maintain the temperature of our coffee at 84 degrees Celsius (357K), we want dT=0 after dt=2000 seconds. We also know Tair=293K and Rth=0.85.
Plugging this information into the given equation and solving for P:
A good P value is 75.3.
Working Backwards
The graph on page 7 of the assignment sheet shows that it reaches a final temperature of 356 K. Using this information, we can solve for Rth:To solve for C we make estimations for the slope at time t=0. Looking at the graph, we made an estimation that dT/dt at t=0 is approximately 0.07.
Using this information to solve for C:
Feedback and Control
1) Heating Coffee Using Bang-Bang Control:For bang-bang control, we kept all of the initial conditions, but added a if-else statement inside the while loop and set the power to 90 when the temperature is less than the desired temperature (357K) and 0 when the temperature is greater than the desired temperature.
Bang-bang control graph |
https://drive.google.com/file/d/0Bymp1CBCUUYRRklmcXAxd3pPNHM/edit?usp=sharing
Q: Why is bang-bang control appropriate for many thermal systems? When might it be insufficient?
Bang-bang control is appropriate for thermal systems because it is simple. It just requires a heater that can be turned on or off and a thermometer. It doesn't require subtle controls of the heater power.
Bang-bang control might be insufficient if there is a fast change in temperature of the system. For example, if the the temperature of the system fluctuates at a fast rate, turning the heater on and off might not occur fast enough to maintain a stable temperature.
2) Heating Coffee Using Proportional Control:
For proportional control, we set power equal to the error multiplied by gain, where error is the difference between the measured temperature and the desired final temperature.
Proportional Control Graph |
We noticed that the temperature levels off at different points when gain is varied. This is because there is a point where dE_in and dE_out is equal to each other as error and power gets smaller. Therefore, the graph would level out at the temperature that makes dE_in and dE_out equal.
We could try to achieve the desired results if we set the final temperature at a higher value than our actual desired temperature.
Q: How does this approach compare to the bang-bang control?
Compared to bang-bang control, the proportional control maintains a constant temperature more smoothly, without any fluctuations.
Link to Proportional Control .m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRUnBOX0tHMHdQbVk/edit?usp=sharing
3) Bang-Bang Control with Delay:
Bang-bang Delay |
For the bang-bang control with a delay, we start out with a for-loop that goes through until t=tmax. Since t changes in intervals of dt, the maximum index of the for-loop is (tmax/dt).
With a delay, the sensor would not read anything until the time passes the delay time. During this time, the power would be zero. After the delay time, we can start heating the system. This is modeled by the first if-else statement.
The power can be set according to the temperature displayed on the sensor, which is T(i-delay). Since this is bang-bang control, we set the power to 90 only when the temperature read by the sensor is less than the final desired temperature. Else, the power is zero. This is modeled in the second if-else statement nested under the first 'if'.
Q: What is the impact of this "sensor delay"?
The graph shows the initial delay and the fluctuations in temperature caused by overshooting and undershooting. The overshooting and undershooting is caused by the discrepancies between the actual temperature and the temperature read by the sensor. Even when the actual temperature reaches the desired temperature, the sensor reads a different value and supplies the power accordingly, causing the temperature to over/undershoot.
Link to Bang-Bang Delay .m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRT3NpZ2NBZ25IUkU/edit?usp=sharing
4) Proportional Control with Delay
All we changed for the proportional control is to set the power equal to gain x error, where error is Tf-T(i-delay). As in the previous script, P=0 when the time has not passed the delay time.
Proportional Control Delay |
Q: What is the impact of this "sensor delay"?
There is an initial overshoot caused by the delay followed by an undershoot in temperature, but as the error gets smaller, the overshoot and the undershoot also gets smaller and eventually the temperature levels out.
For a system with a delay in the sensor, proportional control seems like a better way to maintain a constant temperature.
Link to Proportional Control Delay .m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRcTFMejJpYlZIdVk/edit?usp=sharing
Q: What other delays might you expect in your thermodynamic system, apart from sensor delays?
Apart from sensor delays, there could also be delays caused by the heater. There could be a discrepancy between the time when the power changes and the time it actually affects the temperature of the coffee.
Also, depending on where and how the heater is positioned, it might take some time for ALL of the coffee to reach the same temperature. In other words, the coffee that is closer to the heat source can heat up faster than the coffee furthest away from the heater.
You have some really dynamic and revealing pictures! The bang-bang delay one is really interesting to look at because I think it really represents the idea of bang-bang control really well.
ReplyDeleteI also enjoyed how you graphed multiple Rths, I thought that it visually demonstrated what is the best/worst at your goals.
I like how some of you graphs show multiple runs on one graph so that the effects of the altered variables are easy to observe. It makes following your points and observations much simpler.
ReplyDeleteI really like the graphs where you showed different values of C. It helped present the information to me much more as well as better see the relationship amongst different values of C. I'm going to use your approach for my future graph runs since it's a very good way to present information clearly as well as efficiently.
ReplyDelete