Modeling of Physical Activity Behavioral Interventions Relying on MPC Strategy

: Physical inactivity is becoming an important threat to public health in today’s society. The COVID-19 pandemic has also reduced physical activity (PA) levels given all the restrictions imposed worldwide. In this work, physical activity interventions supported by mobile devices and relying on control engineering principles were proposed. The model was constructed relying on previous studies that consider a ﬂuid analogy of Social Cognitive Theory (SCT)


Introduction
According to the World Health Organization (WHO), physical inactivity is becoming a serious problem worldwide.Sedentary people tend to develop major health issues, most needing long-term treatments or continuous medication.In some countries, people without private insurance rely on local government health providers to be treated.Consequently, governments are held responsible for the health, treatment, and medical care of millions of citizens which causes a huge economic impact.On the other hand, physical activity (PA) decreases emotional stress and improves physical and psychological health [1].The COVID-19 pandemic has had unprecedented health, economic, and social consequences worldwide causing a decrease in physical activity and a deterioration in physical and psychological health [2][3][4].
Different organizations (i.e., National Institutes of Health (NIH) or American Council on Exercise (ACE)) are trying to encourage people to engage more in physical activity and are involved in research on how to do this effectively [5,6].As part of the aforementioned research, Behavioral Intervention models were developed based on Bandura's Social Cognitive Theory (SCT) [7][8][9].Fortunately, to mitigate the problem of sedentary behavior, recent technologies have opened new ways for intervening upon behavior via mobile applications to improve and test models with data that can be collected easily, using "patient-friendly" ideas [10].
For some years now, control system engineering principles have been proposed to address problems in behavioral medicine [11,12].In this work, a control strategy was proposed that relies on an SCT model obtained from secondary data (information that was collected and analyzed by someone else for a different purpose but can be reused for a new research project) and tested on a different model obtained from primary data (information that is original and has not been collected or analyzed by anyone else for a different purpose) to address the physical inactivity issue.
In summary, this paper presents a model approach to simulating and managing dynamic multivariable systems using Model Predictive Control (MPC), which has gained significant traction in the biomedical engineering and control systems field.It involves creating a model of the system being controlled and using that model to predict future behavior and optimize control inputs accordingly [13,14].
The paper is organized as follows.Section 2 presents a modeling procedure obtained from previous research regarding Behavioral Intervention problems and the challenges that arose.Section 3 describes the proposed control strategy for Behavioral Intervention.Section 4 provides the details of the results of the analysis obtained from a simulation using the proposed controller.Section 5 gives a summary of conclusions and future work.

Modeling Procedure
Bandura's Social Cognitive Theory (SCT) is a widely used framework for behavior change strategies, providing a basis for understanding behavior and its relationships.SCT emphasizes reciprocal determinism, where personal factors, environmental factors, and behavior interact and mutually affect each other; in other words, that both personal and environmental factors contribute to shaping behavior and, in turn, behavior also influences personal and environmental factors [7].Using a fluid analogy can help to create a structured framework and mathematical model of behavioral performance in a simple way, representing Bandura's SCT constructs and their interrelationships.The outputs are treated as levels of tanks (constructs), while the other signals are treated as inputs to those inventories.Behavior is represented as a fluid inventory that changes over time (t) based on various SCT factors.The model was developed on a daily time frame and could be adapted for different behaviors and time frames of interest [15].The levels of tanks are represented by the variables η i and exogenous inputs are represented in the diagram by variables ξ i .The inflow resistances are denoted by γ i and outflow resistances are represented by β i .These resistances can be interpreted as the fraction of each inventory or input that flows from one instance to the next.Other parameters represent the physical characteristics of each inventory and flow, including time constants τ i and time delays θ i .Unmeasured disturbances are considered as ζ i .
By means of a fluid analogy of SCT, computational approaches can be used to model and test these relationships, while mobile and wireless technologies can help measure them in real-time.SCT has proven successful in mobile health interventions for biomedical engineering and applications such as smoking cessation, weight management, and management of physical inactivity [8].
A procedure for identifying a dynamic model of a Social Norm Physical Activity Intervention was proposed using a semi-physical system and data from a randomized controlled trial [9,16].However, the secondary data model needs to be improved in order to meet the necessary conditions for the proposed behavior change intervention.

