Novel Genetic Algorithm-Based Energy Management in a Factory Power System Considering Uncertain Photovoltaic Energies

The demand response and accommodation of different renewable energy resources are essential factors in a modern smart microgrid. This paper investigates the energy management related to the short-term (24 h) unit commitment and demand response in a factory power system with uncertain photovoltaic power generation. Elastic loads may be activated subject to their operation constraints in a manner determined by the electricity prices while inelastic loads are inflexibly fixed in each hour. The generation of power from photovoltaic arrays is modeled as a Gaussian distribution owing to its uncertainty. This problem is formulated as a stochastic mixed-integer optimization problem and solved using two levels of algorithms: the master level determines the optimal states of the units (e.g., micro-turbine generators) and elastic loads; and the slave level concerns optimal real power scheduling and power purchase/sale from/to the utility, subject to system operating constraints. This paper proposes two novel encoding schemes used in genetic algorithms on the master level; the point estimate method, incorporating the interior point algorithm, is used on the slave level. Various scenarios in a 30-bus factory power system are studied to reveal the applicability of the proposed method.


Introduction
Unit commitment (UC) for the power utility determines the states (on/off) of each thermal generator over the scheduled time horizon.Recently, the problem of the high penetration of renewables in power systems has become important.Bertsimas et al. proposed a two-stage adaptive robust UC model for the security-constrained UC problem in the presence of nodal net injection uncertainty using Benders decomposition algorithm [1].Kalantari et al. projected all feasible generation and demand vectors onto the demand space and reformulated the UC within this loadability set [2].Ignoring the uncertainty, Bakirtzis et al. used a mixed integer linear programming based on different time-resolutions to study the UC problem, considering renewables [3].
On the other hand, demand response (DR) is the change in electric usage by end-use customers from their normal consumption patterns in response to changes in the electricity price associated with the retail market or incentive policies [4][5][6].Customer participation in the DR program is a key factor to enhance the reliability in a modern smart grid.
Traditionally, DR has been addressed in the scheduling of household appliances for their energy consumption in response to retail prices [7,8] or the electricity prices in the day ahead power market [9].Yoon et al. proposed a dynamic demand response controller that changed the set-point temperature to control HVAC loads, depending on electricity retail price, which was published each 15 min, and partially shifted some of this load away from the peak [10].Tsui and Chan developed a versatile DR optimization framework that used convex programming for the automatic load management of various household appliances in a smart home [11].Pipattanasomporn et al. proposed an algorithm to manage household loads according to their preset priorities and to guarantee that total household power consumption was below certain levels [12].Chavali et al. proposed an approximate greedy iterative algorithm to schedule the energy usages of appliances of end-use customers.Each customer in the system will find the optimal start time and operating mode of each appliance in response to varying electricity prices [13].
DR can also be achieved by alternative approaches, such as aggregated load control [14,15], plug-in electric vehicles [16] and frequency-related control [17].Pourmousavi et al. evaluated the thermostat setpoint control of aggregate electric water heaters for load shifting, and for providing a desired balancing reserve for the utility.This work also assessed the economic benefits of DR for customers considering time-of-use pricing [14].Salinas et al. considered a third-party's management of the energy consumption of a group of users, and formulated the corresponding load scheduling problem as a constrained multi-objective optimization problem.The optimization objectives were to minimize the cost of consumed energy and to maximize a certain utility, which can be conflicting and non-commensurable [15].Tan et al. investigated a market in which users have the flexibility to sell back the energy generated by their distributed generators or the energy stored in their plug-in electric vehicles, using a distributed optimization algorithm [16].Chang-Chien et al. proposed an overall frequency restoration plan that considered the DR and spinning reserve.The DR program was used first to restore declining frequency caused by a large disturbance.The scheduled spinning reserve was then used to raise frequency back to the pre-disturbance level [17].
The concepts of DR, UC and renewable energy as they pertain to a power utility were recently integrated [18][19][20].Abdollahi et al. investigated the economically driven and environmentally driven measures of DR programs and proposed a new linearized formulation of the cost-emission-based UC problem that was associated with DR program solved by mixed-integer programming [18].Zhao et al. addressed DR programs as another reserve resource to mitigate uncertainty in wind power output; they developed a robust optimization approach to derive an optimal UC decision by maximizing total social welfare under the joint worst-case wind power output and DR scenario [19].Zhao and Guan presented a unified stochastic and robust UC model by introducing weights for the components of the stochastic and robust parts in the objective function, which was solved by a Benders' decomposition algorithm [20].
This paper explores the optimal DR and UC in a factory's power system, rather than a bulk power system or a DR at home, considering uncertain photovoltaic (PV) power generation.A factory tends to produce more real power from its micro-turbine generators once the time-of-use electricity price set by the utility is high or the PV power is inadequate.The factory has elastic loads, such as production lines, which are associated with interruptible demand and fixed energy consumption in a day.The time periods for operating these elastic loads can be determined by the time-of-use tariff, PV generation, a capacity contract, cost of the fuel of the micro-turbine generator and other operational constraints.The uncertainty of PV power output was addressed by many papers [21][22][23][24][25][26][27][28][29][30][31][32].In this paper, the uncertainty of PV power is modeled using stochastic distributions.This problem is expressed by a stochastic mixed integer optimization formulation.The innovations of this paper are summarized as follows: (1) The problem is solved by a two-level method: the master level determines the optimal states (0/1) of the generators and the elastic loads using a novel genetic algorithm; and the slave level deals with optimal real power scheduling and power purchase/sale from/to the utility, subject to the system operating constraints, using the interior point algorithm.(2) Two novel encoding schemes associated with new crossover and mutation operations in genetic algorithms are presented.These new operations make this novel GA more efficient to solve the optimal UC and DR in a factory's power system.
(3) The uncertainty in the PV power generation is studied by using the point estimate method that integrates the master level with the slave level to gain an optimal stochastic mixed-integer solution.(4) Not only the states of micro-turbine generators in UC but also the states of elastic loads at the production lines in DR are addressed at the same time.
The rest of this paper is organized as follows.Section 2 formulates the problem to be solved.Section 3 then presents the methodology based on genetic algorithms.Section 4 summarizes the simulation results of a 30-bus factory power system with PV generations.Section 5 draws conclusions.

