Hi, I don't have any idea how to solve this system. I'm beginner so i don't knew how to write corect code. Pls help me. Equations:
(A-B-C)*5=C*6 ////
(A-B-C)*2+B*3=(A-B)*D ////
(A-B)*(2-D)=B*3 ////
(A-B)*2+B*4=B*E ////
A*2+(A-B)*3+(A-B-C)*2=50

댓글 수: 7

use this http://math.stackexchange.com/questions/255750/5-linear-equations-in-5-unknowns and to solve 5 equations with 5 unknown variables use this http://math.cowpi.com/systemsolver/5x5.html hope this is fine...
Roger Stafford
Roger Stafford 2015년 5월 29일
Not all these equations are linear.
@Roger check the equations again..
John D'Errico
John D'Errico 2015년 5월 29일
편집: John D'Errico 2015년 5월 29일
Oh, gosh. I learn something new every day. Apparently (A-B)*D, (A-B)*(2-D), and B*E are all linear in the unknowns! I guess I'll need to go back and review my notes for all of those linear algebra classes. Darn this new math.
Walter Roberson
Walter Roberson 2015년 5월 29일
Muhammad, the expressions involve A*D, B*D, and B*E, so they certainly are non-linear.
Hinko Fic
Hinko Fic 2015년 5월 30일
편집: Hinko Fic 2015년 5월 30일
Yeah, i knew how to solve linear, but this isn't. That's reason why i need help. I need to solve these equations with different numbers (more complicated) for my project in school
Roger Stafford
Roger Stafford 2018년 3월 11일
I don't remember this problem from almost two years ago, but apparently all of us (except perhaps Muhammad Saleem) overlooked the fact that it is actually a system of five linear equations in the five unknown quantities, A, B, C, d=(A-B)*D, and e=B*E, so it can be solved for these latter five variables using matrix division. From those solutions, it is easy to then find D and E: D = d/(A-B) and E = e/B.

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

 채택된 답변

Roger Stafford
Roger Stafford 2015년 5월 29일
편집: Roger Stafford 2015년 5월 29일

0 개 추천

You can use 'solve' in the Symbolic Toolbox to solve them.
My alternate method was in error. Just use 'solve'. It does very well.

댓글 수: 5

Hinko Fic
Hinko Fic 2015년 5월 30일
편집: Walter Roberson 2015년 5월 30일
I used this code:
equ1='(a-b-c)*5-6*c' ////
equ2='(a-b-c)*2+b*3-(a-b)*d' ////
equ3='(a-b)*(2-d)-b*3' ////
equ4='(a-b)*2+b*4-b*e' ////
equ5='a*2+(a-b)*3+(a-b-c)*2-50' ////
sol=solve(equ1,equ2,equ3,equ4,equ5) ////
but now i don't knew how to transform my results into numerical because i got "a: [1x1 sym]...
solve by substitution and simultaneously methods to make this in 1*1 system
(1) firstly you have to make a function that take these 5 equations as input (2) make an algorithm by using methods of simultaneously or substitutions.. (3) set output of this function as system of 1*1 equation..
structfun(@double, sol, 'Uniform', 0)
will return back a structure whose fields are a, b, c, d, e. For any particular one of them you can use (e.g.) double(sol.b)
Hinko Fic
Hinko Fic 2015년 5월 30일
That works, ty a lot, you saved me a lot of time

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

추가 답변 (1개)

Alex Sha
Alex Sha 2019년 10월 12일

0 개 추천

Numercial solution:
a: 9.00473933649289
b: 1.18483412322275
c: 3.55450236966825
d: 1.54545454545455
e: 17.2

카테고리

도움말 센터File Exchange에서 Optimization에 대해 자세히 알아보기

제품

질문:

2015년 5월 29일

답변:

2019년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by