Secondary Data Modeling
A model was created through secondary data analysis of a randomized controlled trial conducted in the United Kingdom, which suggested that smartphones are effective at motivating individuals with limited intrinsic motivation for exercise to engage in physical activity [16].There were three groups of 55 male adult participants each.Data from participant number 115 were used for the semi-physical identification because he had the most reliable set of data for the study period with the least amount of missing information.
The structure of the intervention is based on a simplified version of the dynamical systems model of the Social Cognitive Theory (SCT) presented by Martín et al. [15], which is illustrated as a fluid analogy in Figure 1.The only output considered is the behavior (η 4 ), which is measured through the number of daily steps taken by the individual.This "subsystem" is used to describe the algorithm of physical activity intervention related to social norms to encourage physical activity behavior.The simplified model included inputs (ξ 1 ), (ξ 2 ), (ξ 5 ) and (ξ 7 ), while ignoring inputs (ξ 3 ) (Persuasion), (ξ 4 ) (Internal Cues), and (ξ 6 ) (Intrapersonal States) as they were irrelevant to the study.These inputs will be assumed to be equal to zero.The meaning of some inputs is:

•
Skills training (ξ 1 ).These activities help to increase (or decrease) the self-management skills of the individual.

•
Observed behavior of others (ξ 2 ).This input refers to vicarious learning or social learning.This is a type of learning that occurs when an individual can acquire knowledge and skills by observing others and learning from the outcomes of their actions.

•
Perceived barriers (ξ 5 ).This input refers to external conditions that affect behavior.For instance, unfavorable weather conditions, limited availability of exercise facilities, or insufficiently secure walking paths can all hinder physical activity levels.This input refers to conditions that are perceived by the participants.

•
Environmental context (ξ 7 ).This input refers to situational factors which directly influence the behavioral outcomes.This study takes into account the date of measurement, which is identified as either a weekend or a weekday.
This approach used principles from semi-physical system identification and relied on the widely-accepted prediction-error identification methods (PEM) [17].Semi-physical identification combines physical knowledge and experimental data to create a mathematical model of a physical system (which was created based on the data obtained from male subjects in Great Britain and was previously presented in an earlier study published in 2016) [16].It involves using simplified physical models or analogies to represent a complex system (human behavior can be considered a complex system, composed of interconnected components that interact nonlinearly) and then fitting experimental data to these models to estimate system parameters.This approach can be used to predict the system's behavior under different conditions.
The estimation process was carried out in MATLAB ® using the idgrey and greyest commands from the System Identification Toolbox [18].The idgrey model is used to represent a system as a state-space model with identifiable coefficients.The greyest function is employed to estimate the unknown parameters of the idgrey model.Results obtained are depicted in Figure 2. By comparing the estimated behavior (η 4 ) based on the number of steps obtained from semi-physical identification using simulated data with the real experimental data from male adult participant number 115, a fitting of 30.5% was achieved with nine iterations, which serves as a good starting point.
Additionally, a validation procedure relying on correlation analysis was performed for a semi-physical identification method resulting in residual errors within confidence bounds.The autocorrelation for behavior and cross-correlation for different lags between behavior and each of the following variables are shown in Figure 3, where: • "Co-usage"⇔"skills training" corresponds to the daily number of glances at the application.• "Sumusa" is "sum of application usage"⇔"observed behavior" is the total length of time (in seconds) per day the application was glanced at.• "Weather"⇔"perceived barriers" means the environmental condition in which the subject is influenced to engage in physical activity or not.• "Weekend"⇔"environmental context" indicates whether the date of measurement falls or does not fall during the weekend.
Lag refers to a time delay or temporal shift between two variables.Therefore, when calculating correlation with lag, the relationship between the two variables was analyzed with a certain time delay to see if there was any significant correlation between them at that specific moment.Correlation analysis is a statistical method that measures the strength and direction of the relationship between two variables.It uses the correlation coefficient, with the amplitude ranging from −1 to 1, where −1 indicates a perfect negative correlation, 0 indicates no correlation, and 1 indicates a perfect positive correlation.To confirm the predictive ability of the model [9], it was expected that the amplitude of autocorrelation would be equal to 1 at zero lag and would take any value within the confidence interval for other lags, if the model is reliable.Moreover, the values within the confidence bounds depicted in Figure 3 in the cross-correlation plots validate the reliability of the model [19].
Although the percentage fit was relatively low, the model developed in [9] is able to follow some of the dynamic characteristics of the system (i.e., amplitude and frequency variations of the signal η 4 over time), even though it was derived from secondary data.Nevertheless, the model has limited applicability for the required purpose since it does not support the implementation of behavioral interventions using external cues or reinforcement through outcome expectancy.
As a result of the previous analysis, internal parameters for the secondary data SCT model were obtained [9].For the intervention design, this SCT model needs to be expanded to include additional input variables directly associated with the required behavior change intervention.Thus, the secondary data model was expanded with parameters obtained from different experiments where preliminary validated models were obtained using primary data [11,20].

