Modeling And Optimization Of Microgrid Energy System For Ship Applications