Power and Energy Management System of a Lunar Microgrid—Part I: Modeling Power Demand of ISRU

Autonomous power control (APC) and energy management system (EMS) for space microgrids (MGs) on the Moon require well-designed operating references to ensure their safe operation considering the long-term goals of the mission. Oxygen and water, as two vital elements for human survival on the Moon, can be produced from the lunar regolith using the in-situ resource utilization (ISRU) and water treatment subsystems. Since ISRU is one of the highest power-demanding units in a lunar base, this article proposes a methodology for modeling the power demand profile for ISRU, considering oxygen and water management systems, which was not addressed in the literature. The article presents the power consumption model of the ISRU, considering the Sun's illumination profile at a candidate site near the Shackleton crater at the lunar south pole. Furthermore, a methodology is proposed to create oxygen and water consumption and wastewater generation profiles in the crew habitat. This article proposes models and algorithms to maintain the oxygen level and pressure in the crew habitat, transfer oxygen from ISRU to the associated oxygen tank, filter wastewater in the wastewater subsystem, transfer water produced from ISRU and freshwater from the wastewater subsystem to the associated water tank, considering oxygen and water consumption, and wastewater generation profiles of the crew habitat. Finally, an optimization framework is proposed to determine the power demand profile of ISRU by maintaining the oxygen in ISRU, the crew habitat, and water tanks at desired levels. It is observed that the ISRU power demand profile depends on the desired levels of oxygen and water in their associated tanks and their consumption/production rates. In addition, the interaction of different oxygen and water generation and consumption subsystems and storage tanks is thoroughly analyzed.


