# doc-cache created by Octave 9.1.0
# name: cache
# type: cell
# rows: 3
# columns: 8
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
RS2q


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2268
 Syntax:
 -- q=RS2q(data,X,q,R)

 RS2q computes the feed quality
  of a distillation column
  using the Ponchón-Savarit method given
  a x-h-y-H matrix of the liquid and the vapor fractions
  at equilibrium and their enthalpies,
  the vector of the fractions of the products and the feed,
  the reflux ratio at the top of the column and
  the reflux ratio at the bottom of the column.
 RS2q is a main function of
  the ponchon-savarit toolbox for GNU Octave.

 Examples:
 # Compute the feed quality
 # of a distillation column for acetone and methanol given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 93 %,
 # the composition of the feed is 41 %,
 # the composition of the bottoms is 7 %,
 # the reflux ratio at the top of the column is 2 and
 # the reflux ratio at the bottom of the column is 1.7:
 data=[2.5e-4 3.235 1.675e-3 20.720; # enthalpy in kcal/mol
       0.05   2.666 0.267    20.520;
       0.1    2.527 0.418    20.340;
       0.15   2.459 0.517    20.160;
       0.2    2.422 0.579    20.000;
       0.3    2.384 0.665    19.640;
       0.4    2.358 0.729    19.310;
       0.5    2.338 0.779    18.970;
       0.6    2.320 0.825    18.650;
       0.7    2.302 0.87     18.310;
       0.8    2.284 0.915    17.980;
       0.9    2.266 0.958    17.680;
       1.     2.250 1.       17.390];
 x=[0.93;0.41;0.07];
 q=RS2q(data,x,2.1,1.7)

 # Compute the feed quality
 # of a distillation column for oxygen and nitrogen given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 88 %,
 # the composition of the feed is 44 %,
 # the composition of the bottoms is 8 %,
 # the reflux ratio at the top of the column is 2 and
 # the reflux ratio at the bottom of the column is 1.3:
 data=[0.    0.420 0.    1.840; # enthalpy in kcal/mmol
       0.075 0.418 0.193 1.755;
       0.17  0.415 0.359 1.685;
       0.275 0.410 0.50  1.625;
       0.39  0.398 0.63  1.570;
       0.525 0.378 0.75  1.515;
       0.685 0.349 0.86  1.465;
       0.88  0.300 0.955 1.425;
       1.    0.263 1.    1.405];
 x=[0.88;0.44;0.08];
 q=RS2q(data,x,2,1.3)

 See also: stages, refmin, qR2S, qS2R.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
 Syntax:
 -- q=RS2q(data,X,q,R)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
bissection


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 246
 Syntax:
 -- x2=bissection(f,x1,x2)

 bissection computes the root of
  a function using the method of bissection
  given it is found between the guess values.
 bissection is an auxiliary function of
  the ponchon-savarit toolbox for GNU Octave.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
 Syntax:
 -- x2=bissection(f,x1,x2)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
myinterp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 279
 Syntax:
 -- x=myinterp(f,P,Q,a,b)

 myinterp computes the intecection of
  a function and a stright line defined by two points,
  using bissection method given
  it is between the guess values.
 myinterp is an auxiliary function of
  the ponchon-savarit toolbox for GNU Octave.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
 Syntax:
 -- x=myinterp(f,P,Q,a,b)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
newtonraphson


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
 Syntax:
 -- x=newtonraphson(f,x)

 newtonraphson computes the root of
  a function using the method of Newton-Raphson
  given a guess value.
 newtonraphson is an auxiliary function of
  the ponchon-savarit toolbox for GNU Octave.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
 Syntax:
 -- x=newtonraphson(f,x)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
qR2S


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2245
 Syntax:
 -- S=qR2S(data,X,q,R)

 qR2S computes the reflux ratio at the bottom
  of a distillation column
  using the Ponchón-Savarit method given
  a x-h-y-H matrix of the liquid and the vapor fractions
  at equilibrium and their enthalpies,
  the vector of the fractions of the products and the feed,
  the feed quality and
  the reflux ratio at the top of the column.
 qR2S is a main function of
  the ponchon-savarit toolbox for GNU Octave.

 Examples:
 # Compute the reflux ratio at the bottom
 # of a distillation column for acetone and methanol given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 93 %,
 # the composition of the feed is 41 %,
 # the composition of the bottoms is 7 %,
 # the feed is a saturated liquid and
 # the reflux ratio at the top of the column is 2:
 data=[2.5e-4 3.235 1.675e-3 20.720; # enthalpy in kcal/mol
       0.05   2.666 0.267    20.520;
       0.1    2.527 0.418    20.340;
       0.15   2.459 0.517    20.160;
       0.2    2.422 0.579    20.000;
       0.3    2.384 0.665    19.640;
       0.4    2.358 0.729    19.310;
       0.5    2.338 0.779    18.970;
       0.6    2.320 0.825    18.650;
       0.7    2.302 0.87     18.310;
       0.8    2.284 0.915    17.980;
       0.9    2.266 0.958    17.680;
       1.     2.250 1.       17.390];
 x=[0.93;0.41;0.07];
 S=qR2S(data,x,1,2)

 # Compute the reflux ratio at the bottom of the column
 # of a distillation column for oxygen and nitrogen given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 88 %,
 # the composition of the feed is 44 %,
 # the composition of the bottoms is 8 %,
 # the feed quality is 55 % and
 # the reflux ratio at the top of the column is 2:
 data=[0.    0.420 0.    1.840; # enthalpy in kcal/mmol
       0.075 0.418 0.193 1.755;
       0.17  0.415 0.359 1.685;
       0.275 0.410 0.50  1.625;
       0.39  0.398 0.63  1.570;
       0.525 0.378 0.75  1.515;
       0.685 0.349 0.86  1.465;
       0.88  0.300 0.955 1.425;
       1.    0.263 1.    1.405];
 x=[0.88;0.44;0.08];
 S=qR2S(data,x,0.55,2)

 See also: stages, refmin, qS2R, RS2q.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
 Syntax:
 -- S=qR2S(data,X,q,R)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
