A Hierarchical Optimisation of a Compressed Natural Gas Station for Energy and Fuelling Efﬁciency under a Demand Response Program

: Compressed natural gas stations serve customers who have chosen compressed natural gas powered vehicles as an alternative to diesel and petrol based ones, for cost or environmental reasons. The interaction between the compressed natural gas station and electricity grid requires an energy management strategy to minimise a signiﬁcant component of the operating costs of the station where demand response programs exist. Such a strategy when enhanced through integration with a control strategy for optimising gas delivery can raise the appeal of the compressed natural gas, which is associated with reduced criteria air pollutants. A hierarchical operation optimisation approach adopted in this study seeks to achieve energy cost reduction for a compressed natural gas station in a time-of-use electricity tariff environment as well as increase the vehicle fuelling efﬁciency. This is achieved by optimally controlling the gas dispenser and priority panel valve function under an optimised schedule of compressor operation. The results show that electricity cost savings of up to 60.08% are achieved in the upper layer optimisation while meeting vehicle gas demand over the control horizon. Further, a reduction in ﬁlling times by an average of 16.92 s is achieved through a lower layer model predictive control of the pressure-ratio-dependent fuelling process. This study provides an expansive perspective of the operation proﬁle of an optimised CNG fast-ﬁll station, which is the major component of gas delivery infrastructure, incorporating both energy savings and pressure conditions management. The proposed approach achieves a huge reduction in the cost of electricity for the CNG fast-ﬁll station, and delivers on shorter ﬁlling times for vehicles fuelling at the station. The results demonstrate savings of up to 60.08% in electricity cost for the upper layer as well as average savings of 16.92 s in vehicle fuelling times for the lower layer. Further, the sensitivity analysis shows an ability of the solutions obtained to withstand some disturbances in the inputs, which is important for the station operation reliability. The demonstrates that As a combined and C.K. the guidance and supervision L.Z. and X.X., who also provided critical review the manuscript.


Background
Global efforts to minimise environmental pollution have become a priority of many governments, with the transport industry targeted to replace diesel and petrol fuels with less polluting alternatives such as compressed natural gas (CNG) [1]. The use of CNG correlates with the lowest emissions of particulate matter, non-methane organic gases (NMOG), nitrogen oxides (NO x ), carbon monoxide (CO) and other air toxics, among hydrocarbon fuels [2] as well as lower carbon dioxide emission for the same quantity of energy delivered [3]. The availability of the infrastructure to deliver CNG to vehicular customers is a major success factor in the growth of CNG as an alternative fuel for the transportation sector [4] because of fuelling convenience considerations [5]. There has been steady growth in the number of commercial fuelling stations in both developing [6] and developed [7] countries, which has corresponded to the increase in number of CNG vehicles on roads. For commercial fuelling stations, vehicles needing refuelling arrive randomly and are required to be filled quickly, hence the fast-fill CNG fuelling configuration has been the prominent design of choice [8]. In fast-fill stations, gas from the utility line is compressed into a pressurised cascade storage consisting of gas tanks in three pressure levels, from which arriving vehicles are filled [9]. In this type of operation, the compressor is cycled between the upper and lower limits of the cascade storage capacity [10]. Given that the compressor is the main electrical load in a CNG fast-fill station, the cycling of the compressor and its potential for being scheduled present opportunities for the improvement of operation efficiency.