Problem Formulation
As described in Section 1, the problem can be expressed as follows.

Objective Function
The problem is to minimize the expected value of following objective.
where f is the total cost ($) of power generations from micro-turbine generators plus that of power purchase/sale; T denotes the total number of hours (T = 24 h herein); G 1 represents the number of micro-turbine generators; u i (t) is the unknown state (0/1) of the i-th unit at hour t; and F i P i (t) and S i (t) represent the fuel cost ($/h) and the start-up cost of the i-th unit at hour t, respectively.P i (t) and P p (t)/ P s (t) are the unknown real power generated by the i-th unit and the unknown purchased/sold power at the point of common coupling (the swing bus) at hour t.The terms p p (t) and p s (t) are the known time-of-use electricity tariffs (purchased/sold power) for this factory.The symbol "~" denotes random variables.

Equality Constraint
At hour t, the objective is subject to where G 2 is the number of PV arrays; PV j (t) is the known power generation from PV array j at hour t, modeled by a stochastic distribution.v (t) is the unknown state (0/1) of the P el (t) at hour t.P in (t) and P el (t) are the known inelastic and known maximum elastic loads (MW) at the -th production line at hour t, respectively, = 1, 2, . . ., L. If an elastic load is activated (v (t) = 1), then maximum power is consumed (that is, P el (t)); otherwise (v (t) = 0), the power consumption is zero.

Inequality Constraints
At hour t, the powers generated by each micro-turbine generator and each PV array must be within the following limits.
where P i min PV i min and P i max (PV i max ) denote the minimum and maximum of P i (PV i ). ) between two consecutive hours (if the unit is on at time t − 1 and t) [33].
The i-th micro-turbine generator should be operated with a minimum up time M on i and a minimum down time M o f f i [33].The total elastic load at the -th production line in a day is fixed because the amount of requested products is firmed.

