Abstract:
A method for removing calcium, iron, other metals, and amines from crude oil in a refinery desalting process includes the steps of: running a plurality of tests to determine at least one statistically significant processing characteristic of the refinery desalting process; adding a wash water to the crude oil; adding the wash water to the crude oil to create an emulsion; adding to the wash water, the crude oil or the emulsion an acid additive consisting of at least one of the following: oxalic acid, citric acid, water-soluble hydroxyacid selected from the group consisting of glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof; resolving the emulsion containing the acid additive into a hydrocarbon phase and an aqueous phase; and adjusting a control setting of the processing characteristic as a function of the tests.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to a method and device for determining the statistically optimal desalter parameter settings for removing metals, amines and other contaminants from crude oil at minimum cost via electrostatic coalescence. 
       BACKGROUND INFORMATION 
       [0002]    U.S. Pat. No. 4,853,109 discloses a method for removing metal contaminants, particularly iron and non-porphyrin, organically-bound iron components from crude petroleum. This process comprises mixing crude oil with an aqueous solution of hydroxo-carboxylic acids or salts thereof, preferably citric acid, and separating the aqueous solution and metals from the crude. 
         [0003]    U.S. Pat. No. 5,078,858 discloses a method for extracting iron species from crude oil by directly adding oxalic or citric acid to the crude oil feedstock, mixing the acid and oil, then adding wash water to form a water in oil emulsion. The emulsion is resolved separating the aqueous solution and metals from the crude. 
         [0004]    U.S. Pat. No. 7,497,943 discloses a method for transferring metals and/or amines from a hydrocarbon phase to a water phase in an oil refinery desalting process. The method consists of adding to a wash water an effective amount of a composition comprising certain water-soluble hydroxyacids to transfer metals and/or amines from a hydrocarbon phase to a water phase. The water-soluble hydroxyacid is selected from the group consisting of glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxyacids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof. The pH of the wash water is lowered to 6 or below, before, during and/or after adding the composition and the wash water is added to crude oil to create an emulsion. Finally, the emulsion is resolved into the hydrocarbon phase and an aqueous phase using electrostatic coalescence, where at least a portion of the metals and/or amines are transferred to the aqueous phase. 
         [0005]    Optimum Temperature in the Electrostatic Desalting of Maya Crude Oil by Pruneda et al published in the 2005 Journal of the Mexican Chemical Society discloses a simulation model which suggests that there is an optimum temperature to maximize economic benefit when desalting heavy crude oil. As indicated in the art, an increase in process temperature has two effects to be considered. First, as temperature is increased, there is a corresponding decrease in oil density and viscosity which implies a significant increase in the settling rate of water droplets within the oil phase thus allowing a greater amount of oil to be processed resulting in an increase in profit from performing oil desalting. However, crude oil conductivity increases exponentially with temperature which implies a higher rate of electrical power consumption during electrostatic coalescence which increases processing expense. 
         [0006]    Basic Statistics by Kiemele et al published in 1991 discloses basic statistical hypothesis testing techniques and statistical design techniques. In the techniques outlined by Kiemele et al, all decision-making operations are made by a human operator. 
         [0007]    U.S. Pat. No. 4,853,109, U.S. Pat. No. 5,078,858, U.S. Pat. No. 7,497,943, Optimum Temperature in the Electrostatic Desalting of Maya Crude Oil by Pruneda et al, and Basic Statistics by Kiemele et al are hereby incorporated by reference herein. 
       SUMMARY OF THE INVENTION 
       [0008]    The present invention provides a method for removing calcium, iron, other metals, and amines from crude oil in a refinery desalting process includes the steps of: running a plurality of tests to determine at least one statistically significant processing characteristic of the refinery desalting process; adding a wash water to the crude oil; adding the wash water to the crude oil to create an emulsion; adding to the wash water, the crude oil or the emulsion an acid additive consisting of at least one of the following: oxalic acid, citric acid, water-soluble hydroxyacid selected from the group consisting of glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof; resolving the emulsion containing the acid additive into a hydrocarbon phase and an aqueous phase; and adjusting a control setting of the processing characteristic as a function of the tests. 
         [0009]    The present invention also provides a method for improving a refinery desalting process comprising the steps of: providing a range of values for at least one candidate variable representing a desalting process characteristic; performing a statistical calculation to determine at least one statistically significant candidate variable of the at least one candidate variable which is statistically significant for improving the refinery desalting process; and adjusting a control setting of the desalting process as a function of the statistical calculation. 
         [0010]    An oil refinery, desalter and laboratory equipment are also provided. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0011]      FIG. 1  shows a block diagram of a typical single stage crude oil electrostatic desalting mechanism according to one embodiment of the present invention; 
           [0012]      FIG. 2  shows a block diagram of a typical first stage dehydration followed by a second stage electrostatic desalting mechanism according to one embodiment of the present invention; 
           [0013]      FIG. 3  shows a block diagram of a typical two stage electrostatic desalting mechanism according to one embodiment of the present invention; 
           [0014]      FIG. 4  shows an algorithm diagram for a multiple variable, two-level statistical quantification and estimation of performance for a given crude oil desalter according to one embodiment of the present invention; 
           [0015]      FIG. 5  shows a diagram of one embodiment of the method of the present invention for a typical crude oil desalting operation. 
       
    
    
     DETAILED DESCRIPTION 
       [0016]      FIG. 1  shows a diagram of a single stage crude oil electrostatic desalting mechanism  1000  of the present invention. 
         [0017]    The desalting mechanism  1000  of the present invention includes a crude oil supply  10  for storing crude oil. The crude oil supply  10  is connected to a controllable pump  70  which is connected to an optional controllable fluid mixer  80 . The optional controllable fluid mixer  80  allows an emulsion of crude oil  10 , wash water  20 , and acid additive  30  to be created prior to heating based upon the specific characteristics of the crude oil supply  10  to be desalted. The optional controllable fluid mixer  80 , if necessary to process the crude oil supply  10 , is controlled by the controller  110  to create and maintain the proper emulsion mix of crude oil  10 , wash water  20 , and acid additive  30 . 
         [0018]    Following either the controllable pump  70  or the optional controllable fluid mixer  80  is a controllable flow control valve (FCV)  120 . The controllable flow control valve  120  and the controllable pump  70  work in conjunction under command of the controller  110  to control and maintain the crude oil feed rate and pressure. The crude oil  10  or crude oil emulsion created via optional controllable fluid mixer  80  is then heated to a desired processing temperature by the heater  130  which is controlled by controller  110 . 
         [0019]    The desalting mechanism  1000  of the present invention also includes a wash water supply  20  and an acid additive supply  30 . In the embodiment of  FIG. 1 , as is preferred, the acid additive  30  is mixed with the wash water  20  by the controllable fluid mixer  40  before the crude oil/wash water emulsion is formed. Alternatively, the acid additive  30  could be mixed with the wash water  20  and crude oil  10  during the emulsion creation or after water-oil emulsion creation or with the crude oil  10 . The fluid mixer  40  is controlled by the controller  110  to create and maintain the proper solution mixture of acid additive  30  and wash water  20 . The acid additive  30  can be selected from the group consisting of oxalic acid, citric acid, glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof. 
         [0020]    After mixing the solution of acid additive  30  and wash water  20  with the controllable fluid mixer  40 , the resulting solution is input to a controllable flow control valve  90  which is used to allow samples of the mixed acid additive  30  and wash water  20  solution to be measured at a measurement station  200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, and percentage of acid additive  30  to wash water  20 . This information is sent to the controller  110 . 
         [0021]    After mixing the solution of acid additive  30  and wash water  20  with the controllable fluid mixer  40 , the resulting solution is also input to a controllable pump  50  whose output is connected to a controllable flow control valve  60 . The controllable pump  50  and the flow control valve  60  work in conjunction under the command of the controller  110  to control and maintain the wash water/acid solution feed rate and pressure. In the embodiment of  FIG. 1 , the controllable flow control valve  60  is shown to be a three-way valve to allow for emulsion creation with the crude oil supply  10  via the optional controllable fluid mixer  80 , the optional controllable fluid mixer  140 , or both. Like the optional controllable fluid mixer  80 , the optional controllable fluid mixer  140 , if necessary to process the crude oil supply  10 , is controlled by the controller  110  to create and maintain the proper emulsion mix of crude oil  10 , wash water  20 , and acid additive  30 . The controllable flow control valve  60  also allows for the acid additive  30  and wash water  20  solution to be presented to the optional controllable fluid mixer  80  and optional controllable fluid mixer  140  at the same or different flow rates when both mixer devices are used in the desalting process. 
         [0022]    Following the optional controllable fluid mixer  140 , the emulsion passes through a pressure control valve  160  before entering the electrostatic desalter  170 . The electrostatic desalter  170  includes a liquid level sensor (LS)  210  used to measure the aqueous level in the electrostatic desalter  170 . In the embodiment of  FIG. 1 , the measurement output of the liquid level sensor  210  is routed to the controller  110 . The controller  110  uses the liquid level measurement data to control the controllable flow control valve  220  to drain the effluent from the electrostatic desalter  170  and control the aqueous layer and emulsion layer within the electrostatic desalter  170 . Alternatively, the liquid level sensor  210  output may be directly connected to a level control valve instead of the controllable flow control valve  220  to drain the effluent. The controllable flow control valve  220  is also configured to allow samples of the effluent solution to be measured at a measurement station  200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, temperature, and amount of residual oil present in the effluent. This information is sent to the controller  110 . 
         [0023]    The electrical power supply  150  provides the voltage necessary to create the electric field necessary for electrostatic coalescence in the electrostatic desalter  170 . The controller  110  controls the electrical power supply  150  output. The electrical power supply  150  output may be static (i.e. constant voltage with a current limit) or, preferably, able to change key parameters to enhance the desalting operation. The electrical power supply  150  under the control of the controller  110  would preferably be able to alter its&#39; output to include but not be limited to changes in the voltage level applied to the electrostatic desalter  170 , the voltage waveform applied to the electrostatic desalter  170 , current limits (if any) on the electrical power supply  150 , or any combination thereof. 
         [0024]    The desalted crude output of the electrostatic desalter  170  passes through a pressure control valve  180  and a controllable flow control valve  190 . The controllable flow control valve  190  has two outputs to direct the desalted crude oil. Under control of the controller  110 , the controllable flow control valve  190  controls and maintains the flow rate of desalted crude oil to the remaining refinery operations. Additionally, under control of the controller  110 , the controllable flow control valve  190  can also direct samples of the desalted crude to the measurement station  200 . Measurements made on the solution samples would include but not be limited to impurity levels, temperature, residual acid additive  30  and wash water  20  solution, etc. This information is sent to the controller  110 . 
         [0025]    The controller  110  can adjust various parameters of the desalting operation including but not limited to the following: 
         [0026]    The crude oil supply  10  feed rate through the controllable pump  70  and controllable flow control valve  120   
         [0027]    The temperature of the crude oil supply  10  or, optionally, the emulsion created by mixing the crude oil supply  10  with a solution comprising the acid additive  30  and/or wash water  20  through the controllable heater  130 . 
         [0028]    The solution mixture of acid additive  30  and wash water  20  through the controllable fluid mixer  40 . 
         [0029]    The flow rate of the solution mixture of acid additive  30  and wash water  20  through the controllable pump  50  and controllable flow control valve  60 . 
         [0030]    The emulsion formation through optional controllable fluid mixer  80  and/or optional controllable fluid mixer  140 . 
         [0031]    The electrostatic desalter  170  electric field through the controllable electrical power supply  150 . 
         [0032]    Control of the electrostatic desalter water level and emulsion layers through the liquid level sensor  210 , the controllable flow control valve  220 , and the controllable flow control valve  190 . 
         [0033]    As different tests are conducted with the desalting mechanism  1000 , the parameters are adjusted per the test matrix and the selected product measurements are made after desalting the crude oil supply  10 . The memory/data storage  100  function of the desalting mechanism  1000  allows the controller to access and update, if required, the control settings required to conduct the test matrix tests and store the measured data. 
         [0034]      FIG. 2  shows a diagram of a typical first stage dehydration followed by a second stage electrostatic desalting mechanism  2000  of the present invention. 
         [0035]    The desalting mechanism  2000  of the present invention includes a crude oil supply  2010  for storing crude oil. The crude oil supply  2010  is connected to a controllable pump  2070  whose output is connected to a controllable flow control valve (FCV)  2120 . The controllable flow control valve  2120  and the controllable pump  2070  work in conjunction under command of the controller  2110  to control and maintain the crude oil feed rate and pressure. The crude oil  2010  is then heated to a desired processing temperature by the heater  2130  which is controlled by controller  2110 . In the embodiment of  FIG. 2 , the heated crude oil passes through a pressure control valve  2160  before entering the dehydration mechanism  2310 . The dehydration mechanism  2310  is designed to remove high salinity water from the crude oil supply  2010 . The dehydration process relies on establishing a varying high voltage electric field in the oil phase of the dehydration mechanism  2310 . Due to the action of the imposed electric field, the droplets are agitated causing the drops to coalesce into droplets of sufficient size to migrate via gravity to the lower water phase of the dehydration mechanism  2310 . The dehydration mechanism  2310  includes a liquid level sensor (LS)  2340  used to measure the water level in the dehydration mechanism  2310 . In the embodiment of  FIG. 2 , the measurement output of the liquid level sensor  2340  is routed to the controller  2110 . The controller  2110  uses the liquid level measurement data to control the controllable flow control valve  2330  to drain the waste water from the dehydration mechanism  2310  and control the water layer and oil layer within the dehydration mechanism  2310 . Alternatively, the liquid level sensor  2340  output may be directly connected to a level control valve instead of the controllable flow control valve  2330  to drain the waste water. The controllable flow control valve  2330  is also configured to allow samples of the effluent solution to be measured at a measurement station  2200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, temperature, and amount of residual oil present in the waste water. This information is sent to the controller  2110 . 
         [0036]    The electrical power supply  2300  provides the voltage necessary to create the electric field necessary for water coalescence in the dehydration mechanism  2310 . The controller  2110  controls the electrical power supply  2300  output. The electrical power supply  2300  output may be static (i.e. constant voltage with a current limit) or, preferably, able to change key parameters to enhance the dehydration operation. The electrical power supply  2300  under the control of the controller  2110  would preferably be able to alter its&#39; output to include but not be limited to changes in the voltage level applied to the dehydration mechanism  2310 , the voltage waveform applied to the dehydrator, current limits (if any) on the electrical power supply  2300 , or any combination thereof. 
         [0037]    The crude output of the dehydration mechanism  2310  passes through a pressure control valve  2320  on its way to the controllable fluid mixer  2350 . The controllable fluid mixer  2350  allows an emulsion of crude oil  2010 , wash water  2020 , and acid additive  2030  to be created based upon the specific characteristics of the crude oil supply  2010  to be desalted. The controllable fluid mixer  2350  is controlled by the controller  2110  to create and maintain the proper emulsion mix of crude oil  2010 , wash water  2020 , and acid additive  2030 . 
         [0038]    The desalting mechanism  2000  of the present invention also includes a wash water supply  2020  and a acid additive supply  2030 . In the embodiment of  FIG. 2 , as is preferred, the acid additive  2030  is mixed with the wash water  2020  by the controllable fluid mixer  2040  before the crude oil/wash water emulsion is formed. Alternatively, the acid additive  2030  could be mixed with the wash water  2020  and crude oil  2010  during the emulsion creation or after emulsion creation or with the crude oil  2010  itself. The fluid mixer  2040  is controlled by the controller  2110  to create and maintain the proper solution mixture of acid additive  2030  and wash water  2020 . The acid additive  2030  can be selected from the group consisting of oxalic acid, citric acid, glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof. 
         [0039]    After mixing the solution of acid additive  2030  and wash water  2020  with the controllable fluid mixer  2040 , the resulting solution is input to a controllable flow control valve  2090  which is used to allow samples of the mixed acid additive  2030  and wash water  2020  solution to be measured at a measurement station  2200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, and percentage of acid additive  2030  to wash water  2020 . This information is sent to the controller  2110 . 
         [0040]    After mixing the solution of acid additive  2030  and wash water  2020  with the controllable fluid mixer  2040 , the resulting solution is also input to a controllable pump  2050  whose output is connected to a controllable flow control valve  2060 . The controllable pump  2050  and the flow control valve  2060  work in conjunction under the command of the controller  2110  to control and maintain the wash water/acid solution feed rate and pressure. The output of the flow control valve  2060  is an input to the controllable fluid mixer  2350  where the emulsion of crude oil  2010 , wash water  2020 , and acid additive  2030  is formed. 
         [0041]    After mixing the crude oil  2010 , acid additive  2030 , and wash water  2020  in the controllable fluid mixer  2350 , the resulting emulsion passes through a controllable flow control valve  2360  before entering the electrostatic desalter  2170 . The controllable flow control valve  2360 , under command of the controller  2110 , controls the flow rate of the crude oil emulsion into the electrostatic desalter  2170  as well as allowing samples of the emulsion to be directed to the measurement station  2200 . Measurements made on the solution samples would include but not be limited to impurity levels, temperature, amount of acid additive  2030  and wash water  2020  solution, etc. This information is sent to the controller  2110 . 
         [0042]    The electrostatic desalter  2170  includes a liquid level sensor (LS)  2210  used to measure the aqueous level in the electrostatic desalter  2170 . In the embodiment of  FIG. 2 , the measurement output of the liquid level sensor  2210  is routed to the controller  2110 . The controller  2110  uses the liquid level measurement data to control the controllable flow control valve  2220  to drain the effluent from the electrostatic desalter  2170  and control the aqueous layer and emulsion layer within the electrostatic desalter  2170 . Alternatively, the liquid level sensor  2210  output may be directly connected to a level control valve instead of the controllable flow control valve  2220  to drain the effluent. The controllable flow control valve  2220  is also configured to allow samples of the effluent solution to be measured at a measurement station  2200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, temperature, and amount of residual oil present in the effluent. This information is sent to the controller  2110 . 
         [0043]    The electrical power supply  2150  provides the voltage necessary to create the electric field necessary for electrostatic coalescence in the electrostatic desalter  2170 . The controller  2110  controls the electrical power supply  2150  output. The electrical power supply  2150  output may be static (i.e. constant voltage with a current limit) or, preferably, able to change key parameters to enhance the desalting operation. The electrical power supply  2150  under the control of the controller  2110  would preferably be able to alter its&#39; output to include but not be limited to changes in the voltage level applied to the electrostatic desalter  2170 , the voltage waveform applied to the electrostatic desalter  2170 , current limits (if any) on the electrical power supply  2150 , or any combination thereof. 
         [0044]    The desalted crude output of the electrostatic desalter  2170  passes through a pressure control valve  2180  and a controllable flow control valve  2190 . The controllable flow control valve  2190  has two outputs to direct the desalted crude oil. Under control of the controller  2110 , the controllable flow control valve  2190  controls and maintains the flow rate of desalted crude oil to the remaining refinery operations. Additionally, under control of the controller  2110 , the controllable flow control valve  2190  can also direct samples of the desalted crude to the measurement station  2200 . Measurements made on the solution samples would include but not be limited to impurity levels, temperature, residual acid additive  2030  and wash water  2020  solution, etc. This information is sent to the controller  2110 . 
         [0045]    The controller  2110  can adjust various factors of the desalting operation including but not limited to the following: 
         [0046]    The crude oil supply  2010  feed rate through the controllable pump  2070  and controllable flow control valve  2120   
         [0047]    The temperature of the crude oil supply  2010  through the controllable heater  2130 . 
         [0048]    Control of the dehydration mechanism  2310  water level and oil layers through the liquid level sensor  2340 , the controllable flow control valve  2330 , and the controllable flow control valve  2360 . 
         [0049]    The dehydration mechanism  2310  electric field through the controllable power supply  2300 . 
         [0050]    The solution mixture of acid additive  2030  and wash water  2020  through the controllable fluid mixer  2040 . 
         [0051]    The flow rate of the solution mixture of acid additive  2030  and wash water  2020  through the controllable pump  2050  and controllable flow control valve  2060 . 
         [0052]    The emulsion formation through controllable fluid mixer  2350 . 
         [0053]    The electrostatic desalter  2170  electric field through the controllable electrical power supply  2150 . 
         [0054]    Control of the electrostatic desalter  2170  water level and emulsion layers through the liquid level sensor  2210 , the controllable flow control valve  2220 , and the controllable flow control valve  2190 . 
         [0055]    As different tests are conducted with the desalting mechanism  2000 , the parameters are adjusted per the test matrix and the selected product measurements are made after desalting the crude oil supply  2010 . The memory/data storage  2100  function of the desalting mechanism  2000  allows the controller to access and update, if required, the control settings required to conduct the test matrix tests and store the measured data. 
         [0056]      FIG. 3  shows a diagram of a typical two stage electrostatic desalting mechanism  3000  of the present invention. 
         [0057]    The desalting mechanism  3000  of the present invention includes a crude oil supply  3010  for storing crude oil. The crude oil supply  3010  is connected to a controllable pump  3070  whose output is connected to a controllable flow control valve (FCV)  3120 . The controllable flow control valve  3120  and the controllable pump  3070  work in conjunction under command of the controller  3110  to control and maintain the crude oil feed rate and pressure. The crude oil  3010  is heated to a desired processing temperature by the heater  3130  which is controlled by controller  3110 . In the embodiment of  FIG. 3 , the heated crude oil is mixed with recycled effluent from the electrostatic desalter  3170  to create an emulsion mix of the crude oil supply  3010  and recycled effluent from the electrostatic desalter  3170  via the controllable fluid mixer  3380 . Use of an effluent recycle as indicated in  FIG. 3  is well-known in the art. The crude oil/effluent recycle emulsion passes through a pressure control valve  3160  before entering the electrostatic desalter  3310 . The electrostatic desalter  3310  includes a liquid level sensor (LS)  3340  used to measure the aqueous level in the electrostatic desalter  3310 . In the embodiment of  FIG. 3 , the measurement output of the liquid level sensor  3340  is routed to the controller  3110 . The controller  3110  uses the liquid level measurement data to control the controllable flow control valve  3330  to drain the waste effluent from the electrostatic desalter  3310  and control the aqueous layer and emulsion layer within the electrostatic desalter  3310 . Alternatively, the liquid level sensor  3340  output may be directly connected to a level control valve instead of the controllable flow control valve  3330  to drain the waste effluent. The controllable flow control valve  3330  is also configured to allow samples of the waste effluent solution to be measured at a measurement station  3200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, temperature, and amount of residual oil present in the waste effluent. This information is sent to the controller  3110 . 
         [0058]    The electrical power supply  3300  provides the voltage necessary to create the electric field necessary for electrostatic coalescence in the electrostatic desalter  3310 . The controller  3110  controls the electrical power supply  3300  output. The electrical power supply  3300  output may be static (i.e. constant voltage with a current limit) or, preferably, able to change key parameters to enhance the electrostatic coalescence operation. The electrical power supply  3300  under the control of the controller  3110  would preferably be able to alter its&#39; output to include but not be limited to changes in the voltage level applied to the electrostatic desalter  3310 , the voltage waveform applied to the desalter, current limits (if any) on the electrical power supply  3300 , or any combination thereof. 
         [0059]    The crude output of the electrostatic desalter  3310  passes through a pressure control valve  3320  on its way to the controllable fluid mixer  3350 . The controllable fluid mixer  3350  allows a second emulsion of electrostatic desalter  3310  output, wash water  3020 , and acid additive  3030  to be created based upon the specific characteristics of the crude oil supply  3010  to be desalted. The controllable fluid mixer  3350  is controlled by the controller  3110  to create and maintain the proper emulsion mix of crude oil  3010 , wash water  3020 , and acid additive  3030 . 
         [0060]    The desalting mechanism  3000  of the present invention also includes a wash water supply  3020  and an acid additive supply  3030 . In the embodiment of  FIG. 3 , as is preferred, the acid additive  3030  is mixed with the wash water  3020  by the controllable fluid mixer  3040  before the crude oil/wash water emulsion is formed. Alternatively, the acid additive  3030  could be mixed with the wash water  3020  and crude oil  3010  during the emulsion creation or after emulsion creation or with the crude oil  3010  itself. The fluid mixer  3040  is controlled by the controller  3110  to create and maintain the proper solution mixture of acid additive  3030  and wash water  3020 . The acid additive  3030  can be selected from the group consisting of oxalic acid, citric acid, glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof. 
         [0061]    After mixing the solution of acid additive  3030  and wash water  3020  with the controllable fluid mixer  3040 , the resulting solution is input to a controllable flow control valve  3090  which is used to allow samples of the mixed acid additive  3030  and wash water  3020  solution to be measured at a measurement station  3200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, and percentage of acid additive  3030  to wash water  3020 . This information is sent to the controller  3110 . 
         [0062]    After mixing the solution of acid additive  3030  and wash water  3020  with the controllable fluid mixer  3040 , the resulting solution is also input to a controllable pump  3050  whose output is connected to a controllable flow control valve  3060 . The controllable pump  3050  and the flow control valve  3060  work in conjunction under the command of the controller  3110  to control and maintain the wash water/acid solution feed rate and pressure. The output of the flow control valve  3060  is an input to the controllable fluid mixer  3350  where the second emulsion of electrostatic desalter  3310  output, wash water  3020 , and acid additive  3030  is formed. 
         [0063]    After mixing the second emulsion in the controllable fluid mixer  3350 , the second emulsion passes through a controllable flow control valve  3360  before entering the electrostatic desalter  3170 . The controllable flow control valve  3360 , under command of the controller  3110 , controls the flow rate of the second emulsion into the electrostatic desalter  3170  as well as allowing samples of the emulsion to be directed to the measurement station  3200 . Measurements made on the solution samples would include but not be limited to impurity levels, temperature, amount of acid additive  3030  and wash water  3020  solution, etc. This information is sent to the controller  3110 . 
         [0064]    The electrostatic desalter  3170  includes a liquid level sensor (LS)  3210  used to measure the aqueous level in the electrostatic desalter  3170 . In the embodiment of  FIG. 3 , the measurement output of the liquid level sensor  3210  is routed to the controller  3110 . The controller  3110  uses the liquid level measurement data to control the controllable flow control valve  3220  to recycle the effluent from the electrostatic desalter  3170  and control the aqueous layer and emulsion layer within the electrostatic desalter  3170 . Alternatively, the liquid level sensor  3210  output may be directly connected to a level control valve instead of the controllable flow control valve  3220  to recycle the effluent. The controllable flow control valve  3220  along with the controllable pump  3370 , under command of the controller  3110 , control and maintain the recycled effluent flow rate and pressure to the controllable mixer  3380 . The controllable flow control valve  3220  is also configured to allow samples of the effluent solution to be measured at a measurement station  3200 . Measurements made on the solution samples would include but not be limited to solution pH, solution impurity levels, temperature, and amount of residual oil present in the effluent. This information is sent to the controller  3110 . 
         [0065]    The electrical power supply  3150  provides the voltage necessary to create the electric field necessary for electrostatic coalescence in the electrostatic desalter  3170 . The controller  3110  controls the electrical power supply  3150  output. The electrical power supply  3150  output may be static (i.e. constant voltage with a current limit) or, preferably, able to change key parameters to enhance the desalting operation. The electrical power supply  3150  under the control of the controller  3110  would preferably be able to alter its&#39; output to include but not be limited to changes in the voltage level applied to the electrostatic desalter  3170 , the voltage waveform applied to the electrostatic desalter  3170 , current limits (if any) on the electrical power supply  3150 , or any combination thereof. 
         [0066]    The desalted crude output of the electrostatic desalter  3170  passes through a pressure control valve  3180  and a controllable flow control valve  3190 . The controllable flow control valve  3190  has two outputs to direct the desalted crude oil. Under control of the controller  3110 , the controllable flow control valve  3190  controls and maintains the flow rate of desalted crude oil to the remaining refinery operations. Additionally, under control of the controller  3110 , the controllable flow control valve  3190  can also direct samples of the desalted crude to the measurement station  3200 . Measurements made on the solution samples would include but not be limited to impurity levels, temperature, residual acid additive  3030  and wash water  3020  solution, etc. This information is sent to the controller  3110 . 
         [0067]    The controller  3110  can adjust various parameters of the desalting operation including but not limited to the following: 
         [0068]    The crude oil supply  3010  feed rate through the controllable pump  3070  and controllable flow control valve  3120   
         [0069]    The temperature of the crude oil supply  3010  through the controllable heater  3130 . 
         [0070]    Control of the electrostatic desalter  3310  aqueous level and emulsion layers through the liquid level sensor  3340 , the controllable flow control valve  3330 , and the controllable flow control valve  3360 . 
         [0071]    The electrostatic desalter  3310  electric field through the controllable power supply  3300 . 
         [0072]    The solution mixture of acid additive  3030  and wash water  3020  through the controllable fluid mixer  3040 . 
         [0073]    The flow rate of the solution mixture of acid additive  3030  and wash water  3020  through the controllable pump  3050  and controllable flow control valve  3060 . 
         [0074]    The first emulsion formation of crude oil supply  3010  and recycled effluent from electrostatic desalter  3170  through controllable flow control valve  3220 , controllable pump  3370 , and controllable fluid mixer  3380 . 
         [0075]    The second emulsion formation through controllable fluid mixer  3350 . 
         [0076]    The electrostatic desalter  3170  electric field through the controllable electrical power supply  3150 . 
         [0077]    Control of the electrostatic desalter  3170  water level and emulsion layers through the liquid level sensor  3210 , the controllable flow control valve  3220 , and the controllable flow control valve  3190 . 
         [0078]    As different tests are conducted with the desalting mechanism  3000 , the parameters are adjusted per the test matrix and the selected product measurements are made after desalting the crude oil supply  3010 . The memory/data storage  3100  function of the desalting mechanism  3000  allows the controller to access and update, if required, the control settings required to conduct the test matrix tests and store the measured data. 
         [0079]      FIG. 4  shows an algorithm diagram for a multiple variable, two-level statistical quantification and estimation of performance for a given crude oil desalter  4000  according to one embodiment of the present invention. 
         [0080]    In step  4010 , the crude oil desalter for which performance will be characterized will be determined. The choice of crude oil desalter may be set based upon an existing refinery infrastructure. However, the company or processor who performs crude oil desalting may have a choice of desalting configurations. Thus, the processor may choose to conduct the multiple variable, two-level statistical quantification and estimation algorithm  4000  on more than one crude oil desalter configuration to choose the most economical configuration for processing a given crude oil type. 
         [0081]    In step  4020 , the desalter output product measurements to be characterized and modeled are chosen. The product measurements made for each test run may include but not be limited to the desalted crude oil salt content, basic sediments and water content of the desalted crude oil, the temperature of the desalted crude oil, the density of the desalted crude oil, the viscosity of the desalted crude oil, et al. Additionally, the costs to produce the desalted crude oil output product may also be collected for each test run. 
         [0082]    In step  4030 , the desalter parameters to be varied are chosen. The parameters to be varied for each test run may include but not be limited to the crude oil supply feed rate, the crude oil temperature, the electrostatic desalter aqueous layer, the electrostatic desalter emulsion layer, the electrostatic desalter electric field, the demulsifier type, the pH of the acid additive and wash water solution, and/or the flow rate of the acid additive and wash water solution. 
         [0083]    In step  4040 , a minimum and maximum setting are chosen for each variable selected in step  4030 . The minimum and maximum setting should be at the limits that would be used in a potential desalting application. Additionally, for the multiple variable, two-level statistical quantification and estimation algorithm  4000 , the minimum and maximum for each variable should be chosen such that the expected effect on the product output is linear over the minimum and maximum setting range. The multiple variable, two-level statistical quantification and estimate of performance technique  4000  can be extended to multiple min/max ranges to estimate performance in a piece-wise linear estimate for situations with intrinsically high non-linearity over an extended parameter range. 
         [0084]    In step  4050 , the 2-level test matrix is designed. The matrix identifies the parameter settings for all of the test combinations. Each parameter is set to one of the two ranges chosen in step  4040  for each test run. In the initial 2-level test matrix design of step  4050 , all combinations of parameter settings are tested so that all possible effects, including parameter interactions, are independently estimated. As an example, the test matrix developed in step  4050  would be represented by Table I if we were measuring the cost of desalting a certain number of barrels of crude oil while varying three desalting parameters between two levels; the pH of the wash water and acid additive solutions (designated as parameter A), the temperature of the crude oil (designated as parameter B), and the crude oil flow rate (designated as parameter C). 
         [0000]    
       
         
               
             
               
               
               
               
               
             
           
               
                 TABLE I 
               
             
             
               
                   
               
               
                 Step 4050 Example 2-Level Test Matrix for Three Parameters 
               
             
          
           
               
                   
                 Test Run 
                 A 
                 B 
                 C 
               
               
                   
                   
               
               
                   
                 1 
                 L 
                 L 
                 L 
               
               
                   
                 2 
                 L 
                 L 
                 H 
               
               
                   
                 3 
                 L 
                 H 
                 L 
               
               
                   
                 4 
                 L 
                 H 
                 H 
               
               
                   
                 5 
                 H 
                 L 
                 L 
               
               
                   
                 6 
                 H 
                 L 
                 H 
               
               
                   
                 7 
                 H 
                 H 
                 L 
               
               
                   
                 8 
                 H 
                 H 
                 H 
               
               
                   
                   
               
             
          
         
       
     
         [0085]    where represents the parameter set at the minimum value and ‘H’ represents the parameter set at the maximum value. 
         [0086]    The number of effects that can be modeled for the design of step  4050  is given by 2 m - 1  where m is the number of parameters to be varied. The prediction estimate resulting from the 2-level test matrix design of step  4050  is an approximation of the process response model to the parameter variations and is given by equation 1 (eq. 1), below, 
         [0000]    
       
         
           
             
               
                 
                   
                     Y 
                     ^ 
                   
                   = 
                   
                     
                       Y 
                       _ 
                     
                     + 
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         m 
                       
                        
                       
                         
                           n 
                           i 
                         
                          
                         
                           x 
                           i 
                         
                       
                     
                     + 
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         
                           m 
                           - 
                           1 
                         
                       
                        
                       
                         
                           ∑ 
                           
                             j 
                             = 
                             
                               i 
                               + 
                               1 
                             
                           
                           m 
                         
                          
                         
                           
                             n 
                             ij 
                           
                            
                           
                             x 
                             i 
                           
                            
                           
                             x 
                             j 
                           
                         
                       
                     
                     + 
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         
                           m 
                           - 
                           2 
                         
                       
                        
                       
                         
                           ∑ 
                           
                             j 
                             = 
                             
                               i 
                               + 
                               1 
                             
                           
                           
                             m 
                             - 
                             1 
                           
                         
                          
                         
                           
                             ∑ 
                             
                               k 
                               = 
                               
                                 j 
                                 + 
                                 1 
                               
                             
                             m 
                           
                            
                           
                             
                               n 
                               ijk 
                             
                              
                             
                               x 
                               i 
                             
                              
                             
                               x 
                               j 
                             
                              
                             
                               x 
                               k 
                             
                           
                         
                       
                     
                     + 
                     
                       … 
                        
                       
                           
                       
                        
                       higher 
                        
                       
                           
                       
                        
                       order 
                        
                       
                           
                       
                        
                       terms 
                        
                       
                           
                       
                        
                       as 
                        
                       
                           
                       
                        
                       applicable 
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   1 
                 
               
             
           
         
       
     
         [0087]    where Ŷ is the output estimate,  Y  is the average of the outputs from all test matrix runs, n represents the coefficients for each model term, and x i  represents the variable parameters. 
         [0088]    Step  4060  computes the total number of tests that must be conducted. The total number of tests is given by the number of test runs times the number of tests per test run. In step  4110  a hypothesis test is conducted to determine the significance of each term in the prediction estimate developed in step  4050 . The number of tests per test run may be computed based upon the statistical confidence that each term placed in the prediction equation is significant coupled with minimizing the possibility that a significant term is determined to be insignificant. The number of test runs is determined by the test matrix design. 
         [0089]    Decision step  4080  determines if the total number of tests is acceptable. This decision considers the resources required to conduct each test, the estimated total expense, the time that will be required to run the tests, etc. 
         [0090]    If the total number of tests is determined to be too high, the number of tests is reduced in step  4070 . The total number of tests may be reduced by re-designing the test matrix, reducing the number of tests per test run, or both. If the test matrix is re-designed to eliminate test runs, there will be one or more terms eliminated in the prediction equation as a result. The choice of term to eliminate is based upon the likelihood that the term is significant. The impact of eliminating the term(s) in the prediction equation is that the design will have one or more terms ‘aliased’ with the eliminated term. The practical implication of aliasing is that it will not be possible to determine whether an output effect is due to a lower order term, the eliminated term, or some combination of both. Generally, higher-order terms may be eliminated in a test matrix re-design while the main effect terms and lower order interaction terms are preserved. In a re-designed test matrix, it is desirable that the resulting test matrix does not alias the main effect terms 
         [0000]    
       
         
           
             ( 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 m 
               
                
               
                 
                   n 
                   i 
                 
                  
                 
                   x 
                   i 
                 
               
             
             ) 
           
         
       
     
         [0000]    with each other or with two-way interactions 
         [0000]    
       
         
           
             
               ( 
               
                 
                   ∑ 
                   
                     i 
                     = 
                     1 
                   
                   
                     m 
                     - 
                     1 
                   
                 
                  
                 
                   
                     ∑ 
                     
                       j 
                       = 
                       
                         i 
                         + 
                         1 
                       
                     
                     m 
                   
                    
                   
                     
                       n 
                       ij 
                     
                      
                     
                       x 
                       i 
                     
                      
                     
                       x 
                       j 
                     
                   
                 
               
               ) 
             
             . 
           
         
       
     
         [0000]    In addition, it is desirable that the two-way interactions are not aliased with one another. 
         [0091]    In step  4090 , the tests are conducted for each test run. It is desirable to run the tests in a random order to help compensate for minor variation in uncontrolled parameters. For each test conducted in step  4090 , 
         [0092]    The variable process characteristics are set to the min or max value based upon the test run to be conducted. 
         [0093]    An acid additive is mixed with wash water, directly with the crude oil, or a wash water/crude oil solution. 
         [0094]    An emulsion of acid additive, wash water, and crude oil is created 
         [0095]    The wash water/acid additive/crude oil emulsion is resolved into an oil phase and aqueous phase. 
         [0096]    The output response characteristics are measured and recorded for the applicable test run. 
         [0097]    In step  4100 , a series of statistical computations are made on the data collected in step  4090 . To facilitate the computations to be made in step  4100  and step  4110 , the test matrix parameter variations between the minimum and maximum are transformed using the following equation (eq. 2): 
         [0000]    
       
         
           
             
               
                 
                   
                     CS 
                     i 
                   
                   = 
                   
                     
                       2 
                       × 
                       
                         ( 
                         
                           
                             AS 
                             i 
                           
                           - 
                           
                             
                               AS 
                               _ 
                             
                             i 
                           
                         
                         ) 
                       
                     
                     
                       
                         Max 
                         i 
                       
                       - 
                       
                         Min 
                         i 
                       
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   2 
                 
               
             
           
         
       
     
         [0098]    where CS i  is the coded setting for parameter i, AS i  is the actual setting for the parameter i,  AS i    is the average of all the actual settings for parameter i, Max, is the maximum actual setting for parameter i, and Min i  is the minimum actual setting for parameter i. The actual parameter settings are used during the test runs, the coded parameter settings are used for analysis purposes. Using the transformation defined by eq. 2, when evaluating eq.1, each parameter setting would be defined by its coded value. For the example defined to develop Table I, the coded test matrix values for each candidate variable in the prediction equation would be represented by Table II. 
         [0000]    
       
         
               
             
               
               
               
               
               
               
               
               
               
             
           
               
                 TABLE II 
               
             
             
               
                   
               
               
                 Example 2-Level Coded Test Matrix for Three Parameters and 
               
               
                 All Interactions 
               
             
          
           
               
                   
                 Test 
                   
                   
                   
                   
                   
                   
                   
               
               
                   
                 Run 
                 A 
                 B 
                 C 
                 AB 
                 AC 
                 BC 
                 ABC 
               
               
                   
                   
               
               
                   
                 1 
                 −1 
                 −1 
                 −1 
                 +1 
                 +1 
                 +1 
                 −1 
               
               
                   
                 2 
                 −1 
                 −1 
                 +1 
                 +1 
                 −1 
                 −1 
                 +1 
               
               
                   
                 3 
                 −1 
                 +1 
                 −1 
                 −1 
                 +1 
                 −1 
                 +1 
               
               
                   
                 4 
                 −1 
                 +1 
                 +1 
                 −1 
                 −1 
                 +1 
                 −1 
               
               
                   
                 5 
                 +1 
                 −1 
                 −1 
                 −1 
                 −1 
                 +1 
                 +1 
               
               
                   
                 6 
                 +1 
                 −1 
                 +1 
                 −1 
                 +1 
                 −1 
                 −1 
               
               
                   
                 7 
                 +1 
                 +1 
                 −1 
                 +1 
                 −1 
                 −1 
                 −1 
               
               
                   
                 8 
                 +1 
                 +1 
                 +1 
                 +1 
                 +1 
                 +1 
                 +1 
               
               
                   
                   
               
             
          
         
       
     
         [0099]    For each test, run in the test matrix compute the average output response as (eq. 3) 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       y 
                       tr 
                     
                     _ 
                   
                   = 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         y 
                         i 
                       
                       n 
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   3 
                 
               
             
           
         
       
     
         [0100]    where  y tr    is the average output response of each test run, y i  is the output response for each test for the test run, and n is the number of tests conducted per test run. 
         [0101]    For each test run in the test matrix, the sample variance is also computed as (eq. 4) 
         [0000]    
       
         
           
             
               
                 
                   
                     V 
                     tr 
                   
                   = 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         
                           ( 
                           
                             
                               y 
                               i 
                             
                             - 
                             
                               
                                 y 
                                 tr 
                               
                               _ 
                             
                           
                           ) 
                         
                         2 
                       
                       
                         ( 
                         
                           n 
                           - 
                           1 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   4 
                 
               
             
           
         
       
     
         [0102]    where V tr , is the variance of the output responses for each test run,  y tr    is the average output response of each test run, y i  is the output response for each test for the test run, and n is the number of tests conducted per test run. 
         [0103]    For each candidate variable in the prediction equation, the difference in the average output response between the maximum settings for the variable (i.e. coded value of +1) and the minimum settings for the variable (i.e. coded value of −1) is computed as (eq. 5) 
         [0000]          y   i   =    y   +   −    y   −     eq. 5
 
         [0104]    where  y i    represents the difference in the average output response between the maximum setting and minimum settings for the candidate variable i,  y +    is the average output response for all test runs in which the candidate variable i has a coded value of +1, and  y −    is the average output response for all test runs in which the candidate variable i has a coded value of −1. 
         [0105]    In step  4110 , a statistical hypothesis test is conducted for each candidate variable in the prediction equation to determine if the candidate variable has a statistically significant contribution to the output response. There are many statistical methods of hypothesis testing. In the embodiment of the present invention, hypothesis testing for the multiple variable, two-level statistical quantification and estimation of performance for a given crude oil desalter  4000  will utilize the F distribution. 
         [0106]    The hypothesis to be tested can be defined for each candidate variable in the prediction equation as: 
         [0107]    H 0 : The average output response for +1 coded values is statistically equal to the average output response for −1 coded values. Therefore, the candidate variable does not significantly contribute to the output response. 
         [0108]    H 1 : The average output response for +1 coded values is statistically different from the average output response for −1 coded values. Therefore, the candidate variable does significantly contribute to the output response. 
         [0109]    These two statements are called the null hypothesis (H 0 ) and the alternative hypothesis (H 1 ). There are two errors that may be made in the hypothesis test. The first error, called a Type I error, is concluding that the alternative hypothesis is true when in fact the null hypothesis is true. The second error, called a Type II error, is concluding that the null hypothesis is true when in fact the alternative hypothesis is true. In step  4110 , the probability of committing a Type I error (a) is chosen for each candidate variable in the prediction equation. 
         [0110]    For each candidate variable, the mean-square-between value is computed in step  4110  as (eq. 6) 
         [0000]    
       
         
           
             
               
                 
                   
                     MSB 
                     i 
                   
                   = 
                   
                     
                       N 
                       4 
                     
                     × 
                     
                       
                         ( 
                         
                           
                             y 
                             i 
                           
                           
                             _ 
                             _ 
                           
                         
                         ) 
                       
                       2 
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   6 
                 
               
             
           
         
       
     
         [0111]    where MSB i  is the mean-square-between value for the candidate variable i, N is the total number of tests conducted in step  4090  (number of test runs times the number of tests per test run), and  y i    is the difference in the average output response between the maximum setting and minimum settings for the candidate variable i computed using eq. 5 in step  4100 . 
         [0112]    For each candidate variable, the mean square error is computed in step  4110  as (eq. 7) 
         [0000]    
       
         
           
             
               
                 
                   MSE 
                   = 
                   
                     
                       
                         ∑ 
                         
                           tr 
                           = 
                           1 
                         
                         k 
                       
                        
                       
                         
                           ( 
                           
                             n 
                             - 
                             1 
                           
                           ) 
                         
                         × 
                         
                           V 
                           tr 
                           2 
                         
                       
                     
                     
                       
                         ∑ 
                         
                           tr 
                           = 
                           1 
                         
                         k 
                       
                        
                       
                         ( 
                         
                           n 
                           - 
                           1 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   7 
                 
               
             
           
         
       
     
         [0113]    where MSE is the mean square error, k is the number of test runs, n is the number of tests per test run, and V tr  is the variance of the output responses for each test run. 
         [0114]    In step  4110 , the MSE and MSB i  are both estimates of the population variance and should be approximately equal in value if the null hypothesis is true. It is likely that the MSE and MSB i  will not be exactly the same since they are estimates that are based upon different aspects of the sample statistics (MSB i  is computed from the sample means and MSE is computed from the sample variances). However, if the alternative hypothesis is true, the MSB i  will compute to a larger value due to the differences among sample means while the MSE will still estimate the population variance because differences in population means do not affect variances. Thus, to determine the statistical significance of a candidate variable in eq.1, the associated mean-square-between value is compared to the mean square error in the form of an F ratio. The F ratio to be computed for each candidate variable in step  4110  is given by eq. 8 
         [0000]    
       
         
           
             
               
                 
                   
                     F 
                     i 
                   
                   = 
                   
                     
                       MSB 
                       i 
                     
                     MSE 
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   8 
                 
               
             
           
         
       
     
         [0115]    where F i  is the F ratio for the candidate variable i, MSB i  is the mean-square-between value for the candidate variable i, and MSE is the mean square error. 
         [0116]    In step  4110 , each F i  is compared to the F-statistic which depends upon the significance level (1-α), the degrees of freedom for the mean-square between value (equal to one for two-levels), and the degrees of freedom for the mean square error (equal to 
         [0000]    
       
         
           
             
               ∑ 
               
                 tr 
                 = 
                 1 
               
               k 
             
              
             
               ( 
               
                 n 
                 - 
                 1 
               
               ) 
             
           
         
       
     
         [0000]    in eq. 7). If F i  is less than or equal to the F-statistic, then the alternative hypothesis is rejected and the candidate variable i in eq.1 is not considered significant. If F i  is greater than the F-statistic, then the null hypothesis is rejected with (1-α)100% confidence and the candidate variable i in eq. 1 is considered significant. It should be noted that  Y , which is the average of the outputs from all test matrix runs, is not tested for significance and is included in the prediction estimate of eq. 1. For each candidate variable i in eq.1 that is considered significant, the coefficient for the model term, n i , is given by eq. 9 
         [0000]    
       
         
           
             
               
                 
                   
                     n 
                     i 
                   
                   = 
                   
                     
                       
                         y 
                         i 
                       
                       
                         _ 
                         _ 
                       
                     
                     2 
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   9 
                 
               
             
           
         
       
     
         [0117]    where n i  is the model term coefficient for the significant candidate variable i and  y i    represents the difference in the average output response between the maximum setting and minimum settings for the candidate variable i. 
         [0118]    In step  4120 , the prediction equation (s) resulting from step  4110  is used to predict the response for various parameter settings. If the objective is to minimize or maximize the output responses, the optimum settings may be obtained using the associated prediction equations. It should be noted that the values for the significant parameters in the prediction equation must be in coded form (i.e. between −1 and +1). The parameter setting may be transformed from a coded value to an actual setting using the following calculation (eq. 10) 
         [0000]    
       
         
           
             
               
                 
                   
                     AS 
                     i 
                   
                   = 
                   
                     
                       
                         
                           CS 
                           i 
                         
                         × 
                         
                           ( 
                           
                             
                               Max 
                               i 
                             
                             - 
                             
                               Min 
                               i 
                             
                           
                           ) 
                         
                       
                       2 
                     
                     + 
                     
                       
                         AS 
                         i 
                       
                       _ 
                     
                   
                 
               
               
                 
                   eq 
                   . 
                   
                       
                   
                    
                   10 
                 
               
             
           
         
       
     
         [0119]    where CS i  is the coded setting for parameter i, AS i  is the actual setting for the parameter i,  AS i    is the average of all the actual settings for parameter i, Max, is the maximum actual setting for parameter i, and Min, is the minimum actual setting for parameter i. 
         [0120]    After the parameter settings have been optimally computed using the prediction equation, a number of tests may be conducted in step  4120  with the optimally computed settings to determine if the response output statistically agrees with the predicted output. 
         [0121]    In decision step  4130 , it is determined if more tests are necessary to refine the prediction equation. This decision is driven by the confidence level desired for each variable in the prediction equation coupled with the results of testing in step  4120 , if any. If additional tests are determined to be necessary, the computed prediction equation is discarded and additional tests are conducted in step  4090 . If there are no additional tests deemed necessary, the prediction equation developed in step  4110  and optimized in step  4120  is considered confirmed. 
         [0122]      FIG. 5  shows a process diagram  5000  of one embodiment of the method of the present invention for a typical crude oil desalting operation. 
         [0123]    In step  5010 , the crude oil desalter configuration is determined. The configuration may be a single stage electrostatic desalting mechanism, a first stage dehydration followed by a second stage electrostatic desalting mechanism, a two stage desalting mechanism, or any other form of crude oil desalting mechanism. 
         [0124]    In step  5020 , the output response characteristics to be modeled and measured are selected. Output response characteristics that may be selected include but are not limited to the desalted crude oil impurities, the percentage of basic sediments and water of the desalted crude oil, and/or the cost to desalt the oil. One or more of the selected characteristics may be measured for each test run. Each different output response will have a corresponding prediction equation model associated with it. 
         [0125]    In step  5030 , the process characteristics to be varied are selected along with the minimum and maximum variation levels. The crude electrostatic desalter characteristics that may potentially be varied include but are not limited to the crude oil feed rate, the crude oil temperature, the dehydration/desalter electric field characteristics, the wash water flow rate, the emulsion formation, the control of the dehydration/desalter water level and emulsion layer, the acid additive type, the acid additive rate, and the effluent recycle. 
         [0126]    In step  5040 , the appropriate statistical test matrix design is determined based upon the number of parameters to be varied, the number of levels of variation, and the number of tests to be conducted per test matrix run. The result of this step determines the total number of tests to be conducted and the potential parameter interactions where prediction aliasing may occur. 
         [0127]    In step  5050 , the tests are conducted. Preferably, the tests are run in random order relative to the test matrix. For each test, the following steps are made: 
         [0128]    The variable process characteristics are setup according to the selected test matrix run. 
         [0129]    An acid additive is mixed with the wash water, directly with the crude oil, or with a wash water/crude oil solution. 
         [0130]    An emulsion of acid additive, wash water, and crude oil is created. 
         [0131]    The crude oil is resolved into an oil phase and an aqueous phase. 
         [0132]    The chosen output response characteristics are measured. 
         [0133]    In step  5060 , an equation or series of equations relating the output responses selected in step  5020  to the process characteristics selected in step  5030  is developed. The equation (s) are based upon the statistical computations made on the data collected in step  5050  relative to the variation in the process characteristics. The variables in the developed equations are determined to be statistically significant with a (1-α)100% confidence level Where α is selected before step  5060  is conducted. 
         [0134]    In step  5070 , the prediction equation is optionally confirmed through a series of experiments. 
         [0135]    The above embodiments are merely preferred and the scope of the invention defined by the claims below. 
         [0136]    The method can be performed, by an oil refinery, desalter, or laboratory equipment.