Skip to main content
Log in

Using linear–quadratic regulator to optimally control the gas lift operation

  • Original Paper
  • Published:
Arabian Journal of Geosciences Aims and scope Submit manuscript

Abstract

As the reservoir pressure declines, production decreases and there is no way just using artificial lift methods such as the gas lift to make the production economical. Gas lift optimal control is one of the dominant problems in gas lift operation. There are various methods for this purpose in literature, but all of them use a primary control method with a simple and inaccurate simulation model which does not guarantee enough accuracy. Besides, in all of the previous studies, the control model was just concentrated on well, while the part that converts a static optimization to an optimal control one is the reservoir and the main constraints of the optimization problem are on the surface facilities. Here, first using simulation software an integrated model of reservoir, wells, and surface facilities are developed, then for that, an accurate proxy model is created and using the linear–quadratic regulator (LQR), the optimal trajectory of the lift gas injections for all wells are calculated. Finally, the results are validated by comparison with two other heuristic optimization algorithms, and results confirmed the better performance of the method of this paper in comparison with two heuristic methods, higher net present value (NPV) and a highly stable control trajectory of the method of this paper.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Abbreviations

A(t):

State coefficient

b :

Control trajectory coefficient

B(t):

Input coefficient

CAPEX:

Capital expenditures

GOA:

Grass hover optimization algorithm

H :

Hamiltonian

LQR:

Linear–quadratic regulator

NPV:

Net present value

OPEX:

Operating expense

pr:

Price (oil, gas, water treatment) (USD)

q :

Oil rate (STB/day)

r :

Discount rate

SA:

Simulated annealing

SCF:

Standard cubic foot

STB:

Standard barrel of oil

t :

Time

T :

Transpose

u :

Input (gas injection rate (MSCF/day))

USD:

United states dollar

x :

State

0:

Initial state

f:

Final state

g:

Gas

i:

Well number

o:

Oil

w:

Water

References

  • Baker O, Swerdloff W (1955) Calculations of surface tension-3: calculations of surface tension parachor values. Oil Gas J 43:141

    Google Scholar 

  • Bin H, Golan M (2003) Gas-lift instability resulted production loss and its remedy by feedback control: dynamical simulation results. https://doi.org/10.2118/84917-MS

    Book  Google Scholar 

  • Campos MCMM et al. (2017) Advanced control for gas-lift well optimization, https://doi.org/10.4043/28108-MS.

  • Chew J, Connally J (1959) A viscosity correlation for gas-saturated crude oils. AIME 216:23–25

    Google Scholar 

  • Edwards R, Marshall DL, Wade KC (1990) A gas-lift optimization and allocation model for manifolded subsea wells. https://doi.org/10.2118/20979-MS

    Book  Google Scholar 

  • Eikrem GO, Aamo OM, Foss BA (2008) On instability in gas lift wells and schemes for stabilization by automatic control. SPE Prod Oper 23(02):268–279. https://doi.org/10.2118/101502-PA

    Article  Google Scholar 

  • Elf Exploration, “PUNQ S3,” 1992. http://www.nitg.tno.nl/punq/cases/punqs3/index.html.

  • Fairuzov YV et al. (2004) “Stability maps for continuous gas-lift wells: a new approach to solving an old problem,” in SPE Annual Technical Conference and Exhibition, pp. 1–9. https://doi.org/10.2118/90644-MS.

  • Garcia AP, “Stability analysis and stabilization of gas lift systems,” in 22nd International Congress of Mechanical Engineering, November, 2013, pp. 3–7.

  • Guo B, Lyons WC, and Ghalambor A., Petroleum production engineering, no. February. 2007.

  • Hagedorn AR, Brown KE (1965) Experimental study of pressure gradient occuring during continious two phase flow in small diameter vertical conduit. J Pet Technol:234

  • Hussein H, Al-Durra A, Boiko I (2015) Design of gain scheduling control strategy for artificial gas lift in oil production through modified relay feedback test. J Frankl Inst 352(11):5122–5144. https://doi.org/10.1016/j.jfranklin.2015.08.007

    Article  Google Scholar 

  • Khamehchi E and Mahdiani MR (2017a) “An introduction to gas lift,” in Gas allocation optimization methods in artificial gas lift, Springer International Publishing, pp. 1–5.

  • Khamehchi E and Mahdiani MR (2017b) “Constraint optimization,” in Gas allocation optimization methods in artificial gas lift, Springer International Publishing, pp. 25–34.

  • Khamehchi E, Mahdiani MR, Amooie MA, and Hemmati-Sarapardeh A (2020) Modeling viscosity of light and intermediate dead oil systems using advanced computational frameworks and artificial neural networks, J Pet Sci Eng, p. 107388.

  • Khamehchi E, Zolfagharroshan M, and Mahdiani MR, “A robust method for estimating the two-phase flow rate of oil and gas using wellhead data.”

  • Kumar A and Malhotnal BD (1996) Automation of gas lift operation in Bombay offshore fields.

  • Larsen CA, Asheim HA (2014) Experimental investigation of gas lift instability and dynamic regulation to control it (Russian). https://doi.org/10.2118/172271-RU

    Book  Google Scholar 

  • Lasater JA (1958) Bubble point pressure correlation. Tran AIME 213:379–381

    Google Scholar 

  • Lee AL, Gonzalez MH, Eakin BE (1966) The Viscosity of natural gases. J Pet Technol:237

  • Mahdiani MR, Khamehchi E (2015a) Stabilizing gas lift optimization with different amounts of available lift gas. J Nat Gas Sci Eng 26:18–27. https://doi.org/10.1016/j.jngse.2015.05.020

    Article  Google Scholar 

  • Mahdiani MR, Khamehchi E (2015b) Preventing instability phenomenon in gas-lift optimization. Iran J Oil Gas Sci Technol 4(1):49–65 Accessed: Jan. 17, 2016. [Online]. Available: https://www.researchgate.net/publication/273373506_Preventing_Instability_Phenomenon_in_Gas-lift_Optimization

    Google Scholar 

  • Mahdiani MR and Khamehchi E (2016) “A novel model for predicting the temperature profile in Gas Lift Wells,” Petroleum https://doi.org/10.1016/j.petlm.2016.08.005.

  • Mahdiani MR, Kooti G (2016) The most accurate heuristic-based algorithms for estimating the oil formation volume factor. Petroleum 2(1):40–48

    Article  Google Scholar 

  • Mahdiani MR and Norouzi M (2018) A new heuristic model for estimating the oil formation volume factor,” Petroleum

  • Mahdiani MR, Khamehchi E, Suratgar AA, Mahdiani MR, Suratgar AA (2019a) Optimizing and stabilizing the gas lift operation by controlling the lift gas specific gravity. J Pet Sci Technol 9(3):46–63

    Google Scholar 

  • Mahdiani MR, Khamehchi E, Suratgar AA (2019b) Using modern heuristic algorithms for optimal control of a gas lifted field. J Pet Sci Eng 183:106348

    Article  Google Scholar 

  • Mahdiani MR, Khamehchi E, Suratgar AA (2020) A new time-dependent model for controlling the gas injection pressure in continuous gas lift. Sigma J Eng Nat Sci ve Fen Bilim Derg 1:38

    Google Scholar 

  • Mirzaei-Paiaman A (2013a) An empirical correlation governing gas-condensate flow through chokes. Pet Sci Technol 31(4):368–379

    Article  Google Scholar 

  • Mirzaei-Paiaman A (2013b) The severe loss of well productivity in an Iranian gas condensate carbonate reservoir: problem identification and remedy. Energy Sources, Part A Recover Util Environ Eff 35(19):1863–1872

    Article  Google Scholar 

  • Mirzaei-Paiaman A, Salavati S (2012) The application of artificial neural networks for the prediction of oil production flow rate. Energy Sources, Part A Recover Util Environ Eff 34(19):1834–1843

    Article  Google Scholar 

  • Mirzaei-Paiaman A, Salavati S (2013) A new empirical correlation for sonic simultaneous flow of oil and gas through wellhead chokes for Persian oil fields. Energy Sources, Part A Recover Util Environ Eff 35(9):817–825

    Article  Google Scholar 

  • Monyei CG, Adewumi AO, and Obolo MO (2014) Oil well characterization and artificial gas lift optimization using neural networks combined with genetic algorithm, Discret Dyn Nat Soc., vol. 2014 https://doi.org/10.1155/2014/289239.

  • Papay J (1968) “Changes of technical parameters in producing gas fields,” in OGIL, pp. 267–273.

  • Plucenio A, Pagano DJ, Camponogara E, Traple A, Teixeira A (2009) Gas-lift optimization and control with nonlinear MPC. IFAC Proc Vol 42(11):904–909. https://doi.org/10.3182/20090712-4-TR-2008.00148

    Article  Google Scholar 

  • Saremi S, Mirjalili S, Lewis A (2017) Grasshopper optimisation algorithm: theory and application. Adv Eng Softw 105:30–47

    Article  Google Scholar 

  • Seim JE, van Beusekom VL, Henkes RAWM and Nydal OJ (2011) “Experiments and modelling for the control of riser instabilities with gas lift,”

  • Shao W, Boiko I, Al-Durra A (2016) Control-oriented modeling of gas-lift system and analysis of casing-heading instability. J Nat Gas Sci Eng 29:365–381. https://doi.org/10.1016/j.jngse.2016.01.007

    Article  Google Scholar 

  • Sharma R, Glemmestad B (2013) On generalized reduced gradient method with multi-start and self-optimizing control structure for gas lift allocation optimization. J Process Control 23(8):1129–1140. https://doi.org/10.1016/j.jprocont.2013.07.001

    Article  Google Scholar 

  • Standing MB (1947) A pressure-volume-temperature correlation for mixtures of California oils and gases.

    Google Scholar 

  • Takács G (2005) Gas lift manual. PennWell.

  • Vinegar HJ, Burnett RR, Savage WM, Carl FG Jr (2004) Controllable gas-lift well and valve. Google Patents

  • Vogel JV (1968) Inflow performance relationship of solution-gas drive wells. JPT:83–92

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ehsan Khamehchi.

