How can I solve this complex 4 equation with 4 unknowns

Hello,
I am having a very hard time solving for the following 4 equations with 4 unknonws.
269.0 = R1*(R2+R3+R4)/(R1+R2+R3+R4)
267.8 = R2*(R1+R3+R4)/(R1+R2+R3+R4)
265.8 = R3*(R1+R2+R4)/(R1+R2+R3+R4)
267.3 = R4*(R1+R2+R3)/(R1+R2+R3+R4)
I was able to narrow it down to:
R4=267.3(R1+R2+R3)/(R1+R2+R3-267.3)
R3=265.8(R1+R2+R4)/(R1+R2+R4-265.8)
R2=267.8(R1+R3+R4)/(R1+R3+R4-267.8)
R1=269.0(R2+R3+R4)/(R2+R3+R4-269.0)
How do I solve for R1 R2 R3 and R4 using matlab? I tried the following code but I don't think it's giving me the right answer:
[R1,R2,R3,R4]=solve('R1=269.0(R2+R3+R4)/(R2+R3+R4-269.0)','R2=267.8(R1+R3+R4)/(R1+R3+R4-267.8)','R3=265.8(R1+R2+R4)/(R1+R2+R4-265.8)','R4=267.3(R1+R2+R3)/(R1+R2+R3-267.3)','R1','R2','R3','R4')

 Accepted Answer

equ1='269.0-R1*(R2+R3+R4)/(R1+R2+R3+R4)'
equ2='267.8-R2*(R1+R3+R4)/(R1+R2+R3+R4)'
equ3='265.8- R3*(R1+R2+R4)/(R1+R2+R3+R4)'
equ4='267.3 - R4*(R1+R2+R3)/(R1+R2+R3+R4)'
sol=solve(equ1,equ2,equ3,equ4)

7 Comments

Thank you Azzi for your response.
I pasted your code into Matlab and here is what I got:
sol =
R1: [4x1 sym]
R2: [4x1 sym]
R3: [4x1 sym]
R4: [4x1 sym]
What does this answer mean? I don't see any values for R1 R2 R3 R4.
Thank you
Once again, thank you Azzi! I am now able to get the values for the resistors.
One last question Azzi, Is there a way to tell Matlab to give me only the positive answer in the R matrices? (since in real life R cannot be negative)
syms R1 R2 R3 R4 positive
equ1=269.0-R1*(R2+R3+R4)/(R1+R2+R3+R4);
equ2=267.8-R2*(R1+R3+R4)/(R1+R2+R3+R4);
equ3=265.8- R3*(R1+R2+R4)/(R1+R2+R3+R4);
equ4=267.3 - R4*(R1+R2+R3)/(R1+R2+R3+R4);
sol=solve(equ1,equ2,equ3,equ4)
Or
equ1='269.0-R1*(R2+R3+R4)/(R1+R2+R3+R4)'
equ2='267.8-R2*(R1+R3+R4)/(R1+R2+R3+R4)'
equ3='265.8- R3*(R1+R2+R4)/(R1+R2+R3+R4)'
equ4='267.3 - R4*(R1+R2+R3)/(R1+R2+R3+R4)'
sol=solve(equ1,equ2,equ3,equ4,'R1>0','R2>0','R3>0','R4>0')
Thank you guys, both method worked. I appreciate all the help.

Sign in to comment.

More Answers (1)

R1 = -.1528124199, R2 = .1523845305, R3 = -.1519010380, R4 = .1522421676
R1 = 1.350702113, R2 = -1.354494804, R3 = -1.349440249, R4 = 1.346416572
R1 = 359.6939654, R2 = 357.2814545, R3 = 353.2965306, R4 = 356.2810534
R1 = 1.849064292, R2 = 1.844921136, R3 = -1.850793347, R4 = -1.855990235
Any imaginary components are vanishingly small and only appear due to round-off error.

1 Comment

Thank you for replying Walter. Using Azzi's matlab code above I managed to get the same answers as yours.
And since R's cannot be negative, the only possible solution would be: R1 = 359.6939654, R2 = 357.2814545, R3 = 353.2965306, R4 = 356.2810534
Have a good rest of the week!

Sign in to comment.

Categories

Community Treasure Hunt

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

Start Hunting!