0% found this document useful (0 votes)
7 views15 pages

Goal Seek Solver

Goal_Seek_Solver

Uploaded by

Subhranil Basu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views15 pages

Goal Seek Solver

Goal_Seek_Solver

Uploaded by

Subhranil Basu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Discipline Specific Elective A2

UG Semester 5
Lecture 1
 A built-in
built in Excel tool!
 “Cause and effect” scenario …….impacts
of one data item in a formula on another!
 U
Uses N
Newton
t Raphson
R h method
th d

f   xn 
xn1  xn 
f  xn 
 Applicable for only one variable
Step 1: Open a spreadsheet in MS Excel.
Step 2: Write the equation using the cell for variable.

Step 3: Go to Data What-if analysis Goal seek!

Step 4: Set target cell equal to zero or desired


value by changing the cell selected for
variable and then press ok.

Step 5: For other values of variables, change


the g
guess value and repeat
p steps
p 3-4.
Syllabus:
Solutions in chemical equilibrium problems using
Excel Goal seek!

6. KP 6.51 at 800 K for the ideal-gas reaction


2A + B = C + D. If 3.000 mol of A, 1.000 mol
off B,
B andd 4.000
4 000 moll off C are placed
l d in
i an
8000-cm3 vessel at 800 K, find the
equilibrium amounts of all species.
species

[Ph Chem Levine, 6th ed, Pg-189 ]


Solution-
2A + B = C + D
At t=0
A 0 3 1 4 0
At eqm 3-2x 1-x 4+x x

KP = pC pD /(pA)2(pB)
=(4+x)x/(3 2x)2(1-x)
=(4+x)x/(3-2x) (VP0/RT) = 6
(1 x)*(VP 6.51
51
or, (4+x)x/(3-2x)2(1-x)*(8*1/0.082*800) = 6.51
or (4x+x^2)/(9+4x^2-12x)(1-x)=6.51*0.082*100
or, (4x+x^2)/(9+4x^2 12x)(1 x)=6 51*0 082*100

or
or, x^3
x 3 -3
3.99x
99x^2+
2+ 5
5.269x
269x-2
2.25
25=0
0
Ans. 0.92
 Not installed by default! An additional add-in is required.

 A powerful and flexible optimisation tool!

 Allows to perform "what if" calculations based on several


variables (upto 200)!

 Constraints or conditions that must be true for the


solution to be valid can be added.

 Can be used to find the value of the variables that give a


formula
o u a a maximum
a u o
or minimum
u value
a ue as well
e as a
specific value.

 Solver uses GRG2 (Generalized Reduced Gradient)


algorithm!
 In the Set Objective box/ target cell, enter a cell reference or
name for the objective cell. The objective cell must contain a
form la
formula.
 Do one of the following:
 If we want the value of the objective cell to be as large as
possible, click Max.
 Iff we want the value off the objective
j cell to be as small as
possible, click Min.
 If we want the objective cell to be a certain value, click Value
of,
f andd th
then ttype the
th value
l ini the
th bbox.
 In the By Changing Variable Cells box, enter a name or
reference for each decision variable cell range. Separate the
non-adjacent references with commas. The variable cells
must be related directly or indirectly to the objective cell. We
can specify
if up tto 200
00 variable
i bl cells.
ll
j to the Constraints box, enter any constraints that we want to
 In the Subject
apply by doing the following:
 In the Solver Parameters dialog box, click Add.
 In the Cell Reference box, enter the cell reference or name of the cell range for
which we want to constrain the value.
 Click the relationship p ( <=,, =,, >=,, int,, bin,, or diff ) that we want between
the referenced cell and the constraint. If we click int, integer appears in the
Constraint box. If we click bin, binary appears in the Constraint box. If we
f all different
click dif, ff pp
appears in the Constraint box.
 If we choose <=, =, or >= for the relationship in the Constraint box, type a
number, a cell reference or name, or a formula.
 Do one of the following:
 To accept the constraint and add another, click Add.

 To accept the constraint and return to the Solver Parameters dialog box,
click
li k OK
OK.
 Note We can apply the int, bin, and dif relationships only in constraints on
decision variable cells.
 We can change or delete an existing constraint by doing the following:
To restore the original values before we clicked Solve, click Restore Original
Values.
Syllabus:
Solutions in chemical equilibrium problems using
Excel Solver!

5. Finding Equilibrium composition-


1 0 atm of NOCl(g) is introduced in
1.0
the vessel.
2 NOCl (g) = 2 NO(g) +Cl2 (g) ;
K = 2.18
Kp 2 18 att a certain
t i ttemperature
t
[Ref. Mol. TD, McQuarrie‐Simon, p‐40‐41]
2 NOCl (g) = 2 NO(g) +Cl2 (g)
1 – 2x 2x x
Kp =P2 (NO) P(Cl2 ) /P2 (NOCl)
= (2x)2 x / (1-2x)2 = 2.18
2 18

4 x^3
^3 – 8.72
8 2 x^2
^2 + 8.72
8 2 x -2.18
2 18 =0
0

Ans: 0.356086
6.. Consider the chemical reaction described by
the equation
q
CH4 (g)+ H2O(g) = CO (g) +3H2 (g)
At 300K
300K, if 1.0
1 0 atm of CH4 and H2O are
introduced into a reaction vessel and
Kp = 26
26, find the equilibrium composition.
composition
[Ref. Mol. TD, McQuarrie‐Simon, p‐46]
CH4 (g)+ H2O(g) = CO (g) +3H2 (g)
At eqm 1‐x 1‐x x 3x

Kp = pco.(pH2)3/pCH4. pH2O = 26
(3 )3 / (1‐x)(1‐x)
or,, x(3x) ( )( ) =26

27 x^4
^4 – 26 x^2
^2 + 52 x -26
26 =0
0
Ans: x=0.614809
7. Suppose the following two ideal‐gas reactions
occur CH4 + 2H2O = CO2 + 4H2 ……..(1)
CH4 + H2O = CO + 3H2 ………(2)
Let the initial numbers of moles be
CH4 H2O CO2 H2 CO

1 1 1 1 2

K°P(1) =1.30 and K°P (2) = 2.99.


T= 900K, P=0.01 bar
[Ref: Levine, p‐191]
Now K°P(1) = pCO2 (pH2)4/ pCH4 (pH2O)2
= nCO2 (nH2)4/ nCH4 (nH2O)2 * (P/n)2
K°P(2) = pCO (pH2)3/ pCH4 (pH2O)
K
= nCO (nH2)3/ nCH4 (nH2O) * (P/n)2
Using the concept of conservation‐of‐matter, we get
three equations‐
q
nC = nCH4 + nCO2 + nCO
nH = 4nCH4 + 2nH2O + 2nH2
nO = nH2O + 2nCO2 + nCO
C H O Kp 1 (cal) Kp 2 (cal)
Initial 4 8 5
E ilib i
Equilibrium 4 8 5
Fractional In‐Eq/In 1.3‐Kp 1 (cal) 2.99‐Kp 2
/1.3 (cal) / 2.99
error
Equation for target cell =
1.3‐ Kp1(cal)/1.3
K ( l)/ =0
Constraints:
F ti
Fractionall error for
f C,C H,
H O,
O Kp
K 2 =0
Number of moles is larger than some very small
positive number (say 1010^‐14)
14)

Ans: CH4 H2O CO2 H2 CO


0.0006101 0.324805095 0.67580501 3.673975 3.323584893

You might also like