I. INTRODUCTION
A human lunar base requires an electrical power system (EPS) consisting of power generation and energy storage systems (ESSs) to cover the electricity demand of its powerconsuming units and can be called space microgrid (MG) on the Moon [1].The crew habitat, laboratories, environment control and life support systems (ECLSSs), and electric rovers are some of the power-consuming units at a lunar base.ECLSS consists of several subsystems to maintain the artificial atmosphere (air), biomass production, food processing and storage, water and waste management, thermal control, and extra-vehicular activity support [2], [3].In situ resource utilisation (ISRU) is one of the powerconsuming units with high electricity demand that utilizes the lunar regolith to produce oxygen and water [1], [4].In this regard, efficient operation management systems are required to coordinate the operation of available energy resources and different power-consuming units, ensuring the safety and reliability of the space MG.Human exploration space missions further away from low Earth orbit make real-time control using ground stations infeasible [5], [6] due to increased communication delay [7].Therefore, an autonomous control system is vital for space MGs on the Moon.
To maintain a coordinated operation among several power-consuming units, one of the main tasks of the autonomous power controller (APC) is to schedule their operating mode and rate, thereby the power demanded by each unit at each time interval [5].An autonomous control laboratory is under development for deep space missions using the EPS for International Space Station (ISS) [8].The authors of [5], [6], [9] proposed a distributed control architecture for spacecraft to organize APC tasks in several control levels consisting of vehicle manager, subsystem, and reactive levels, similar to the three-level hierarchical control structure (HCS) that is employed in terrestrial MGs [10].The vehicle manager at the highest control level in APC controls system operation to ensure the safety and timely execution of the space mission.The uppermost controller is responsible for planning, scheduling, and energy management to satisfy the operating requirements of several subsystems.Recently, such a HCS for a photovoltaic (PV)-battery based MG for a lunar base has been studied in [11], and adaptive control of two interconnected MGs is studied in [12].
Information on the power required by different subsystems is essential for the control and operation management of space MGs.Commonly, the constant average or peak power demand of power-consuming units is used in the power budget of the space mission [4], [13].For instance, a constant rate of 1.63 kg/h for oxygen production is assumed in [4] for designing the power system of ISRU and the base camp.However, the required power of the power-consuming units depends on the operation mode or operation rate of their subsystems.For example, the rate of photosynthetic photon flux (PPF), the oxygen consumption rate of the plants in the biomass subsystem [14], and the rate of oxygen and water production by the ISRU [4].In addition, several subsystems are interconnected in a closed loop to recycle resources.For instance, wastewater can be reused in the crew habitat after purification by the wastewater subsystem, or carbon dioxide generated by crew members can be utilized by plants in the biomass subsystem, while oxygen generated in the biomass subsystem can be utilized in the crew habitat [2].Indeed, reusing and recycling are essential for long-duration space missions due to the scarcity of resources and the difficulty of resupply.Thus, to increase system efficiency and safety, APC is responsible for coordinating system operation, taking into account the interaction among different subsystems and their power consumption rate, as well as the criticality of the space mission.The importance of this study lies in the fact that for a lunar base, the power demand of power-consuming units such as ISRU and water management systems is dependent on their technical characteristics and operating mode, the interaction among different units, as well as several strict life-sustaining requirements.Therefore, instead of considering a constant average or peak power consumption of different subsystems, their power consumption profiles should be used.However, deriving these profiles considering the interaction among subsystems is a challenging task that has not been addressed in previous studies to the best of our knowledge.
In this article, a new methodology for operation management of ISRU system in a lunar base is proposed taking into account oxygen and water requirements of the base and the interaction among different subsystems, namely ISRU, crew habitat, and wastewater treatment system.The article presents a model for producing oxygen and water by ISRU from the lunar regolith.The oxygen and water consumption profiles of the crew are also generated using the proposed technique.Several oxygen and water tanks are considered in the proposed model to ensure the safe operation of the system by maintaining their storage levels at desired values.The maximum oxygen and water transfer rates of the system are taken into account in the proposed model to schedule the transfer of oxygen from ISRU and water from both ISRU and wastewater subsystems to the crew habitat, respectively.Finally, an optimization framework is proposed to determine the power consumption profile of the ISRU while maintaining the oxygen and water levels in the respective storage tanks in the ISRU and crew habitat, considering oxygen and water production, consumption, and recycling in the three interacting subsystems.The availability of Sun radiation is also taken into account in determining the power consumption profile of ISRU to minimize dependence on the ESS.A PV-battery-based power system located in a candidate site near the Shackleton crater is considered for the lunar base, and it is assumed that the PV arrays are installed on towers of 10 m height.The main contribution of this study is to propose an optimization framework to determine the ISRU power demand profile maintaining the oxygen and water levels in the respective storage tanks of ISRU and habitat.
The rest of this article is organized as follows.The functionality of interacting subsystems for maintaining the oxygen and water in the lunar base is described in Section II.Further, deployed models for finding the power consumption by ISRU, the proposed methodologies for creating oxygen and water consumption and wastewater generation profiles, modeling wastewater filtration, and transfer of oxygen and water to the crew habitat are explained.The proposed optimization framework for maintaining the oxygen and water levels in the storage tanks is introduced in Section III.The simulation results are presented in Section IV.Finally, Section V concludes this articles.

II. CLOSED-LOOP MODEL FOR THE LUNAR BASE
Fig. 1 shows the three interacting subsystems, ISRU, habitat, and wastewater subsystem, that are involved in maintaining oxygen and water in the lunar base.The required oxygen and water for crew members are primarily provided by the ISRU using the lunar regolith.The water is used by crew members for drinking, urine flush, and personal hygiene.The urine flush and wastewater are appropriately filtered and recycled to produce freshwater for further use in the habitat.The power demand of ISRU depends on the stored levels of oxygen and water in ISRU tanks and their desired reference values, as they are related to the oxygen and water consumption of the crew members and the long-term mission objectives.For instance, if the oxygen and water levels in the storage tanks are below the reference levels or there is a long dark period in the near future, the oxygen and water production rates should be increased.Likewise, the power demand of the wastewater subsystem is directly proportional to the production rate of urine flush and wastewater and reference levels of their respective tanks.

