The Assignment:
In class today we explored MATLAB further by altering mathematical models of thermal systems. The selected exercises are shown below.
Question 1: How does the cooling behavior change if we vary the parameters Rth and C?
Before increasing anything the graph looked like this with values of C=1000 and Rth=0.85...
If we increased C then the resulting graph looks like this...
If we increase Rth then the resulting graph looks like this...
If both C and Rth are increased then the graph looks like this
If we decrease C then the resulting graph looks like this...
If we decrease Rth then the resulting graph looks like this...
If both C and Rth are decreased then the resulting graph looks like this...
Based on the way the graphs above behaved Rth and C seem to make the slope more positive and more linear when increased. This makes sense intuitively because C is capacitance or the amount of heat it can hold, Rth is the thermal resistance so if the resistance is increased then the heat does not escape as easily. In both cases the heat is retained longer. When either C of Rth are decreased the function decays even more exponentially. Mathematically the expression...
Which can be rearranged to include Rth and C as shown below shows that these observations are grounded in the mathematical properties of the function...
Question 2: Calculate the value for P if we want our coffee to heat up to the Starbucks ideal 84 C.
Using the equation given in the text we were able to find P by setting dT equal to zero since as the function approaches the temperature we want, in this case 84 C (357 K) dT will approach zero. We can then simplify the expression and plug in the correct numbers.
The Code which implements this power value and the resulting graph are shown below...
Page 9: Bang-Bang and Proportional Control of Thermal Systems
1. Modify the program to stimulate a temperature controller using bang-bang control to reach the temperature. Why is bang-bang control appropriate for many thermal systems? Why might it be insufficient?
The original heatsim program is shown below...
In order to create a bang bang control system we altered the code so that if the temperature reahced the target then the power would turn off completely. If the the temperature was lower than the target then the power would turn completely on. The altered code and the resulting graph are shown below...
As you can see from the graph, once the temperature reaches the target then the power will turn on and off completely to make it oscillate sharply around the target. Bang bang control like this is common in heating systems because it allows the heater to reach the target quickly. With proportional control the temperature can never mathematically reach the target, and it takes much longer to get to a close approximation.
2. Create a program that uses proportional control to reach and maintain the desired temperature. How does this approach compare to bang-bang control?
Our proportional control program actually reached the target faster than the bang bang control program, but that was only because the power used in the proportional program was much higher and most likely unrealistic for a real device. When we ran the program with the same power as the bang bang control it never even got close to the target within the time window, Mathematically the temperature can never reach the target because there is an asymptote. Our code and graph are shown below...
3. Modify both programs to add a sensor delay to both programs. What is the impact of this "sensor delay" on each system? What other delay(s) might you expect in your thermodynamic system, apart from sensor delays?
Shown below is the modified proportional delay program to include a sensor delay of 5 seconds. This forces the temperature to actually surpass the target temperature because by the time the program senses that the temperature has exceeded the target, the temperature has continued to rise for 5 seconds. After this the program will respond causing it to pull the temperature back down. In this way it will continue to oscillate with an increasingly subtle curve towards infinity,
The modified heatsim_banbang program to include a delay shown below changes the program by increasing the amount of time that passes before the heater is turned back on all the way to reach the target. This would prevent the heater from turning on and off too quickly preventing mechanical malfunctions that could occur as a result.
As for other forms of delays. I would say that there could be an action delay which rather than delaying how often the sensor reads the information, delaying the response to that reading. In this way the sensor would constantly be reading but the action for a given kind of stimuli would not occur until 5 seconds after the stimuli occurred if the delay was 5 seconds.
Reflection:
This set of problems really helped to ground the concept of bang bang and proportional control for me since I now have graphical/visual references for their effects. Moving forward this knowledge will be very helpful when trying to incorporate bang bang and proportional control into my final project.