Hypothetical Model
A second extended model is now considered including additional parameters and intervention inputs.For this purpose, an SCT model enhanced with individualized selfregulation via internalized cues is shown in Figure 4.In the case of this model, too, the daily number of steps was used as a measure of behavior (η 4 ).The primary aim of the intervention proposal is to promote physical activity among inactive individuals, with the specific target of achieving an average of 10,000 daily steps per week in light of the observed significant negative correlation between daily step counts and mortality risk [21].To motivate participants, the intervention's conceptual diagram incorporates a reward system.The model includes the following inputs and outputs:

•
Environmental context (ξ 7 ), social and physical factors that affect behavior.

•
Expected points (ξ 9 ), the expected daily reward points that will be exchanged for specific rewards.• Granted points (ξ 10 ), which are fed to the behavioral outcomes (η 5 ) inventory only if the performed behavior (η 4 ) meets or exceeds the specified goal (u 8 ).

•
Goal attainment (ξ 11 ), a new input signal that indicates the amount of attainment of the established goals.

•
Outcome expectancy (η 2 ), the perceived probability that performing a given behavior will result in specific outcomes.

•
Self-efficacy (η 3 ), the self-perceived capability to perform the required behavior.
The simplified SCT model upon which the physical activity intervention design with goal setting is based is illustrated in Figure 5, where: • Daily goals (u 8 ), to quantitatively establish the desired behavior, e.g., 10,000 steps per day.

•
Expected points (u 9 ), the daily reward points announced that will be given to individuals if they achieve the daily goal.

•
Granted points (u 10 ), given every day if individuals meet the established goal; this feature is represented by the "if/then" block.The points can be redeemed later for tangible rewards, such as gift cards.
• Goal attainment (u 11 ) = ξ 11 = y 4 − u 8 , a signal that represents the gap between the actual behavior and daily goals.It can be used as an input for the self-efficacy inventory and as an output to evaluate the effectiveness of the intervention.The fluid analogy allows the use of the conservation of mass principle to calculate the accumulation of each inventory based on the net difference between mass inflows and outflows over time domain t.It relates to how a system or signal changes over time.Variables ξ i represent external excitations (i.e., inputs), η i are the inventory levels (i.e., outputs), γ 1 and β 1 are factors that represent interactions among the different constructs, ζ i are external disturbances, and θ i are delay times.The fluid analogy can be represented by the following system of first-order differential equations: Equations ( 1)-( 5).
The extended model includes two additional components.The first one is incorporating an optimal range for step goals.This was accomplished by adding a goal attainment signal that affects self-efficacy based on the effectiveness of the required behavior.Secondly, a self-regulation loop was established by using internal cues and is represented by the C sr block.The idea behind this block is derived from internal model control (IMC) [23]) and is mathematically defined in the equation outlined in [11].The self-regulation process is represented through a controller that adjusts action cues based on the discrepancies between the set goal (u 8 ) and the measured outcome (y 4 ).The controller needs to allow for a partial set point tracking to permit other intervention components (such as points) to influence changes in the output.According to the IMC formulation, the self-regulator is a classical feedback controller.See Equation (6).
The performance of the self-regulator is determined by two parameters: λ, which indicates the closed-loop speed of response, and K sr , which ranges between 0 and 1 and represents the level of integral action, with 1 indicating perfect integral action.Equations ( 1)-( 5), without disturbances or delays (ζ i = 0, θ i = 0, ∀ i ), and self-regulator C sr , with state η 7 , were considered.Assuming that the dominant effect on the output is obtained from the time constant of the behavior inventory (η 4 ), the state matrices are shown in Equations ( 7)- (9). where: A stimulus in the form of a reward mechanism was employed to encourage the desired behavior in the intervention, whereby users receive a specified number of points (ξ 9 ) upon reaching their daily step goals (u 8 ).These points can later be exchanged for tangible rewards.This is represented by an if/then block that is considered external to the simplified SCT model due to its non-linear nature, as depicted in Figure 4.
The obtained model can be described by means of the parameters shown in Table 1, which were partially obtained through Secondary Data Modeling in Section 2.1, using a semi-physical estimation procedure (combining physical knowledge and experimental data to create a mathematical model).