Additional information

Responsible Editor: Santanu Banerjee

Appendix: Finding the optimal trajectory using LQR method

Appendix: Finding the optimal trajectory using LQR method

First of all, the mathematical model should be determined. It should be mentioned that in this paper, subscript 1 stands for well 1, 2 for well 2, and so on.

State variables:

The state variable is as the following form:

$$ {\mathrm{x}}_1\left(\mathrm{t}\right),{\mathrm{x}}_2\left(\mathrm{t}\right),\dots .,{\mathrm{x}}_{\mathrm{n}}\left(\mathrm{t}\right) $$
(1)

In which:

$$ {\displaystyle \begin{array}{c}{\mathrm{x}}_1\left(\mathrm{t}\right)-{\mathrm{x}}_6\left(\mathrm{t}\right):{\mathrm{q}}_{\mathrm{o}1}\left(\mathrm{t}\right)-{\mathrm{q}}_{\mathrm{o}6}\left(\mathrm{t}\right)\\ {}{\mathrm{x}}_7\left(\mathrm{t}\right)-{\mathrm{x}}_{12}\left(\mathrm{t}\right):{\mathrm{q}}_{\mathrm{g}1}\left(\mathrm{t}\right)-{\mathrm{q}}_{\mathrm{g}6}\left(\mathrm{t}\right)\\ {}{\mathrm{x}}_{13}\left(\mathrm{t}\right)-{\mathrm{x}}_{18}\left(\mathrm{t}\right):{\mathrm{q}}_{\mathrm{w}1}\left(\mathrm{t}\right)-{\mathrm{q}}_{\mathrm{w}6}\left(\mathrm{t}\right)\end{array}} $$

Thus:

$$ {\displaystyle \begin{array}{c}x(t)=\left[{\mathrm{x}}_1\left(\mathrm{t}\right),{\mathrm{x}}_2\left(\mathrm{t}\right),\dots .,{\mathrm{x}}_{18}\left(\mathrm{t}\right)\right]\\ {}=\left[{\mathrm{q}}_{\mathrm{o}1}\left(\mathrm{t}\right),\dots, {\mathrm{q}}_{\mathrm{o}6}\left(\mathrm{t}\right),{\mathrm{q}}_{\mathrm{g}1}\left(\mathrm{t}\right),\dots, {\mathrm{q}}_{\mathrm{g}6}\left(\mathrm{t}\right),{\mathrm{q}}_{\mathrm{w}1}\left(\mathrm{t}\right),\dots .,{\mathrm{q}}_{\mathrm{w}6}\left(\mathrm{t}\right)\right]\end{array}} $$
(2)

Control inputs:

As mentioned earlier, by a sensitivity analysis, the lift gas injection rates were determined as the control inputs:

$$ \mathrm{u}\left(\mathrm{t}\right)=\left[{\mathrm{u}}_1\left(\mathrm{t}\right),{\mathrm{u}}_2\left(\mathrm{t}\right),\dots {\mathrm{u}}_6\left(\mathrm{t}\right)\right]=\left[{\mathrm{q}}_{\mathrm{inj}1}\left(\mathrm{t}\right),\dots, {\mathrm{q}}_{\mathrm{inj}6}\left(\mathrm{t}\right)\right] $$
(3)

Now, the system should be described in the following form:

