How to solve 7 unknowns with 7 equations with ln

6 次查看(过去 30 天)
I have 7 equations containing 7 unknowns: nMj, nMk, pHj, pMj, pHk, pMk, Am. Following are my equations.
eq 1: 50=nMj+nMk
eq2: 500=pHj+pMj
eq3: 20=pHk+pMk
eq4: pHj=(22500/(45+nMj))
eq5: pHk=(8100/(405+nMk))
eq6: 405=(0.000343*Am*((450-pHj)/ln((450-pHk)/(pHj-pHk))))
eq7: nMk=(0.0000555*Am*((50-pMj)/ln((50-pMk)/(pMj-pMk))))
Below is the code that I've tried to put in. Tried to use the 'solve' function to solve the problem but failed. Could anyone enlighten me on how to solve this? Thank you.
syms nMj nMk pHj pMj pHk pMk Am
eq1=50-nMj-nMk
eq2=500-pHj-pMj
eq3=20-pHk-pMk
eq4=pHj-(22500/(45+nMj))
eq5=pHk-(8100/(405+nMk))
eq6=405-(0.000343*Am*((450-pHj)/ln((450-pHk)/(pHj-pHk))))
eq7=nMk-(0.0000555*Am*((50-pMj)/ln((50-pMk)/(pMj-pMk))))
solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7,nMj,nMk,pHj,pMj,pHk,pMk,Am)

回答(2 个)

Roger Stafford
Roger Stafford 2014-11-18
Try using 'log' instead of 'ln' for the natural logarithm. I don't think 'solve' recognizes 'ln'.

MA
MA 2014-11-18
clear all
close all
clc;
syms nMj nMk pHj pMj pHk pMk Am
eq1=50-nMj-nMk;
eq2=500-pHj-pMj;
eq3=20-pHk-pMk;
eq4=pHj-(22500/(45+nMj));
eq5=pHk-(8100/(405+nMk));
eq6=405-(0.000343*Am*((450-pHj)/log((450-pHk)/(pHj-pHk))));
eq7=nMk-(0.0000555*Am*((50-pMj)/log((50-pMk)/(pMj-pMk))));
S=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7);
display('nMj nMk pHj pMj pHk pMk Am')
S=[S.nMj S.nMk S.pHj S.pMj S.pHk S.pMk S.Am]

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by