A. ISRU
To produce oxygen and water in ISRU system, the lunar regolith is scooped, transported to a vibrating screen to select the appropriate particle size, magnetically separated for the required particle size, and the ilmenite is transferred Fig. 2. ISRU power consumption and oxygen and water production rates with respect to the ilmenite intake rate (V ir ).Inset figure: V ir varying from 0 to 0.1.
to the reactor.The catalyzed hydrogen reduction reaction of the ilmenite is performed inside the reactor, and water is electrolyzed to produce oxygen [4].The electrolyzer and electrical motors for scooping, transporting, vibrating, separating, and transferring regolith require electrical power (P E ).It is also assumed that the thermal power required by the reactor (P Q ) to heat the ilmenite is supplied by electrical heaters.The total power (P T ) consumed by the ISRU is the sum of (P E ) and (P Q ) as shown in Fig. 2. It can be observed in Fig. 2 that the power consumption of the ISRU and the oxygen and water production rates (M O and M W , respectively) are directly proportional to the rate at which the reactor is replenished with ilmenite (V ir ), varying from 0 to 1 [4].At higher rates of V ir , ISRU consumes significant amounts of power in the order of 10 3 kW.Supplying such high power might be challenging as it requires a large PV and battery system.Therefore, considering the required oxygen and water production rates, the maximum power required by ISRU can be limited by controlling the maximum of V ir .

B. Crew Habitat
The oxygen consumption by a crew member for several different activities is given in Table I [14] that is used to generate the oxygen consumption profile of all the crew members throughout the day.To maintain good health in space, crew members should have 8 h of sleep, 1 h of aerobic exercise, 1 h of exercise recovery, and 13.5 h of normal activities [14].Each of these activities is scheduled for each day as shown in Table I [14], [15] to generate the oxygen consumption profile of the crew members.In this article, four crew members are considered to be in      the habitat throughout the day for a mission duration of 708 h (= 29.5 days = 1 lunar month).The daily oxygen consumption profile given in Table I is used to create the complete oxygen consumption profile of all crew members during the entire mission duration.
Maintaining an artificial atmosphere is crucial in the habitat to sustain the life of crew members.In an artificial atmosphere, other than the temperature and humidity, maintaining the air pressure and gas composition [14], [16] are vital.In this article, only the pressure and concentration of oxygen are taken into account, and their limits are shown in Table II [14].
The pressure and concentration of oxygen in the habitat are maintained using the Ideal Gas Law (pV = nRT ).A total volume of 148.6 m 3 and a room temperature of 295.37 K are considered in this article following the human research program of NASA, to test the Human Exploration Research Analog (HERA) facility [17], [18].The oxygen pressure and concentration in the habitat drop due to the oxygen consumption by the crew members.The proposed Algorithm 1 determines the amount of oxygen that should be infused in the habitat to maintain the desired level of oxygen pressure and concentration.Algorithm  Similar to oxygen, water is also vital for life support and is consumed by the crew members for several other purposes listed in Table III [14].Each of these activities can be also scheduled for each day, as discussed in Table IV        the water consumption profile of the crew members.The daily water consumption profile for four crew members present in the habitat throughout the day, according to the schedule given in Table IV, is shown in Fig. 3(a) and is repeated to extend it for the complete mission duration.

C. Wastewater
In a habitat, wastewater is generated from different activities of the crew members as shown in Table V [14], in which the crew latent humidity condensate is the water vapor condensed from crew perspiration and respiration [19].The daily urine wastewater and wastewater generation profile of four crew members in the habitat according to the schedule of Table IV are shown in Fig. 3(b) and (c), respectively, and is repeated to extend it for the complete mission duration.The wastewater generated in the is stored in the respective tanks as shown in Fig. 1.The wastewater can be recycled for further use by the crew habitat after suitable filtration.This process will reduce the need for producing water from the lunar regolith, designing a special process for wastewater disposal on the Moon, or transporting them to the Earth, thereby reducing the mission cost.For longduration space missions, a new alternative water processor (AWP) is currently in the development stages to recover water from wastewater and replace the state-of-the-art water recovery system (WRS) on the ISS [20], [21], [22].WRS consists of an urine processor assembly (UPA) and water processor assembly (WPA) as shown in the wastewater subsystem of Fig. 1 [19], which is also considered in this study.In this article, it is assumed that WRS can process 2.5 kg/h of urine and latent wastewater and can recover approximately 81% of the wastewater fed [23].The process of producing filtered freshwater from urine and wastewater is described in Algorithm 3, which was first proposed by the authors in [24].The algorithm calculates T err U F , T err WW , and T err FW (from T re f U F , T re f WW , and T re f FW , respectively), the amount of freshwater obtained from filtering the wastewater, and updates T U F , T WW , and T FW .
The water consumed in the habitat can be resupplied from both ISRU and freshwater tanks as shown in Fig. 1 using an improved version of the methodology first introduced by the Saha et al. [24]  , water is collected from one or both of the freshwater and ISRU water tanks and is transferred to the water tank in the crew habitat.Instead of using the water produced from the ISRU, the freshwater recycled from the wastewater filtration system is prioritized in Algorithm 4 to transfer water from the freshwater tank to the water tank in the crew habitat.

