How to solve 7 unknowns with 7 equations with ln

조회 수: 13 (최근 30일)
Shazreen
Shazreen 2014년 11월 18일
답변: MA 2014년 11월 18일
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