# Solving linear systems

Hello, I am not sure if I am going about this correctly, but I am having some trouble using sage ('Sage Version 5.3, Release Date: 2012-09-08') to solve pretty simple linear systems. For example:


sage: var('i1 i3 i4')
sage: r1 = ... (r1 - r6 are constants)
sage: v1 = ... (v1, v2 constants)
sage: eq1 = i1*(r1+r2+r6) + i3*(r2 + r6) + i4*(r4+r5) == 0
sage: eq2 = i3*(r2+r2+r6) + i1*(r6+r2) + v1 - v2 ==0
sage: eq3 = i1*(r1+r2+r6) + i3*(r6+r2) - v2 == 0
sage: solve([eq1,eq2,eq3], i3)
[]
 

I have had to manually go through and perform substitution to solve this. I am also aware of techniques from linear algebra to solve these systems, however I do not know how to use any of them. Even so, it seems like the solve command should be able to perform this, so I assume I am just using it incorrectly.

Thanks!

edit retag close merge delete

Sort by » oldest newest most voted

You need to give the solve command all of the variables for which it is to solve.

solve([eq1,eq2,eq3], [i1,i3,i4])

more