III. ISRU OPTIMAL POWER DEMAND
ISRU is the primary source of oxygen and water production for the crew habitat.The tertiary level controller of the APC is responsible for operation management of the ISRU to maintain secure amounts of oxygen and water in respective storage tanks in ISRU and crew habitat by providing the required power to ISRU system.The proposed optimization framework to determine the power demand profile of ISRU takes into account the available power for ISRU and the reference levels of the oxygen and water tanks in the crew habitat and ISRU as shown in (1).The Sun illumination time series profile considering the Sun, Earth, and Moon as a three-body system is used to determine the available power profile at the candidate lunar base following the technique proposed in [25]: Step 14: Step 18: Step 19: Determine new T hab H 2 O using T OT H 2 O out to the crew habitat water tank according to Algorithm 4 and the maximum rate at which water transfer can take place from the ISRU and the freshwater tank is determined by the solution of the optimization problem.Besides, it should be noted that with the intake of lunar regolith, both oxygen and water are produced in ISRU.Therefore, V ir at each hour is a decision variable of the optimization problem as with the intake of lunar regolith, oxygen and water are produced and stored in respective tanks in ISRU to maintain T ISRU O 2 and T ISRU H 2 O at their desired reference levels.To maintain , O max 2 ISRU −hab is a decision variable to control the maximum rate at which oxygen can be transferred from ISRU oxygen tank to the oxygen tank in the crew habitat following Algorithm 2. Further, to maintain FW out is a decision variable to control the maximum rate at which freshwater can be transferred from wastewater subsystem to the water tank in the crew habitat.Finally, W max ISRU out for each hour is a decision variable to control the maximum rate at which water is transferred from the ISRU water tank to crew habitat water tank at each hour.
, Latitude and longitude of the candidate site Step 1: Generate illumination time series profile using [25] Step 2: Generate oxygen, water consumption, and wastewater generation profile using Tables I, III, and V, respectively The complete optimization is carried out according to Algorithm 5.The algorithm takes all the required parameters as input and continues till the optimum results are found.The time t accounts for every minute for the complete T H and Algorithm 1 is executed every minute to maintain pV O 2 in the crew habitat.At each hour, Algorithms 2-4 are executed to update the transfer of oxygen from ISRU oxygen  tank to the oxygen tank in the crew habitat, filter freshwater from wastewater in the wastewater subsystem, and transfer water from ISRU and wastewater filtered water tanks to the crew habitat water tank, respectively.

