Modeling optimal investments with portfolio analysis in electricity markets