Control Strategy
The control strategy for the intervention must incorporate the defined requirements and constraints for physical activity behavioral intervention.Model Predictive Control (MPC) is a controller formulation whereby the current values of the manipulated variables are determined in real-time as the solution of an optimal control problem over a horizon of a given length [14].In MPC, "move horizon" refers to the number of future control moves computed by the controller at each time step.These future moves are then used to optimize the control actions over a finite time horizon.The "move horizon" length is a key design parameter in MPC, as it affects the trade-off between computational complexity and control performance.A more extended move horizon allows for better prediction and optimization of future behavior but requires more computation time.The optimization problem is solved for a move horizon using a "hypothetical model", from where a new set of control moves are obtained [22].Therefore the success of MPC depends on the degree of precision of the model.Only the first calculated move is applied at each instant; the whole process is repeated and new control moves are obtained.

Open-Loop Behavioral Interventions Analysis: Tuning of MPC
The proper selection of controller parameters (tuning) can be estimated by analyzing the open-loop step response of the proposed behavioral interventions.The choice of suitable values for these parameters is important because they affect not only the controller's performance but also the computational complexity of the MPC algorithm, which solves an optimization problem online at each time step.Analyzing an open-loop step response is important because it provides information about the dynamic behavior of a system.It allows us to observe the system's response to a sudden change in its input and measure its performance in terms of characteristics such as rise time, settling time, overshoot, and steady-state error.This information is crucial for obtaining specifications of the system (human behavior) and tuning the controller parameters to achieve desired performance.
By analyzing the open-loop step response, we can gain insights into the system's stability, transient response, and steady-state behavior, which are all essential for designing and implementing control systems.Given the aim of reaching 10,000 steps daily, our approach to conducting the open-loop test involves setting a target of 1500 steps per day for the model and observing the point at which the system attains stability, as indicated in Figure 6.Based on the system's stabilization from day 20 onwards, calculations are made for the dynamic specifications of the performed step response.From this, some specifications and parameters of the system are calculated: percent overshoot (%OS), damping ratio (ζ), natural frequency (ω n ), and rise time (T r ).Rise time is the time required for the system output to reach and maintain a percentage of its final value, typically 90%.It is an important characteristic of a system's response because it indicates how quickly the system can respond to changes in its input.A shorter rise time indicates a faster response and better performance.See Equations ( 12 = 0.337, ( 13) The sampling time parameter (T s ) is the rate at which data are sampled.This time is determined based on two considerations: limiting the number of samples to 20 during the rise time to avoid computational overload, and following Nyquist's theorem, which requires sampling a periodic signal at more than twice the highest frequency component of the signal [24].See Equations ( 16) and (17).

T s >
T r 20 T s > 1.99 20 T s > 0.099 (days), ( 16) Thus, given 0.099 < T s < 4.69, a value of T s = 1 is recommended.Selecting a prediction horizon that covers its significant dynamics is crucial to predicting a system's future behavior accurately.A recommended approach is to choose a value that is high enough to capture the relevant dynamics but not too high to introduce unnecessary delay [13].Based on the calculation of the sampling time, it is recommended to use a prediction horizon of 20 to 40 samples in order to cover the transient response of the open-loop system.A prediction horizon parameter value of 30 was selected.Choosing a very large control horizon only increases computational complexity.The control horizon was chosen to be less than (or equal to) the prediction horizon [25].Thus, the value of the control horizon parameter was selected to be equal to 10.
Finally, the parameters shown in Table 2 were selected, and a maximum number of 15,000 steps as the daily goal was chosen.Additionally, considering that 10 points correspond to one cent of a US dollar , a maximum daily limit of 5000 points, corresponding to USD 5 as a reward, was established.
Table 2. Tuning of model predictive control.Sample time is set equal to 1 to limit samples to 20 during rise time and to follow Nyquist's theorem.A prediction horizon of 20 to 40 samples is recommended.Therefore, a value of 30 is chosen.A control horizon equal to 10 is selected, as this value is typically less than (or equal to) the prediction horizon [25].