$$ \dot{\mathrm{x}}\left(\mathrm{t}\right)=\mathrm{a}\left(\mathrm{x}\left(\mathrm{t}\right),\mathrm{u}\left(\mathrm{t}\right),\mathrm{t}\right) $$
(4)

The general for of proxy models is:

$$ \dot{{\mathrm{x}}_{\mathrm{i}}}\left(\mathrm{t}\right)={\mathrm{b}}_1.{\mathrm{q}}_{\mathrm{g}\mathrm{inj}1}+\dots +{\mathrm{b}}_6.{\mathrm{q}}_{\mathrm{g}\mathrm{inj}6}+{\mathrm{b}}_7.{\mathrm{q}}_{\mathrm{o}1}+\dots +{\mathrm{b}}_{12}.{\mathrm{q}}_{\mathrm{o}6}+{\mathrm{b}}_{13}{\mathrm{q}}_{\mathrm{g}1}+\dots +{\mathrm{b}}_{18}{\mathrm{q}}_{\mathrm{g}6}+{\mathrm{b}}_{19}{\mathrm{q}}_{\mathrm{w}1}+\dots +{\mathrm{b}}_{24}{\mathrm{q}}_{\mathrm{w}6} $$
(5)

In which, \( \dot{\mathrm{x}}\left(\mathrm{t}\right) \) is a representative for all factors of states and coefficients are constants with respect to the time. The value of these parameters is listed in Tables 5, 6, and 7. Based on these tables, four new variables are defined, bginj, bo, bg, and bw. Each variable is an 18 × 6 matrix in which each row is the coefficient of the injection lift gas, oil rates, gas rate, and water rates, respectively, in proxy models and there are 18 rows in which each row is related to one of the proxy models (first 6 for \( {\dot{\mathrm{q}}}_{\mathrm{o}} \), second 6 for \( {\dot{\mathrm{q}}}_{\mathrm{g}} \) and the third 6 for \( {\dot{\mathrm{q}}}_{\mathrm{w}} \)). These data are extracted from Tables 5, 6, and 7.

