I want to optimize the cost of microgrid which contains few diesel generator and energy storage. The cost function of diesel generator is quadratic (non-linear) and battery cost function is also non-linear.
battery_cost(t) = ((b_price)/(b_cap*dod(t)*lifecycle(t)*eff))+0.5*Pb_dis(t)*x_dis(t)
The objective function is
I am trying to use fmincon for non linear optimization. I need use your suggestions how to use fmincon for this purpose as I am confuse should I use the gen1 as variable or the power dispatched by gen1. Kindly need your valuable answers