Parameter Value
Sample time 1 Prediction Horizon 30 Control horizon 10

MPC Close Loop Structure
MPC uses a system model to predict behavior (e.g., the number of steps).It handles MIMO systems (Multiple-Input Multiple-Output) with interactions between inputs and outputs.The goal is to find the optimal control action that minimizes a cost function subject to constraints.Quadratic Programming (QP) is a mathematical optimization technique that aims to find the optimal solution to a given problem by minimizing or maximizing an objective function subject to certain constraints.QP involves the use of mathematical models and algorithms to optimize a specific objective function while satisfying a set of constraints.Thus, QP was used to determine the best control input at each time step, to achieve optimal performance while adhering to the system's constraints.The strategy is known as a receding horizon control strategy, where only the first calculated moves are applied at each instant and the process is repeated to obtain new control moves.This strategy is shown in Figure 7.The MPC structure used in this project is shown in Figure 8.The layout of the project ecosystem implemented in MATLAB ® is shown in Figure 9.Some abbreviations used in this figure are explained in Table 3.At each time instant (t), the controller uses previous system information and its states, current demands, and control actions to forecast the system outcome for the prediction horizon.Based on this, it calculates a sequence of future control actions for the control or move horizon by solving an optimization problem using cost functions from Equations ( 18) and (19).
where J i (z k ) are the partial cost functions, z k is the quadratic programming (QP) decision, and slack variable ε k (dimensionless) represents the deviation of system state variables from their setpoints at each control interval in control systems. where: • k is the current control interval; • p is the prediction horizon (number of intervals); • n y is the number of plant output variables; • y j (k + i|k) is the predicted value of the jth plant output at the i−th prediction horizon step; • r j (k + i|k) is the reference value for the jth plant output at the ith prediction horizon step; • s y j is the scale factor the jth plant output; • w y i,j is the tuning weight for the jth plant output at the ith prediction horizon step (dimensionless).
The values n y , p, s y j , and w y i,j are constant controller specifications.The controller receives r j (k + i|k) for the entire prediction horizon and uses the state observer to predict the plant outputs, y j (k + i|k), which depend on manipulated variables (MV) adjustments (u k ) (goals (u 8 ) and expected points (u 9 )), measured disturbances (MD), and state estimates.At interval k, the state estimates and MD values are available.Therefore, J y is a function of z k only.
The second cost function is: where: • n u is the number of MV; • u j,target (k + i|k) is the target value for jth MV at the ith prediction horizon step; • s u j is the scale factor for the jth MV; • w u i,j is the tuning weight for the jth MV at the ith prediction horizon step (dimensionless).
The values n u , p, s u j and w u i,j are constant controller specifications.The controller receives u j,target (k + i|k)-values for the entire horizon.The controller uses the state observer to predict the plant outputs.Thus, J u is a function of z k only.
An MPC controller uses the subsequent scalar performance metric to suppress the movement of manipulated variables (see Equation ( 22)), (22) and the partial cost function for the slack variable ε k (see Equation ( 23)).In practical applications, constraint violations can sometimes be inevitable.Soft constraints ensure a feasible QP solution even under such conditions.An MPC controller utilizes a slack variable, ε k , which is non-negative (greater than or equal to zero) and dimensionless, to measure the worst-case constraint violation. where: • ε k is the slack variable at control interval k (dimensionless); • ρ ε is the constraint violation penalty weight (dimensionless).The slack variable ε k represents the amount by which the system state variables can deviate from their setpoints at each control interval.The value of ε k is used to ensure that the constraints are satisfied within the given tolerance levels.On the other hand, the weight assigned to the constraint violation penalty, ρ ε , is a scalar value that determines the trade-off between achieving a lower cost function and satisfying the constraints.A higher value of ρ ε indicates a greater penalty for violating the constraints, which can lead to a more conservative controller.
MPC constraints are limited as shown below. where: y max = y j,max (i) Here, V j parameters correspond to the Equal Concern for Relaxation parameter (ECR), which specifies the relative importance of satisfying constraints versus achieving performance goals in a control problem.They are dimensionless controller constants analogous to the cost function weights and used for constraint softening (zero implies a hard constraint).A more significant positive ECR value means that the controller is willing to compromise the satisfaction of the constraint to achieve the goals.