IV. RESULTS
In this article, the modeling of the ISRU power demand profile is done considering the desired oxygen and water tank levels of the ISRU and crew habitat subsystems.The optimization problem is implemented in MATLABfmincon and solved using Interior-point algorithm.The actual illumination-time series profile for a period of 708 h from July 6, 2023, to August 5, 2023, at a candidate site with longitude 222.6627 • and latitude −89.4511 • near the Shackleton crater (see Fig. 4) is used by the optimization algorithm.The assumptions made on the initial, minimum, maximum, and reference levels of different storage tanks as well as on the habitat O 2 pressure and pV O 2 are listed in Table VI.The lower and upper bounds of the decision variables V ir , O max 2 ISRU −hab , W max FW out , and W max ISRU out are listed in Table VII.The available solar power using a 300 m 2 -PV array area is shown in Fig. 5(a).It can be that there are many periods when solar power is unavailable, and therefore, the ESS is required for supplying the critical loads of the base.According to Fig. 5(b), there is no intake of lunar regolith during the dark time.During this period, the ISRU oxygen and water production are ceased, and ISRU requires only the minimal survival power, as can be seen in Fig. 5(c), to reduce the power demanded from the ESS. The since the water production of ISRU is 1.125 times more than the oxygen production with the same V ir according to Fig. 2. It can be seen in Fig. 5(d) and (g) that both T ISRU O 2 and T ISRU H 2 O start from their initial values and continue to increase till they reach their preset reference levels.At this time, the ISRU power demand [see Fig. 5(c)] is reduced even when solar power is available as the regolith intake is reduced, and thereby, the oxygen and water production by ISRU are also reduced.It is observed from comparing Fig. 5(a) and (c) that the power demand of ISRU increases just before the onset of the dark period to prepare the ISRU oxygen and water reservoirs [see Fig. 5(e) and (h)].During the dark period, the stored amounts of oxygen and water in the respective tanks of the ISRU drop below the desired references as the oxygen and water production in the ISRU are stopped.As soon as solar power becomes available, the ISRU power demand increases to the maximum to reach the desired levels of oxygen and water storage.Once the desired levels of oxygen and water are reached in the respective tanks of ISRU, the power demand of the ISRU reduces to a level to only maintain the stored amounts of oxygen and water at their desired levels.Therefore, the ISRU power demand depends on the regolith intake rate and the desired references of oxygen and water levels in the respective tanks.As can be observed in Fig. 5(f), the oxygen transfer from ISRU to the oxygen tank in the crew habitat follows the oxygen consumption pattern of the crew members.The high amount of oxygen transfer from ISRU oxygen tank to the oxygen tank in the crew habitat is related to the exercise time of the crew members.
The level of the water tank in the habitat (T hab H 2 O ) increases to reach T re f hab H 2 O after decreasing for the first few hours.This decrease in T hab H 2 O during the initial hours is because there is no transfer of water from the freshwater tank in the wastewater subsystem and the water tank in ISRU as can be seen in Fig. 5(k) and (l), respectively.There is no water transfer from ISRU as it delays reaching its reference (T re f ISRU H 2 O ).As soon as the discrepancy between T ISRU H 2 O and T re f ISRU H 2 O is compensated, water is transferred to the water storage tank in the crew habitat as shown in Fig. 5(l).For the case of transferring freshwater from the wastewater subsystem, it can be observed from Fig. 5(j) that initially T FW remains at 0 kg for a few hours as T U F and T WW reach T re f U F and T re f WW , respectively.As soon as WRS starts its operation, T FW increases from 0 kg.When T FW reaches T min FW , the water transfer starts from the freshwater tank to the crew habitat water tank as the transfer of recycled water is prioritized in Algorithm 4. In the crew habitat oxygen tank, T hab O 2 increases from its initial level to T re f hab O 2 as can be seen in Fig. 6(a).Also, pV O 2 in the habitat is maintained within its minimum and maximum amounts, as shown in Fig. 6(b).According to Table II, the oxygen pressure in the crew habitat is maintained around its nominal level as shown in Fig. 6(c).Similarly, it can be seen in Fig. 6(d) that the oxygen level in the crew habitat is maintained approximately at 20.9% according to Table II.The dips in T hab O 2 , pV O 2 , oxygen pressure, and concentration level in the crew habitat are due to the high oxygen intake of the crew members while exercising.
According to the obtained results, the proposed optimization framework generates the power demand profile for the ISRU as shown in Fig. 5(c) to maintain the desired levels of oxygen and water in the respective storage tanks of the ISRU and habitat.The average, minimum, and maximum power consumption of ISRU are 25.144 kW, 4.086 kW, and 76.267 kW, respectively.The peak power demand of ISRU can be reduced by limiting the maximum rate of regolith intake (V ir ).However, lowering the maximum V ir will also decrease the maximum oxygen and water production rates and more time will be required to reach the desired levels of oxygen and water in the storage tanks.Thereby, a satisfactory compromise should be made between tracking performance and power consumption through a multicriteria optimization problem that is the scope of the future research of the authors.This is especially critical when there are several power-consuming units in the system to avoid power surges and enhance resource utilization.

