```Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Newton Raphson method for chemical equilibrium system
Date: Wed, 4 Aug 2010 14:00:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <i3brpb\$2bi\$1@fred.mathworks.com>
References: <i3a98v\$lck\$1@fred.mathworks.com> <i3b6ie\$83g\$1@fred.mathworks.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1280930411 2418 172.30.248.35 (4 Aug 2010 14:00:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Aug 2010 14:00:11 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:658973

Thanks Steve, but I can't read German.  I'm trying to solve the following system of equations:
where: CH4 = N(1), H2O = N(2), CO = N(3), H2 = N(4), CO2 = N(5), O2 = N(6)

CH4+CO+CO2-C = 0
4*CH4+2*H2O+2*H2-H = 0
H2O+CO+2*CO2+2*O2-O = 0
-LnKp1+2*log(P/sum(N))+log(N(3))+3*log(N(4))-log(N(1))-log(N(2)) = 0
-LnKp2+log(N(5))+log(N(4))-log(N(3))-log(N(2)) = 0
-LnKp3-0.5*log(P/sum(N))+log(N(2))-log(N(4))-0.5*log(N(6)) = 0

Known inputs are LnKp, C, H, O.  Where LnKp is the log of the equilibrium constant for that particular reaction at the specified temperature.
```