•
ε k is a scalar QP slack variable (dimensionless) used for constraint softening; • s y j is a scale factor for the jth plant output; • s u j is a scale factor for the jth MV; • y j,min(i) , y j,max(i) are the lower and upper bounds for the jth plant output at the ith prediction horizon step; • u j,min(i) , u j,max(i) are the lower and upper bounds for the jth MV at the ith prediction horizon step; • ∆u j,min(j) , ∆u j,max(i) are the lower and upper bounds for the jth MV increment at the ith prediction horizon step.
Due to the substantial correlation between higher daily step counts and lower mortality risk, a recommended target of 10,000 steps per day has been established [26].
As mentioned before, a maximum number of 15,000 steps as the daily goal was chosen.Furthermore, a daily cap of 5000 points was set, which equates to a reward of USD 5, given that 10 points are equivalent to one cent.These constraints are indicated in Table 4.
In an MPC controller design, the selection of the weights must be chosen to favor or disfavor the variability of the MVs, their rate, and the variability of the outputs.The selected weights for the MPC are shown in Table 5. unconstrained (points/day) Table 5. MPC weights.Taking into account the economic factor which is critical for the project, the controller will try to penalize abrupt values of offered reward points (u 9 ) for which the weight of 1 is assigned.The weight of the daily step goal (u 8 ) was set to zero.The weights assigned to ∆u 8 and ∆u 9 are both 0.1 , indicating that those variables are not considered significant.The weight of the output variable η 4 is also equal to 1 since that variable, which corresponds to the behavior, is the one to be regulated, leaving the other outputs to vary freely (other output weight = 0).

Results Analysis
It is essential to use accurate system parameters when designing and testing a control system to ensure that it performs as expected and achieves the desired control objectives.Thus, an identification procedure with the data from the "hypothetical model" was performed to obtain a linear state-space variable model.This discrete model was then used to design an MPC controller that considers the actual system dynamics.However, to test the controller the "hypothetical model" was used.This led to a difference between the identified parameters used for the MPC design and the system's parameters used for simulation, similar to what may occur in a real scenario.
The proposed controller was tested and the following results were obtained (Figure 10).The results from day 30 to day 120 are shown.During the first month, an initial desired behavior of 1000 daily steps was set.Step tracking.This figure describes the ability of a controller to track or follow a step input signal.A step input signal is a signal that abruptly changes from one constant value to another, often used to represent a change in the desired setpoint of a controlled system.In this case, the desired behavior or setpoint was a change in daily steps from 1000 to 10,000.The figure shows that the control system was able to achieve this desired behavior in less than 20 days.The settling time for this test was 10 days and the percentage overshoot was 17%.
The response of the manipulated variables (i.e., goals (u 8 ) and expected points (u 9 )) is shown in Figure 11, demonstrating the successful achievement of the constraints considered in the MPC design.Since the weight of the expected points was set to 1 (the highest level of importance), the signal tends to decrease over time.On the other hand, the weight of the goals was set to 0, resulting in an increase and stabilization of the signal at a steady-state value of around 10,000 steps.In Figures 12 and 13, the other input variables (granted points (u 10 ) and goal attainment (u 11 )) are shown.It is noticeable that the number of granted points in Figure 12 was lower than the number of expected points in Figure 11.Meanwhile, the goal attainment signal in Figure 13 shows that, for the majority of the experiment, the number of daily steps taken surpassed the proposed goal.
In Figure 14, the steady state of the goal attainment signal is shown.It can be observed that most of the time this signal has positive values, which indicates that the number of daily steps is greater than the set goal.Goal attainment positively affects behavior through the auto-efficacy inventory as demonstrated through the fluid analogy of the SCT model.
The designed controller achieves the desired behavior even though there is a mismatch between the model used for the MPC design and the model used for the simulation.Thanks to the robust control ideas of this type of controller, the difference between those models does not affect the system's performance.Only a few points were needed as rewards to achieve the desired behavior.A ramp test was also performed to examine the dynamic performance of a system by evaluating how it reacts to a gradually varying input signal.The results of this progressive approach can be observed in Figure 15.It can be observed that the output tracks the reference input, achieving zero steady-state error.This input type is suggested for the experiment to avoid abrupt changes in the output with the step input.Steps tracking: progressive approach.In a ramp test, the dynamic performance of a system is evaluated by observing its response to a slowly changing input signal.
To further demonstrate the performance of the designed controller, two parameters that directly affect behavior were modified; the values were arbitrarily selected.In the first scenario, the time constant τ 4 was modified from 0.8 to 0.65 days.Figure 16 shows the original and modified responses.In the second scenario, the input coefficient from the behavior inventory β 45 was modified from 0.5 to 0.8; the obtained results are shown in Figure 17.In both scenarios, it can be observed that the obtained responses do not suffer any significant change compared to the system response without the parameter modification.The results obtained from varying both τ 4 and β 45 simultaneously are shown in Figure 18.In the three scenarios, it can be observed that the steps tracking is maintained, thus zero steady-state error is achieved even though there is a mismatch between the identified model, which was used for the MPC design, and the hypothetical model used for the simulation, which also had some of its parameters modified.The effect of the time constant parameter τ 4 is significant for the system's performance.A time-constant sweep was performed via simulation.The results obtained from the simulation for the minimum and maximum tested values, as well as for the original value (τ 4 = 0.8) are shown in Figure 19.It should be noted that the controller responds better when the time constant is increased from its original value than when it is decreased.When the time constant decreases, the system tends to become unstable.Figure 19.Effects of the time constant parameter τ on the number of steps.The controller's response shows a significant improvement when the time constant is increased from its original value, as opposed to the situation in which it is decreased.It is worth noting that a decrease in the time constant may cause the system to become unstable.
A sweep was conducted for the parameter value of β, with the limitation that it can only take values between 0 and 1.The results obtained from the simulation with all arbitrarily considered values are shown in Figure 20.The settling time is approximately the same in the three scenarios.However, the percentage overshoot is affected by the parameter variation but the zero steady-state error is still achieved.The time constant parameter τ 4 is more sensitive (meaning it has a greater impact on the stability of the system) than the input coefficient β 45 .An analysis of the obtained results is presented below, along with relevant comments and requisite considerations, while acknowledging that this is an approximation of a complex system such as human behavior.
Despite the limitations of the mathematical modeling of human behavior, initial estimates of the MPC controller's parameters were made based on the model obtained.Open-loop tests were conducted to establish the natural and uncontrolled response of the model, followed by closed-loop tests to evaluate the system's response to gradual and continuous changes in input.The controller successfully regulated both step and ramp signals, although the step response showed a relatively high overshoot.Implementing saturation-limiting elements could address this issue.
Finally, closed-loop tests were conducted for different scenarios and the controller was effective in absorbing variations in sensitivity levels depending on the parameter being varied.We should note that the time constant parameter τ 4 appears to have a considerably more significant impact on the stability of the system compared to the input coefficient β 45 .This suggests that it exhibits a higher level of sensitivity concerning the stability of the system.

