필터 지우기
필터 지우기

Solving four equations with four unknowns in MATLAB

조회 수: 2 (최근 30일)
Meysam
Meysam 2014년 11월 26일
댓글: Meysam 2014년 11월 26일
Hello every one. I need to find the coefficients R1-R4 in these four equations. Appreciate your comments and helps.
399.87=(34.78R1)*((8.52E-6)^R2)*(0.2025^R3)*(0.33^R4)
399.87=(52.3R1)*((1.9E-5)^R2)*(0.2025^R3)*(0.33^R4))
936.72=(57.5R1)*((1.9E-5)^R2)*(0.3009^R3)*(0.33^R4))
1129=(53R1)*((1.9E-5)^R2)*(0.335^R3)*(0.5^R4))
I tried this code but it didnt help:
equ1='((34.78R1)*((8.52E-6)^R2)*(0.2025^R3)*(0.33^R4))-399.87'
equ2='((52.3R1)*((1.9E-5)^R2)*(0.2025^R3)*(0.33^R4))-399.87'
equ3='((57.5R1)*((1.9E-5)^R2)*(0.3009^R3)*(0.33^R4))-936.72'
equ4='((53R1)*((1.9E-5)^R2)*(0.335^R3)*(0.5^R4))-1129'
sol=solve(equ1,equ2,equ3,equ4)
Am I using a wrong code or I didn't execute it in the correct way?
Thanks in advance.

채택된 답변

John D'Errico
John D'Errico 2014년 11월 26일
When you ask a question, it help that you add sufficient information for someone to know your problem without a guess. What did it do that you felt was wrong? If an error message was generated, then show the complete message.
I might point out that fragments like 34.78R1 are not valid syntax in MATLAB. Multiplication employs the * operator.
Beyond that, it seems clear that your equations form a linear system once they are logged. Since you have 4 equations in 4 unknowns, a linear system will yield an exact answer. So backslash would trivially suffice.
  댓글 수: 1
Meysam
Meysam 2014년 11월 26일
Thanks for the information and I'm sorry for not providing complete information. Here is the error that I received:
??? Error using ==> solve>getEqns at 182 ' (34.78R1)*((8.52E-6)^R2)*(0.2025^R3)*(0.33^R4))-399.87 ' is not a valid expression or equation.
Error in ==> solve at 67 [eqns,vars] = getEqns(varargin{:});
Error in ==> meysam at 8 sol=solve(equ1,equ2,equ3,equ4)
I guess I failed at inserting the equations in the correct format. I try to correct them.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by