balancing chemical equation using linear algebra in matlab

56 ビュー (過去 30 日間)
Azhar Alguraini
Azhar Alguraini 2020 年 11 月 17 日
回答済み: Mahesh Taparia 2020 年 11 月 20 日
How can I balancing this chemical equation using linear algebra in matlab?
C2H6+O2→CO2+H2O

回答 (1 件)

Mahesh Taparia
Mahesh Taparia 2020 年 11 月 20 日
Hi
One of the possible approach is to find the simultaneous equations of coefficients of the chemical equationa nd solve those equations using solve function. For example, for your case:
x1(C2H6)+x2(O2)=x3(CO2)+x4(H2O)
Then the equations will be:
2*x1=x3; %Equating C coefficients
6*x1=2*x4; %Equating H coefficients
2*x2=2*x3+x4; %Equating O coefficients
Since these are 3 equations and 4 variable. The solution require the ratio of unknowns, so you can put x4=1 and then solve these equations and divide the solution with smaller value of unknown to get the ratio. Moreover, it becomes Ax=b system, you can also solve it using inv function, i.e
x=inv(A)*b;
Hope it will help!

カテゴリ

Help Center および File ExchangeChemistry についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by