Create Circuit Simulation
I wrote the simulation engine that powers CircuitLab from scratch: from the sparse matrix library up through component models and simulation modes. My co-founder wrote the front-end. It ended up being an unbelievably huge programming project, but one I'm quite proud of. If you're up for the challenge, writing a circuit simulator may be one of the most rewarding programming projects you'll ever tackle.

At a high level, you just need to:


Turn a network of components into a system of equations (non-linear differential equations).
Numerically solve the system of equations (using sparse matrix techniques).


I don't know of an online tutorial, but I've tried to document a lot of this as I write the "Ultimate Electronics" textbook, especially in Chapter 2. There are also a number of 1990s-era books on the topic of circuit simulation, though I don't have them handy at the moment.

My suggestion would be to start from only voltage sources and resistors, and continue building from there. Good luck.