{"id":22,"date":"2021-06-21T18:47:05","date_gmt":"2021-06-21T22:47:05","guid":{"rendered":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/?post_type=chapter&#038;p=22"},"modified":"2021-10-07T18:13:29","modified_gmt":"2021-10-07T22:13:29","slug":"lab-2","status":"publish","type":"chapter","link":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/chapter\/lab-2\/","title":{"raw":"Modelling a shelter","rendered":"Modelling a shelter"},"content":{"raw":"Cubicles equipped with heaters such as the one shown in Figure 2.1 could be used as temporarily shelters to protect people in cold weather conditions.\r\n\r\n&nbsp;\r\n\r\n[caption id=\"attachment_60\" align=\"aligncenter\" width=\"229\"]<img class=\" wp-image-60\" src=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-300x219.jpg\" alt=\"\" width=\"229\" height=\"167\" \/> Figure 2.1\u2013 Cubicle[\/caption]\r\n\r\nA company that builds such cubicles has provided a catalog as in Table 2.1. The purpose of this lab is to confirm the functionality of these cubicles in various conditions. Assuming the internal temperature of the cubicle is\u00a0T<sub>r<\/sub>, our goal is to adjust the heater to maintain this temperature in an appropriate range. The temperature of the walls is denoted as\u00a0 T<sub>w<\/sub> , and the outside temperature is\u00a0 T<sub>o ,<\/sub>which is considered as disturbance to the system because we do not have any control on the weather outside.\r\n<p style=\"text-align: center\">Table 1\u2013 Specifications of the cubicle<\/p>\r\n<img class=\"wp-image-63 aligncenter\" src=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-scaled.jpg\" alt=\"\" width=\"818\" height=\"182\" \/>\r\n\r\n&nbsp;\r\n\r\nThe heat flow rate of the heater is our input and control signal to the system. We will examine this system in different situations to see if it can provide our needs.\r\n\r\n<strong>Objectives<\/strong>\r\n\r\nThe following objectives will be covered as you go through the experiment procedure.\r\n<ul>\r\n \t<li>Examine the basic MATLAB functions<\/li>\r\n \t<li>Practice basic signals and operations<\/li>\r\n \t<li>Derive the the transfer function of a thermodynamic system<\/li>\r\n \t<li>Derive the state space of a thermodynamic system<\/li>\r\n \t<li>Derive the differential equations of a thermodynamic system<\/li>\r\n<\/ul>\r\n<strong>Procedure <\/strong>\r\n\r\n1.\u00a0 \u00a0Assume Figure 2.2 shows the outside temperature T<sub>o<\/sub> in a 24-hour cycle (one day). Write the function of the signal T<sub>o<\/sub> (t) using signal operations (time shift, time scaling, and time-reversal) on the base signal F(t)=cos(t) . We assume that T<sub>o <\/sub>waveform remains the same during our experiment.\r\n\r\n&nbsp;\r\n\r\n[caption id=\"attachment_61\" align=\"aligncenter\" width=\"414\"]<img class=\" wp-image-61\" src=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-scaled.jpg\" alt=\"\" width=\"414\" height=\"230\" \/> Figure 2.2\u2013 The outside temperature in one day[\/caption]\r\n\r\n2.\u00a0 \u00a0Derive the differential equation that describes the relationship between the input (outside temperature T<sub>r<\/sub> ) and output (internal temperature) of the system. Find the output ( T<sub>r<\/sub>) for 3 days, by solving the differential equation with <em>ode45<\/em> function in MATLAB (Solve Non-Stiff differential equations \u2013 medium order method) . Assume the heater turns on for the first time at midnight (T<sub>r<\/sub>(0)=T<sub>W(<\/sub>0)=T<sub>o<\/sub>(0)=0) and works with its maximum power instantly Q=q<sub>max<\/sub> U(t).\r\n\r\n3.\u00a0 \u00a0Derive the transfer function of the system. Using the transfer function, simulate the system in MATLAB and derive\u00a0 T<sub>r<\/sub> for the scenario described below. Then, plot T<sub>r <\/sub>for 3 days. Note that is given in Part 1 and we don\u2019t have any initial condition in the transfer function model. ( T<sub>r<\/sub>(0)= D T<sub>r<\/sub>(0)=0), where D represents x(t)=dx(t)\/dt.\r\n<p style=\"padding-left: 40px\">a) <span style=\"font-size: 1em\">The heater turns on at midnight and reaches its nominal performance instantly (<\/span><span style=\"font-size: 1em\">Q=q<\/span><sub>max<\/sub><span style=\"font-size: 1em\"> U(t) <\/span><span style=\"font-size: 1em\">). (Step signal) what if it happens in 10 hours? (Ramp signal)<\/span><\/p>\r\n<p style=\"padding-left: 40px\">b) <span style=\"font-size: 1em\">The heater breaks and makes a big spark at 8 pm (Q=q<sub>max<\/sub> Dirac(t-20) ) the next day. This situation will suddenly produce an amount of energy ( ) (Impulse signal).<\/span><\/p>\r\n<p style=\"padding-left: 40px\"><span style=\"font-size: 1em\">c) Next, the heater doesn\u2019t work for 10 hours. Imagine the heater slowly cools down (Q=q<sub>max<\/sub>\u00a0 e<sup>-(t-20)<\/sup>) then it turns back on in the same way (Q=q<sub>max<\/sub> (1- e<sup>-(t-30)<\/sup> ) )(Exponential signal).<\/span><\/p>\r\n\u00a0 \u00a04.\u00a0 \u00a0Derive the state-space model of the system. Consider T<sub>r<\/sub>, T<sub>w<\/sub> as state variables, T<sub>r\u00a0 <\/sub>as the output, Q<sub>\u00a0<\/sub>as input, and T<sub>o<\/sub> as a disturbance. Simulate the system in MATLAB. Try to derive the transfer function of the system from the state space. Verify that the transfer function obtained from the state space is the same as the one obtained in Part 3.\r\n\r\n5.\u00a0 \u00a0Assuming that the heater automatically turns off when the internal temperature reaches and turns on at (square signal), plot T<sub style=\"text-align: initial\">r<\/sub><span style=\"text-align: initial;font-size: 1em\"> for 3 days ( <\/span><span style=\"text-align: initial;font-size: 1em\">T<\/span><sub style=\"text-align: initial\">r<\/sub><span style=\"text-align: initial;font-size: 1em\">(0) = T<sub>w<\/sub><\/span><span style=\"text-align: initial;font-size: 1em\">(<\/span><span style=\"text-align: initial;font-size: 1em\">0) = T<\/span><sub style=\"text-align: initial\">o<\/sub><span style=\"text-align: initial;font-size: 1em\">(0) <\/span><span style=\"text-align: initial;font-size: 1em\">. Also, plot the internal temperature for 3 days if the temperature sensor has error (Noise).<\/span>","rendered":"<p>Cubicles equipped with heaters such as the one shown in Figure 2.1 could be used as temporarily shelters to protect people in cold weather conditions.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_60\" aria-describedby=\"caption-attachment-60\" style=\"width: 229px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-60\" src=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-300x219.jpg\" alt=\"\" width=\"229\" height=\"167\" srcset=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-300x219.jpg 300w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-1024x746.jpg 1024w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-768x560.jpg 768w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-1536x1119.jpg 1536w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-65x47.jpg 65w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-225x164.jpg 225w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1-350x255.jpg 350w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.1.jpg 1920w\" sizes=\"auto, (max-width: 229px) 100vw, 229px\" \/><figcaption id=\"caption-attachment-60\" class=\"wp-caption-text\">Figure 2.1\u2013 Cubicle<\/figcaption><\/figure>\n<p>A company that builds such cubicles has provided a catalog as in Table 2.1. The purpose of this lab is to confirm the functionality of these cubicles in various conditions. Assuming the internal temperature of the cubicle is\u00a0T<sub>r<\/sub>, our goal is to adjust the heater to maintain this temperature in an appropriate range. The temperature of the walls is denoted as\u00a0 T<sub>w<\/sub> , and the outside temperature is\u00a0 T<sub>o ,<\/sub>which is considered as disturbance to the system because we do not have any control on the weather outside.<\/p>\n<p style=\"text-align: center\">Table 1\u2013 Specifications of the cubicle<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-63 aligncenter\" src=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-scaled.jpg\" alt=\"\" width=\"818\" height=\"182\" srcset=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-scaled.jpg 2560w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-300x67.jpg 300w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-1024x228.jpg 1024w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-768x171.jpg 768w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-1536x341.jpg 1536w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-2048x455.jpg 2048w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-65x14.jpg 65w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-225x50.jpg 225w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Table2.1-1-350x78.jpg 350w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The heat flow rate of the heater is our input and control signal to the system. We will examine this system in different situations to see if it can provide our needs.<\/p>\n<p><strong>Objectives<\/strong><\/p>\n<p>The following objectives will be covered as you go through the experiment procedure.<\/p>\n<ul>\n<li>Examine the basic MATLAB functions<\/li>\n<li>Practice basic signals and operations<\/li>\n<li>Derive the the transfer function of a thermodynamic system<\/li>\n<li>Derive the state space of a thermodynamic system<\/li>\n<li>Derive the differential equations of a thermodynamic system<\/li>\n<\/ul>\n<p><strong>Procedure <\/strong><\/p>\n<p>1.\u00a0 \u00a0Assume Figure 2.2 shows the outside temperature T<sub>o<\/sub> in a 24-hour cycle (one day). Write the function of the signal T<sub>o<\/sub> (t) using signal operations (time shift, time scaling, and time-reversal) on the base signal F(t)=cos(t) . We assume that T<sub>o <\/sub>waveform remains the same during our experiment.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_61\" aria-describedby=\"caption-attachment-61\" style=\"width: 414px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61\" src=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-scaled.jpg\" alt=\"\" width=\"414\" height=\"230\" srcset=\"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-scaled.jpg 2560w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-300x167.jpg 300w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-1024x570.jpg 1024w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-768x428.jpg 768w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-1536x855.jpg 1536w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-2048x1140.jpg 2048w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-65x36.jpg 65w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-225x125.jpg 225w, https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-content\/uploads\/sites\/1435\/2021\/06\/Fig2.2-350x195.jpg 350w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><figcaption id=\"caption-attachment-61\" class=\"wp-caption-text\">Figure 2.2\u2013 The outside temperature in one day<\/figcaption><\/figure>\n<p>2.\u00a0 \u00a0Derive the differential equation that describes the relationship between the input (outside temperature T<sub>r<\/sub> ) and output (internal temperature) of the system. Find the output ( T<sub>r<\/sub>) for 3 days, by solving the differential equation with <em>ode45<\/em> function in MATLAB (Solve Non-Stiff differential equations \u2013 medium order method) . Assume the heater turns on for the first time at midnight (T<sub>r<\/sub>(0)=T<sub>W(<\/sub>0)=T<sub>o<\/sub>(0)=0) and works with its maximum power instantly Q=q<sub>max<\/sub> U(t).<\/p>\n<p>3.\u00a0 \u00a0Derive the transfer function of the system. Using the transfer function, simulate the system in MATLAB and derive\u00a0 T<sub>r<\/sub> for the scenario described below. Then, plot T<sub>r <\/sub>for 3 days. Note that is given in Part 1 and we don\u2019t have any initial condition in the transfer function model. ( T<sub>r<\/sub>(0)= D T<sub>r<\/sub>(0)=0), where D represents x(t)=dx(t)\/dt.<\/p>\n<p style=\"padding-left: 40px\">a) <span style=\"font-size: 1em\">The heater turns on at midnight and reaches its nominal performance instantly (<\/span><span style=\"font-size: 1em\">Q=q<\/span><sub>max<\/sub><span style=\"font-size: 1em\"> U(t) <\/span><span style=\"font-size: 1em\">). (Step signal) what if it happens in 10 hours? (Ramp signal)<\/span><\/p>\n<p style=\"padding-left: 40px\">b) <span style=\"font-size: 1em\">The heater breaks and makes a big spark at 8 pm (Q=q<sub>max<\/sub> Dirac(t-20) ) the next day. This situation will suddenly produce an amount of energy ( ) (Impulse signal).<\/span><\/p>\n<p style=\"padding-left: 40px\"><span style=\"font-size: 1em\">c) Next, the heater doesn\u2019t work for 10 hours. Imagine the heater slowly cools down (Q=q<sub>max<\/sub>\u00a0 e<sup>-(t-20)<\/sup>) then it turns back on in the same way (Q=q<sub>max<\/sub> (1- e<sup>-(t-30)<\/sup> ) )(Exponential signal).<\/span><\/p>\n<p>\u00a0 \u00a04.\u00a0 \u00a0Derive the state-space model of the system. Consider T<sub>r<\/sub>, T<sub>w<\/sub> as state variables, T<sub>r\u00a0 <\/sub>as the output, Q<sub>\u00a0<\/sub>as input, and T<sub>o<\/sub> as a disturbance. Simulate the system in MATLAB. Try to derive the transfer function of the system from the state space. Verify that the transfer function obtained from the state space is the same as the one obtained in Part 3.<\/p>\n<p>5.\u00a0 \u00a0Assuming that the heater automatically turns off when the internal temperature reaches and turns on at (square signal), plot T<sub style=\"text-align: initial\">r<\/sub><span style=\"text-align: initial;font-size: 1em\"> for 3 days ( <\/span><span style=\"text-align: initial;font-size: 1em\">T<\/span><sub style=\"text-align: initial\">r<\/sub><span style=\"text-align: initial;font-size: 1em\">(0) = T<sub>w<\/sub><\/span><span style=\"text-align: initial;font-size: 1em\">(<\/span><span style=\"text-align: initial;font-size: 1em\">0) = T<\/span><sub style=\"text-align: initial\">o<\/sub><span style=\"text-align: initial;font-size: 1em\">(0) <\/span><span style=\"text-align: initial;font-size: 1em\">. Also, plot the internal temperature for 3 days if the temperature sensor has error (Noise).<\/span><\/p>\n","protected":false},"author":197,"menu_order":3,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-22","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/chapters\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/wp\/v2\/users\/197"}],"version-history":[{"count":7,"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/chapters\/22\/revisions"}],"predecessor-version":[{"id":347,"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/chapters\/22\/revisions\/347"}],"part":[{"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/chapters\/22\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/pressbooks\/v2\/chapter-type?post=22"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/wp\/v2\/contributor?post=22"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/sysmodeling\/wp-json\/wp\/v2\/license?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}