SIMULATION AND OPTIMIZATION OF HYBRID SYSTEM