$$ {\mathrm{b}}_{\mathrm{ginj}}=\left[\begin{array}{cc}\begin{array}{c}\begin{array}{c}19.51869\\ {}77.90273\\ {}-128.864\end{array}\kern0.5em \begin{array}{c}63.99556\\ {}133.3043\\ {}-432.835\end{array}\kern0.5em \begin{array}{c}-43.6708\\ {}52.13013\\ {}-49.3166\end{array}\\ {}\begin{array}{c}109.7704\\ {}-44.6052\\ {}18.63184\end{array}\kern0.5em \begin{array}{c}68.12849\\ {}-27.6772\\ {}-38.2472\end{array}\kern0.5em \begin{array}{c}-157.979\\ {}-168.19\\ {}-47.0328\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}5475.533\\ {}24189.97\\ {}-40945.5\end{array}& \begin{array}{c}44134.73\\ {}32682.59\\ {}-137149\end{array}& \begin{array}{c}-46529.7\\ {}25692.67\\ {}-14317.7\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}-5.74883\\ {}98.12983\\ {}-312.155\end{array}& \begin{array}{c}35.95253\\ {}-54.9185\\ {}56.22917\end{array}& \begin{array}{c}9.092735\\ {}69.70845\\ {}-104.394\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}144.0481\\ {}7.59055\\ {}-54.1682\end{array}& \begin{array}{c}22.23096\\ {}127.9731\\ {}10.14346\end{array}& \begin{array}{c}141.8283\\ {}-79.2866\\ {}-26.1613\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-24590.6\\ {}22380.04\\ {}-99272.1\end{array}& \begin{array}{c}43149.59\\ {}-24794.2\\ {}17038.02\end{array}& \begin{array}{c}-4371.01\\ {}21343.64\\ {}-33375.7\end{array}\end{array}\end{array}\\ {}\begin{array}{c}\begin{array}{ccc}\begin{array}{c}44214.27\\ {}-20817.3\\ {}21421.14\end{array}& \begin{array}{c}56303.33\\ {}-12549.7\\ {}-12178.5\end{array}& \begin{array}{c}-47109.7\\ {}-70534.9\\ {}-25986\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.75099\\ {}3945.394\\ {}-1430.34\end{array}& \begin{array}{c}2.737366\\ {}6905.261\\ {}-4924.41\end{array}& \begin{array}{c}-0.45077\\ {}2246.148\\ {}-620.212\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}4685.601\\ {}-822.303\\ {}0.377439\end{array}& \begin{array}{c}5191.368\\ {}-754.013\\ {}-1.1793\end{array}& \begin{array}{c}-6819.2\\ {}-3183.02\\ {}-1.56708\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}76072.82\\ {}-1076.59\\ {}-27916.4\end{array}& \begin{array}{c}4566.836\\ {}55973.33\\ {}-1610.56\end{array}& \begin{array}{c}58981.14\\ {}-35597.5\\ {}-10708.9\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.219743\\ {}5028.765\\ {}-3533.97\end{array}& \begin{array}{c}0.471764\\ {}-2447.13\\ {}649.9386\end{array}& \begin{array}{c}0.170363\\ {}3409.162\\ {}-1161.85\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}7364.745\\ {}-1106.43\\ {}-1.81484\end{array}& \begin{array}{c}996.7621\\ {}2350.329\\ {}0.575917\end{array}& \begin{array}{c}6902.153\\ {}-2800.46\\ {}-0.89859\end{array}\end{array}\end{array}\end{array}\right] $$
$$ {\mathrm{b}}_{\mathrm{o}}=\left[\begin{array}{cc}\begin{array}{c}\begin{array}{c}-3.91722\\ {}12.89984\\ {}-8.53318\end{array}\kern0.5em \begin{array}{c}5.943169\\ {}-26.5249\\ {}30.12196\end{array}\kern0.5em \begin{array}{c}-1.91383\\ {}24.08847\\ {}-9.33007\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-11.5793\\ {}-14.9257\\ {}-1.53236\end{array}& \begin{array}{c}3.409462\\ {}28.79974\\ {}6.915694\end{array}& \begin{array}{c}9.707503\\ {}-20.9951\\ {}-5.04067\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-5280.58\\ {}4441.473\\ {}-2584.63\end{array}& \begin{array}{c}7701.111\\ {}-9096.09\\ {}9570.217\end{array}& \begin{array}{c}-4404.73\\ {}8922.27\\ {}-2800.31\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}0.398172\\ {}-1.93508\\ {}2.499365\end{array}& \begin{array}{c}1.201417\\ {}-1.55252\\ {}4.598442\end{array}& \begin{array}{c}0.188561\\ {}1.906188\\ {}-2.25239\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-3.27551\\ {}2.577603\\ {}0.697694\end{array}& \begin{array}{c}3.481796\\ {}3.05501\\ {}0.610075\end{array}& \begin{array}{c}2.157504\\ {}-2.07794\\ {}-1.96687\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}446.1933\\ {}-712.447\\ {}816.4239\end{array}& \begin{array}{c}1235.091\\ {}-355.831\\ {}1486.094\end{array}& \begin{array}{c}-347.146\\ {}667.5498\\ {}-723.234\end{array}\end{array}\end{array}\\ {}\begin{array}{c}\begin{array}{ccc}\begin{array}{c}1882.871\\ {}-6493.98\\ {}1141.214\end{array}& \begin{array}{c}-2285.82\\ {}\mathrm{12,219.46}\\ {}2626.637\end{array}& \begin{array}{c}9969.335\\ {}-9097.29\\ {}44.77462\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-0.06946\\ {}635.477\\ {}-114.678\end{array}& \begin{array}{c}0.107933\\ {}-1328.3\\ {}328.6332\end{array}& \begin{array}{c}-0.03175\\ {}1177.418\\ {}-126.795\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}150.2845\\ {}-434.718\\ {}-0.0294\end{array}& \begin{array}{c}-168.21\\ {}756.1789\\ {}0.22992\end{array}& \begin{array}{c}1080.819\\ {}-95.5565\\ {}-0.15267\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}-839.542\\ {}1108.605\\ {}274.198\end{array}& \begin{array}{c}1114.976\\ {}1245.054\\ {}272.4091\end{array}& \begin{array}{c}109.2575\\ {}-757.668\\ {}-1823.2\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.007628\\ {}-94.0684\\ {}24.3523\end{array}& \begin{array}{c}0.025871\\ {}-83.4397\\ {}45.6129\end{array}& \begin{array}{c}-0.00051\\ {}93.61422\\ {}-22.0002\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-90.886\\ {}46.5982\\ {}0.025594\end{array}& \begin{array}{c}129.87\\ {}178.6252\\ {}0.015262\end{array}& \begin{array}{c}8.654326\\ {}39.51658\\ {}-0.08096\end{array}\end{array}\end{array}\end{array}\right] $$
$$ {\mathrm{b}}_{\mathrm{g}}=\left[\begin{array}{cc}\begin{array}{c}\begin{array}{c}0.00295\\ {}-0.01194\\ {}0.011461\end{array}\kern0.5em \begin{array}{c}-0.01516\\ {}0.064522\\ {}-0.07434\end{array}\kern0.5em \begin{array}{c}0.00842\\ {}-0.08361\\ {}0.040148\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.014634\\ {}0.013661\\ {}0.002549\end{array}& \begin{array}{c}-0.00969\\ {}-0.07384\\ {}-0.01678\end{array}& \begin{array}{c}-0.02937\\ {}0.08051\\ {}0.018769\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}4.185925\\ {}-3.9599\\ {}3.501068\end{array}& \begin{array}{c}-19.5151\\ {}22.11203\\ {}-23.6131\end{array}& \begin{array}{c}17.2177\\ {}-30.739\\ {}12.23742\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}-0.00067\\ {}0.006711\\ {}-0.00966\end{array}& \begin{array}{c}-0.00233\\ {}0.005558\\ {}-0.01664\end{array}& \begin{array}{c}-0.00031\\ {}-0.00237\\ {}5.17\mathrm{E}-05\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.007456\\ {}-0.00921\\ {}-0.00179\end{array}& \begin{array}{c}-0.00603\\ {}-0.01085\\ {}-0.0021\end{array}& \begin{array}{c}-0.00661\\ {}0.002334\\ {}0.000682\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-0.87069\\ {}2.448072\\ {}-3.18104\end{array}& \begin{array}{c}-2.75093\\ {}1.310461\\ {}-5.34408\end{array}& \begin{array}{c}0.483808\\ {}-0.89485\\ {}0.039186\end{array}\end{array}\end{array}\\ {}\begin{array}{c}\begin{array}{ccc}\begin{array}{c}-0.8383\\ {}5.89965\\ {}-0.30403\end{array}& \begin{array}{c}5.24383\\ {}-31.3031\\ {}-6.16007\end{array}& \begin{array}{c}-32.4893\\ {}34.74476\\ {}0.830269\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}3.45\mathrm{E}-05\\ {}-0.59202\\ {}0.147895\end{array}& \begin{array}{c}-0.00028\\ {}3.225792\\ {}-8.11\mathrm{E}-01\end{array}& \begin{array}{c}0.000131\\ {}-4.08033\\ {}0.519035\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-0.01804\\ {}0.40027\\ {}5.77\mathrm{E}-05\end{array}& \begin{array}{c}0.369355\\ {}-1.91864\\ {}-0.00056\end{array}& \begin{array}{c}-3.47246\\ {}0.677646\\ {}0.000582\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}1.01575\\ {}-3.93974\\ {}-0.58507\end{array}& \begin{array}{c}-1.71787\\ {}-4.46108\\ {}-0.94445\end{array}& \begin{array}{c}-1.30057\\ {}0.88306\\ {}1.040257\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-9.62\mathrm{E}-06\\ {}0.326058\\ {}-9.12\mathrm{E}-02\end{array}& \begin{array}{c}-3.73\mathrm{E}-05\\ {}0.293292\\ {}-1.71\mathrm{E}-01\end{array}& \begin{array}{c}1.34\mathrm{E}-05\\ {}-0.11558\\ {}-3.98\mathrm{E}-03\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.097345\\ {}-0.16528\\ {}-7.45\mathrm{E}-05\end{array}& \begin{array}{c}-0.21098\\ {}-0.55329\\ {}-6.10\mathrm{E}-05\end{array}& \begin{array}{c}-0.16377\\ {}-0.06059\\ {}4.96\mathrm{E}-05\end{array}\end{array}\end{array}\end{array}\right] $$
$$ {\mathrm{b}}_{\mathrm{w}}=\left[\begin{array}{cc}\begin{array}{c}\begin{array}{c}-2.993365431\\ {}-2.964251078\\ {}-17.90377957\end{array}\kern0.5em \begin{array}{c}0.702129\\ {}0.010334\\ {}0.545039\end{array}\kern0.5em \begin{array}{c}0.605118\\ {}0.310069\\ {}0.781682\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-25.6804916\\ {}-13.61059976\\ {}0.051890422\end{array}& \begin{array}{c}0.176114\\ {}0.762349\\ {}0.92728\end{array}& \begin{array}{c}0.860919\\ {}0.185616\\ {}0.259876\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-802.0512528\\ {}-1610.738998\\ {}-5779.778909\end{array}& \begin{array}{c}0.773891\\ {}0.430653\\ {}0.907082\end{array}& \begin{array}{c}0.285287\\ {}0.875233\\ {}0.492885\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}0.038267\\ {}0.155207\\ {}0.3274\end{array}& \begin{array}{c}0.19515\\ {}0.994083\\ {}0.095263\end{array}& \begin{array}{c}0.330682\\ {}0.450239\\ {}0.441683\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.655948\\ {}0.51677\\ {}0.832475\end{array}& \begin{array}{c}0.856538\\ {}0.640152\\ {}0.175126\end{array}& \begin{array}{c}0.27094\\ {}0.868951\\ {}0.879842\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.824397\\ {}0.067641\\ {}0.20714\end{array}& \begin{array}{c}0.173061\\ {}0.339907\\ {}0.025819\end{array}& \begin{array}{c}0.863643\\ {}0.177062\\ {}0.170209\end{array}\end{array}\end{array}\\ {}\begin{array}{c}\begin{array}{ccc}\begin{array}{c}-\mathrm{10,300.81067}\\ {}-5297.440964\\ {}-415.5435951\end{array}& \begin{array}{c}0.784127\\ {}0.076086\\ {}0.417079\end{array}& \begin{array}{c}0.170393\\ {}0.40626\\ {}0.554477\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-0.128342286\\ {}-117.9729736\\ {}-1.77\mathrm{E}+02\end{array}& \begin{array}{c}0.041599\\ {}0.764898\\ {}0.113998\end{array}& \begin{array}{c}0.75928\\ {}0.996463\\ {}0.84042\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}-1259.767197\\ {}-795.6930059\\ {}0.025446028\end{array}& \begin{array}{c}0.288928\\ {}0.309191\\ {}0.23777\end{array}& \begin{array}{c}0.124354\\ {}0.747136\\ {}0.127723\end{array}\end{array}\end{array}& \begin{array}{c}\begin{array}{ccc}\begin{array}{c}0.731294\\ {}0.430213\\ {}0.029752\end{array}& \begin{array}{c}0.246622\\ {}0.659312\\ {}0.866706\end{array}& \begin{array}{c}0.081841\\ {}0.218391\\ {}0.894414\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.324874\\ {}0.265018\\ {}0.337497\end{array}& \begin{array}{c}0.521822\\ {}0.792067\\ {}0.429436\end{array}& \begin{array}{c}0.951888\\ {}0.134609\\ {}0.793779\end{array}\end{array}\\ {}\begin{array}{ccc}\begin{array}{c}0.514081\\ {}0.336661\\ {}0.53412\end{array}& \begin{array}{c}0.387512\\ {}0.883354\\ {}0.056697\end{array}& \begin{array}{c}0.97861\\ {}0.333656\\ {}0.468575\end{array}\end{array}\end{array}\end{array}\right] $$