qS2R


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2239
 Syntax:
 -- R=qS2R(data,X,q,R)

 qS2R computes the reflux ratio at the top
  of a distillation column
  using the Ponchón-Savarit method given
  a x-h-y-H matrix of the liquid and the vapor fractions
  at equilibrium and their enthalpies,
  the vector of the fractions of the products and the feed,
  the feed quality and
  the reflux ratio at the bottom of the column.
 qS2R is a main function of
  the ponchon-savarit toolbox for GNU Octave.

 Examples:
 # Compute the reflux ratio at the top
 # of a distillation column for acetone and methanol given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 93 %,
 # the composition of the feed is 41 %,
 # the composition of the bottoms is 7 %,
 # the feed is a saturated liquid and
 # the reflux ratio at the bottom of the column is 1.7:
 data=[2.5e-4 3.235 1.675e-3 20.720; # enthalpy in kcal/mol
       0.05   2.666 0.267    20.520;
       0.1    2.527 0.418    20.340;
       0.15   2.459 0.517    20.160;
       0.2    2.422 0.579    20.000;
       0.3    2.384 0.665    19.640;
       0.4    2.358 0.729    19.310;
       0.5    2.338 0.779    18.970;
       0.6    2.320 0.825    18.650;
       0.7    2.302 0.87     18.310;
       0.8    2.284 0.915    17.980;
       0.9    2.266 0.958    17.680;
       1.     2.250 1.       17.390];
 x=[0.93;0.41;0.07];
 R=qS2R(data,x,1,1.7)

 # Compute the reflux ratio at the top
 # of a distillation column for oxygen and nitrogen given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 88 %,
 # the composition of the feed is 44 %,
 # the composition of the bottoms is 8 %,
 # the feed quality is 55 % and
 # the reflux ratio at the bottom of the column is 1.3:
 data=[0.    0.420 0.    1.840; # enthalpy in kcal/mmol
       0.075 0.418 0.193 1.755;
       0.17  0.415 0.359 1.685;
       0.275 0.410 0.50  1.625;
       0.39  0.398 0.63  1.570;
       0.525 0.378 0.75  1.515;
       0.685 0.349 0.86  1.465;
       0.88  0.300 0.955 1.425;
       1.    0.263 1.    1.405];
 x=[0.88;0.44;0.08];
 R=qS2R(data,x,0.55,1.3)

 See also: stages, refmin, qR2S, RS2q.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
 Syntax:
 -- R=qS2R(data,X,q,R)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
refmin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2210
 Syntax:
 -- [R,S]=refmin(data,X,q)

 refmin computes the minimum reflux ratios
  of a distillation column
  using the Ponchón-Savarit method given
  a x-h-y-H matrix of the liquid and the vapor fractions
  at equilibrium and their enthalpies,
  the vector of the fractions of the products and the feed and
  the feed quality.
 If feed is saturated liquid q = 1, q is reset to q = 1 - 1e-10.
 refmin is a main function of
  the ponchon-savarit toolbox for GNU Octave.

 Examples:
 # Compute the minimum value of the reflux ratio
 # of a distillation column for oxygen and nitrogen given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 88 %,
 # the composition of the feed is 46 %,
 # the composition of the column's bottom product is 11 % and
 # the feed quality is 52 %:
 data=[0.    0.420 0.    1.840; # enthalpy in kcal/mmol
       0.075 0.418 0.193 1.755;
       0.17  0.415 0.359 1.685;
       0.275 0.410 0.50  1.625;
       0.39  0.398 0.63  1.570;
       0.525 0.378 0.75  1.515;
       0.685 0.349 0.86  1.465;
       0.88  0.300 0.955 1.425;
       1.    0.263 1.    1.405];
 x=[0.93;0.41;0.07];
 [r,s]=refmin(data,x,q=0.52)

 # Compute the minimum value of the reflux ratio
 # of a distillation column for acetone and methanol given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 88 %,
 # the composition of the feed is 46 %,
 # the composition of the column's bottom product is 11 % and
 # the feed is a saturated liquid:
 data=[2.5e-4 3.235 1.675e-3 20.720; # enthalpy in kcal/mol
       0.05   2.666 0.267    20.520;
       0.1    2.527 0.418    20.340;
       0.15   2.459 0.517    20.160;
       0.2    2.422 0.579    20.000;
       0.3    2.384 0.665    19.640;
       0.4    2.358 0.729    19.310;
       0.5    2.338 0.779    18.970;
       0.6    2.320 0.825    18.650;
       0.7    2.302 0.87     18.310;
       0.8    2.284 0.915    17.980;
       0.9    2.266 0.958    17.680;
       1      2.250 1        17.390];
 x=[0.88;0.46;0.08];
 [r,s]=refmin(data,x,q=1)

 See also: stages, qR2S, qS2R, RS2q.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
 Syntax:
 -- [R,S]=refmin(data,X,q)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
