由於傳統化石燃料能源造成嚴重的環境問題,可整合分散式再生能源的微電網變得越來越重要,本論文研究微電網的能源管理最佳化,在微電網中具有可再生能源和電池儲能等系統,並考慮可再生能源的電力潮流限制和不確定性,此外維持微電網營運商利潤的重要性及對主電網提供額外電力的需求正在提高。本研究提出了基於拉格朗日乘數之方法,把上述問題化為限制式,且可同時處理等式限制和不等式限制,並直接求解獲得最佳經濟調度的結果。為了驗證結果是否符合等式與不等式限制的條件,並探討基於拉格朗日乘數法的性能,採用位於台灣澎湖群島的七美島微電網模型進行研究;將所提出的方法與經驗式判斷法和牛頓結合粒子群體法進行比較,評估三種方法獲得的結果;最後,還考慮了向主電網出售電力和需量反應的情況,透過OPAL-RT即時模擬器內建的硬體迴圈機制與浮點數位訊號處理器,充分驗證和展現所提出方法的有效性。;Microgrid incorporating distributed renewable energy resources (RERs) has been increasingly important due to the serious environmental problems caused by conventional fossil fuel energy. This study deals with the optimal energy management of microgrid comprising RERs and battery energy storage system (BESS). In addition to considering power flow constraints and uncertainties of RERs, the importance of retaining profits of microgrid operators and the needs for providing extra supports to the main grid are rising. To meet all the requirements, the Lagrange multipliers-based method is proposed to deal with equality and inequality constraints at the same time to directly obtain the optimal economic dispatch solution analytically. Moreover, to examine the compliance with the requirements of equality and inequality constraints and investigate the performance of the Lagrange multipliers-based method, the microgrid built in Cimei Island in Penghu Archipelago, Taiwan, is investigated. Furthermore, the comparison of the proposed method with experience-based energy management system (EMS) and Newton-particle swarm optimization (Newton-PSO) is provided to evaluate the obtained solutions. In addition, the conditions of selling power to the main grid and demand response are considered. Through the hardware in the loop (HIL) mechanism, which is built using OPAL-RT real-time simulator with floating-point digital signal processor (DSP), the effectiveness of proposed Lagrange multipliers-based method can be verified and demonstrated.