Design and cost analysis for STATCOM in low and medium voltage systems