For that, the proxy models which were developed earlier are used. As all proxy models are linear, for finding the optimal control trajectory, it is better to describe the problem as a linear regulator problem in the following form:

$$ \dot{\mathrm{x}}\left(\mathrm{t}\right)=\mathrm{A}\left(\mathrm{t}\right)\mathrm{x}\left(\mathrm{t}\right)+\mathrm{B}\left(\mathrm{t}\right)\mathrm{u}\left(\mathrm{t}\right) $$
(6)

In the proxy models of this study, A(t) and B(t) are not time-variant, we have:

$$ \mathrm{A}\left(\mathrm{t}\right)=\left[{\mathrm{b}}_{\mathrm{o}}\ {\mathrm{b}}_{\mathrm{g}}\ {\mathrm{b}}_{\mathrm{w}}\right] $$
(7)

In which “A(t)” or “A” is an 18 × 18 matrix.

$$ \mathrm{B}\left(\mathrm{t}\right)={\mathrm{b}}_{\mathrm{ginj}} $$
(8)

Also, “B(t)” or “B” is a 6 × 18 matrix. As/while/where “x(t)” is a 18 × 1 and “u(t)” is a 6 × 1 so, the equation is consistent. In the problem of this paper, x(t0) and x(tf) are unknown. In addition, the total amount of lift gas is limited and equal to 10 MSCF and no negative injection rate is meaningful, so:

Constraints:

$$ \mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\prime }<10 $$
(9)
$$ 0\le \mathrm{u}\left(\mathrm{t}\right)\le 10 $$
(10)

The objective of controlling the injection gas rate is to maximize the total NPV. The NPV function is defined as follows:

$$ {\mathrm{J}}_0={\int}_{{\mathrm{t}}_0}^{{\mathrm{t}}_{\mathrm{f}}}\mathrm{x}\left(\mathrm{t}\right).\mathrm{pr}\left(\mathrm{t}\right)-\mathrm{OPEX}\left(\mathrm{t}\right)\mathrm{dt} $$
(11)

In which pr(t) is the price of oil, gas, and the cost of water treatment, while it is an 18 × 1 matrix of 6 time repetition of oil price, gas price, and water treatment cost. Here, the oil price is assumed 65 USD/BBL, gas price is 3 USD/MSCF, and water treatment cost is 5 USD/BBL. Thus pr(t0) is:

$$ \mathrm{pr}\left({\mathrm{t}}_0\right)=\left[\mathrm{65,65,65,65,65,65,3},3,3,3,3,3,-5,-5,-5,-5,-5,-5\right] $$
(12)

Similarly, the OPEX in the start time is assumed 10,000 USD per month. Both OPEX and price are money and the money value discount during the time. Here, for this purpose, the following equations are defined:

$$ \mathrm{pr}\left(\mathrm{t}\right)=\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right) $$
(13)
$$ \mathrm{OPEX}\left(\mathrm{t}\right)=\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{OPEX}\left({\mathrm{t}}_0\right) $$
(14)

In which r is the discount rate and its value is assumed 0.01 per month. In addition, the problem is solved in time zero to month 20, so t0 = 0 and tf is 20.

Thus, the performance function is as follows:

$$ {\mathrm{J}}_0={\int}_0^{20}\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)-\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{OPEX}\left({\mathrm{t}}_0\right)\ \mathrm{dt} $$
(15)

As the amount of lift gas injection rate and the compressor capacity is constant during the simulation time, the injection rate is not involved in the performance function. The equation can be separated into two other equations as follows:

$$ {\mathrm{J}}_0={\int}_0^{20}\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)\mathrm{dt}-{\int}_0^{20}\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{OPEX}\left({\mathrm{t}}_0\right)\ \mathrm{dt} $$
(16)
$$ {\int}_0^{20}\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{OPEX}\left({\mathrm{t}}_0\right)\ \mathrm{dt}={\int}_0^{20}\frac{1}{{\left(1+0.01\right)}^{\mathrm{t}}}\ 100\ 000\ \mathrm{dt}=1813600\kern0.5em $$
(17)
$$ {\mathrm{J}}_0={\int}_0^{20}\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)\mathrm{dt}-1813600 $$
(18)

