In the attached file i charge a capacitor when voltage is applied and decharge when 0V is applied by the help of an and gate(for simulation). What i want to do is capacitor will charge the same way ; but when 0 volts come i do not want its voltage to drop down but rather i want it to stay steady at its reached level like the yellow line in the picture i drew in paint.... How can this be possible?
When you charge a large capacitor or a capacitor bank it is like a dead short on the power supply. You need a current limiting resistor to prevent it from destroying your rectifier. If you need it to charge faster use higher current diodes or put several diodes in parallel.
that won't work because diodes have a negative Vfw coefficient. The first one to turn on will get warmer and it's forward voltage will drop and take all the current.