Im looking on the net for one so I can code a circuit simulator, anyone can help with a link or short tutorial?
This is very elementary, so I am unsure how you can code a circuit simulator without any apparent knowledge of electronic circuits or physics?
But leaving that unfortunate complaint aside, an ideal capacitor has the following model. Bear in mind that no real capacitor obeys this model, and using such a model may lead to odd results.
$$i=C {\mathrm{d}v \over \mathrm{d}t}$$