In this subsection, an MiL (Model-in-the-Loop) approach is presented. First, the modeling of the heating system is described. Next, the results of the model validation are shown, and finally, the implementation of the MPC in MiL is discussed.
3.1. Modeling of the Heating System
The structure of the cabin heating system in the SeLv truck is shown in
Figure 3. The heating system consists of a water pump, a high-voltage heater, and a heat exchanger. The heat exchanger is integrated into a standard HVAC unit in the vehicle cabin. The HVAC unit includes a heater core (heat exchanger for heating), an evaporator for air conditioning, air-guiding flaps, and a blower that draws in ambient or recirculated air and forces it through the heat exchangers.
The working fluid, hereafter referred to as the coolant, is a mixture of 50% water and 50% ethylene glycol. The heater is equipped with sensors that measure the inlet and outlet coolant temperatures. The dashed lines and T-connectors indicate the possibility of coupling the heating circuit with the medium-temperature (MT) cooling circuit, enabling the use of waste heat for cabin heating, as demonstrated in previous PEM research [
21].
While the HVAC unit also provides air conditioning via the evaporator, this study focuses on heating mode. A detailed analysis of the cooling functionality, including its modeling and control, is beyond the scope of this paper and would require separate consideration due to its distinct physical dynamics and operating conditions.
Thermodynamic modeling of the heating system describes the thermal dynamics of the coolant circulating through the circuit and passing through the heater and cabin heat exchanger. First, a mathematical model comprising differential equations is developed and then implemented in MATLAB/Simulink R2024a [
22]. Two Simulink blocks represent the lumped thermal masses of the heater and the heat exchanger. By applying the first law of thermodynamics, expressions for the coolant outlet temperatures of these components are obtained. To capture transient behavior, the thermal mass of the coolant is also included.
Table 1 defines the nomenclature used to describe the heating system.
Equation (7) describes the transient behavior of the first portion of the coolant thermal mass, namely, the coolant volume in the system downstream of the heater. This transient formulation is necessary to capture the time-dependent temperature response during variations in heater power or coolant flow, which cannot be represented by a steady-state model. The resulting temperature is then used as the inlet condition for the heat exchanger.
where
is the thermal mass of the coolant volume in the system downstream of the heater.
The volume of coolant in the system after the heat exchanger is considered as the second part of the coolant thermal mass. The corresponding heat balance equation is given in Equation (8), where the resulting temperature is used as the inlet temperature to the HV heater.
Here, denotes the thermal mass of the coolant volume after the heat exchanger.
The coolant outlet temperature of the heater is determined from Equation (9), derived from a steady-state energy balance between the enthalpy change of the coolant and the input power of the heater.
Here, denotes the input power of the heater.
The coolant temperature change in the heat exchanger is determined using Equation (10).
Here, represents the energy transferred from the coolant to the air, which will be modeled in the following section.
Since the maximum power consumption of the pump (
) is negligible compared to the maximum heater power (
), the pump is operated at maximum speed whenever it is switched on. Consequently, variations in the flow rate are primarily caused by temperature-dependent changes in viscosity. The coolant flow rate is therefore determined experimentally using an ultrasonic volume flow sensor. As the sensor measures volume flow, the temperature-dependent relationship between volume flow and mass flow is incorporated into the model by accounting for the coolant density as a function of temperature. The experimentally determined volume flow and its dependence on temperature are shown in
Figure 4.
3.1.1. Heat Exchanger Model
The heat transferred across the heat exchanger is determined using the expression in Equation (11), based on the NTU (Number of Transfer Units) method. A detailed derivation can be found in [
23].
The heat capacity rate
C of a fluid is defined as
where
is the mass flow rate and
is the specific heat capacity. The terms
and
denote the smaller and larger of the two heat capacity rates (for the hot and cold fluids), respectively:
For a cross-flow heat exchanger with both fluids unmixed, the effectiveness
is calculated using the following correlation [
24]:
Here,
is defined as
, while the NTU is calculated as
The overall heat transfer coefficient
is expressed as
where
and
are the convective thermal conductances of fluids 1 and 2, respectively, and
is the thermal conductance of the separating wall. The convective conductance on each side is defined by
where
is the Nusselt number,
is the thermal conductivity,
is the heat transfer area, and
is the characteristic length for heat exchange.
The Nusselt number (
) is calculated using Equation (18). The constants
,
, and
, as well as the Reynolds number (
) and Prandtl number (
) for both fluids, are determined by performing a least-squares regression using measurement data from the heat exchanger with the E-NTU regression tool in Simcenter Amesim [
25]. The dependency of the Nusselt number on the Reynolds and Prandtl numbers is expressed by the following equation:
The Reynolds number depends on the flow conditions, while the Prandtl number characterizes the fluid properties and is independent of flow conditions. Both numbers are calculated using the formulas provided by the Amesim Regression Tool.
where:
is the hydraulic diameter
is the mass flow rate
is the dynamic viscosity
S is the cross-sectional area
is the thermal conductivity
Calculating the Nusselt number allows the determination of the
value in the next step. Using the computed
, the effectiveness
of the heat exchanger can be obtained from Equation (14). Finally, Equation (11) is used to calculate the actual heat transferred based on the maximum possible heat exchange. Assuming ideal conditions (i.e., no heat losses and perfect insulation, consistent with the first law of thermodynamics), it can be considered that both the hot and cold fluids exchange the same amount of heat. Under this assumption, the outlet temperature of the coolant can be calculated using Equation (9), while the temperature increase of the air flowing through the heat exchanger is determined using Equation (21).
3.1.2. Model of the Cabin Volume
The cabin volume is modeled using the heat balance method (HBM), a modeling approach commonly applied in building simulations and presented by the American Society of Heating, Refrigerating, and Air-Conditioning Engineers (ASHRAE) [
26]. This approach incorporates three distinct heat balance equations:
The cabin air volume, assumed to have a uniform temperature ;
The internal cabin wall temperature ;
The external cabin wall temperature .
This layered modeling approach enables improved representation of external heat flows affecting the cabin, including solar radiation and convective heat transfer with the ambient air.
Figure 5 represents the thermal loads affecting the thermal balance of a vehicle cabin.
The thermal loads affecting vehicle cabin are as follows:
Metabolic Load
Vehicle occupants produce heat as a result of their metabolic processes. This is considered in the metabolic load modeling. The contribution of this load is relatively small, since physical activity levels are low during driving. Nevertheless, it is included for the sake of completeness in the model. According to ISO 7730 [
28], the metabolic rate for a seated person driving is considered constant at
. Assuming an average body surface area of
[
29], the total metabolic load can be calculated using the following equation:
Ambient Load
The ambient load describes the heat transfer between the cabin and the environment. In heating mode, heat is transferred from the cabin to the environment, while in air conditioning mode, the direction is reversed. The heat transfer can be separated into the following contributions:
- -
Heat convection between cabin air and the inner wall, calculated as:
where
is the internal heat transfer coefficient, assumed constant since the blower settings of the HVAC unit remain unchanged.
S denotes the convective heat transfer surface area obtained from the cabin model.
- -
Heat conduction from the inner wall to the external wall, expressed as:
where
is the thermal conductivity of the cabin walls and
is the wall thickness.
- -
Heat convection from the external wall to the ambient air, given by:
where
S denotes the convective heat transfer surface obtained from the cabin CAD model, and
is the external heat transfer coefficient. This coefficient is strongly influenced by the air velocity around the vehicle (or the vehicle speed). The convective heat transfer coefficient is modeled as a function of vehicle speed [
30]:
Solar Radiation Load
Various approaches exist in the literature for modeling solar radiation heat loads. Some studies rely on experimental data [
31], while others estimate solar irradiance and sun position based on weather forecasts or historical data [
32].
The radiation load on a surface is calculated as:
where:
- -
I is the solar irradiance,
- -
is the incident angle, defined as the angle between the sun’s rays and the surface normal,
- -
S is the surface area.
The incident solar radiation on a surface can be divided into three components: absorption, reflection, and transmission [
33]. Since the reflected component does not directly affect the cabin heat balance, it is neglected in the model. For external walls, solar radiation is primarily absorbed and is calculated using an absorption coefficient
, as shown in Equation (28). For windows, solar radiation is predominantly transmitted through the glass, directly impacting the inner walls. This effect is quantified using a transmission factor
, as shown in Equation (29).
Heating Load
The heat input into the cabin from the heating system is calculated as:
where
is the temperature of the air entering the cabin after passing through the heat exchanger, calculated using Equation (21).
3.1.3. Heat Balance Equations for Thermal Masses in the Cabin
After defining all relevant heat flows, the next step in the modeling process is to establish the heat balance equations for all thermal masses. Although the heat transfer to the ambient is modeled here for the heating scenario, the equations are formulated in a general manner, making them equally applicable to the air-conditioning scenario.
The cabin air temperature,
, is assumed to be uniform throughout the cabin volume. The heat balance for the cabin air volume is expressed as:
Here, represents the thermal mass of the cabin air.
The heat flows affecting the cabin air are as follows:
—heat input from the heating system, Equation (30)
—metabolic heat generation of the driver, Equation (22)
—heat transfer between cabin air and internal wall, Equation (23)
The heat balance for the inner wall is expressed as:
The heat flows considered in the inner wall heat balance are as follows:
—heat transfer between cabin air and internal wall, Equation (23)
—heat transfer from the inner wall to the external wall, Equation (24)
—solar radiation transmitted through the windows, Equation (29)
The heat balance for the external wall is expressed as:
The heat flows considered in the external wall heat balance are as follows:
—heat absorbed from solar radiation, Equation (28)
—heat transferred from the inner wall to the external wall, Equation (24)
—heat transferred between external wall and environment, Equation (25)
3.1.4. Extension of the Model for Coupling with Cooling Circuit
As illustrated in
Figure 3, the heating circuit is coupled via a three-way valve with a middle-temperature (MT) cooling circuit operating at approximately 40–60 °C. This cooling circuit manages the temperature of the drivetrain components (motors, inverters, transmission), DC/DC converters, air compressor, fuel cell power electronics, and the on-board charger (OBC). Coupling the circuits in the simulation allows evaluating the effectiveness of the MPC in managing multi-input multi-output (MIMO) systems.
For simplification, the cooling system is modeled with a constant coolant temperature of 40 °C, representing a worst-case scenario for heating due to the low coolant temperature. A simulation of the MT cooling circuit using a dedicated model, the details of which are beyond the scope of this investigation, showed that the coolant temperature remains nearly constant after the initial heating phase (<3% of the driving cycle). In this simulation, the temperature was successfuly controlled to 40 °C, as exceeding 45 °C would trigger derating of the electric motor. This confirms that the assumption of a constant 40 °C is reasonable for evaluating MPC performance. The valve regulates the volume flow between the heating and cooling systems by adjusting its position. The resulting coolant temperature entering the HV heater is calculated algebraically using an energy balance between the heating system and the cooling system:
Here, represents the effective coolant temperature entering the heater (Equation (9)), denotes the valve position ( when fully open, when closed), is the temperature calculated in Equation (8), and is the temperature of the coolant returning from the drivetrain cooling system.
Although this approach significantly simplifies the cooling system by assuming a constant coolant temperature, it still provides valuable insights into two key aspects: the potential use of drivetrain waste heat for cabin heating, and the effectiveness of the MPC controller in handling MIMO systems.
3.1.5. Thermal Comfort Calculation
Thermal comfort is subjective and dependent on both environmental conditions and individual sensations. It is not merely influenced by temperature, but also by relative air humidity, mean radiant temperature, and air velocity. One of the most common methods for evaluating thermal comfort in the automotive field is the PMV method proposed by Fanger [
29]. Its applications range from localized thermal comfort assessments under specific operating conditions, where the cabin is represented as a 3D model and PMV is computed spatially [
34], to its integration into HVAC control strategies for optimizing occupant comfort. The PMV index is assessed on a seven-point scale (
: cold,
: cool,
: slightly cool, 0: neutral,
: slightly warm,
: warm,
: hot), with 0 representing neutral conditions where most humans would feel comfortable.
Closely linked to PMV is the Predicted Percentage of Dissatisfied (PPD) index, which is not independent but mathematically derived from PMV. It quantifies the expected share of people dissatisfied with the thermal environment at a given PMV value, according to the following relation [
35]:
This relationship is nonlinear: even at PMV = 0, at least 5% of people are predicted to feel uncomfortable, and the PPD increases sharply as PMV deviates from neutral. A PPD value of 10% (corresponding approximately to PMV between
and
) is usually considered the acceptable threshold for a comfortable thermal environment, as illustrated in
Figure 6.
Both the ASHRAEand ISO 7730 thermal comfort standards define thermal comfort assessment using the PMV index. A common feature of both standards is that they provide pseudo-code outlining the calculation procedure for the PMV index [
28,
35]. In this study, the PMV calculation is implemented in a MATLAB Simulink model, based on the pseudo-code provided in these standards. The Simulink model is organised into three main parts. The first part defines the input parameters required for the PMV calculation, including the computation of relative humidity as a function of the cabin temperature. The second part performs the iterative calculation of the clothing surface temperature using the equations specified in the standards. Finally, the third part computes the PMV index.
In
Table 2, the values of the parameters chosen for the PMV calculation are presented. The choice of the parameter values was made with the tables present in the ISO norm 7730 [
28].
The partial pressure of water vapor is determined using the relative humidity and the saturation vapor pressure, as shown in Equation (36). The saturation vapor pressure can be estimated with the Tetens equation [
36]. Equation (37) illustrates this calculation.
where:
Because there is no relative humidity sensor in the vehicle cabin, this value must be estimated from the temperature. The estimation assumes that the water vapor partial pressure remains constant. The initial water vapor partial pressure is calculated using the relative humidity, and for subsequent states, it is estimated based only on temperature. The accuracy of this approach should be assessed using experimental data; see
Section 3.2.3. If the results are not sufficiently precise, other methods may be considered, such as applying a different correlation or installing a humidity sensor in the cabin. The initial water vapor pressure can be determined using Equations (36) and (37), and the relative humidity (as a percentage) for a given cabin temperature
T is calculated as follows.
The air velocity and mean radiant temperature within a vehicle cabin can vary significantly depending on location. For instance, the air speed at head and torso level often differs from that near the feet. Similarly, the mean radiant temperature is affected by factors such as solar exposure and surface temperatures of the interior, leading to spatial variations. Although cabin models typically assume uniform temperature distributions, these spatial differences in air velocity and radiant temperature should be considered when evaluating thermal comfort. ISO 7730 addresses this by recommending measurements in non-uniform environments at multiple heights, specifically, at three levels with results averaged as summarized in
Table 3.
The mean radiant temperature in a vehicle cabin is affected by several factors, including cabin air temperature, the temperature of interior surfaces, and incoming solar radiation. To better understand how these variables are correlated, targeted measurements will be conducted (see
Section 3.2.3).
The blower settings of the HVAC system will be kept constant to maintain a steady air velocity. For accurate thermal comfort analysis, air velocity will be measured at three specified heights, and these measurements will be averaged to determine the mean air velocity, .
3.2. Experimental Setup and Data Acquisition
To enable fast calculations suitable for Model Predictive Control (MPC), considerable simplifications were made when modeling the vehicle cabin. A series of experiments were conducted to verify that these simplifications did not introduce significant errors. This validation is especially important because exact values of some heat transfer coefficients are difficult to calculate, often requiring reliance on approximate or literature values.
Given the hypothesis that the mean radiant temperature can be approximated by the temperature of surrounding surfaces (
), PMV-related measurements were performed. Sensors were installed at various locations throughout the cabin to collect relevant data. These measurements were also essential for acquiring realistic air velocity data. Furthermore, the simplified relative humidity calculation required validation. Lastly, PMV measurements were used to analyze the impact of cabin inhomogeneity on PMV parameter values. An overview of the sensor positions inside the vehicle cabin is shown in
Figure 7.
A summary of the sensors used, along with their measurement purposes and accuracies, is provided in
Table 4.
Data acquisition was performed using a modular Q.brixx system from Gantner [
37]. Three XL A107 measurement modules, each featuring four multifunctional analog inputs, were utilized. In total, the following three experiments were conducted to provide a basis for model validation:
Heating system validation
Solar radiation–related measurements
PMV-related measurements (including air velocity and air humidity measurements)
3.2.1. Heating System Validation
The heating system validation experiment was performed on a cold winter day after sunset to eliminate the influence of solar radiation. The heater power was kept constant at to enable a more straightforward comparison between simulation and measurement. Under these conditions, the only significant heat loads acting on the cabin were the metabolic load, the heating system itself, and heat losses to the ambient environment.
The experiment was carried out with the vehicle in a stationary state and the HVAC system operating in heating mode. The ambient air temperature, interior and exterior surface temperatures, and cabin air temperature were recorded using temperature sensors placed at representative positions inside and outside the cabin. The inner wall temperatures were measured at several heights near the driver’s position and subsequently averaged. The ambient temperature sensor was positioned away from any local heat sources to ensure undistorted measurements.
The chosen constant heating power allowed the thermal response of the cabin to be observed without interference from fluctuating control inputs. This approach simplified the identification of thermal parameters, such as the internal and external convection coefficients, the thermal conductivity of the cabin wall, and the thermal masses of key components. The resulting data formed the basis for parameter estimation in the simulation model, ensuring that the simulated temperature profiles could be matched to the experimental results with minimal deviation.
3.2.2. Solar Radiation Validation
Following the heating system test, a second experiment was conducted to isolate and quantify the effects of solar radiation on the cabin thermal loads. This test was performed with the heating system turned off to exclude its influence, allowing the thermal impact of solar radiation alone to be observed.
Measurements included ambient air temperature, exterior and interior surface temperatures of the cabin, as well as cabin air temperature. Solar radiation was recorded using a sensor insensitive to the angle of incidence, which was suitable given that the vehicle remained stationary throughout the test and the relative positions of the surfaces did not change. The sun’s position during the test was determined using historical solar data.
3.2.3. PMV Measurements
For the PMV measurements, the primary objective was to obtain data for thermal comfort assessment, including parameters such as air velocity. As highlighted in
Section 3.1.5, while the PMV calculation assumes homogeneous environmental conditions, ISO 7726 [
38] also allows the inclusion of inhomogeneous data. This method involves measuring environmental parameters at three standardised heights and calculating their mean values.
To achieve this, a measurement stand was constructed to facilitate data collection at the three heights specified by ISO 7726, as shown in
Table 3. A photo of the stand built for the measurements is provided in
Figure 8. Also visible in the photos are the Swema air velocity sensors and the black globe thermometers used for determining the mean radiant temperature.
Since the HVAC blower settings were kept constant throughout the test, the air velocities inside the cabin were also expected to remain relatively stable over time. The air velocity was measured at the three standardised heights during three different tests. The time-averaged values from each height were then computed, and the mean air velocity around the driver’s body was determined for the PMV calculation.
For the measurement of air velocity, an omnidirectional probe (Swema 03) compliant with ISO 7730 was used. It is capable of detecting the velocity magnitude independent of direction.
It was previously decided not to measure relative humidity directly and to treat it as a measured disturbance. Instead, a simple calculation method was introduced in
Section 3.1.5. This calculation method must be validated against measurements to ensure that it can accurately reproduce the behavior of relative humidity.
For this purpose, a Telaire T9602 humidity and temperature sensor was installed at head height. Using the same sensor for both temperature and humidity improves the accuracy of the relative humidity measurement.
3.3. Model Validation
This section presents the validation of the developed simulation models using experimental data. The aim is to demonstrate that the models accurately represent the physical behavior of the cabin thermal system under various conditions.
3.3.1. Air Velocity Measurements
To characterize the airflow conditions within the cabin, air velocity measurements were performed at three representative heights corresponding to the head, abdomen, and ankle levels (see
Table 3). The measured velocities were averaged over the measurement period and are summarized in
Table 5.
These measured velocities serve as input parameters for the thermal comfort model and contribute to the calculation of convective heat transfer and PMV estimations in the simulation. While no direct comparison with simulation results is performed here, these values ensure that the modeled airflow conditions realistically reflect the experimental environment.
3.3.2. Relative Humidity Measurements
The data obtained in the experiment described in
Section 3.2.3 are compared with simulation results. The measured and calculated values are shown in
Figure 9.
Since the comparison shows deviations of no more than 3% between the measured and calculated relative humidity values, the approach can be considered valid and sufficient. Therefore, no sensor for relative humidity is required to implement this variable as a measured disturbance.
3.3.3. Mean Radiant Temperature
Similar to the air velocity measurements, the mean radiant temperature (MRT) was recorded using black globe thermometers positioned at three different heights. When calculating the average radiation temperature, it is commonly assumed to be comparable to the air temperature measured with a standard PT1000 sensor or approximated by the interior wall temperature, which represents radiation from the surrounding surfaces.
To verify these assumptions, measurements from the two experiments described in
Section 3.2, one conducted without solar radiation and one conducted with solar radiation, were analyzed. The first experiment allows verification of the correlation between MRT and air or interior wall temperatures under baseline conditions, while the second experiment provides insight into how solar radiation influences MRT.
When measuring temperature with black globe thermometers, ISO 7726 [
38] recommends a correction to eliminate the influence of convective heat transfer with the environment. This correction is applied using the following formula:
is the emissivity of the black globe ( for matte black surfaces)
is the air velocity
is the measured globe temperature
is the measured air temperature
D is the diameter of the sphere
Due to the blower configuration during testing, which directed all airflow toward the windshield, noticeable differences in average radiant temperature were observed across different vertical levels. As illustrated in
Figure 10, the radiant temperatures at head and torso levels are relatively similar, whereas the value at foot level is considerably lower. These observations further highlight the need to account for non-uniform conditions in the thermal comfort evaluation to avoid overlooking discomfort in specific body regions.
3.3.4. Heating System
The essential part of the simulation model for ensuring robust control is the heat transfer from the coolant to the interior air. To validate the suitability of the model, the coolant temperatures before and after the heater, the coolant mass flow, and the air temperature entering the interior must be compared with measurements. For the coolant temperatures, the measurements available via vehicle CAN communication within the HV heater were used. Losses through the hoses and pipes are neglected, so that the temperature at the outlet of the HV heater corresponds to the temperature at the inlet of the heat exchanger. The volume flow was measured with an ultrasonic flow sensor from Keyence attached to one of the hoses.
By analyzing the steady state, the heat transfer characteristics of the heater and the heat exchanger can be accurately validated. To achieve a steady state, the heating power was set to a constant value of . Since the speed of the water pump does not vary, the hydraulic losses in the system were not modeled. Instead, the volume flow is calculated as a function of the coolant temperature, for which a characteristic curve was created based on measurements.
The results of the coolant temperatures with a constant heating output of 5 kW are shown in
Figure 11. As can be seen, the model accurately predicts the coolant temperatures, with deviations of less than 1 °C. Considering that the accuracy of the available temperature measurements in the heater is approximately 1 °C, this represents a satisfactory match.
The recorded data from the same experiment were also used to validate the air temperature at the outlet of the heat exchanger and at the inlet to the cabin. The temperatures were measured with two PT1000 sensors installed in the ventilation opening of the HVAC system.
Figure 12 compares the air temperature at the outlet of the heat exchanger in the measurements and in the simulation. Since the sensors used here are more accurate, the model predictions are even closer to reality. The slightly higher temperatures observed in the experimental data may be due to the warming effect of nearby components such as hoses and expansion tanks located near the air intake point.
3.3.5. External Heat Loads
The most challenging part of the model is capturing the external heat loads due to the simplifications involved. For example, representing the cabin air volume as a single thermal mass is a significant simplification, since inhomogeneities occur in reality. The aim of validating this part of the model is to ensure that these effects on the heating system are represented realistically.
The validation of heat loads acting on the interior considers both the heat input from solar radiation and the heat loss to the environment. Since these two loads act simultaneously, they are evaluated separately. Accordingly, the validation is carried out in two steps. In the first step, data from tests without solar radiation are analyzed; in the second step, solar radiation is included.
The heat loss to the environment consists of three components, all of which are validated by measurements. The convective heat transfer between the cabin air and the interior walls is evaluated by measuring the temperature difference between the cabin air and the interior wall. Two surface temperature measurements are used to assess heat conduction through the cabin walls. Finally, heat transfer from the walls to the ambient air is evaluated based on the temperature difference between the ambient air and the outer wall. Surface temperatures were measured with type K thermocouples placed in direct contact with the surfaces. The inner wall temperatures were measured near the driver’s position at various heights and then averaged.
The first test was carried out after sunset to exclude the influence of solar radiation. The two remaining loads acting on the cabin are the heat input from the high-voltage heating system, kept constant at , and the heat loss to the environment. The heat loss consists of three components: , determined by the internal convection coefficient ; , determined by the ratio of thermal conductivity to wall thickness, ; and , determined by the external convection coefficient . The following temperatures were recorded for validation: ambient air temperature, exterior and interior surface temperatures of the cabin, and cabin air temperature. The aim was to estimate the heat transfer coefficients for internal and external convection, the thermal resistance of the cabin walls, and the thermal masses of various components in order to match the simulated temperature profiles with the experimental data.
Heat transfer coefficients are challenging to model because they are influenced by many factors. For this reason, the Simulink Parameter Estimation Tool was used to adjust these parameters so that the model matches reality. The final results of this process are shown in
Figure 13. The results are highly satisfactory, with deviations between simulation and measurement of less than 1 °C on average.
After completing the test with the heating system, another test was conducted to quantify the effects of solar radiation. This test was performed without activating the heating system in order to isolate the effect of solar radiation. The radiation absorption factor and the transmission factor were used to correlate the model with the experimental values and to account for the simplifications in the calculation of . The temperature measurements included ambient temperature, exterior and interior surface temperatures, as well as the cabin air temperature. The sensor used to measure solar radiation is insensitive to the angle of incidence; however, since the vehicle was stationary, the positions of the vehicle surfaces remained constant. The position of the sun was determined from historical data.
As shown in
Figure 14, the positioning of the temperature sensors has a significant impact on the measurements. Although the sensors in the cabin air and on the interior wall initially display similar values, a clear difference emerges when exposed to sunlight. This is because the interior wall temperature is measured above the driver’s head, where it receives little direct sunlight, whereas the sensor near the driver’s head is directly exposed to sunlight. Although heat convection occurs between the interior wall and the cabin air, it is not sufficient to equalize the temperatures.
Two possible explanations exist for these discrepancies. First, inhomogeneity of the cabin air could account for the temperature difference. Second, solar radiation may directly influence the temperature measurement by heating the sensor itself. This is plausible, as a sharp drop in temperature was observed as soon as the solar radiation was removed.
To estimate the parameters
and
, the following approach was implemented: Since it was observed that, after the initial influence of solar radiation, both the cabin and interior wall temperatures tend to converge to similar values, it was assumed that in a distributed system, the homogeneous cabin air temperature should converge to these values. Knowing the temperature after the first solar radiation exposure, the parameters
and
can be estimated. The comparison between the model calculations and the experimental data is shown in
Figure 14.
3.3.6. Repeatability of Experimental Results
Each heating experiment was repeated three times (
). While environmental conditions such as ambient temperature, solar radiation, and wind varied slightly between runs, the simulation consistently captured the system behavior.
Table 6 reports the root mean square error (RMSE) between the simulation and each experiment, along with the standard deviation across the three runs. The RMSE provides a measure of the deviation between the simulated and measured values. These results highlight that the simulation reliably reproduces the measured dynamics despite variations in the experimental conditions.
3.4. Formulation of the Optimization Problem
To implement MPC in Simulink, the associated optimization problem must first be defined. This involves specifying the optimization objective by formulating an appropriate cost function. The system dynamics are represented using state variables, while control over the system is exerted through manipulated variables (MVs). External influences on the system behavior are treated as measured disturbances (MDs).
Within the cabin thermal model, the state variables
X represent the temperatures governed by the five heat balance equations of the system. The system output
Y is defined as a function of these state variables. The input vector
U comprises both measured disturbances and the manipulated variable, which in this study is the heating power
. The categorization of these signals is presented in Equation (40).
The input vector
U includes varying external MDs such as solar irradiance (
), ambient temperature (
), and vehicle velocity (
). Additionally, the metabolic heat load from the passenger (
) is modeled as a constant input. The manipulated variable considered in this study is the heater power (
). To enable coupling with the cooling system, the valve position (
) is also included, as described in
Section 3.1.4.
The MPC structure is designed to be extendable with additional MVs, such as pump control () to regulate coolant flow in the heating circuit, and two air velocity inputs related to HVAC operation: the air velocity through the heat exchanger () and the average air velocity near the occupant’s body used in the PMV calculation ().
To ensure that the developed control strategy respects physical and operational boundaries, constraints are introduced. For example, the temperature of the water–glycol mixture is limited as defined in Equation (41):
The HV electrical heater has a maximum power of
, which is enforced in the MPC controller, as shown in Equation (42). A lower power boundary is also introduced to avoid numerical issues when the power approaches zero.
It is necessary to limit actuator changes to prevent unphysical variations in the manipulated variables. For this purpose, the rate of change of heating power per time step is constrained, as defined in Equation (43):
The implemented possibility of coupling the heating circuit with the middle-temperature (MT) cooling circuit allows evaluation of the MPC’s capability in handling MIMO systems. This implementation introduces a new MV, the valve position, defined as . The valve regulates the coolant volume flow between the cabin heating system and the MT cooling circuit.
This coupling is meaningful only when the outlet temperature of the cabin heat exchanger is lower than the MT coolant temperature; otherwise, more energy would be consumed. The valve position ranges from 0 to 1, where represents a fully closed valve, impeding coolant transfer between the systems, and represents a fully opened valve, merging both systems into a single circuit.
To ensure system stability and prevent abrupt fluctuations, the rate of change of
per controller time step is constrained. The corresponding constraints are as follows:
The primary objective of the MPC is to optimize energy consumption while maintaining thermal comfort in the cabin. Energy consumption is quantified by the electrical heater power, whereas thermal comfort is assessed using the PMV index. The MPC is designed to unify and balance these two potentially conflicting goals: maintaining thermal comfort while minimizing energy consumption.
To achieve this, the cost function includes a quadratic penalty term that disproportionately penalizes larger deviations from the desired comfort level. The energy consumption term is formulated as the square of the heater power at each time step, imposing a stronger penalty on higher energy usage. This structure enhances the balance between tracking performance and energy efficiency, providing a flexible and adaptable optimization framework.
As highlighted in
Section 3.1.5, an acceptable thermal comfort environment is defined by a PPD of 10%, corresponding to
. This range allows the inclusion of a slack variable in the cost function, which penalizes deviations only when the PMV falls outside the defined range.
The cost function consists of three components: the energy usage cost, the PMV deviation cost, and the PMV slack variable. Each component is weighted by a factor that enables prioritization of different elements within the cost function. The defined cost function is shown in Equation (46):
where:
, , and are the weighting factors
is the heater power
is the calculated PMV index
is the PMV slack variable
The slack variable for the PMV penalizes deviations when the absolute value of the PMV exceeds the acceptable range of
:
The proposed cost function prioritizes maintaining the cabin within an acceptable thermal comfort range over the other objectives. Once this region is reached, the cost function optimally balances thermal comfort and energy consumption. By adjusting the weighting factors, the MPC strategy can be customized to emphasize either thermal comfort or energy efficiency, depending on the desired objective.
To clarify the MPC implementation, the selection of the prediction and control horizons is briefly summarized here. A sensitivity study was conducted to evaluate the effect of the prediction horizon on controller performance, using step sizes of and . The prediction horizon p was varied while maintaining a fixed ratio for the control horizon (). The main priority of the MPC was to bring the cabin environment into the acceptable thermal comfort range, after which the controller balanced thermal comfort and energy consumption.
The study showed that a step size of outperforms in responding to sudden changes in external disturbances, with only minor fluctuations in PMV values. Increasing the prediction horizon further improves the MPC’s proactive response, enhancing overall performance without significantly increasing computational demand.
Based on these findings, the combination , , and was selected for the simulations. This configuration provides an effective balance between performance, computational efficiency, and robustness against potential model mismatch, making it suitable for realistic vehicle implementation.