V. CONCLUSION
In this study, an optimization framework was formulated to determine the power demand profile of the ISRU system in a lunar base.The actual Sun illumination time-series profile was considered to determine the solar power generation profile at the candidate location for one lunar month mission duration.A methodology was proposed to determine the oxygen and water consumption and wastewater generation profiles of the crew members in the habitat.Several algorithms were also proposed to maintain the oxygen pressure and concentration in the crew habitat, transfer oxygen from the ISRU to the habitat oxygen tank, and transfer water from the ISRU water tank and freshwater tank in the wastewater subsystem to the habitat water tank.The main contribution of the study is to propose an optimization framework to maintain the desired levels of oxygen and water in the respective storage tanks of the ISRU and the habitat and model the ISRU power demand profile.The proposed optimization framework maintains the required amount of oxygen pressure and concentration in the habitat, along with maintaining the desired level of oxygen and water in the respective ISRU and habitat tanks throughout the optimization horizon.The optimization framework considered the crew oxygen and water consumption and wastewater generation according to the standard amounts of oxygen and water consumption and wastewater generation for several tasks specified in the literature.It was considered that the crew members follow a daily schedule of operation in the habitat.A model for ISRU power demand profile was obtained at the candidate location, satisfying the safe life-supporting conditions of the habitat and long-term objectives of the space mission.It was observed that the ISRU power demand is not constant throughout the duration of its operation.Rather, it depends on the required regolith intake rate affected by the required oxygen and water production rate of the habitat and the desired levels of oxygen and water in the respective ISRU and water tanks.The study assumes an equal and constant amount of oxygen and water consumption and wastewater generation rate for all crew members.However, uncertainties must be considered in the oxygen and water consumption and wastewater generation rates by different crew members in the habitat that will be considered as a future study by the authors.Also, the power required by the system to transfer the oxygen and water from the ISRU and freshwater tanks to the respective habitat tanks and by the oxygen infusion system to maintain the habitat oxygen pressure and concentration are not considered due to the lack of appropriate data.The effect of deviation from the considered daily schedule and the assumed initial levels of several tanks in the ISRU and habitat on the ISRU power demand also needs further investigation.The obtained power demand profile of the ISRU can be used as a reference for the operation and energy management of a lunar base, which is the scope of the second part of this article.

Fig. 1 .
Fig. 1.Three interacting subsystems for maintaining oxygen and water flows in the lunar base (UPA/WPA: Urine/wastewater processor assembly).

Algorithm 1 :
Proposed Algorithm to Maintain Oxygen Pressure and Concentration in the Crew Habitat.

Step 3 :
Solve optimization problem to minimize the objective function given in (1) subject to pV min O 2 ≤ pV O 2 ≤ pV max O 2 and running Algorithm 1 every minute and Algorithm 2, Algorithm 3, Algorithm 4 every hour

Fig. 5 .
Fig. 5. (a) PV power profile at the candidate location with an unoptimized PV array area of 300 m 2 from July 6, 2023 August 5, 2023.(b) V ir .(c) Power demand profile for ISRU.(d) ISRU oxygen tank level.(e) ISRU oxygen tank level reference tracking zoomed.(f) Transfer of oxygen from ISRU to crew habitat oxygen tank.(g) ISRU water tank level.(h) ISRU water tank level reference tracking zoomed.(i) Crew habitat water tank level.(j) Filtered freshwater tank level.(k) Transfer of freshwater to the crew habitat water tank.(l) Transfer of water from ISRU to crew habitat water tank.

:
O out 2 and M O 2 Step 2: Determine pV err O 2 from pV re f O 2 and pV O 2 if pV err O 2 is present then Step 3: Determine n in O 2 using pV err O 2 , R, T , and m (using the ideal gas law pV = nRT ) Step 4: Determine O in 2 using n in O 2 and M O 2 if the required O in 2 can be provided from the T hab O 2 (using m ) and O in 2 < O in max Determine new T hab O 2 after infusing the required O in Determine new pV O 2 using n out O 2 , n in O 2 , R, T , and m else if the required O in 2 cannot be provided from the T hab O 2 (using m ) and O in 2 < O in max Determine new T hab O 2 using the new O in Determine new pV O 2 using n out O 2 , the new n in O 2 , R, T , and m else if the required O in 2 can be provided from the T hab O 2 (using m ) but O in 2 ≥ O in max Determine new T hab O 2 using the new O in Determine new T hab O 2 using the new O in 2Step 6: 2 and m Step 9: Determine new n in O 2 using the new O in 2 and M O 2Step 10:2Step 12:

TABLE I
[14]dule of Crew Members for Their Daily Activities and Associated Oxygen Consumption Rate of One Crew Member[14]

Table 4 -
ISRU −hab , the amount of O 2 ISRU −hab to be transferred from the oxygen tank in ISRU to oxygen tank in the crew habitat is specified.

then Step 10: Determine
to generate Determine O 2 ISRU −hab using T err ISRU −hab ≤ O max 2 ISRU −hab and the required amount of O 2 ISRU −hab (converted to kg) can be provided from T ISRU O 2 (considering T min Determine new T ISRU O 2 using O 2 ISRU −hab (converted to kg) and h Step 4: Determine new T hab O 2 using O 2 ISRU −hab and ISRU −hab ≤ O max 2 ISRU −hab but the required amount of O 2 ISRU −hab (converted to kg) cannot be provided from T ISRU O 2 (considering T min Determine new O 2 ISRU −hab that can be provided maintaining T min Determine new T ISRU O 2 using the new O 2 ISRU −hab (converted to kg) and h Step 7: Determine new T hab O 2 using the new O 2 ISRU −hab and h else if T err hab O 2 is present and O 2 ISRU −hab > O max 2 ISRU −hab and the amount of O max 2 ISRU −hab (converted to kg) can be provided from T ISRU O 2 (considering T min Determine new T ISRU O 2 using the allowable maximum limit O max 2 ISRU −hab (converted to kg) and h Step 9: Determine new T hab O 2 using the allowable maximum limit O max 2 ISRU −hab (converted to kg) and h else if T err hab O 2 is present and O 2 ISRU −hab > O max 2 ISRU −hab but the amount of O max 2 ISRU −hab (converted to kg) cannot be provided from T ISRU O 2 (considering T min new O 2 ISRU −hab that can be provided maintaining T min Determine new T ISRU O 2 using the new O 2 ISRU −hab (converted to kg) and h Step 12: Determine new T hab O 2 using the new O 2 ISRU −hab and h

TABLE IV Daily
Schedule of the Crew Members Used for Creating the Water Consumption and Wastewater Generation Profile

TABLE V Wastewater
[14]rated in the Habitat by One Crew Member[14]

Table 4
-21 (P. 73) that is presented in Algorithm 4. In this algorithm, if water is available in both ISRU and freshwater tanks, after comparing T err hab H 2 O , W max FW out , T min FW , W max ISRU H 2 O out , and T min ISRU H 2 O

)
Algorithm 3: Algorithm to Filter Urine and Wastewater and Store it in the Freshwater Tank.Determine new T WW after removing C WW from T WW Step 9: Set WW total = C U F + C WW Step 10: Determine C FW which is 81% of the WW total Step 11: Determine new T FW using C FW else if T err U F is present and T U F > T min U F and T U F ≥ T ph W RS (using h ) and C W RS can be stored in T FW considering T max Proposed algorithm to Transfer Water from ISRU and Freshwater Tanks to the Crew Habitat Water Tank.Input: T hab H 2 O , T re f hab H 2 O , T FW , T min FW , T ISRU H 2 O , T min ISRU H 2 O , W max FW out , W max ISRU H 2 O out Set: h = 1 h and T OT H 2 O out equal to 0 Step 1: Determine T err hab H 2 O from T re f hab H 2 O and T hab H 2 O if T err hab H 2 O is present and T FW > T min Determine T OT H 2 O out such that T FW is maintained at T min Determine T OT H 2 O out using W max FW out and h Step 7: Determine new T FW after removing W max FW out (using h ) from T FW else if T err hab H 2 O ≥ W max FW out (using h ) but W max Determine T OT H 2 O out such that T FW is maintained at T min Determine T OT H 2 O out using T err hab H 2 O oxygen tank, oxygen will be transferred from the oxygen tank in ISRU to the crew habitat oxygen tank according to Algorithm 2 and the maximum rate at which oxygen transfer can take place is determined by the solution of the optimization problem.Also, water is transferred from both the ISRU and freshwater tank in the wastewater subsystem 4:

Step 12 :
Determine new T ISRU H 2 O after removing