How to reverse a Ax=b system of equation to find an A value from a x and b value

1 view (last 30 days)
I have a system of equations that calculates for an i value called i4. This value is an x in the Ax
=b system of equation format. I have the given input A vector, and b vector. I have to find a R3 value which gives me an i4 value of 0.0157. I do not know how to reverse the calculation so that it gives me a R value instead. I HAVE to use a Fzero command, but I do not know how to integrate that either.
R1=4000;
R2=8000;
R3=R3;
R4=2000;
R5=5000;
v=125;
A=[0 R2 0 R4 0 0
-R1 R2 -R3 0 0 0
0 0 R3 R4 -R5 0
1 1 0 0 0 -1
0 1 1 -1 0 0
-1 0 1 0 1 0];
b=[v 0 0 0 0 0]';
x=A\b;
i4=x(4,:) %i4=0.0157

Accepted Answer

David Hill
David Hill on 3 Aug 2021
R1=4000;
R2=8000;
syms R3;
R4=2000;
R5=5000;
v=125;
A=[0 R2 0 R4 0 0
-R1 R2 -R3 0 0 0
0 0 R3 R4 -R5 0
1 1 0 0 0 -1
0 1 1 -1 0 0
-1 0 1 0 1 0];
b=[v 0 0 0 0 0]';
x=A\b;
F=vpasolve(x(4)==0.0157,R3);
  2 Comments
Petch Anuwutthinawin
Petch Anuwutthinawin on 4 Aug 2021
Is there a way to do this with only the Fzero command and no syms. I cannot use syms in my version of matlab?
David Hill
David Hill on 4 Aug 2021
Solved for R3 in terms of R1,R2,R4,R5,v, and i4.
R1=4000;
R2=8000;
R4=2000;
R5=5000;
v=125;
i4=0.0157;
R3=-(R1*R5*conj(v) - i4*(R2*R4*R5 + R1*R4*R5 + R1*R2*R5 + R1*R2*R4) + R2*R5*conj(v))/(R1*conj(v) - i4*(R4*R5 + R2*R5 + R1*R4 + R1*R2) + R5*conj(v));

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!