Proposed Method
The problem expressed by Equations ( 1)-( 7) consists of T × (G 1 + L) unknown binary variables and T × (2 + G 1 ) unknown random variables.In this paper, G 1 = 4, L = 5 and T = 24.This problem may be solved by binary linear programming or dynamic programming [33][34][35] in the case that no probability density function is involved.The genetic algorithm (GA), on the other hand, randomly produces many chromosomes, which represent solutions, and selects the fittest one.However, the computational burden of the GA becomes large if the binary bit length of a chromosome and the number of functional constraints is large [36][37][38].Thus, this work proposes an enhanced GA to deal with UC and DR.
The proposed method includes two levels of calculations: the master and slave levels.On the master level, two novel methods for encoding generators and elastic demands are presented to overcome the above limitations of the GA and to improve the genetic operations.The GA on the master level solves the problem formulated as Equations ( 1)- (7) and the constraints of a minimum up time M on i and a minimum down time M o f f i for each micro-turbine generator.When the states of the generators and elastic loads are determined, the remaining problem is to determine P i (t), P p (t) and P s (t) on the slave level, taking into account uncertain PV generation.The interior point method, which incorporates the point-estimation method, is used to solve the problem on the slave level.

Novel Encoding of Generator States
The traditional GA may encode the on/off states (u(t)) of each generator using binary bits (0 or 1), according to Equations (1)-(3).For example, the grey and white parts in a chromosome denote the on and off states, respectively, of a generator in one hour period over 24 h, as shown in Figure 1a.
The i-th micro-turbine generator should be operated with a minimum up time and a minimum down time [33].The total elastic load at the ℓ-th production line in a day is fixed because the amount of requested products is firmed.

Proposed Method
The problem expressed by Equations ( 1)-( 7) consists of T × (G1 + L) unknown binary variables and T × (2 + G1) unknown random variables.In this paper, G1 = 4, L = 5 and T = 24.This problem may be solved by binary linear programming or dynamic programming [33][34][35] in the case that no probability density function is involved.The genetic algorithm (GA), on the other hand, randomly produces many chromosomes, which represent solutions, and selects the fittest one.However, the computational burden of the GA becomes large if the binary bit length of a chromosome and the number of functional constraints is large [36][37][38].Thus, this work proposes an enhanced GA to deal with UC and DR.
The proposed method includes two levels of calculations: the master and slave levels.On the master level, two novel methods for encoding generators and elastic demands are presented to overcome the above limitations of the GA and to improve the genetic operations.The GA on the master level solves the problem formulated as Equations ( 1)- (7) and the constraints of a minimum up time and a minimum down time for each micro-turbine generator.When the states of the generators and elastic loads are determined, the remaining problem is to determine ( ), ( ) and ( ) on the slave level, taking into account uncertain PV generation.The interior point method, which incorporates the point-estimation method, is used to solve the problem on the slave level.

Novel Encoding of Generator States
The traditional GA may encode the on/off states (u(t)) of each generator using binary bits (0 or 1), according to Equations ( 1)-(3).For example, the grey and white parts in a chromosome denote the on and off states, respectively, of a generator in one hour period over 24 h, as shown in Figure 1a.When the number of generators is large and traditional encoding is used, the length of a chromosome becomes very long.Consequently, this work proposes a pair-based encoding, in which the first and second slots (genes) in a pair represent the starting and ending hours in a period, respectively.Hence, each slot contains integer.Figure 1b shows the new encoding of the chromosome that corresponds to Figure 1a.With this new encoding, the length of a chromosome is much reduced and variable.

Crossover Operation
The crossover operation in this new encoding comprises three steps using a given crossover rate, as follows.When the number of generators is large and traditional encoding is used, the length of a chromosome becomes very long.Consequently, this work proposes a pair-based encoding, in which the first and second slots (genes) in a pair represent the starting and ending hours in a period, respectively.Hence, each slot contains integer.Figure 1b shows the new encoding of the chromosome that corresponds to Figure 1a.With this new encoding, the length of a chromosome is much reduced and variable.

Crossover Operation
The crossover operation in this new encoding comprises three steps using a given crossover rate, as follows.

Mutation Operation
A mutation rate for the mutation operation is specified.When a slot is identified, its corresponding integer is mutated to a value that is between those of its neighbors.Figure 4 presents an example: the slot with "11" is identified and mutated to the value of "17", which is between 9 and 19.