stages


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3747
 Syntax:
 -- N=stages(data,X,q,R,:[,fig=true])
 -- N=stages(data,X,q,:,S[,fig=true])
 -- N=stages(data,X,:,R,S[,fig=true])

 stages computes the number of theoretical stages
  of a distillation column
  using the Ponchón-Savarit method given
  a x-h-y-H matrix of the liquid and the vapor fractions
  at equilibrium and their enthalpies,
  the vector of the fractions of the products and the feed and
  two paramaeters aong the feed quality,
  the reflux ratio at the top of the column and
  the reflux ratio at the bottom of the column.
 By default, fig = true, stages plots a schematic diagram of the solution.
 If fig = false is given, no plot is shown.
 stages is a main function of
  the ponchon-savarit toolbox for GNU Octave.

 Examples:
 # Compute the number of theoretical stages
 # of a distillation column for acetone and methanol
 # from the bottom to the top of the column given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 93 %,
 # the composition of the feed is 41 %,
 # the composition of the bottoms is 7 %,
 # the feed is a saturated liquid and
 # the reflux ratio at the top of the column is
 # 55 % higher that the minimum reflux ratio,
 # and plot a schematic diagram of the solution:
 data=[2.5e-4 3.235 1.675e-3 20.720; # enthalpy in kcal/mol
       0.05   2.666 0.267    20.520;
       0.1    2.527 0.418    20.340;
       0.15   2.459 0.517    20.160;
       0.2    2.422 0.579    20.000;
       0.3    2.384 0.665    19.640;
       0.4    2.358 0.729    19.310;
       0.5    2.338 0.779    18.970;
       0.6    2.320 0.825    18.650;
       0.7    2.302 0.87     18.310;
       0.8    2.284 0.915    17.980;
       0.9    2.266 0.958    17.680;
       1.     2.250 1.       17.390];
 x=[0.93;0.41;0.07];
 [r,s]=refmin(data,x,q=1)
 N=stages(data,x,q,R=1.55*r)

 # Compute the number of theoretical stages
 # of a distillation column for oxygen and nitrogen
 # from the bottom to the top of the column given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 88 %,
 # the composition of the feed is 44 %,
 # the composition of the bottoms is 8 %,
 # the feed quality is 55 % and
 # the reflux ratio at the bottom of the column is
 # 46 % higher that the minimum reflux ratio and
 # plot a schematic diagram of the solution:
 data=[0.    0.420 0.    1.840; # enthalpy in kcal/mmol
       0.075 0.418 0.193 1.755;
       0.17  0.415 0.359 1.685;
       0.275 0.410 0.50  1.625;
       0.39  0.398 0.63  1.570;
       0.525 0.378 0.75  1.515;
       0.685 0.349 0.86  1.465;
       0.88  0.300 0.955 1.425;
       1.    0.263 1.    1.405];
 x=[0.88;0.44;0.08];
 [r,s]=refmin(data,x,q=0.55)
 N=stages(data,x,q,:,S=1.46*s)

 # Compute the number of theoretical stages
 # of a distillation column for oxygen and nitrogen
 # from the bottom to the top of the column given
 # a matrix that relates the liquid and the vapor fractions
 # and their enthalpies at equilibrium,
 # the composition of the distillate is 92 %,
 # the composition of the feed is 59 %,
 # the composition of the bottoms is 9 %,
 # the reflux ratio at the bottom of the column is 1.9,
 # the reflux ratio at the top of the column is 1.5:
 data=[0.    0.420 0.    1.840; # enthalpy in kcal/mmol
       0.075 0.418 0.193 1.755;
       0.17  0.415 0.359 1.685;
       0.275 0.410 0.50  1.625;
       0.39  0.398 0.63  1.570;
       0.525 0.378 0.75  1.515;
       0.685 0.349 0.86  1.465;
       0.88  0.300 0.955 1.425;
       1.    0.263 1.    1.405];
 x=[0.92;0.59;0.09];
 q=RS2q(data,x,R=1.5,S=1.9)
 N=stages(data,x,:,R,S,fig=false)

 See also: refmin, qR2S, qS2R, RS2q.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Syntax:
 -- N=stages(data,X,q,R,:[,fig=true])
 -- N=stages(data,X,q,:,S[,fig...