Conclusions and Future Work
In previous work co-authored by some of the present study's authors, a model was obtained relying on secondary data focused on interventions for physical inactivity problems [9].However, the earlier model did not take into consideration some critical aspects needed for the proposed behavioral interventions.In the present study, a new hypothetical model was proposed including information obtained from the initial secondary data modeling, supplemented with additional parameters obtained from previous experiments and personal experiences to include all the inputs and outputs needed for the proposed behavioral intervention.
This hypothetical model was simulated under realistic conditions to provide data for system identification; the model obtained as a result of this process was used for the MPC design.As frequently seen in practical control scenarios, some of the parameters of the hypothetical model differ from the parameters of the identified linear model causing a model mismatch.Another factor contributing to model mismatch is the non-linearity of the hypothetical system and the fact that each person's state represents a different set of those parameters.
Because this model represents human behavior using Bandura's Social Cognitive Theory and fluid analogy, a mismatch will exist between the person's behavior, the model output, and the identified system output.This leads to the need for a model-based controller that is able to absorb the model mismatches.The MPC control strategy meets these requirements and was demonstrated to be suitable for the non-linear behavioral intervention model.This work presented the results from the proposed adaptive MPC Control Design applied to a non-linear behavioral intervention model.
Simulations demonstrated that the MPC controller could maintain zero steady-state error and similar settling times even if a critical parameter of the behavior inventory was modified.Additionally, because it is possible to set weights and constraints using this control strategy, the number of points granted as a reward was low, which is important for the economic aspect of this kind of intervention.A settling time of approximately 10 days was achieved.However, this value is not feasible in a real-life situation because other aspects need to be taken into account that the model does not.For example, in this case, if someone is able to achieve the goal within 10 days, he/she is probably able to succeed without the need for additional rewards.This is a case of someone who is likely a young athlete, and therefore is outside the target group of interest.
As future work, a validation test for the mathematical models created through system identification, which is the process of building mathematical models of dynamic systems based on observed data, should be performed.A reliable model is needed for a good MPC performance, hence system identification is a fundamental undertaking prior to the MPC design.The duration of the experiment is critical if it is performed in real-time and not simulated, so a test monitoring procedure should also be performed during the online identification of the parameter values carried out to improve the reliability of the obtained model.
Due to the nature of the system, each person represents a different set of parameters.Additionally, for a given person, this set of parameters can change as a function of that person's state (mental, physical, or environmental).Therefore, a multiple MPC design is highly recommended.This controller could include different models that represent different states of a given person and switch the controller parameters, weights, and constraints used depending on their current and past states.