Mutation Operation
A mutation rate for the mutation operation is specified.When a slot is identified, its corresponding integer is mutated to a value that is between those of its neighbors.Figure 4 presents an example: the slot with "11" is identified and mutated to the value of "17", which is between 9 and 19.

Novel Encoding of States of Elastic Load
The encoding of elastic loads should differ from that of generators because each elastic load must satisfy the required amount of production daily.This novel encoding is based on the well-known knapsack problem [36].
For example, the grey and white parts in a chromosome denote hours when the state of an elastic load is on or off, respectively, over 24 h, as shown in Figure 5a, using the traditional encoding.The proposed encoding employs several slots (genes) to represent consecutive periods of on, off, on, off and so on states.Restated, the odd and even slots denote the periods where the load is in the on or off state, respectively.Figure 5b shows the results (with respect to Figure 5a) that are obtained by the novel encoding.Notably, the sum of all integers equals 24.

Novel Encoding of States of Elastic Load
The encoding of elastic loads should differ from that of generators because each elastic load must satisfy the required amount of production daily.This novel encoding is based on the well-known knapsack problem [36].
For example, the grey and white parts in a chromosome denote hours when the state of an elastic load is on or off, respectively, over 24 h, as shown in Figure 5a, using the traditional encoding.The proposed encoding employs several slots (genes) to represent consecutive periods of on, off, on, off and so on states.Restated, the odd and even slots denote the periods where the load is in the on or off state, respectively.Figure 5b shows the results (with respect to Figure 5a) that are obtained by the novel encoding.Notably, the sum of all integers equals 24.

Crossover Operation
The crossover operation is performed using the following three steps.
Step B1: Identify a pair of slots (on and off states) in parent 2. The identified pair is inserted in a position between the off and on slots.Figure 6a gives an example in which the total number of hours after insertion is 35.
Step B3: Trim the integers in the slots to make the total sum 24, as shown in Figure 6b. (a)

Crossover Operation
The crossover operation is performed using the following three steps.
Step B1: Identify a pair of slots (on and off states) in parent 2. The identified pair is inserted in a position between the off and on slots.Figure 6a gives an example in which the total number of hours after insertion is 35.
Step B3: Trim the integers in the slots to make the total sum 24, as shown in Figure 6b.
The crossover operation is performed using the following three steps.
Step B1: Identify a pair of slots (on and off states) in parent 2. The identified pair is inserted in a position between the off and on slots.Figure 6a gives an example in which the total number of hours after insertion is 35.
Step B3: Trim the integers in the slots to make the total sum 24, as shown in Figure 6b.

Mutation Operation
The mutation operation is carried out by identifying a pair of slots (on and off hours) according to a given mutation rate.The integers in these two slots are mutated to other integers but their sum is unchanged.Figure 7 displays an example in which (7,2) is mutated to (1,8).

Mutation Operation
The mutation operation is carried out by identifying a pair of slots (on and off hours) according to a given mutation rate.The integers in these two slots are mutated to other integers but their sum is unchanged.Figure 7 displays an example in which (7,2) is mutated to (1,8).

Point Estimation Method
Once the states of micro-turbine generators and elastic loads have been determined on the master level, the remaining problem becomes a stochastic optimization problem, which is solved on the slave level.The uncertain PV generation is estimated using the point estimation method [39,40], as follows.Let the expected values, standard deviation and skewness coefficient of each uncertain PV generation (i.e., ) be , and, , respectively, where j = 1, 2, …, G2.
Step C1: Set the first and second moments of the ( ) at the i-th generator, ( ) and ( ) to zero where i = 1, 2, …, G1.
where the symbol E stands for the expectation operator.

