The name is absent



Stata Technical Bulletin

29


Example 2: Regulation of the shower water temperature

a) Negative feedback without delay

We wish to regulate the warm water flux (with temperature Tw = 50o C) to obtain the desired temperature (Topt = 35o
C), maintaining a cold water flux of 0.2 l/s. Let the cold water temperature be
Tc = 10o C. The state variables of the system
can be the warm water flux (IVw) and the cold water flux (Wc).

We assume no variation in the IVc flux (VAc = 0) and the warm water regulation depending on temperature difference
ɪopt —
T. V is the auxiliary variable representing the temperature of the mixed water. We assume also a perfect regulation, with
no delays in perceiving the real temperature at the mixer level. The total flux (V) is considered given by the summation of IVc
and IVw. The model, recorded as a .dct file, is as follows:

dictionary -(

* file showerl.dct

* Shower water temperature regulation - 1 - WITHOUT DELAY

* Cold water flux constant - regulation of warm water flux

* to obtain the desired temperature (Topt).

str70 .model

J-

”* — state variables —                                      ,,

”S Wc=Wc+dt*VAc                 Cold water flux (l/s)         ”

”S Ww=Ww+dt*VAw                 Warm water flux (l/s)         ”

,,* Note: in this case fluxes are levels, not rates.            ,,

”R VAc=O                        Variat. rate cold flux (1/s/s)”

”R VAw=K*(Topt-T)               Variat. rate warm flux (1/s/s)”

”1 Wc=O.2                                                              ”

”1 Ww=O                                                            ”

”P Topt=35                      Optimal temperature (C)       ”

”P Tc=IO                        Cold water temperature (C)    ”

”P Tw=50                        Warm water temperature (C)    ”

”A T=(Tc*Wc+Tw*Ww)∕(Wc+Ww)      Shower water temperature      ”

ιp κ=Qi03                         Adjusting speed                ”

To read this file and perform the simulation, we type

. infile using shower
dictionary -(

* file showerl.dct

* Shower water temperature regulation - 1 - WITHOUT DELAY

* Cold water flux constant - regulation of warm water flux

* to obtain the desired temperature (Topt).
str70 .model

>

(15 observations read)

. simula, dt(0.2) tspan(12)

The simulation results reported in Figure 6(a) show that after a few seconds the system reaches the equilibrium and T equals
the optimal temperature.

b) Negative feedback with a constant information delay

Really, there is a delay in perceiving the real water temperature at the mixer level. This determines a difficult regulation
with temperature higher and lower than the optimal. The desired condition is obtained later and with oscillating warm water
fluxes. This situation can be simulated by inserting an “information delay” in the VAw rate calculation of the previous model.
This is done by modifying our model:

. replace .model=,'R VAw=IDL[K*(Topt-T) ,dly] ” in 7

. replace .model="P dly=l,' in 16

The first command inserts a constant information delay of dly seconds in the VAw rate; the second command assigns the value
to the dly parameter. Recalling the simulation command,

. simula, dt(0.2) tspan(12)

we obtain the results shown in Figure 6(b). The constant information delay produces an oscillating behavior of the warm water
flux.



More intriguing information

1. The name is absent
2. Urban Green Space Policies: Performance and Success Conditions in European Cities
3. The name is absent
4. Cultural Diversity and Human Rights: a propos of a minority educational reform
5. The Distribution of Income of Self-employed, Entrepreneurs and Professions as Revealed from Micro Income Tax Statistics in Germany
6. The name is absent
7. Internationalization of Universities as Internationalization of Bildung
8. An Investigation of transience upon mothers of primary-aged children and their school
9. A COMPARATIVE STUDY OF ALTERNATIVE ECONOMETRIC PACKAGES: AN APPLICATION TO ITALIAN DEPOSIT INTEREST RATES
10. The name is absent
11. The Integration Order of Vector Autoregressive Processes
12. Prevalence of exclusive breastfeeding and its determinants in first 6 months of life: A prospective study
13. Update to a program for saving a model fit as a dataset
14. The name is absent
15. The name is absent
16. The name is absent
17. Restructuring of industrial economies in countries in transition: Experience of Ukraine
18. Partner Selection Criteria in Strategic Alliances When to Ally with Weak Partners
19. 5th and 8th grade pupils’ and teachers’ perceptions of the relationships between teaching methods, classroom ethos, and positive affective attitudes towards learning mathematics in Japan
20. A Principal Components Approach to Cross-Section Dependence in Panels