Chapter 9
Grid Modeling, Optimization and Decision Making
Bachelors Program in Electrical Engineering
Smart Grid Technology
•
Bachelor
Grid Modeling, Optimization and Decision Making
Introduction
Modern power-system operation is a model-based decision process. Control-room engineers must determine whether the network can supply demand securely, estimate the actual system state from imperfect measurements, schedule generating units, forecast uncertain demand and renewable production, and select actions that balance cost, reliability, emissions and other objectives. Smart-grid technology strengthens this process by combining conventional power-system models with advanced measurement, communication, automation, optimization and data analytics.
The central operational chain is:
represent the network mathematically;
estimate or calculate its electrical state;
predict future conditions;
optimize controllable resources;
evaluate uncertainty and constraints;
implement and monitor the decision.
No optimization is more reliable than the model and data on which it is based. Consequently, engineering judgment, validation, cybersecurity and regulatory compliance remain essential even when sophisticated software or artificial intelligence is used.
Learning Objectives
By the end of this chapter, students should be able to:
formulate basic bus, branch and generator models;
explain and apply load-flow methods;
describe weighted least-squares state estimation;
formulate optimal power flow and unit-commitment problems;
select suitable forecasting and uncertainty-analysis methods;
explain multi-objective optimization and decision-making;
interpret operational results while recognizing assumptions and limitations.
1. Mathematical Representation of a Power Grid
A transmission or distribution grid is commonly represented as a graph. Buses are nodes and lines, transformers and other components are edges. Each bus may have specified or controlled quantities: active power P, reactive power Q, voltage magnitude V, and voltage-angle δ. The complex bus voltage is
Vi = |Vi|∠δi
where |Vi| is in per unit (p.u.) or volts and δi is in radians or degrees. Per-unit modeling uses selected base power Sbase and base voltage Vbase. The base current and impedance are
for a balanced three-phase system using line-to-line voltage. Per-unit values are dimensionless, but the selected bases must be used consistently.
The nodal network equation is
I = Ybus V
where I is the vector of injected complex currents, V is the vector of bus voltages, and Ybus is the bus-admittance matrix in siemens or per unit. For a branch between buses i and j with series impedance zij, its series admittance is yij = 1 ÷ zij. Transformer taps, line charging, shunts and phase shifts modify the corresponding entries of Ybus.
For bus i, complex injected power is
Si = Pi + jQi = Vi Ii* = Vi (∑j=1n Yij Vj)*
where j is the imaginary unit, the asterisk denotes complex conjugate, and n is the number of buses. This equation is nonlinear because voltage magnitudes and angles multiply one another.
Bus Types
Bus type
Specified quantities
Usually solved quantities
Slack/reference
[[MATH:
V
PV generator bus
P, [[MATH:
V
PQ load bus
P, Q
[[MATH:
The slack bus balances system losses and any mismatch caused by imperfectly specified injections. Generator reactive-power limits must be checked after solving; if a PV generator reaches a limit, it is commonly converted to a PQ bus with fixed reactive power.
2. Load Flow Analysis
Load flow, or power-flow analysis, calculates steady-state voltages, angles, branch flows and losses for a specified operating condition. It is used for planning, contingency analysis, voltage assessment and real-time operation.
Newton–Raphson Method
Let the state vector contain unknown voltage angles and magnitudes. Define the mismatch vector as specified injection minus calculated injection:
Δf(x) = fspec − fcalc(x)
At iteration k, Newton–Raphson updates the state using
J(xk) Δxk = Δf(xk), xk+1 = xk + Δxk
where J = ∂f ÷ ∂x is the Jacobian matrix. The method is locally quadratic near a solution, but it requires a reasonable initial guess and may struggle near voltage-collapse conditions or with poorly scaled models.
The fast-decoupled method exploits the approximate independence of active power and angle, and reactive power and voltage magnitude:
B' Δδ = ΔP ÷ |V|, B'' Δ|V| = ΔQ ÷ |V|
The exact matrix forms depend on the chosen scaling and implementation. The method is computationally efficient for high-voltage transmission systems but less reliable for heavily loaded, resistive or distribution networks.
Distribution Load Flow
Distribution feeders are often radial, have a high resistance-to-reactance ratio, and contain unbalanced single-phase loads. Backward/forward sweep methods are therefore useful. In the backward sweep, branch currents are calculated from downstream loads toward the source. In the forward sweep, bus voltages are updated from the source toward the feeder end. Three-phase models may be required for phase imbalance, neutral currents and voltage unbalance.
Worked Example: Two-Bus Voltage Estimate
Consider a simplified lossless two-bus system. Bus 1 has fixed voltage V1 = 1.0 p.u. and bus 2 supplies a load of P = 0.80 p.u. through a reactance X = 0.30 p.u. Neglect reactive demand and resistance. The approximate voltage-angle relation for a lossless line is
P ≈ (V1 V2 ÷ X) sin δ
Assuming V2 ≈ 1.0 p.u.,
sin δ ≈ PX ÷ (V1V2) = (0.80 × 0.30) ÷ 1.0 = 0.24
Thus δ ≈ 13.9°. This is an approximation, not a complete load-flow solution: voltage magnitude, reactive power, losses and generator limits have been neglected. It nevertheless illustrates that active-power transfer increases with angle difference and decreases with reactance.
3. State Estimation
Measurements in a smart grid are noisy, asynchronous and sometimes erroneous. Supervisory control and data acquisition systems may receive bus-injection measurements, line flows, voltage magnitudes, phasor measurements and breaker-status information. State estimation converts these measurements into a consistent estimate of bus voltages.
The measurement model is
z = h(x) + e
where z is the measurement vector, x is the state vector, h(x) is the nonlinear measurement function, and e is measurement error. In a conventional positive-sequence estimator, the state commonly consists of voltage angles and non-reference voltage magnitudes.
Weighted least squares minimizes
J(x) = [z − h(x)]ᵀ R⁻¹ [z − h(x)]
where R is the measurement-error covariance matrix. If errors are independent, R is often diagonal, with larger variance receiving smaller weight. Linearizing about xk gives
H(xk) Δx = z − h(xk)
and the normal-equation update is
Δx = [HᵀR⁻¹H]⁻¹ HᵀR⁻¹ [z − h(xk)]
provided the matrix is nonsingular and the system is observable. The Jacobian H contains measurement sensitivities. Bad-data processing examines residuals and can identify suspicious measurements, but sophisticated false-data attacks may evade simple residual tests. Phasor measurement units provide synchronized voltage and current phasors and can improve dynamic awareness, observability and model validation.
4. Optimal Power Flow
Load flow asks, “What state results from specified injections?” Optimal power flow (OPF) asks, “Which feasible injections and control settings best satisfy an objective?” A general AC-OPF can be written as
minimize F(x,u) subject to g(x,u) = 0, hmin ≤ h(x,u) ≤ hmax, umin ≤ u ≤ umax
Here x represents network states, u controllable variables, g = 0 power-balance equations, and h operational quantities such as branch flows, voltages and generator outputs. Typical controls include generator real and reactive power, transformer taps, capacitor switching and flexible demand.
A simplified generation-cost objective is
F = ∑i=1G (ai Pi² + bi Pi + ci)
where Pi is generator output in MW, ai, bi and ci are cost coefficients, and G is the number of generators. The coefficients must be calibrated to the relevant cost convention. A practical objective may add emissions, losses, voltage-deviation penalties or reliability costs.
DC-OPF linearizes the network by assuming approximately constant voltage magnitudes, small angle differences, negligible resistance and a lossless network. It is fast and useful for market clearing and screening, but it cannot accurately represent voltage magnitude, reactive-power or thermal effects. AC-OPF is more physically complete but nonlinear and potentially nonconvex. Linear, convex-relaxation and mixed-integer formulations are selected according to accuracy and computational requirements.
5. Unit Commitment and Economic Dispatch
Economic dispatch determines generator outputs for committed units. Unit commitment additionally determines which units are on or off over a time horizon. A binary variable ui,t ∈ {0,1} indicates whether unit i is operating at time t. A simplified objective is
where Ci is production cost, SUi and SDi are start-up and shut-down costs, and v and w indicate start-up and shut-down events.
The basic power-balance constraint is
∑i Pi,t + Pimpt − Pexpt = Dt + Plosst
where Dt is demand and Ploss,t is network loss. Additional constraints include
Pimin ui,t ≤ Pi,t ≤ Pimax ui,t
and ramp limits
−Ridown ≤ Pi,t − Pi,t−1 ≤ Riup
as well as minimum up/down times, reserve requirements, fuel constraints and transmission limits. Unit commitment is a mixed-integer optimization problem and may be solved using mixed-integer programming, dynamic programming, Lagrangian relaxation or specialized decomposition.
6. Forecasting and Uncertainty
Operational decisions depend on forecasts of load, solar and wind generation, prices, outages and electric-vehicle charging. A point forecast gives one expected value; a probabilistic forecast gives a distribution, prediction interval or set of scenarios.
For observations yt and forecasts ŷt, common accuracy measures are
MAE = (1 ÷ n) ∑t=1n |yt − ŷt|
RMSE = √[(1 ÷ n) ∑t=1n (yt − ŷt)²]
MAE is in the same units as the variable and weights errors linearly. RMSE also has the original units but penalizes large errors more strongly. Percentage measures can be misleading when actual demand is near zero.
Forecasting methods include persistence, seasonal averages, regression, exponential smoothing, autoregressive models, state-space models, gradient boosting and neural networks. A model should be selected through time-ordered validation, not random shuffling alone, because future information must not leak into training data. Forecast performance should be assessed separately for normal conditions, extreme weather and rare events.
Uncertainty can be represented by scenarios s ∈ S with probability πs, where ∑s πs = 1. A stochastic objective may be written
minimize ∑s∈S πs Cs(xs)
subject to shared first-stage decisions and scenario-dependent recourse decisions. Robust optimization instead seeks decisions that remain feasible for all values within a specified uncertainty set. Stochastic methods use probability assumptions; robust methods provide protection without requiring exact probabilities but may be conservative.
7. Multi-Objective Optimization and Decision Making
Grid decisions rarely have one objective. Cost, emissions, resilience, voltage quality, renewable utilization and equity may conflict. A weighted-sum formulation is
minimize J = w₁ f₁(x) + w₂ f₂(x) + … + wm fm(x)
where fk are normalized objective functions and wk ≥ 0 are weights satisfying ∑wk = 1. Normalization is essential because dollars, tonnes of CO₂ and reliability indices have different scales. Weights should reflect transparent stakeholder priorities, not obscure political or commercial choices.
A solution is Pareto-optimal if no objective can be improved without worsening at least one other objective. The Pareto frontier helps planners understand trade-offs. Techniques include the ε-constraint method, goal programming, lexicographic optimization and evolutionary algorithms. Final selection should include sensitivity analysis: if a small change in weights radically changes the chosen plan, the decision is not robust.
Decision quality also depends on criteria outside the mathematical objective, including cybersecurity, maintainability, workforce capability, legal duties, public acceptance and interoperability. These factors should be documented rather than hidden in unexplained numerical penalties.
8. Integrated Operational Workflow
A practical energy-management workflow begins with validated topology and equipment data. Measurements are screened, time synchronized and processed by state estimation. Short-term forecasts are generated, and scenarios are constructed for demand, renewable output and outages. Unit commitment and OPF then determine schedules and control actions. A contingency analysis tests credible failures such as a line or generator outage. Operators review violations, reserve margins and sensitivity results before issuing commands. Measurements after implementation close the feedback loop.
Integrated smart-grid decision workflow
Figure: Integrated smart-grid decision workflow
Figure: Measurements, estimation, forecasting and optimization form a closed operational decision loop.
9. Illustrative Case: Renewable-Rich Distribution Feeder
Background
A fictional municipal utility operates a radial 11-kV feeder supplying residential customers, rooftop photovoltaic systems, a battery and electric-vehicle chargers. At midday, photovoltaic production is high and feeder voltage approaches its upper limit. In the evening, demand rises rapidly while solar output falls.
Problem
A day-ahead schedule based only on expected load produces two risks: excessive midday voltage and insufficient evening ramping. The utility must maintain voltage within its permitted band, reduce peak imports and avoid unnecessary battery cycling.
Analysis and Approach
The utility first validates the feeder topology and phase-specific customer data. A three-phase load-flow model is used because phase imbalance is significant. Probabilistic forecasts produce scenarios for cloud cover, household demand and vehicle charging. A mixed-integer optimization schedules battery charge/discharge states and flexible charging periods. The objective combines energy cost, voltage-deviation penalties, battery degradation and a penalty for unmet flexibility. A robust constraint limits charging schedules so that feeder voltage remains feasible across the selected uncertainty set.
The optimization is followed by scenario load flows and an outage screen. The operator rejects a mathematically cheaper schedule because it leaves too little reserve for a communication failure. The final schedule charges the battery during high-solar periods, limits selected vehicle charging during the evening ramp and reserves battery capacity for forecast error.
Outcome and Learning Points
The scenario reduces peak substation import and keeps modeled voltages within limits without relying on a single optimistic forecast. Its success depends less on the optimization algorithm than on accurate phase models, trustworthy measurements, realistic battery limits and clear override authority. The case demonstrates that distributed energy resources should be treated as controllable flexibility, but only within customer, privacy, cybersecurity and equipment constraints.
10. Limitations, Governance and Professional Practice
Models are abstractions. Incorrect topology, outdated impedance data, missing transformer taps or unmodeled protection settings can invalidate results. Correlated forecast errors may make independent scenarios overconfident. Optimization can also produce infeasible commands if communication latency, discrete control delays or human procedures are ignored.
Critical applications should use version-controlled models, documented assumptions, independent validation and reproducible studies. Operators need explainable constraint violations and the ability to reject automated recommendations. Cybersecurity controls should include authentication, least-privilege access, network segmentation, secure updates, anomaly detection and incident-response procedures. Measurement and customer data require privacy protection and retention policies.
Regulatory requirements commonly address reliability, power quality, market conduct, interconnection, safety and data protection. Engineers must distinguish an economically optimal result from a legally permissible or operationally safe result. AI forecasting and optimization can improve performance, but training-data bias, concept drift, adversarial manipulation and opaque recommendations require monitoring. Human accountability cannot be delegated to a model.
Best-Practice Checklist
Use a validated, version-controlled network model.
Check observability, measurement quality and bad-data indicators.
State all objective functions, constraints and units explicitly.
Validate forecasts using time-ordered out-of-sample data.
Represent forecast and outage uncertainty rather than hiding it.
Test optimized schedules with nonlinear load flow and contingencies.
Include equipment limits, reserve, ramping and communication constraints.
Perform sensitivity analysis on costs, weights and forecast errors.
Preserve operator authority, audit trails and secure access controls.
Reassess models after topology, equipment or market changes.
Chapter Summary
Grid modeling converts physical equipment and topology into equations describing voltages, currents, power and constraints. Load flow determines the steady-state operating condition, while state estimation reconciles noisy measurements with a physically consistent state. Optimal power flow selects control settings subject to network equations and operating limits. Unit commitment adds time-coupled binary decisions, start-up costs, ramping and reserve requirements. Forecasting supports these decisions, but uncertainty from weather, demand, outages and markets must be represented through scenarios or robust sets. Multi-objective optimization exposes trade-offs among cost, emissions, reliability and flexibility. In professional practice, model validation, cybersecurity, regulatory compliance, explainability and operator oversight are as important as mathematical optimality.
Key Terms
Bus: A node at which electrical quantities are represented.
Per unit: A normalized representation based on selected power and voltage bases.
Bus-admittance matrix: Matrix relating bus currents to bus voltages.
Slack bus: Reference bus balancing active and reactive mismatches.
PV bus: Generator bus with specified active power and voltage magnitude.
PQ bus: Load bus with specified active and reactive power.
Load flow: Calculation of steady-state voltages, angles and flows.
Jacobian: Matrix of sensitivities used in nonlinear solution or estimation.
State estimation: Statistical inference of grid state from measurements.
Observability: Ability to determine the state from available measurements.
Bad data: Measurement inconsistent with the network and other measurements.
Optimal power flow: Constrained optimization of grid operating controls.
Unit commitment: Scheduling decisions determining generator on/off status.
Economic dispatch: Allocation of output among committed generators.
Reserve: Available capability held to respond to uncertainty or contingencies.
Point forecast: Single predicted future value.
Probabilistic forecast: Forecast represented by distributions, intervals or scenarios.
Robust optimization: Optimization designed to remain feasible over an uncertainty set.
Pareto-optimal solution: Solution for which no objective improves without another worsening.
Contingency analysis: Assessment of system behavior after specified failures.
Review Questions
Short Answer Questions
Why is a slack bus required in conventional load-flow analysis?
Distinguish a PV bus from a PQ bus.
What information does state estimation add beyond raw measurements?
State two assumptions commonly used in DC-OPF.
Why must forecast errors be considered in unit commitment?
Long Answer Questions
Explain the Newton–Raphson load-flow method, including the role of the mismatch vector and Jacobian.
Describe weighted least-squares state estimation and explain the importance of the covariance matrix.
Compare AC-OPF and DC-OPF in terms of accuracy, computational effort and application.
Formulate the principal constraints of a unit-commitment problem and explain their operational meaning.
Discuss how cybersecurity, data quality and human oversight affect automated grid decisions.
Analytical / Application Questions
A generator reaches its reactive-power maximum during a load-flow solution. Explain how the bus type should be treated and what operational issue this indicates.
Design a forecasting and optimization workflow for a feeder with high photovoltaic penetration and evening electric-vehicle demand. Identify at least three uncertainties and appropriate validation tests.
A planner must choose between a low-cost transmission reinforcement with high emissions and a higher-cost low-carbon alternative. Propose a multi-objective framework, identify normalization and weighting issues, and explain how Pareto analysis could support the decision.
Multiple Choice Questions with Answers
Question 1
Which quantities are normally specified at a PQ bus?
A. Voltage magnitude and angle
B. Active and reactive power
C. Active power and voltage magnitude
D. Reactive power and voltage angle
Correct Answer: B. Active and reactive power
Question 2
In the nodal equation I = Ybus V, what does Ybus represent?
A. The bus-admittance matrix
B. The generator-cost matrix
C. The measurement covariance matrix
D. The Jacobian of forecast errors
Correct Answer: A. The bus-admittance matrix
Question 3
What is the main purpose of the slack bus?
A. To eliminate all reactive-power limits
B. To represent the reference angle and balance mismatch
C. To specify every load voltage
D. To force all line flows to zero
Correct Answer: B. To represent the reference angle and balance mismatch
Question 4
Which method explicitly minimizes a weighted measurement residual objective?
A. Economic dispatch
B. Weighted least-squares state estimation
C. Fast-decoupled load flow
D. Unit decommitment
Correct Answer: B. Weighted least-squares state estimation
Question 5
A DC-OPF generally neglects which effect?
A. Generator active-power limits
B. Voltage-angle differences
C. Reactive-power and voltage-magnitude behavior
D. Transmission topology
Correct Answer: C. Reactive-power and voltage-magnitude behavior
Question 6
Which variable commonly indicates whether a unit is operating in unit commitment?
A. A continuous voltage angle
B. A binary status variable
C. A covariance coefficient
D. A branch admittance
Correct Answer: B. A binary status variable
Question 7
If the actual values are 10 and 14 MW and the forecasts are 12 and 11 MW, what is the MAE?
A. 1 MW
B. 1.5 MW
C. 2 MW
D. 2.5 MW
Correct Answer: B. 1.5 MW
Question 8
What distinguishes a probabilistic forecast from a point forecast?
A. It always has zero error
B. It provides a distribution, interval or scenarios
C. It uses no historical data
D. It can only forecast voltage
Correct Answer: B. It provides a distribution, interval or scenarios
Question 9
A Pareto-optimal solution is one for which:
A. All objectives have identical numerical values
B. No objective can improve without worsening at least one other objective
C. The cheapest objective is always selected
D. All constraints are removed
Correct Answer: B. No objective can improve without worsening at least one other objective
Question 10
Why should an optimized schedule be tested with load flow after optimization?
A. Optimization never includes any variables
B. The schedule may violate nonlinear electrical or contingency constraints not adequately represented
C. Load flow determines fuel prices
D. Testing removes the need for measurements
Correct Answer: B. The schedule may violate nonlinear electrical or contingency constraints not adequately represented