C_bar(k); <span class="keyword">end</span>;
      <span class="keyword">end</span>
      <span class="keyword">for</span> k = children{node}
        C_tilde(node,1) = C_tilde(node,1) + C_bar(k);
      <span class="keyword">end</span>
    <span class="keyword">end</span>

    <span class="comment">% now compute total downstream capacitances</span>
    C_total = C_tilde;
    <span class="keyword">for</span> node = N:-1:1
      <span class="keyword">for</span> k = children{node}
        C_total(node,1) = C_tot