As the purpose of the optimal control is to maximize J, thus, a constant value does not affect, and it should be emphasized that this is because the value of J is not important; its extreme is important. So J can be reduced as follows: (J0 is equivalent to J and introduced to prevent the mistakes. Also, a negative sign is given to the equation because the calculation minimizes the equation.

$$ \mathrm{J}={\int}_0^{20}-\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)\mathrm{dt} $$
(19)

In addition, it should be emphasized that the control trajectory of this study has some limitations which will be explained in the following equations.

$$ \mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\prime }<10 $$
(20)
$$ 0\le \mathrm{u}\left(\mathrm{t}\right)\le 10 $$
(21)

As mentioned, the total amount of lift gas is limited and this can be applied in performance function by adding a new term to that.

$$ \mathrm{J}={\int}_0^{20}\left(-\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)+\mathrm{f}\left(\mathrm{u}\left(\mathrm{t}\right)\right)\right)\mathrm{dt} $$
(22)

f(u(t)) is a function of u(t), in which as the summation of injection gas or u is smaller than the maximum available lift gas; it has a small and almost fixed value, but as the total summation of u exceeds the maximum available lift gas, and its value becomes huge, and thus, it falls off the optimum point. For this purpose, exponential functions can be useful. Here, f is defined below:

$$ \mathrm{f}\left(\mathrm{u}\left(\mathrm{t}\right)\right)={\mathrm{e}}^{10^4\ \left(\mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\mathrm{T}}-10\right)} $$
(23)

The value of 104 is found by the trial and error method. The value of f(u(t)) for 9.99 is 3.72 × 10−44 which is small enough and has an ignorable effect on the performance function value and for the values smaller than 9.99, the value of f(u(t)) decreases. In addition, for 10.01, the value of f(u(t)) is 2.69 × 1043 which is large enough to increase the value of the performance function as large as it cannot be accepted as the optimum point.

In which:

$$ \mathrm{g}\left(\mathrm{x}\left(\mathrm{t}\right)\right)=-\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)+\mathrm{f}\left(\mathrm{u}\left(\mathrm{t}\right)\right) $$
(24)

Now, the Hamiltonian equation should be developed. The general form of the Hamiltonian is as follows.

Hamiltonian:

$$ \mathrm{H}\left(\mathrm{x}\left(\mathrm{t}\right),\mathrm{u}\left(\mathrm{t}\right),\mathrm{p}\left(\mathrm{t}\right),\mathrm{t}\right)=\mathrm{g}\left(\mathrm{x}\left(\mathrm{t}\right),\mathrm{u}\left(\mathrm{t}\right),\mathrm{t}\right)+{\mathrm{p}}^{\mathrm{T}}\left(\mathrm{t}\right)\left[\mathrm{a}\left(\mathrm{x}\left(\mathrm{t}\right),\mathrm{u}\left(\mathrm{t}\right),\mathrm{t}\right)\right]+\mathrm{f}\left(\mathrm{u}\left(\mathrm{t}\right)\right) $$
(25)

By substituting equations and in equation:

$$ \mathrm{H}\left(\mathrm{x}\left(\mathrm{t}\right),\mathrm{u}\left(\mathrm{t}\right),\mathrm{p}\left(\mathrm{t}\right),\mathrm{t}\right)=-\mathrm{x}\left(\mathrm{t}\right).\frac{1}{{\left(1+\mathrm{r}\right)}^{\mathrm{t}}}\ \mathrm{pr}\left({\mathrm{t}}_0\right)+{\mathrm{p}}^{\mathrm{T}}\left(\mathrm{t}\right)\left[\mathrm{A}.\mathrm{x}\left(\mathrm{t}\right)+\mathrm{B}.\mathrm{u}\left(\mathrm{t}\right)\right]+{\mathrm{e}}^{10^4\ \left(\mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\mathrm{T}}-10\right)} $$
(26)

In which r, pr(t0), A, and B are known.

By simplifying and inserting equations in it, it will result in:

$$ {\displaystyle \begin{array}{c}\begin{array}{c}\mathrm{H}=\frac{-1}{(1.01)^{\mathrm{t}}}\left(65{\mathrm{q}}_{\mathrm{o}1}+\cdots +65{\mathrm{q}}_{\mathrm{o}6}+3{\mathrm{q}}_{\mathrm{g}1}+\cdots +3{\mathrm{q}}_{\mathrm{g}6}-5{\mathrm{q}}_{\mathrm{w}1}-{}_{\cdots }-5{\mathrm{q}}_{\mathrm{w}6}\right)\\ {}+\sum \limits_{\mathrm{i}=1}^{18}\left[{\mathrm{p}}_{\mathrm{i}}\cdot \left({\mathrm{b}}_{\mathrm{o}\mathrm{i}1}{\mathrm{q}}_{\mathrm{o}1}+\cdots +{\mathrm{b}}_{\mathrm{o}\mathrm{i}6}{\mathrm{q}}_{\mathrm{o}6}+{\mathrm{b}}_{\mathrm{g}\mathrm{i}1}{\mathrm{q}}_{\mathrm{g}1}+\cdots {\mathrm{b}}_{\mathrm{g}\mathrm{i}6}{\mathrm{q}}_{\mathrm{g}6}+{\mathrm{b}}_{\mathrm{w}\mathrm{i}1}{\mathrm{q}}_{\mathrm{w}1}\right.\right.\end{array}\\ {}\left.\left.+\cdots +{\mathrm{b}}_{\mathrm{w}\mathrm{i}6}{\mathrm{q}}_{\mathrm{w}\mathrm{i}6}+{\mathrm{b}}_{\mathrm{g}\mathrm{i}\mathrm{nj}\mathrm{i}1}{\mathrm{q}}_{\mathrm{g}\mathrm{i}\mathrm{nj}1}+\cdots +{\mathrm{b}}_{\mathrm{g}\mathrm{i}\mathrm{nj}\mathrm{i}6}{\mathrm{q}}_{\mathrm{g}\mathrm{i}\mathrm{nj}6}\right)\right]\\ {}+{\mathrm{e}}^{10^4\left(\mathrm{u}\left(\mathrm{t}\right).{\left[111111\right]}^{\mathrm{T}}-10\right)}\end{array}} $$
(27)

Now, the state, co-state, and Pontryagin equations should be formed and then they will be solved. First, the condition is ignored.

State, co-state, and Pontryagin equations are as follows:

