equationsToMatrix and linsolve giving incorrect results for voltage divider
Show older comments
I need the solutions for r1, r2 and r3 for the following voltage divider:

Hence the following eqs. system arise:
eq1=(r1+r2+r3)/(1e5+r1+r2+r3)==0.238
eq2=(r2+r3)/(1e5+r1+r2+r3)==0.213
eq3=(r3)/(1e5+r1+r2+r3)==0.125
1) [A,B] = equationsToMatrix([eq1,eq2,eq3], [r1,r2,r3]) gives the error: "Cannot convert to matrix form because the system does not seem to be linear." It seems linear to me, what am I missing?
2) I made step 1 by hand, and found A*X=Y leading to:
A = [-.875 -.875 .875, -.787 .787 .787, .762 .762 .762]
X=[r1, r2, r3]
and
Y=[12.5e3, 21.3e3, 23.8e3]
Then linsolve(A,Y) gives:
ans =
1.0e+04 *
0.2084
0.6390
2.2760
However this answer is wrong. If I enter these values in a simulation, I don't get, i.e., 0.125*Vs over R3. What am I missing again??
3) I found the correct answer using solve instead of linsolve:
[x1, x2, x3]=solve(eq1,eq2,eq3)
Gives after vpa():
x1 = 3281
x2 = 115448
x3 = 16404
And those values run fine during simulation. I still don't get 1) and 2) though.
- Also seems like hitting enter while typing won't space between lines!!
Accepted Answer
More Answers (1)
Tfm tfm
on 23 Oct 2016
0 votes
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!