Improving the CNG Station Operation Efficiency
The improvement of operation efficiency encompasses both energy cost reduction and ensuring performance levels in product delivery are sustained or improved, under the optimised energy cost operation. Operation optimisation for energy cost efficiency through equipment scheduling is a major area of consideration in demand response research [11]. Given the significant consequences of compressor energy consumption on the operating costs of the CNG station [12], it is necessary to study how proposed interventions for energy cost reduction, interact with other operation efficiency improvements at the gas dispensing level. Vehicle fuelling time has been studied as one of the major factors customers consider when deciding whether or not to transition to alternative fuels [13].
Kountz et al. [14] initiated the evaluation of the fast-fill CNG station with a study which involved the development of a model for the flow of gas from one of the cascade storage tanks into the target vehicle tank. Kountz [15] further developed an approach to the design of dispenser algorithm, to ensure correct quantities of gas are dispensed into the target vehicle tank with compensation for temperature effect [16]. Studies of the effects of other components of the CNG station on gas flow such as the hoses [17] and dispensers [18], have aided in developing a basis for their standardisation. Farzaneh et al. [19] developed a numerical method of analysing thermodynamic characteristics of gas flow in the reservoir filling process. The ratio of target vehicle tank pressure to the pressure of the storage tank and the evolution of this ratio as the vehicle tank gets filled are shown to have an effect on the vehicle filling time and profile [20]. Further, studies to determine the optimal location of CNG stations in a network that also includes petrol and diesel fuelling stations [21] have been carried out. Kuby [5] took a deeper look at evaluating the location problem for stations serving alternative fuel vehicles (AFVs) by reviewing the state of relevant research work, and thereby concluded that drivers of AFVs exhibit deliberate behaviour in choosing where to refuel within sparse refuelling networks, with convenience weighing more significantly than price.
Bang et al. [22] modelled the CNG residential refuelling system, and demonstrated the potential effects of an increase in the number of such systems on the existing electricity grid. The study of these effects is especially important, given the significant size of the compressor motor as an electric load in comparison with regular loads of petrol and diesel fuelling stations [23]. Cycling of the compressor in a fast-fill station to replenish the cascade storage may present an opportunity to minimise the energy cost of the CNG station, if the CNG station is located in an area where demand response programs have been implemented through time differentiated pricing [24]. Demand response programs are implemented with an overall goal of achieving lower fluctuations in electricity demand which has been shown to lead to more efficient operation of the grid [25] and to increase the reliability and stability of the grid network [11]. Electricity consumption patterns are modified by raising the price charge per unit of electricity at times when the system reliability is compromised by high demand [26]. This encourages consumers to shift their flexible loads to times when the rates charged are favourable, achieving for them lower overall energy costs [27].
In [12,28], a strategy to minimise electricity cost for a CNG fast fill station was undertaken for a station operating under a time-of-use (TOU) electricity tariff. The station was modelled as a mass balance system where the storage was modelled as a single reservoir with an outflow from a known demand profile and inflow from an optimally scheduled compressor. Further, in [29], an optimal control to determine the operation of the priority panel valves under a known demand profile for each of the three reservoirs of the cascade storage was carried out. These studies considered only the flow of quantity of gas in mass from the compressor to satisfy mass of gas demand at the dispenser. Without evaluating and optimising the pressure conditions during the flow of gas from the cascade storage to the vehicle tanks, it is impossible to guarantee that the level of fuelling time performance is maintained after energy cost saving operation interventions. Disruption of fuelling time performance threatens convenience and could sour consumer sentiment on use of CNG, even when costs are lowered [5].
In the present work, a novel study for the efficient operation of a CNG fast-fill station is presented. The hierarchical model includes an upper layer, which is an optimisation of compressor scheduling to minimise energy cost, and a lower layer to control the valves of the priority panel and the gas dispenser so as to achieve desirable conditions of pressure for minimum vehicle filling time. On the upper layer, the scheduling of the compressor operation to minimise electricity cost incurred under a TOU tariff is realised while minimising compressor switching frequency and meeting the gas demand in the control horizon. The compressor operation schedule obtained is implemented on the lower layer as an input for the optimal control of vehicle fuelling to achieve minimum filling time using a model predictive control strategy (MPC). MPC strategies are popular in modern control applications with demonstrated benefits of their closed loop robustness and stability [30,31], and the ability handle constraints in complex applications [32]. This study presents the first attempt to combine the optimal minimisation of CNG station energy cost through compressor scheduling, with the optimal control of the vehicle filling pressure conditions from the cascade storage to achieve minimum filling times. This proposed approach will safeguard the gains from energy cost savings, by ensuring a simultaneous improvement in gas transfer performance which is of great importance to fuelling convenience. The current work and case study highlight how adoption of alternative fuels intersects with electricity demand response programs, and how the operation optimisation for demand response must be enhanced with performance optimisation to secure the resulting complementary benefits.
This article is laid out as follows: In Section 2, the models for the upper and lower layers are presented. The case study considered for the proposed strategy is described in Section 3. Results and discussions for the outcomes of the study are reported in Section 4. Section 5 concludes the study. Figure 1 shows the configuration of the CNG fast-fill station. Under normal operation, the compressor receives natural gas from the utility's distribution pipeline at low to medium pressure, approximately 4-15 bar [20], and compresses it into a three level cascade storage system. The gas being compressed passes through a priority panel valve system that alternates the flow of CNG between the three levels of the cascade storage usually called the high pressure, medium pressure and low pressure levels according to their minimum allowed operating pressures [18]. The series of valves v hp , v mp and v l p in the priority panel represent the inlet valves to the high pressure, medium pressure and low pressure tanks of the cascade storage respectively. When the upper pressure limit for all the cascade storage level is achieved, the compressor switch u is turned off so that no more gas flows into the cascade storage. Vehicles arriving at the dispenser have their tanks filled through the dispenser valves v ohp , v omp and v ol p for the high pressure, medium pressure and low pressure cascade storage tanks, respectively. The gas flow is alternated so that a lower limit of flow rate determines the tank from which the vehicle is filled, starting with the lowest pressure tank to the medium pressure tank as the vehicle tank fills up and topping off with the high pressure tank [33]. As CNG leaves the cascade storage, the pressure in storage drops and when the minimum pressure limits are reached, the compressor switch u comes on to replenish the storage [34] and the cycle is repeated. The gas demand at the dispenser, m o , determines the cycling of the compressor and thus the total cost of electricity incurred in a TOU electricity tariff [24]. The energy cost minimisation layer is formulated as a mass flow problem, as we proposed in our previous study [29]. This means that the scheduling of the compressor operation is optimised around mass inflow to the cascade storage from the municipal supply line and mass outflow as determined by mass of gas demand at the dispenser over the control horizon.