$$ {\dot{\mathrm{x}}}^{\ast}\left(\mathrm{t}\right)=\frac{\mathrm{\partial H}}{\mathrm{\partial p}}\left({\mathrm{x}}^{\ast}\left(\mathrm{t}\right),{\mathrm{u}}^{\ast}\left(\mathrm{t}\right),{\mathrm{p}}^{\ast}\left(\mathrm{t}\right),\mathrm{t}\right) $$
(28)
$$ {\dot{\mathrm{p}}}^{\ast}\left(\mathrm{t}\right)=-\frac{\mathrm{\partial H}}{\mathrm{\partial x}}\left({\mathrm{x}}^{\ast}\left(\mathrm{t}\right),{\mathrm{u}}^{\ast}\left(\mathrm{t}\right),{\mathrm{p}}^{\ast}\left(\mathrm{t}\right),\mathrm{t}\right) $$
(29)
$$ \frac{\mathrm{\partial H}}{\mathrm{\partial u}}\left({\mathrm{x}}^{\ast}\left(\mathrm{t}\right),{\mathrm{u}}^{\ast}\left(\mathrm{t}\right),{\mathrm{p}}^{\ast}\left(\mathrm{t}\right),\mathrm{t}\right)=0 $$
(30)

State equations:

State equation results in a matrix form of all first 18 state equations.

Co-state equations:

For finding the equation of these forms, differentiation is required and finally, a set of equations in the following form are developed. For example, for p1, it is:

$$ {\dot{\mathrm{p}}}_1=65+\left({\mathrm{b}}_{\mathrm{oi}1}+{\mathrm{b}}_{\mathrm{oi}2}+\dots +{\mathrm{b}}_{\mathrm{oi}18}\right)\ {\mathrm{p}}_1 $$
(31)

For other p, there are similar equations in which the whole set of equations can be summarized in the following form:

$$ \dot{\mathrm{p}}=\mathrm{C}.\mathrm{D}-\mathrm{Ep} $$
(32)

In which:

$$ \dot{\mathrm{p}}={\left[{\dot{\mathrm{p}}}_1,\dots, {\dot{\mathrm{p}}}_{18}\right]}^{\mathrm{T}} $$
(33)
$$ C=\left[\begin{array}{cccccccccccccccccc}-65& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& -65& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& -65& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& -65& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& -65& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& -65& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& -3& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& -3& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& -3& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& -3& 0& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& -3& 0& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& -3& 0& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 5& 0& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 5& 0& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 5& 0& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 5& 0& 0\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 5& \begin{array}{c}0\\ {}0\end{array}\\ {}0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 5\end{array}\right] $$
(34)
$$ \mathrm{D}={\left[1,\dots, 1\right]}^{\mathrm{T}}\kern1.5em \mathrm{size}:1\times 18 $$
(35)
$$ \mathrm{E}=\left[\begin{array}{ccc}{\mathrm{b}}_{1,7}& \dots & {\mathrm{b}}_{1,24}\\ {}:& \dots & :\\ {}{\mathrm{b}}_{18,1}& \dots & {\mathrm{b}}_{18,24}\end{array}\right]\kern2.75em \mathrm{size}:18\times 18 $$
(36)
$$ \mathrm{p}={\left[{\mathrm{p}}_1,\dots, {\mathrm{p}}_{18}\right]}^{\mathrm{T}}\kern1.25em \mathrm{size}:1\times 18 $$
(37)

By substituting values in E, there is:

$$ \mathrm{E}=\left[{\mathrm{E}}_1,{\mathrm{E}}_2,{\mathrm{E}}_3\right] $$
(38)

In which E1 to E3 are:

$$ {E}_1=\left[\begin{array}{cccccc}-3.91722& 12.89984& -8.53318& -11.5793& -14.9257& -1.53236\\ {}5.943169& -26.5249& 30.12196& 3.409462& 28.79974& 6.915694\\ {}-1.91383& 24.08847& -9.33007& 9.707503& -20.9951& -5.04067\\ {}0.398172& -1.93508& 2.499365& -3.27551& 2.577603& 0.697694\\ {}1.201417& -1.55252& 4.598442& 3.481796& 3.05501& 0.610075\\ {}0.188561& 1.906188& -2.25239& 2.157504& -2.07794& -1.96687\\ {}0.00295& -0.01194& 0.011461& 0.014634& 0.013661& 0.002549\\ {}-0.01516& 0.064522& -0.07434& -0.00969& -0.07384& -0.01678\\ {}0.00842& -0.08361& 0.040148& -0.02937& 0.08051& 0.018769\\ {}-0.00067& 0.006711& -0.00966& 0.007456& -0.00921& -0.00179\\ {}-0.00233& 0.005558& -0.01664& -0.00603& -0.01085& -0.0021\\ {}-0.00031& -0.00237& 5.17\mathrm{E}-05& -0.00661& 0.002334& 0.000682\\ {}-2.99337& -2.96425& -17.9038& -25.6805& -13.6106& 0.05189\\ {}0.702129& 0.010334& 0.545039& 0.176114& 0.762349& 0.92728\\ {}0.605118& 0.310069& 0.781682& 0.860919& 0.185616& 0.259876\\ {}0.038267& 0.155207& 0.3274& 0.655948& 0.51677& 0.832475\\ {}0.19515& 0.994083& 0.095263& 0.856538& 0.640152& 0.175126\\ {}0.330682& 0.450239& 0.441683& 0.27094& 0.868951& 0.879842\end{array}\right] $$
(39)
$$ {E}_2=\left[\begin{array}{cccccc}-5280.58& 4441.473& -2584.63& 1882.871& -6493.98& 1141.214\\ {}7701.111& -9096.09& 9570.217& -2285.82& 12219.46& 2626.637\\ {}-4404.73& 8922.27& -2800.31& 9969.335& -9097.29& 44.77462\\ {}446.1933& -712.447& 816.4239& -839.542& 1108.605& 274.198\\ {}1235.091& -355.831& 1486.094& 1114.976& 1245.054& 272.4091\\ {}-347.146& 667.5498& -723.234& 109.2575& -757.668& -1823.2\\ {}4.185925& -3.9599& 3.501068& -0.8383& 5.89965& -0.30403\\ {}-19.5151& 22.11203& -23.6131& 5.24383& -31.3031& -6.16007\\ {}17.2177& -30.739& 12.23742& -32.4893& 34.74476& 0.830269\\ {}-0.87069& 2.448072& -3.18104& 1.01575& -3.93974& -0.58507\\ {}-2.75093& 1.310461& -5.34408& -1.71787& -4.46108& -0.94445\\ {}0.483808& -0.89485& 0.039186& -1.30057& 0.88306& 1.040257\\ {}-802.051& -1610.74& -5779.78& -10300.8& -5297.44& -415.544\\ {}0.773891& 0.430653& 0.907082& 0.784127& 0.076086& 0.417079\\ {}0.285287& 0.875233& 0.492885& 0.170393& 0.40626& 0.554477\\ {}0.824397& 0.067641& 0.20714& 0.731294& 0.430213& 0.029752\\ {}0.173061& 0.339907& 0.025819& 0.246622& 0.659312& 0.866706\\ {}0.863643& 0.177062& 0.170209& 0.081841& 0.218391& 0.894414\end{array}\right] $$
(40)
$$ {E}_3=(0.1)\left[\begin{array}{cccccc}-0.06946& 635.477& -114.678& 150.2845& -434.718& -0.0294\\ {}0.107933& -1328.3& 328.6332& -168.21& 756.1789& 0.22992\\ {}-0.03175& 1177.418& -126.795& 1080.819& -95.5565& -0.15267\\ {}0.007628& -94.0684& 24.3523& -90.886& 46.5982& 0.025594\\ {}0.025871& -83.4397& 45.6129& 129.87& 178.6252& 0.015262\\ {}-0.00051& 93.61422& -22.0002& 8.654326& 39.51658& -0.08096\\ {}3.45\mathrm{E}-05& -0.59202& 0.147895& -0.01804& 0.40027& 5.77\mathrm{E}-05\\ {}-0.00028& 3.225792& -8.11\mathrm{E}-01& 0.369355& -1.91864& -0.00056\\ {}0.000131& -4.08033& 0.519035& -3.47246& 0.677646& 0.000582\\ {}-9.62\mathrm{E}-06& 0.326058& -9.12\mathrm{E}-02& 0.097345& -0.16528& -7.45\mathrm{E}-05\\ {}-3.73\mathrm{E}-05& 0.293292& -1.71\mathrm{E}-01& -0.21098& -0.55329& -6.10\mathrm{E}-05\\ {}1.34\mathrm{E}-05& -0.11558& -3.98\mathrm{E}-03& -0.16377& -0.06059& 4.96\mathrm{E}-05\\ {}-0.12834& -117.973& -1.77\mathrm{E}+02& -1259.77& -795.693& 0.025446\\ {}0.041599& 0.764898& 0.113998& 0.288928& 0.309191& 0.23777\\ {}0.75928& 0.996463& 0.84042& 0.124354& 0.747136& 0.127723\\ {}0.324874& 0.265018& 0.337497& 0.514081& 0.336661& 0.53412\\ {}0.521822& 0.792067& 0.429436& 0.387512& 0.883354& 0.056697\\ {}0.951888& 0.134609& 0.793779& 0.97861& 0.333656& 0.468575\end{array}\right] $$
(41)