Point Estimation Method
Once the states of micro-turbine generators and elastic loads have been determined on the master level, the remaining problem becomes a stochastic optimization problem, which is solved on the slave level.The uncertain PV generation is estimated using the point estimation method [39,40], as follows.
Step C1: Set the first and second moments of the P i (t) at the i-th generator, P p (t) and P s (t) to zero where i = 1, 2, . . ., G 1 .
where the symbol E stands for the expectation operator.
Step C2: Compute the two perturbations: In addition, compute the two weighting factors: ) Step C3: Estimate the two location parameters: Step C4: Let m be 1 where m denotes a moving index given for the PV arrays.
Step C5: Let k be 1.Start to apply the positive perturbation using Equation ( 9) for the m-th PV array.
and the constraints on ramp rate that are expressed in Equations ( 5) and ( 6).The symbols C1(t) and C2(t) are the set of generators and elastic loads in the on state.
Step C7: Let k = k + 1.If k = 2, then start to conduct the negative perturbation using Equation (10) for the m-th PV array and go to Step C6; else go to Step C8.
The calculations of the means and standard deviations of P p (t), P s (t) and cost are similar and omitted here.
Solving the problem in Step C6 becomes easy because it is a quadratic programming problem.This work employs the interior point method in MATLAB to solve this problem [41].

