circuit calculation