Trying to analytically solve a simple linear system

Hello there. I’m trying to solve the following system:

i1 = i2 + i3;
V = i1*r1 + i2*r2;
V = i1*r1 + i3*r3;

Which is fairly simple to solve, so I tried to use Symbolics.jl to do so. I’ve done the following:

using Symbolics

@variables r1, r2, r3;
@variables V;
@variables i1, i2, i3;

eq1 = Equation(i1, i2 + i3)
eq2 = Equation(E1, i1*r1 + i2*r2)
eq3 = Equation(E1, i1*r1 + i3*r3)

Symbolics.solve_for([eq1, eq2, eq3],[i1, i2, i3])

But it fails to solve, returning me the following error:

LoadError: AssertionError: i1 == i2
AssertionError: i1 == i2

Am I using symbolics.jl wrong? or maybe theres a better library for doing so.

Is E1 supposed to be declared as a variable?

Hi,
You are trying to solve an undetermined system. As its stands, it is impossible to get a solution out of it. Your system can be reduced to two equations and four unknowns (i1,i2,i3,r2). That is why you are getting that error: the package is trying to help you.

3 Likes