Overall Flowchart of Algorithmic Steps
The schematic concept of the master-slave iterations can be illustrated as Figure 8. Overall algorithmic steps for the proposed method based on the master-slave iterations are described as follows.Figure 9 illustrates the flowchart of the proposed method.First, specify the elastic loads with their must-run durations and the 24 h inelastic loads; input generator parameters, which are the ramp rate, minimum up-time, minimum down-time and cost coefficients.In addition, the forecasted 24 h PV power generations in terms of means, standard deviations and skewness coefficients are given.
In the proposed GA, both generator units and elastic demands are initialized to be feasible chromosomes.In the master-level calculation, P i (t) and P s (t) where t = 1, 2, . . . ,T, are determined using Step C1-C9 on the slave level.Please note that if any of the constraints (such as minimum up-time M on i and minimum down-time M o f f i and Equation ( 7) is violated for a chromosome, its corresponding penalty term is added to the fitness, Equation (1).In the proposed GA, the better chromosomes are selected using the roulette wheel.
As described in the beginning of Section 3, G 1 = 4, L = 5 and T = 24.In a day-ahead scheduling problem, T = 24 is always true.Moreover, the number (30 herein) of buses in a factory, which is addressed to consider both UC and DR, is actually large.Considering G 1 = 4 and L = 5 is reasonable in a large factory power system.This studied problem is not the same as the traditional UC problem, which is defined in the transmission system and may include many buses and generators.Moreover, traditional DR is concerned in the distribution system or at home; however, the DR is emphasized herein in the end-user's factory power system.The proposed GA is very efficient to deal with the operational constraints, such as Equation ( 7), for the studied problem.

Simulation Results
A 30-bus factory power system, as shown in Figure 10, is used to illustrate the results of the simulation.The micro-turbine generators are at buses 3-6.Table 1 presents the cost coefficients and MW limits of these generators.Table 2 presents the other operational parameters of these generators.The solar PV generations from 7:00 a.m. to 6:00 p.m. at buses 7-10 are modeled using Gaussian distributions, as shown in Figure 11.The standard deviation is set to 3% of the mean value (see page 17 in [42]); that is, the range of PV generation can be estimated approximately to be (the mean value) × (1 ± 3 × 3%), which covers 99.73% of possible PV generation cases.The maximum sizes of these four arrays are 450, 350, 400 and 500 kW.This factory purchases/sells power from/to the utility in a manner determined by the time-of-use prices, as shown in Table 3.In addition to

Simulation Results
A 30-bus factory power system, as shown in Figure 10, is used to illustrate the results of the simulation.The micro-turbine generators are at buses 3-6.Table 1 presents the cost coefficients and MW limits of these generators.Table 2 presents the other operational parameters of these generators.The solar PV generations from 7:00 a.m. to 6:00 p.m. at buses 7-10 are modeled using Gaussian distributions, as shown in Figure 11.The standard deviation is set to 3% of the mean value (see page 17 in [42]); that is, the range of PV generation can be estimated approximately to be (the mean value) × (1 ± 3 × 3%), which covers 99.73% of possible PV generation cases.The maximum sizes of these four arrays are 450, 350, 400 and 500 kW.This factory purchases/sells power from/to the utility in a manner determined by the time-of-use prices, as shown in Table 3.In addition to inelastic loads, this factory has five production lines with elastic loads at buses 6, 16, 18, 20 and 26, as shown in Table 4.For example, the total energy consumption of the production line at bus 6 must be 75 MWh (10 × 7.5) daily to produce the required amount of products.Other bus data are given in Appendix A.
A personal computer with Intel (R) Core (TM) i5-2500 CPU @ 3.3 GHZ and 8 GB RAM was used to develop a MATLAB (R2011a, The Mathworks Inc., Natick, MA, USA) code to study the problem.Many scenarios (experimental designs) were studied: PV consideration (see Sections 4.1 and 4.2), different electricity tariffs, M on i and M o f f i , ramp rates, and must-run hours (see Section 4.3).For each scenario, the MATLAB code was run 20 times and the best fitness in these 20 results was considered as the optimal solution.It was found that the proposed novel GA always converges in a finite iterations.Section 4.5 gives the statistics of convergence performance of the proposed method.For each scenario, the MATLAB code was run 20 times and the best fitness in these 20 results was considered as the optimal solution.It was found that the proposed novel GA always converges in a finite iterations.Section 4.5 gives the statistics of convergence performance of the proposed method.

Optimal Solutions Obtained by Proposed Method
The proposed method is applied to find the optimal unit commitment and demand response considering the data described above.The convergence criterion is that 10 consecutive iterations yield the same solution.The studied problem consists of 216 unknown binary variables and 144 unknown random variables.
The optimal solution takes 46 master-slave iterations and 106.99 s to converge.The expected value of total cost is $23,737.68.Table 5 shows the expected values of optimal power injections obtained by the interior point method on the slave level.Table 6 illustrates the expected values of optimal demand responses that are obtained on the master level.The following comments can be made.

Impacts of Different Factors on Total Cost
This section explores the impact of different factors (electricity tariffs, minimum on/minimum down times, ramp rates, and must-run hours in production lines) on the expected value of total cost of the factory, considering the PV generation, with the purpose of validating the proposed method.Table 9 gives the simulation results.
Three time-of-use tariffs are examined.When the tariff during the off-peak hours is high (low), the total cost of the factory is high (low).
When the minimum on-/down-times of generators are all set to 1 h, the constraints are almost relaxed and the acquired cost ($21,879.39)is lower than those in other two cases.When the minimum on/minimum down times are set to large values, these operational constraints are very strict and a larger cost ($25,845.03)is attained.
In the perspective of optimization, large (small) ramp rates imply the problem has a large solution space, resulting in a low (high) cost.Generally, small micro-turbine generators have small ramp rates in factories.
The must-run hours of the production lines reveal the amount of products that must be produced in a day.Long must-run hours, corresponding to many required products, lead to a large total cost, as shown in Table 9.  2 23,737.68(8,4), (8,3), (7,3), (7,4)

Comparisons between Traditional Method and Proposed Method
The traditional GA (TGA) incorporating with the interior point method and the point-estimation method was used to study the problem for comparisons.
The case studied in Section 4.1 serves as an example here.Table 10 shows the performances of TGA considering different population sizes (50, 75 and 100).The crossover and mutation rates of TGA are 0.8 and 0.02, respectively.The simulation results imply that the TGA yields a feasible solution only because a long binary bit string (24 × 9 = 216 bits) is needed for encoding u i (t) and v (t) and the number of real variables (encoded by 144 × 32 bits) is also large.The TGA requires much shorter CPU times and less number of iterations than those needed by the proposed method.Obviously, the TGA converges prematurely.The expected values of final cost obtained by TGA are $31,300.69-31,345.96,which are much greater than $23,737.68obtained by the proposed method.The simulation results shown in the previous subsections were conducted by running the developed MATLAB code 20 times and the best solution among the 20 results was identified as the final optimal solution.In order to show the convergence performance of the proposed method, this Sections 4.1-4.4increases the number of runs to 50.The case in Section 4.2 serves as an example.
The best solution occurs in the 9th run out of the 50 runs.The best solution is $24,333.87while the worst one is $30,328.29,which occurs in the 43th run.The difference between $24,333.87 and $30,328.29 are divided equally into 10 portions; that is, 10%, 20%, . . ., 100% of the difference between the worst and best costs.As shown in Figure 12a, the probability of the 1st portion is 0.04 (two runs out of 50 runs); the best cost $24,333.87and the cost, $24,513.49,obtained in the 15th run, are within the 1st portion.The largest probability (0.3) occurs in the 7th portion, which covers the cost between $28,330.11 and $28,996.16. Figure 12b shows the corresponding cumulative probability.

Statistics of Convergence Performance of the Proposed Method
The simulation results shown in the previous subsections were conducted by running the developed MATLAB code 20 times and the best solution among the 20 results was identified as the final optimal solution.In order to show the convergence performance of the proposed method, this subsections 4.1-4.4increases the number of runs to 50.The case in Section 4.2 serves as an example.
The best solution occurs in the 9th run out of the 50 runs.The best solution is $24,333.87while the worst one is $30,328.29,which occurs in the 43th run.The difference between $24,333.87 and $30,328.29 are divided equally into 10 portions; that is, 10%, 20%, …, 100% of the difference between the worst and best costs.As shown in Figure 12a, the probability of the 1st portion is 0.04 (two runs out of 50 runs); the best cost $24,333.87and the cost, $24,513.49,obtained in the 15th run, are within the 1st portion.The largest probability (0.3) occurs in the 7th portion, which covers the cost between $28,330.11 and $28,996.16. Figure 12b shows the corresponding cumulative probability.

Comparison of Results Considering Different Standard Deviations of PV Power Generations
The standard deviation of PV power generation is set to 3% of the mean value in Section 4.1.That is, the range of PV power generation can be estimated approximately to be (the mean value) × (1 ± 3 × 3%), which covers 99.73% of possible PV generation cases.This section investigates impacts of other standard deviation (8%) on the results.Table 11 shows the comparisons of results by studying the same case in Section 4.1 with different standard deviations of PV power generations.The CPU times and iterations indicate that the proposed GA can still converge properly without premature convergence.The expected cost ($23,028.07)obtained by considering the standard deviation of 8% of the mean value is smaller than that ($23,737.68)obtained in Section 4.1.However, the difference is very small.Actually, the expected power generations of all micro-turbine generators

Comparison of Results Considering Different Standard Deviations of PV Power Generations
The standard deviation of PV power generation is set to 3% of the mean value in Section 4.1.That is, the range of PV power generation can be estimated approximately to be (the mean value) × (1 ± 3 × 3%), which covers 99.73% of possible PV generation cases.This section investigates impacts of other standard deviation (8%) on the results.Table 11 shows the comparisons of results by studying the same case in Section 4.1 with different standard deviations of PV power generations.The CPU times and iterations indicate that the proposed GA can still converge properly without premature convergence.The expected cost ($23,028.07)obtained by considering the standard deviation of 8% of the mean value is smaller than that ($23,737.68)obtained in Section 4.1.However, the difference is very small.Actually, the expected power generations of all micro-turbine generators obtained by considering different standard deviations of PV power generations are almost the same because two location parameters of PV power generations in Equation ( 14) are utilized.These location parameters are centered at the same mean value for a given PV array although different standard deviations are considered and different location parameters are gained in Equation (14).

Conclusions
This paper investigates a new problem about optimal UC and DR caused by electricity tariffs in a factory power system.The uncertain amounts of generated power from renewable sources, which may reduce the total cost, are considered in the factory power system.The contributions of this paper can be summarized as follows: 1.
The problem concerning optimal DR and UC, considering uncertain PV power generation, in a factory power system, rather than the UC in the bulk power system or DR at home, is formulated and studied.

2.
The method based on novel genetic algorithms that are associated with the point estimation and interior point methods is proposed to determine the UC and DR in the factory power system.

3.
The proposed string encoding in genetic algorithms efficiently performs both crossover and mutation operations for the UC together with DR.This proposed method ensures that feasible chromosomes can evolve to the fittest solution.4.
Impacts of different parameters (such as PV generations, electricity tariffs, minimum on/down times, ramp rates and must-run hours) were completely investigated on the optimal solutions.
The results of the simulation verify the applicability of the proposed method using a 30-bus factory power system.
Future studies will include modeling different tariffs for electricity and renewable energy as well as different tariffs for purchase and selling energy.Power flow studies in the factory power system will be investigated to ensure that both the voltages and line flows meet the security constraints.

Figure 1 .
Figure 1.(a) On (grey) and off (white) states of a generator over 24 h; and (b) new encoding.

Figure 1 .
Figure 1.(a) On (grey) and off (white) states of a generator over 24 h; and (b) new encoding.

Figure 2 .
Figure 2. Identification of overlapping hours in which states of both chromosomes are on and resulting proto-offspring.

Figure 3 .
Figure 3. (a) Insertion of two on-periods and resulting proto-offspring; and (b) trimming redundant slot.

Figure 4 .
Figure 4. Value of 11 is identified and mutated to 17.

Figure 2 .
Figure 2. Identification of overlapping hours in which states of both chromosomes are on and resulting proto-offspring.

Figure 2 .
Figure 2. Identification of overlapping hours in which states of both chromosomes are on and resulting proto-offspring.

Figure 3 .
Figure 3. (a) Insertion of two on-periods and resulting proto-offspring; and (b) trimming redundant slot.

Figure 3 .
Figure 3. (a) Insertion of two on-periods and resulting proto-offspring; and (b) trimming redundant slot.

Figure 3 .
Figure 3. (a) Insertion of two on-periods and resulting proto-offspring; and (b) trimming redundant slot.

Figure 4 .
Figure 4. Value of 11 is identified and mutated to 17.Figure 4. Value of 11 is identified and mutated to 17.

Figure 4 .
Figure 4. Value of 11 is identified and mutated to 17.Figure 4. Value of 11 is identified and mutated to 17.

Figure 5 .
Figure 5. (a) Hourly on (grey) and off (white) states of an elastic load over 24 h; and (b) new encoding corresponding to that in 5a.

Figure 5 .
Figure 5. (a) Hourly on (grey) and off (white) states of an elastic load over 24 h; and (b) new encoding corresponding to that in 5a.

Figure 6 .
Figure 6.(a) Insertion of a pair of slots; and (b) trimming values in slots to make the sum 24.

Figure 6 .
Figure 6.(a) Insertion of a pair of slots; and (b) trimming values in slots to make the sum 24.

Figure 7 .
Figure 7. Mutation operation for elastic load encoding.

Figure 7 .
Figure 7. Mutation operation for elastic load encoding.

Figure 9 .
Figure 9. Flowchart of the proposed method.

Figure 9 .
Figure 9. Flowchart of the proposed method.
used to develop a MATLAB (R2011a, The Mathworks Inc., Natick, MA,USA) code to study the problem.Many scenarios (experimental designs) were studied: PV consideration (see Sections 4.1 and 4.2), different electricity tariffs, and , ramp rates, and must-run hours (see Section 4.3).

Figure 10 .
Figure 10.One-line diagram of studied power system.

Figure 12 .
Figure 12.(a) Probability; and (b) cumulative probability with respect to the percentage of difference between the best and worst costs.

Figure 12 .
Figure 12.(a) Probability; and (b) cumulative probability with respect to the percentage of difference between the best and worst costs.

Table 1 .
Cost coefficients and MW limits of generators.

Table 2 .
Operational parameters of generators.

Table 1 .
Cost coefficients and MW limits of generators.

Table 2 .
Operational parameters of generators.

Table 3 .
Time-of-use pricing.

Table 4 .
Parameters of elastic loads.

Table 6 .
Expected values of optimal demand response (MW) in a day.

Table 8 .
Optimal demand response (MW) in a day.

Table 9 .
Impacts of different factors on results.

Table 10 .
Performance of traditional GA considering different population sizes.
Appl.Sci.2017, 7, 438 14 of 18 TGA are 0.8 and 0.02, respectively.The simulation results imply that the TGA yields a feasible solution only because a long binary bit string (24 × 9 = 216 bits) is needed for encoding ( ) and ℓ (t) and the number of real variables (encoded by 144 × 32 bits) is also large.The TGA requires much shorter CPU times and less number of iterations than those needed by the proposed method.Obviously, the TGA converges prematurely.The expected values of final cost obtained by TGA are $31,300.69-31,345.96,which are much greater than $23,737.68obtained by the proposed method.

Table 10 .
Performance oftraditional GA considering different population sizes.

Table 11 .
Comparisons of results considering different standard deviations of PV power generations.