How do I solve a non-linear linked system of equations

1 view (last 30 days)
so I need to solve for chemical equilibrium of several product species in the combustion of CH4 and O2, so I am solving for the following unknowns [n_CO2,n_H2O,n_CO,n_OH,n_O2,n_H2,n_O,n_H] using the following equations
hydrogen balance 0=.5n_H2O+n_OH+.5n_H2+n_H-4
carbon balance 0=n_CO2+n_CO-1
Oxygen balance 0=.5n_CO2+n_H2O+n_CO+n_OH+.5n_O2+n_O
all of the previous equations were obviously linear, but now we get to the linked non-linear equations, in the following equations P is a known pressure, k_pn are constants that are also already known, and n is the sum of all the unknowns
CO+O<->CO2
0=n_CO2/(n_CO*n_O)-(P/n)*k_p1
OH+H<->H2O
0=n_H2O/(n_OH*n_H)-(P/n)*k_p2
2O<->O2
0=n_O2/(n_O^2)-(P/n)*k_p3
2H<->H2
0=n_H2/(n_H^2)-(P/n)*k_p4
O+H<->OH
0=n_OH/(n_O*n_H)-(P/n)*k_p5
I know the upper and lower limits of each unknown, so additionally, how would I specify those in whatever solver I would end up using?

Answers (0)

Categories

Find more on Thermal Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!