Microgrids are among the most complex energy systems to model because they combine multiple generation technologies, storage, flexible loads, and two distinct operating modes — island mode and grid-connected mode — each with its own dispatch logic, reliability requirements, and economic characteristics.
Whether you're designing a campus microgrid with CHP and solar, a community microgrid with diesel backup, or a greenfield island microgrid with 100% renewables, the simulation software you choose and the modeling approach you use will directly determine whether the project is economically viable and operationally reliable.
This guide covers the key principles of microgrid simulation — from component modeling and dispatch optimization to reliability constraints and economic analysis — with practical examples across island and grid-connected configurations.
What You'll Learn
- Microgrid Architecture and Operating Modes
- Component Modeling: PV, BESS, Diesel, Wind
- Island Mode Dispatch: Grid-Forming vs Grid-Following
- Grid-Connected Dispatch: Import/Export Optimization
- Reliability Constraints: LOLP, SAIDI, and Reserve Requirements
- Component Sizing Optimization for Least Cost
- Case Study: Island Community Microgrid in Indonesia
- How Energy Optima Models Microgrids
Microgrid Architecture and Operating Modes
Every microgrid simulation begins with defining the architecture — which components are present, how they are interconnected, and in which modes the system operates. The three fundamental architectures are:
AC Coupled (Most Common)
- All components (PV, BESS, diesel, wind) connect to a common AC bus
- Battery inverter provides grid-forming capability in island mode
- Diesel generator provides backup grid-forming when battery SOC is low
- Simplest to model, most common in real installations
DC Coupled
- PV and BESS share a DC bus with a single bidirectional inverter
- Higher efficiency (single conversion step) but less flexibility
- Diesel and wind connect on the AC side
- Better for high-PV-penetration microgrids
Hybrid AC/DC
- Separate AC and DC subgrids with interlinking converters
- Most flexible but most complex to model and control
- Emerging architecture for multi-building campus microgrids
The operating mode defines how the microgrid interacts with the wider utility grid (if connected) and how it maintains stability in island mode. A simulation must handle transitions between modes — including grid islanding events and reconnection — which happen at sub-second timescales but have multi-hour economic consequences.
Component Modeling: PV, BESS, Diesel, Wind
An accurate microgrid simulation models each component with appropriate fidelity. Over-simplification (e.g., constant efficiency assumptions, linear fuel curves) leads to misleading results.
PV Modeling
- Hourly or sub-hourly irradiance from TMY or ERA5 data
- Temperature-dependent module efficiency
- Inverter clipping and DC/AC ratio effects
- Spectral and angle-of-incidence adjustments for bifacial modules
See our PV System Sizing Guide and Bifacial PV Modeling for detailed methodology.
BESS Modeling
- State of charge tracking with configurable SOC limits
- C-rate-dependent RTE and degradation
- Calendar and cycle aging with manufacturer 3D interpolation
- Grid-forming inverter capability for island mode
For detailed BESS sizing methodology, see our BESS Capacity Sizing Optimization guide.
Diesel Generator Modeling
- Fuel curve with no-load and marginal coefficients (see Diesel-Solar Hybrid System Design)
- Minimum load constraints (typically 20-30%)
- Start-up fuel penalty and minimum run times
- Maintenance cost as a function of run hours and starts
Wind Turbine Modeling
- Power curve interpolation from manufacturer data
- Hub-height wind speed from reanalysis data or site measurements
- Air density correction for altitude and temperature
- Turbulence and wake effects for multi-turbine arrays
Island Mode Dispatch: Grid-Forming vs Grid-Following
Island mode is the defining feature of a microgrid — the ability to operate independently of the main grid. In island mode, at least one asset must act as a grid-forming source, establishing the voltage and frequency reference that all other assets follow.
Modern microgrids use the battery inverter as the primary grid-forming source. Key dispatch rules in island mode:
- Solar priority (fuel-saving): If PV + battery can meet the load, the diesel generator stays off. This maximizes fuel savings and reduces emissions.
- Battery SOC management: The battery maintains a reserve margin (e.g., 10-20% SOC) for contingency events. When SOC drops below a threshold, the diesel generator starts.
- Diesel gen start logic: Generator starts when SOC hits the low threshold or load exceeds the battery's rated capacity. A minimum run time (e.g., 1 hour) prevents frequent start/stop cycling.
- Load shedding: In extreme scenarios, non-critical loads are shed to maintain stability. The simulation must model this as a hard constraint, not an optimization variable.
The dispatch logic must be tested across all seasons and weather conditions. A design that works in summer (high solar, moderate loads) may fail in winter (low solar, high loads) if the battery is undersized or the generator start logic is too slow.
Grid-Connected Dispatch: Import/Export Optimization
In grid-connected mode, the microgrid can import from and export to the utility grid. The optimization problem becomes economic — minimize the cost of imported energy plus the cost of local generation, minus the value of exported energy.
Key modeling considerations for grid-connected dispatch:
- Time-of-use tariffs: Import price varies by hour (peak/off-peak), the battery is dispatched to charge during cheap hours and discharge during expensive hours
- Net metering vs net billing: Different compensation structures produce different optimal dispatch strategies
- Demand charges: For commercial and industrial microgrids, the battery may be dispatched to reduce peak demand charges, which can be 30-50% of the total electricity bill
- Feed-in limits: Some utilities limit how much can be exported, creating a constraint on maximum PV output
A grid-connected microgrid simulation must handle at least two dispatch modes (import and export) with potentially different price signals for each direction of power flow.
Reliability Constraints: LOLP, SAIDI, and Reserve Requirements
Unlike grid-connected solar farms, microgrids must guarantee reliable supply to their loads. This introduces hard constraints that are not present in standard PV or BESS simulations:
- Loss of Load Probability (LOLP): The probability that load exceeds available generation at any time. Typically required to be below 0.1% (8.76 hours per year).
- SAIDI (System Average Interruption Duration Index): The average duration of interruptions. For critical loads (hospitals, data centers), SAIDI must approach zero.
- Spinning reserve: A minimum reserve margin (e.g., 10% of peak load) must be maintained at all times, either from the battery's SOC reserve or a running diesel generator.
- N-1 contingency: The system must survive the loss of the single largest generation asset without dropping load. This may require excess capacity or redundant generators.
These reliability constraints fundamentally change the optimal system design. A microgrid optimized purely for minimum energy cost may have insufficient reserve capacity to meet reliability requirements. The simulation must treat reliability as a hard constraint and optimize within it.
Component Sizing Optimization for Least Cost
Microgrid sizing is a multi-dimensional optimization problem that cannot be solved with simple rules of thumb. The optimal size of each component depends on the sizes of all other components, the load profile, the solar/wind resource, fuel costs, and reliability requirements.
A proper sizing optimization sweep should vary:
- PV capacity (kW): from 0 to 3× peak load
- Wind capacity (kW): from 0 to 2× peak load (if wind resource is available)
- Battery energy (kWh): from 1 to 8 hours of average load
- Battery power (kW): from 0.5× to 2× peak load
- Diesel generator capacity (kW): typically at least peak load (for N-1 compliance)
Each combination is simulated for one or more full years at hourly resolution. The output is a multi-dimensional cost surface showing LCOE (or NPC) for each configuration, with reliability violations flagged as infeasible.
Case Study: Island Community Microgrid in Indonesia
A remote island community in eastern Indonesia with 2,000 households had a diesel-only system: three 500 kVA generators running 24/7. Load averaged 350 kW with a peak of 620 kW. Diesel delivered cost was $1.20/L.
The proposed microgrid included 1.2 MW of PV, 3 MWh / 1.5 MW BESS, and retained two of the three generators for backup. The simulation found:
- Island mode dispatch: Fuel-save with battery grid-forming. Generator starts at 30% SOC, stops at 80% SOC with a 2-hour minimum run time.
- Diesel reduction: From 24 hrs/day to 8 hrs/day (nighttime only during low-solar months)
- Fuel savings: 58% — from 420,000 L/yr to 176,000 L/yr
- Renewable fraction: 64%
- Project IRR: 18% (real) at $1.20/L diesel, 4.5-year payback
- Reliability: LOLP = 0.04% (3.5 hours/year), SAIDI target met
A sensitivity analysis showed that a 20% increase in diesel price (to $1.44/L) pushed IRR above 22%, while a 20% decrease (to $0.96/L) reduced IRR to 13% — still above most hurdle rates.
How Energy Optima Models Microgrids
Energy Optima provides a comprehensive microgrid simulation module supporting island, grid-connected, and multi-mode microgrids. Key features include:
- Multi-technology support: PV (mono/bifacial/tracking), BESS (LFP/NMC/flow), diesel (multiple generators), wind (multiple turbines)
- Grid-forming and grid-following inverter modeling with configurable dispatch rules
- Automatic islanding and reconnection event modeling
- Reliability constraint enforcement (LOLP, SAIDI, spinning reserve, N-1)
- Multi-dimensional sizing optimization with infeasibility flagging
- Financial analysis: NPC, LCOE, IRR, payback, and fuel cost sensitivity
- Time-of-use tariff and demand charge modeling for grid-connected mode
The platform enables engineers to move from a single-point design to a full optimization surface in a single automated run, identifying the least-cost configuration that meets all reliability requirements.