Q1.
In Question 1 the key equation isdT = -(T-Tair)*dt/(Rth*C)
Intuitively, when the system has a higher capacity, it is more resistant to change its temperature, hence a smaller dT. When the system has a higher thermal resistance, similarly, the system will have a smaller dT. Mathematically, the equation follows. Here are the graphs.
| C = 2000, Rth = .85 |
| C = 3000, Rth = .85 |
| C = 5000, Rth = .85 |
| C = 1000, Rth = 1 |
| C = 1000, Rth = 0.05 |
| C = 1000, Rth = 0.35 |
| C = 1000, Rth = 0.85 |
Q2.
To calculate the perfect P, we want to set the equation so that when T = 357K (84C), dT would be zero. Since dt =/= 0, thenP/C - (T-Tair)/(Rth*C) = 0
Solve the equation, we have
P = 74.1176
When we plug in the number, we will get the graph:
| P = 75 |
| P = 20 |
Feedback and Control
1) Bang-bang control
Here is the bang-bang control. We are assuming that the heating element has a maximum P of 200. The heating element either turns on fully or turns off completely. As the temperature increases, if we zoom in on the "flat" line in the graph, we will be able to see the temperature jumps up and down not too far from 357K. This is appropriate for many systems because it allows the temperature to stay very closely at the target temperature. However, it may be insufficient sometimes because it requires turning on and off the heating element very frequently, even if the actual temperature is only slightly off from the target temperature.
2) Proportional Control
Here is the proportional control. Clearly, the temperature cannot reach the target temperature (black line) fully, because this system, just like when we worked with Sciborg, also has a "friction". We cannot make it fully to the top, because once it's very close to the target temperature, there is not enough P to overcome the heat leaving the system. We would have needed a nudge like we did before. Proportional control is better than bang-bang in the sense that it would not require constant turning-on and -off of the heating element and can automatically adjust the amount of energy put into the system. However, we must overcome by using nudge or changing the gain. Here I changed the gain.
Here the gain is large. As a result, the coffee would get over-heated immediately and then adjust until the temperature gets close to the target temperature. However, this is probably impossible to achieve in real life, since the heating element cannot actually provide that much P. I would probably alter the code so that dE_in would never exceed Pmax*dt to see simulate a more realistic graph.
Your background is so cool! The code in your blog was also pretty easy and clear to read. I like how you described your P in your proportional code...it is true that you alter values to pretty unrealistic amounts in order for it to be very close to the ideal temperature value.
ReplyDeleteI really liked the way you displayed your code with your photos, it was very easy to go back and compare different trials and tests.
ReplyDeleteI like that you show the 357 straight line for the proportional control. We initially thought we were wrong because our graph would not reach the 357.
ReplyDelete