Scenario
Engineering Equation Solver
๐ Context
You're an engineer solving a system of equations from a circuit analysis. Three loops in a circuit give you 3 equations with 3 unknowns (currents). This is exactly what np.linalg.solve is built for.
1
2
Step 1: Set Up the System
๐ฏ Task
The equations are:2Iโ + Iโ - Iโ = 8-Iโ + 3Iโ + 2Iโ = 1Iโ - Iโ + 4Iโ = 11
Create coefficient matrix A and constants vector b. Print both.
A = np.array([[2,1,-1],[-1,3,2],[1,-1,4]]), b = np.array([8, 1, 11])
โโ run ยท โโ โ nav
โถ Output
Run your code to see output here.