This project generates a random electrical circuit represented as a graph and computes branch currents using Kirchhoff’s laws.
- Generates a connected random graph
- Assigns random resistances to edges
- Adds a voltage source (ε)
- Find cycles in the graph
- Builds equations using Kirchhoff’s laws
- Solves the resulting linear system
- Visualizes resistances and currents with directions
- Open Julia in the project folder
- Run the following commands:
using Pkg
Pkg.activate(".")
Pkg.instantiate()
include("main.jl")