Objective Function
The objective of this layer is to minimise the cost of electricity incurred by the compressor operation over the control horizon so that the following objective function is used: where t is the counter for the sampling instants, N is the total number of sampling instants over the control horizon, P co is the compressor power rating, P e (t) is a vector of the price of electricity per kWh in a TOU tariff, t s is the sampling period and u(t) is the status of the compressor switch which is the control variable such that It is important to modify the objective function so that the switching frequency of the compressor is minimised as well. This is because the frequency of on/off instances positively correlates to increased wear and tear of moving components of the compressor [35,36]. For the optimised minimum cost of electricity incurred over the control horizon, this study seeks to achieve the lowest number of switching instances for the compressor. One of the methods considered is the one used in [12], where the approach involves the reduction of the ramp rate between successive instances of the switch so that the element of the objective function dealing with minimising compressor frequency is ( Elsewhere, in [29], the approach is based on the introduction of an auxiliary variable s(t) [37,38] that assumes a value of 1 when a switch-on occurs and tries to minimise the summation of the auxiliary variable over the control horizon such that and Although both methods have been found to be effective, in the present study, we propose to introduce a new method where the operation is optimised to prefer the occurrence of on-instances in succession of each other by minimising the summation of the negative product of successive instances of the solution to the control variable u, so that the objective function becomes where is a weighting factor. The weighting factor can be set to reduce the number of switching instances so that the minimum number possible is attained for the same energy cost incurred such as was the case in [29]. The method proposed in the current study for minimising the frequency of compressor switching involves a single mathematical operation and no additional constraints which reduces the computational complexity of the problem when compared with Equations (3) and (4).

Constraints
The constraints for this upper layer minimising energy cost are based on the total mass storage capacity of the cascade storage as well as the terminal conditions so that where m max is the maximum mass limit of gas for the cascade storage corresponding to the maximum pressure limits, m min is the minimum mass limit of gas for the cascade storage at the minimum pressure limits and the mass of gas in the cascade storage m(t) is where m o (i) is the gas flowing out of the cascade storage into a vehicle in a sampling instant andṁ co is the mass flow rate of the compressor which is obtained as [39] where ρ std is the density of CNG under standard conditions (0 • C temperature and 10 5 pascals pressure) [40], Mw g is the molecular weight of the CNG, Mw a is the molecular weight of air, ρ a,std is the air density under standard conditions and Q std is the capacity of the compressor under standard conditions. The mass limits of gas for the cascade storage capacity constraints m min and m max are derived from working pressure limits of the cascade storage and the physical properties of the gas where P is the value of the pressure rating, V is the total volume of the cascade storage, z is the compressibility factor, R is the ideal gas constant and n the quantity of gas in moles which is correlated with the mass as where M is the molar mass. The working mass limits for the cascade storage therefore become

Algorithm
To solve the problem using OPTI toolbox SCIP solver interfaced in Matlab, the upper layer energy cost minimisation layer problem is formulated in the form subject to x ∈ {0, 1}.
The objective function in Equation (1) is expressed as From the constraint in Equation (8) and the dynamic equation of mass in Equation (9), these linear inequalities can be expressed as where . . .
The linear inequality constraints in the form of Ax ≤ b become The control vector for the problem, x, can be written in the standard form

Gas Flow Optimisation Layer
A model predictive control (MPC) strategy is implemented on the lower layer with a prediction horizon N p and the sampling time t ss . The status of the compressor switch u is obtained from the solution of optimisation of the upper layer. Whenever switch u is on, gas flows into the three tank storage via valves v hp , v mp and v l p of the priority panel. The gas flows in from the compressor at a constant mass flow rateṁ co . Each of the three tanks has maximum and minimum pressures, p max hp , p max mp , p max l p and p min hp , and p min mp and p min l p , respectively. Gas flows into the vehicle from the storage tanks via the dispenser valves v ohp , v omp and v ol p . The initial pressure for each vehicle tank p veh is a known quantity from the demand data while the initial pressure for the high pressure tank p hp , medium pressure tank p mp and low pressure tank p l p are measured from the final conditions after the previous control action.

Objective Function
The objective of this layer is to minimise the difference between the vehicle tank pressure p veh (k + j) and the target pressure p T (k + j) which corresponds to the quantity of gas ordered by the customer for the vehicle at step j based on the current sampling instant k. This ensures continuous flow of gas from the cascade storage tanks to the vehicle tank. Additionally, we minimise the summation of dispenser valve action instances, which ensures minimisation of filling time. This is because lowering the total number of instances required for the dispenser valves to be on in order to fill the vehicle tank, corresponds to a shorter filling time of the vehicle tank. Therefore, the controller prefers the cascade filling profile with the least number of total dispenser valve open instances. The objective function based on the current sampling instant k is therefore to minimise where ς is a weighting factor and v ohp (k + j), v omp (k + j) and v ol p (k + j) are the dispenser statuses for the high pressure, medium pressure and low pressure cascade storage tanks, respectively. Gas flow from the cascade storage tanks to the vehicle tank,ṁ veh (k + j) ensures that the vehicle pressure approaches the target pressure value and is the sum of flow rates from the three tanks, so that based on the current sampling instant k The equations for the instantaneous flow ratesṁ hp (k + j),ṁ mp (k + j) andṁ l p (k + j) between the high, medium and low pressure tanks of the cascade storage, respectively, and the vehicle tank, are based on the ideal gas model for an adiabatic system [41] and are governed by the pressure ratios between the storage tanks and the vehicle tank. i.e., and similarly for theṁ mp (k + j) and forṁ l p (k + j) anḋ where γ is the ratio of specific heats and c p is the specific heat capacity of the gas at constant pressure while c v is specific heat capacity of the gas at constant volume. C d is the coefficient of discharge of the dispenser valve orifice, A ori f ice is the area of the dispenser valve orifice and ρ hp , ρ mp and ρ l p are the densities of the gas in the high pressure ,medium pressure and low pressure reservoirs, respectively.

Constraints
The valves at the dispenser and the priority panel, as the control variables, are subject to operational constraints. The valves of the priority panel open one at a time when the compressor is filling the cascade storage reservoirs which gives the constraint in Equation (35). The valves of the dispenser also open one at a time during the filling of the vehicle from the cascade storage as represented by the constraint in Equation (36).
Further, the vehicle tank pressure p veh and the pressure in the three cascade reservoirs p hp , p mp and p l p , as the states of the gas flow optimisation layer, are also subject to operational constraints. The limits of pressure for the vehicle tank and each of the reservoirs of the cascade storage are such that Equations (37)- (39) ensure that the maximum and minimum working pressures of the cascade storage tanks are not exceeded, while Equation (40) ensures that, at the end of the control horizon, the vehicle tank is filled to the target pressure corresponding to the requested quantity of gas by the customer.
Based on the described flow of gas for the proposed approach, the general differential equations for pressure change in the vehicle and cascade storage reservoirs are where the constants K 1 , K hp , K mp and K l p are where V veh , V hp , V mp and V l p are the volumes of the vehicle tank, high pressure reservoir, medium pressure reservoir and low pressure reservoir, respectively. This yields the following discrete equations of pressure, for the current sampling instant k

Algorithm
To solve the gas flow optimisation layer problem using the Mixed Integer Distributed Ant Colony Optimisation (MIDACO) solver, the components of the problem have to be formulated as subject to g(x) = 0 (equality constraints) h(x) ≥ 0 (inequality constraints) The control vector consists of the conditions of the three priority panel valves and the three dispenser valves, and for each sampling instant k, x can be written in the standard form The objective function in Equation (26), The equality constraint in Equation (35) yields the g(x) = 0 set for the algorithm so that while the inequality in Equation (36) yields the first set of h(x) ≥ 0 such that The next set of inequality constraints is derived from Equations (37)- (39) such that The final element of the inequality constraints is derived from Equation (40), yielding The combined set of inequality constraints therefore becomes At the current sampling instant k, an open loop optimisation problem is solved by the controller for the prediction horizon N p . Only the first elements of the control variables v hp , v mp , v l p , v ohp , v omp and v ol p are implemented on the CNG filling station plant. The vehicle pressure p veh and the pressure in the cascade storage tanks p hp , p mp and p l p , which are the system states, are measured and the values fed back to the MPC controller, forming the initial states for the following sampling instant k + 1. The input variables are then updated and the cycle repeated until all control actions for the intended period are implemented.
The MPC controller workflow is such that: 1. For the current sampling instant k, the controller minimises the objective function in Equation (26) and finds an optimum solution for the control variables v hp , v mp , v l p , v ohp , v omp and v ol p , subject to the constraints set out in Section 2.2.2. 2. From the solution, only the first elements of the solution v hp (k|k), v mp (k|k), v l p (k|k), v ohp (k|k), v omp (k|k) and v ol p (k|k) are implemented. 3. The states p veh (k + 1), p hp (k + 1), p mp (k + 1) and p l p (k + 1) are measured to be fed back. 4. The value of k is set to k = k + 1 and system states, inputs and outputs are updated. 5. Steps 1-4 are repeated until k reaches a value predetermined to mark the end of the control period.

Case Study
The case study involves a roadside vehicle fuelling station based in Johannesburg South Africa, that is currently in operation, located in an industrial zone, as shown on the map in Figure 2. The average hourly demand profile for a 24-h period, which is the upper layer control horizon N, is shown in Figure 3. The station serves vehicles mainly in the public transportation sector and fleets of courier and security firms. Both individual and fleet customers arrive one by one on their individual need basis, and there is currently no scheduled fleet refuelling at this station. Vehicles serviced by the fuelling station are hybrid fuelled, with combined CNG and diesel/petrol powered engines. The vehicles are run on CNG and resort to diesel and petrol power when the CNG in their tanks runs out. The station itself obtains gas from a municipal line, which is compressed by a 132 kW motor powered compressor, into three levels of the cascade storage, which are 2000 L each. The three level tanks have a maximum operating pressure of 250 bar and are in the baseline operated at minimum pressures of 75 bar, 150 bar and 210 bar for the low pressure, medium pressure and high pressure reservoirs, respectively. The compressor pumps gas into the storage at a rate of 900 m 3 /h. Although the station has two installed compressors and three dispensers, the station only operates one compressor and fills vehicles from one dispenser, since the current number of customers visiting the station is modest and no congestion or queuing problem has arisen. The station compressor operates between the limits of the quantity of gas in storage with the compressor being switched on at the lower limit to fill the cascade storage, and once the compressor is on, stays on to fill the cascade storage to the upper limit. The compressed natural gas station purchases electricity from South Africa's national utility firm Eskom based on a time-of-use tariff known as the Miniflex tariff (http://eskom.co.za/tariffs) which is priced in South African Rands as The tariff is divided into peak, offpeak and standard times during the day, reflecting the times during the day when electricity demand is high, low and intermediate, respectively. A sampling time of 15 min is used for the upper layer of this study with a control horizon of 24 h. For the lower layer MPC problem, a sampling time of 20 s for a receding prediction horizon N p of five minutes is used. During existing baseline operation, vehicle tank filling starts at the low pressure reservoir and the transfer to medium and high pressure reservoir occurs when the flow rate between the reservoir and the vehicle tank falls to a set point. This study seeks to allow the flexibility of the transfer of vehicle filling between the reservoirs through optimised control of the dispenser valves in the lower layer. The priority panel valves and the dispenser valves are modelled as binary valves with orifice diameters of 5 mm each. There are two sizes of vehicle cylinders for the vehicles fuelled in the 24 h control horizon at 80 and 100 L respectively. The initial vehicle tank pressure is assumed to be 1 bar since the vehicles are hybrid CNG and petrol/diesel powered and typically refill CNG tanks on empty.
The solution of the upper layer compressor schedule obtained from optimisation for the average 24-h demand is applied to the MPC receding horizon control of vehicle filling, for a day in which 143 vehicles fuel at the CNG station with gas demand as shown in Figure 4. Table 1 shows additional parameters and constants    Figure 5a, it is clear that the compressor operates during the peak electricity pricing period in the morning, as well as during the standard electricity pricing period during the rest of the day. This means that, under baseline operation, the station does not take advantage of the low electricity prices of the offpeak electricity pricing periods. The total cost of electricity incurred as a result of this baseline operation profile is R440.23. The main component of this cost is the cost of electricity consumed as a result of the compressor-on status during the significantly expensive peak electricity pricing period and an optimal avoidance of this occurrence should lower the cost considerably.

Energy Cost Minimisation Layer Results
The optimised results for the operation schedule of the compressor are shown in Figure 6. The proposed approach is successful in preventing compressor-on instances during both peak electricity demand periods for the average 24-h gas demand of the control horizon. Preceding the first peak demand period between 06:00 and 09:00, the compressor switches on to replenish the gas in storage so as to sustain demand during the peak electricity pricing period during which the compressor stays off. There are two instances when the compressor is turned on during the standard electricity pricing period to meet the gas demand as well as to refill the cascade storage before the second peak electricity demand period of the 24 h. Prior to the second peak, the cascade storage is refilled. The level of gas is thereafter enough to sustain the demand until the end of the second standard electricity pricing time at 22:00. The delay in switching on the compressor after the second peak demand period is a desirable outcome of the optimisation strategy. This is in response to the pricing of the standard electricity demand period that is higher than the pricing during the offpeak electricity demand period, which causes the controller to prefer delaying compressor-on status beyond the peak electricity demand period [42]. The delay is an important quality of the realised schedule as it reduces the contribution of the CNG station to the grid comeback load associated with the surge in electricity demand immediately following the end of the peak pricing period [43,44]. A total of four switching instances occur over the control horizon, which is comparable with observed results for alternative strategies observed in [12,29]. This implies the superiority of the current method as it matches the performance of previously proposed techniques with the added benefit of fewer mathematical operations, thereby achieving the goal of reducing computational complexity of the problem. The computing time achieved for the upper layer using the proposed approach was 15.15 s, compared to 20.22 s for the method using Equation (3) and 35.58 s for the method in Equation (4). The strategy reduces the cost of electricity over the 24-h horizon from the baseline R440.23 to R175.74, which represents a 60.08% reduction in energy cost. This is a significant reduction in cost of operation through a strategy that involves only a change in the operation schedule, without additional investment in new hardware.

Gas Flow Optimisation Layer Results
The compressor scheduling results from the energy cost minimisation layer are passed onto the lower layer, for the implementation of the MPC strategy in the vehicle tank filling for each of 143 vehicles fuelled over 24 h. These upper layer results determine the status of the compressor switch for a particular sampling instant in the lower layer. In the lower layer problem, four scenarios emerge, with each having a different priority panel and dispenser status combination. To ascertain the validity of the proposed approach, the system operation must remain valid and consistent with the system constraints under the four scenarios. These four scenarios are, vehicle tank filling with compressor off, vehicle tank filling with compressor on, compressor on without a vehicle filling at the dispenser, and compressor off without a vehicle filling at the dispenser.

Vehicle Filling with the Compressor Off
The results of optimised MPC filling process when a vehicle is at the dispenser and the compressor is off is shown in Figure 7. The results show the filling profile of the fourth vehicle of the 143 filled over the 24-h control horizon of the upper layer. The priority panel remains inactive since no gas flows into the cascade storage from the compressor given the off-status of the compressor switch, which is scheduled from the optimisation of the upper layer. All levels of cascade storage are utilised in the implemented control actions of the filling process to attain the pressure corresponding to the target level of gas to be filled in the vehicle.
The dispenser valves from the three cascade storage tanks switch between each other to fill the vehicle's tank, as shown in Figure 7b, producing the optimal pressure profile of the filling shown in Figure 7c. In Figure 7b, the MPC controller shuffles the operation of the dispenser valves between the three levels of the cascade storage in the filling process which is dependent on the pressure ratio between the vehicle tank and the reservoirs. This is different from the baseline operation where filling is sequentially scheduled and switching occurs at the set point of the dropping flow rate. A comparison of the pressure increase in the vehicle tank under the optimal control strategy and the baseline can be seen in Figure 7c. A filling time of 200 s is achieved, which is shorter than the 220 s achieved under the baseline operation.

Vehicle Filling with the Compressor On
When the vehicle is filled as the compressor is filling the cascade storage, the profile of operation is shown in Figure 8. The results show the profile of the filling process for 38th vehicle of the 143 filled over the 24-h control horizon. A smooth filling profile is obtained with a filling time of 200 s, which is shorter by 20 s from the baseline filling profile.
Similar to the filling of the vehicle while the compressor is off, the dispenser valves switches between levels of cascade storage to produce the optimal filling profile of the vehicle tank so that the targeted quantity of gas is transferred. The priority panel valves alternate the filling of the gas from the compressor into the cascade storage between the three levels.
For both cases in Sections 4.2.1 and 4.2.2, the proposed control strategy produces an efficient accelerated filling of the vehicle tank by switching optimally between the dispenser valves to achieve the minimum possible number of total dispenser valve-on instances to reach the targeted transfer of gas to the vehicle, which corresponds to the shortest possible filling time under the given constraints. This filling profile represents the optimal increase in pressure in the vehicle tank as achieved through the MPC strategy of the lower layer. Under this novel optimised MPC filling approach, the improvement in filling time is achieved with a median of 20 s reduction in filling time for an average saving of 16.92 s for the 143 vehicles. This outcome confirms that, by altering the operation of the dispenser valves through optimisation, better CNG fuelling performance can be achieved, which would further justify the optimisation of the CNG station operations, beyond the minimising of electricity costs.

Cascade Reservoir Filling without Vehicle Fuelling
As dictated by the energy cost optimisation layer schedule, during the interval when there is no vehicle fuelling at the dispenser but the compressor is on, the profile for the filling of the cascade storage from the compressor is shown in Figure 9. A preference to keep the high pressure reservoir of the cascade storage at high pressure is observed under the MPC strategy for the lower layer. The pressure level is flexibly controlled to fulfil the optimal control goals of vehicle filling and meet the conditions of the operation constraints. By successfully keeping the dispenser valves in the off position, the strategy demonstrates feasibility under this condition and achieves the expected performance profile for the given operational constraints.

Control Action during Idle Time
It is necessary to report on the system performance during idle time when the compressor is off and there is no vehicle fuelling at the dispenser. The state of the control variables and the pressure in the cascade storage for the lower layer is shown in Figure 10. The results show that the dispenser valves and priority panel valves remain in the off position over the entire control period demonstrating that the MPC strategy for the lower layer remains feasible when there is no inflow or outflow of gas from the cascade storage of the filling station. This indicates that the strategy is sufficiently constrained for all operation scenarios of the CNG filling station. The proposed two-layer optimisation for the reduction of energy cost and improvement filling efficiency shows a feasibility demonstrated in the results with a significant reduction in energy cost and vehicle filling times. The achieved reduction in the cost of electricity for the CNG fast-fill station by 60.08% can be passed on to consumers on cost per unit because of the lowered cost of gas delivery. Further, shorter filling times are achieved for vehicles fuelling at the station with a median reduction in filling time of 20 s and an average reduction by 16.92 s for all the vehicles through the MPC strategy for the lower layer. Reduced fuelling time is a welcome improvement in fuelling convenience that could serve to maintain existing CNG vehicle customers and lower the level of concern for new CNG vehicle users. The benefits from the optimisation of the two layers can be viewed as complementary to one another, given the cascaded improvement in financial and technical performance of the CNG station that has been realised.

Sensitivity Analysis
An analysis was carried out to scrutinise the validity of the model's output under disturbances, which originate from scenarios that alter the input parameters. A random change in the gas demand, which is an important parameter for compressor scheduling, is the most probable source of disturbance for the proposed optimal operation approach and could affect the feasibility of the compressor schedule solution. Consequently, an inspection of the possible effects of random disturbances, implemented as random percentage increase or decrease in hourly gas demand, on the quantity of gas in storage was done. The disturbance demand profiles are shown in Figure 11a. It is evident in Figure 11b that the solution of the compressor schedule obtained through the optimal scheduling remains valid through the series of variations in hourly gas demand of up to 20%. This means that the limits of the quantity of gas stored in the cascade storage are not violated if the schedule obtained is implemented, even if some variation in demand occur. However, when effecting the optimal schedule solution to the existing station controller, it is necessary to include safety interrupts to tackle circumstances where large disturbances cause a violation of operating limits, as shown in Figure 11b for the 25% variation in demand. These interrupts would correct the violation by either shutting off the compressor outside of schedule when the maximum quantity of gas limit in the cascade storage is reached, or by turning on the compressor outside of schedule when the minimum limit is reached as a result of unexpected gas demand circumstances. The feedback characteristic of the MPC strategy in the lower layer allows for the controller to adapt to disturbances in the system inputs [32], which means that when disturbances in the quantity of gas condition in the cascade storage occur, the controller updates operation control to attain the lower layer objectives. Table 2 shows the fuelling time for each of the two vehicles in Sections 4.2.1 and 4.2.2 when gas level disturbances in one of the three cascade storage cylinders are implemented. By feeding back the conditions of the system states to the controller input, the approach allows for new calculation of future control action so as to meet the set optimisation goals. The solutions from the proposed approach to optimal CNG station operation have thus been shown to be valid for the predicted operating conditions as well as under some variations to these conditions.

Conclusions
Participation of CNG delivery infrastructure in demand response programs not only saves cost for the station operators and CNG users, but it is also a participation in contributing to the wider goals of such programs in increasing grid reliability and efficiency for all electricity users in society. Cities seeking to expand the use of alternative fuels as cleaner means of transportation also need the associated infrastructure to develop responsibly with regard to use of electricity, which is an indispensable resource.
This study provides an expansive perspective of the operation profile of an optimised CNG fast-fill station, which is the major component of gas delivery infrastructure, incorporating both energy savings and pressure conditions management. The proposed approach achieves a huge reduction in the cost of electricity for the CNG fast-fill station, and delivers on shorter filling times for vehicles fuelling at the station. The results demonstrate savings of up to 60.08% in electricity cost for the upper layer as well as average savings of 16.92 s in vehicle fuelling times for the lower layer. Further, the sensitivity analysis shows an ability of the solutions obtained to withstand some disturbances in the inputs, which is important for the station operation reliability. Implementation of energy cost reduction strategies by energy users should remain sensitive to other performance considerations that may affect the business under consideration. For compressed natural gas vehicle users, vehicle fuelling time cannot be jeopardised as it is one of the main consideration consumers make when deciding on adoption of cleaner gaseous alternative fuels. The study demonstrates that benefits associated with adoption of CNG can be amplified by optimally operating delivery infrastructure with respect to existing demand response programs while simultaneously improving customer convenience. As an introductory study on the implementation of a combined energy cost and filling time optimisation, this study is a timely highlight to an important intersection between different approaches to better use of energy and system performance.
Author Contributions: The research work and manuscript drafting was done by C.K. under the guidance and supervision of L.Z. and X.X., who also provided critical review of the manuscript.
Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest. ρ hp , ρ mp , ρ l p Density of gas in high pressure, medium pressure and low pressure reservoirs (kg/m 3 )