Figure 1 .
Figure 1.Fluid analogy for the simplified version of the SCT model [9].

Figure 3 .
Figure 3. Model validation via correlation analysis for the semi−physical identification procedure.The areas highlighted in blue represent the confidence bounds [9].

Figure 5 .
Figure 5. Low physical activity intervention based on the simplified SCT model [22].

Figure 6 .
Figure 6."Step response" refers to the response of a system to a step input of the Social Cognitive Theory (SCT) model in an open loop configuration.On the other hand, "steps" refers to the number of steps in the output signal (η 4 ).It is a measure of the output of the system.

Figure 7 .
Figure 7. Conceptual application of the receding horizon control strategy to the physical activity behavioral problem [22].

Figure 8 .
Figure 8. MPC structure.Goals (u 8 ) and expected points (u 9 ) are the manipulated variables.Environmental context (u 7 ), granted points (u 10 ), and goal attainment (u 11 ) are measured disturbances.Actual steps-behavior is the controlled variable.All the other outputs are also measured but not controlled.

Figure 9 .
Figure 9. Closed-loop Model Predictive Control project ecosystem in Simulink block (graphical programming environment in MATLAB ® ).These blocks represent the various components such as the plant (simplified SCT), controller (MPC), and other supporting functions.

Figure 10 .
Figure 10.Step tracking.This figure describes the ability of a controller to track or follow a step input signal.A step input signal is a signal that abruptly changes from one constant value to another, often used to represent a change in the desired setpoint of a controlled system.In this case, the desired behavior or setpoint was a change in daily steps from 1000 to 10,000.The figure shows that the control system was able to achieve this desired behavior in less than 20 days.The settling time for this test was 10 days and the percentage overshoot was 17%.

Figure 12 .
Figure 12.Granted points (u 10 ), given every day if individuals meet the established goal.

Figure 13 .Figure 14 .
Figure13.Goal attainment (u 11 ) represents a signal that indicates the difference between the actual behavior and the daily goals.This signal can serve as an input for the self-efficacy inventory, helping to assess an individual's belief in their ability to achieve the goals.
Figure 15.Steps tracking: progressive approach.In a ramp test, the dynamic performance of a system is evaluated by observing its response to a slowly changing input signal.

Figure 16 .
Figure 16.Steps tracking: the first scenario.In order to provide additional evidence of the efficiency of the controller , the time constant τ 4 was arbitrarily adjusted from 0.8 (original response) to 0.65 days (new response).

8 Figure 17 .
Figure 17.Steps tracking: the second scenario.The input coefficient from the behavior inventory β 45 was arbitrarily varied during a test.This parameter value was modified from 0.5 (original response) to 0.8 (new response).

Figure 18 .
Figure 18.The third scenario involves tracking steps in a situation in which both the time constant τ 4 and the input coefficient β 45 were varied simultaneously.The original response had τ 4 = 0.8 and β 45 = 0.5, while the new response had τ 4 = 0.65 and β 45 = 0.8.

Figure 20 .
Figure 20.Effects of modifications of the input coefficient β 45 parameter on the number of steps.

Table 1 .
[11,20]ers of the hypothetical model (i.e., the secondary data model, which was extended with parameters obtained from different experiments using primary data[11,20].

Table 4 .
MPC constraints.Goals (u 8 ) and expected points (u 9 ) are the manipulated variables (MV).∆u i refers to the change in the signal i between two consecutive time instances.