Algebraic equation (Pontryagin method):

$$ \frac{\mathrm{H}}{\mathrm{\partial u}}\left({\mathrm{x}}^{\ast}\left(\mathrm{t}\right),{\mathrm{u}}^{\ast}\left(\mathrm{t}\right),{\mathrm{p}}^{\ast}\left(\mathrm{t}\right),\mathrm{t}\right)=0 $$
(42)

In which it will result in:

$$ \mathrm{F}.\mathrm{p}+{10}^4{\mathrm{e}}^{10^4\ \left(\mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\mathrm{T}}-10\right)}=0 $$
(43)

And F is:

$$ \mathrm{F}=\left[\begin{array}{ccc}{\mathrm{b}}_{\mathrm{ginj}1,1}& \dots & {\mathrm{b}}_{\mathrm{ginj}18,1}\\ {}:& \dots & :\\ {}{\mathrm{b}}_{\mathrm{ginj}1,6}& \dots & {\mathrm{b}}_{\mathrm{ginj}18,6}\end{array}\right] $$
(44)

By substituting the values of binj, it will result in :

$$ \mathrm{F}=\left[{\mathrm{F}}_1,{\mathrm{F}}_2{\mathrm{F}}_3\right] $$
(45)
$$ {F}_1=\left[\begin{array}{cccccc}19.51869& 77.90273& -128.864& 109.7704& -44.6052& 18.63184\\ {}63.99556& 133.3043& -432.835& 68.12849& -27.6772& -38.2472\\ {}-43.6708& 52.13013& -49.3166& -157.979& -168.19& -47.0328\\ {}-5.74883& 98.12983& -312.155& 144.0481& 7.59055& -54.1682\\ {}35.95253& -54.9185& 56.22917& 22.23096& 127.9731& 10.14346\\ {}9.092735& 69.70845& -104.394& 141.8283& -79.2866& -26.1613\end{array}\right] $$
(46)
$$ {F}_2=\left[\begin{array}{cccccc}5475.533& 24189.97& -40945.5& 44214.27& -20817.3& 21421.14\\ {}44134.73& 32682.59& -137149& 56303.33& -12549.7& -12178.5\\ {}-46529.7& 25692.67& -14317.7& -47109.7& -70534.9& -25986\\ {}-24590.6& 22380.04& -99272.1& 76072.82& -1076.59& -27916.4\\ {}43149.59& -24794.2& 17038.02& 4566.836& 55973.33& -1610.56\\ {}-4371.01& 21343.64& -33375.7& 58981.14& -35597.5& -10708.9\end{array}\right] $$
(47)
$$ {F}_3=\left[\begin{array}{cccccc}0.75099& 3945.394& -1430.34& 4685.601& -822.303& 0.377439\\ {}2.737366& 6905.261& -4924.41& 5191.368& -754.013& -1.1793\\ {}-0.45077& 2246.148& -620.212& -6819.2& -3183.02& -1.56708\\ {}0.219743& 5028.765& -3533.97& 7364.745& -1106.43& -1.81484\\ {}0.471764& -2447.13& 649.9386& 996.7621& 2350.329& 0.575917\\ {}0.170363& 3409.162& -1161.85& 6902.153& -2800.46& -0.89859\end{array}\right] $$
(48)

Now, there are 42 linear equations, 18 from equation, 18 from equation and 6 from equation.

From equation, it results in:

$$ \mathrm{F}.\mathrm{p}=\mathrm{G} $$
(49)

In which G is:

$$ {\left[-{10}^4{\mathrm{e}}^{10^4\ \left(\mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\mathrm{T}}-10\right)},\dots, -{10}^4{\mathrm{e}}^{10^4\ \left(\mathrm{u}\left(\mathrm{t}\right).{\left[1\ 1\ 1\ 1\ 1\ 1\right]}^{\mathrm{T}}-10\right)}\right]}^{\mathrm{T}}18\times 1 $$
(50)

If the total amount of lift gas is less than 10 (assumed total amount of lift gas), each term of the G is very near to 0. For example, if it is 9.99, each term of G will be 3.7E−40. If it is a little more than 10, each term of G will be very negative, for example, 10.01 each term of G is − 2.7E−47. Thus, the algebraic equation is not sensitive to the value of a specific u but the summation of all terms of u.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Mahdiani, M.R., Khamehchi, E. & Suratgar, A.A. Using linear–quadratic regulator to optimally control the gas lift operation. Arab J Geosci 14, 147 (2021). https://doi.org/10.1007/s12517-020-06367-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s12517-020-06367-7

Keywords

Navigation