blob: 83ef3c77d201eac7f386802551b5a86e637af628 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
clc
//Initialization of variables
Kp=0.668
y=Kp^2
//calculations
x=poly(0,"x")
vec=roots(x^3 + y*x^3 + 2*y*x^2 -y*x -2*y)
eps=vec(1)
x1=(1-eps)/(1+ eps/2)
x2=eps/(1+eps/2)
x3=eps/2/(1+ eps/2)
//results
printf("degree of reaction = %.3f ",eps)
printf("\n Equilibrium concentration of CO2 = %.3f ",x1)
printf("\n Equilibrium concentration of CO = %.3f ",x2)
printf("\n Equilibrium concentration of O2 = %.3f ",x3)
//the answers are a bit different due to approximation in textbook
|