Matrix simulation of transistor circuit using Ruby