How to solve 7 unknowns with 7 equations with ln
조회 수: 13 (최근 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)
댓글 수: 0
답변 (2개)
Roger Stafford
2014년 11월 18일
Try using 'log' instead of 'ln' for the natural logarithm. I don't think 'solve' recognizes 'ln'.
댓글 수: 0
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]
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!