1 of 65

How to optimize a power grid

Austin Tuttle

2 of 65

My background

  • 2015 - SunEdison - Wind Resource Analyst - Work life, messy data, not well defined problems
  • 2016 - Zuse Institut Berlin - Medical Data Analysis - Teamwork, data science, survey research, misc programming
  • 2017 - Cray - Software Engineer - C programming, high performance computing, math libraries
  • 2018 - Stratasys - Systems Engineer - Open ended engineering problems,

Education

2014 - B.S in Physics and Applied Math (University of the Pacific)

2019 - PhD in Applied Math (UMN)

Internships What I learned

3 of 65

Current Job

“Power systems developer” in “DMS”(Distribution management systems) at OSI(Open Systems International)

Write software that assists in operation of the distribution grid.

  • Traditional software development + power systems
  • Continuous simulation of electrical grid
  • Plan outages, determine impact and safety
  • Minimize cost by reducing losses
  • Dynamically keep grid components within operational limits

2019 - Open Systems International (Private ~1000 employees)

2020 - Emerson (Public 87000 employees…)

2021 - AspenTech (Public 3000 employees)

4 of 65

Intro to power systems

5 of 65

Greater Picture

Grid structure:

Generation

Transmission

Distribution(ME)

6 of 65

3 phase power

Power is distributed along 3 “phases” (parallel lines)

  • Each phase is 120 degrees out of phase(0,120,-120)
  • Natural “sum to zero” current is useful
  • Helps motors be simpler by providing a rotating magnetic field.

Two phase does exist, those are 90 degrees out of phase.

Can translate between the two with transformers.

7 of 65

Grid Components and behavior

Lines Carry current

Switches Cutoff current/provide current

Transformers Step up/down voltage for optimal delivery

Regulators Maintain voltage balance

Capacitors Balance reactive power

Loads Eat power

Generators Create power(within the distribution grid itself)

8 of 65

Distribution:Substation

9 of 65

Distribution: Substation

10 of 65

Substation

11 of 65

Loads/Distribution transformer

12 of 65

Capacitors

13 of 65

Hierarchy structure

14 of 65

Looped structures

15 of 65

Interesting grid things

Reclosers

ATOs(automatic throw over)

Different connection type transformers(usually 3->3 phases, but some can transfer 1->2)

16 of 65

Delta-Wye transformer diagram

17 of 65

Steady State Calculations

Topology:

  • “Will touching this thing shock me”
  • What is the hierarchy information, what things does this feeder feed?

Load Estimation:

  • How much power is each load consuming

Power Flow:

  • Compute voltage and currents for the system

Violations:

  • “Is anything operating outside of operating limits”

18 of 65

Basic Physics

Kirchoff's laws:

Current law: Sum of currents in/out of nodes is 0 (We use this one with I = YV to build matrices)

Voltage law: Sum of voltage differences around a loop is 0

Alternating current -> complex “phasor” form:

(Power = Voltage * Current)

(volt-ampere=Watts + Var), real and reactive power

Ohm’s Law DC to AC

Z = impedance

Y = admittance

19 of 65

Basics of Power Flow: Y-blocks

1

2

3

y12

y13

y23

y1

y2

y3

20 of 65

Basics of Power Flow: Y-blocks

1

2

3

4

5

6

yi can be zero if there’s no “shunt”.

This happens for lines. Causes Y-blocks for lines to be singular

Much larger than rest

21 of 65

Basics of Power Flow: Ohm’s Law

Vi=voltage at node i

Ii = current flow into node i

Y is very sparse, symmetric, complex, diagonally dominant

Y v=i

22 of 65

Basics of Power Flow: Current Injection

Sk=Pk+jQk=VkI*k

Power injected at a node is given by(P is power, Q is reactive power)

In a power system, current is injected from endpoints. So we compute:

Ik=S*k/Vk

23 of 65

Basics of Power Flow: Iteration

Assign all loads a power injection: S

With an initial voltage guess: V

Ik=S*k/Vk

Yv=i

Update voltage, recalculate Ik using it.

Let in be the current at step n, vn the voltage.

In=S*/Vn

Yvn+1=in

For step n:

Stop when converged

Solve for v

24 of 65

Basics of Power Flow: Complexity

  1. Different types of current injection: Constant current, constant power, constant voltage
  2. Capacitors and generators react differently and inject current. Generators can cause instabilities in the calculation.
  3. Y is not constant, but piecewise constant. Regulators “regulate” voltage and adjust their admittance as a function of V. So really it is: Y(v) v=i
  4. Low voltage causes components to get disconnected.
  5. Load is merely estimated, and can be off

25 of 65

Matrix: Examples

95,000 x 95,000: 700,000 nonzeros

15,633 x 15,633: 81,000 nonzeros

26 of 65

Matrix: Low Fill in

95,000 x 95,000: 1,250,000 nonzeros

15,633 x 15,633: 117,000 nonzeros

27 of 65

Comments

28 of 65

Managing a power grid in real time

29 of 65

Problem #1

Faults

30 of 65

Faults: How to find them and fix them

Example: Tree falls on a line.

Downstream: power is knocked out

Upstream: current surges as power goes to ground. Breaker trips

Breaker outages more customers

Where’s that tree?

Let’s show a simple example

31 of 65

Source

Closed switch

Open switch

Customer

Example

32 of 65

Source

Closed switch

Open switch

Customer

Trip

Measured fault current

Fault

33 of 65

Source

Closed switch

Open switch

Customer

Trip

Calculated

Location

Via simulating fault current

34 of 65

Source

Closed switch

Open switch

Customer

Isolate

Close

Open

Open

35 of 65

Source

Closed switch

Open switch

Customer

Restore #1

Causes overload

Close

36 of 65

Source

Closed switch

Open switch

Customer

Restore #2

Close

Causes overload

37 of 65

Source

Closed switch

Open switch

Customer

Restore #2

Close

Close

Share Capacity

38 of 65

Problem #2

Dealing with hot days

39 of 65

Var Control

Air conditioners, for example, consume reactive power reducing voltage. This can cause large amounts of “losses” to appear in the network.

We can utilize grid components to minimize this power loss.

40 of 65

Example

Source

Capacitors

Transformer

Regulator

Regulator

Generator

Load

Regulator

Capacitor

Capacitor

Load

Loads

41 of 65

Control Variables

Source

Reactive Power: Q

Downstream Voltage: Vd

Q

Vd

Q

Vd

Vd

Real Power: P

Complex Power: P+jQ

P+jQ

P+jQ

42 of 65

State Space

Source

Capacitors: S:{0,1}

{0,1}

{0,1}

Transformer:

t:{ t=Real, -16<t<16}

Regulator:

r:{-8<r<8}

r:{ -12<r<12}

r:{ -12<r<12}

Generator:

g:{ g=Real, 0<g<max}

Loads:

l:{ Outaged/Not}*

Not a very good choice….

43 of 65

Problem Statement

Minimize: F(Cap States, Tap Positions, Generators)

Subject to:

  1. Solving Yv=I (Power flow)
  2. No “Violations” (No overloading, no low or high voltage violation, no underloaded customer)

Performed periodically, as demands/conditions change

  • Calculating F/G involves solving powerflow
  • F is just some L2 measure of losses or something else
  • G is an activation function: e.g: if Vi > Vmax = 1, else 0.

44 of 65

Algorithm(s)

Break up into separate parts

Voltage Optimization:

Minimize F(tap positions)

Var Optimization:

Minimize F(cap states)

Gen Optimization:

Minimize F(gen power)

Volt/Var Optimization

Power Flow Optimization

3rd option:

Feeder reconfiguration

Switch changes to move loads

From one feeder to another

45 of 65

Problem #3

Faults and Real-time Data

46 of 65

Problems of Timing

General problem statement:

Customer sees a fault. When recovering from it the estimated loading is way off causing an underloading condition that is not safe.

During the fault, the “last energized” value recorded on loads appears off.

Why….

47 of 65

5 kW

5 kW

5 kW

2 kW

2 kW

2 kW

20 kW

15 kW

6 kW

21 kW

20 kW

41 kW

Not measured but inferred from above

Same with all the loads

Nominal

50 kW

48 of 65

0 kW

0 kW

0 kW

2 kW

2 kW

2 kW

20 kW

0 kW

6 kW

6 kW

26 kW

  • Fault Triggers open
  • Measurements adjust

Nominal

50 kW

49 of 65

0 kW?

2 kW

2 kW

2 kW

20 kW

0 kW

6 kW

6 kW

26 kW

  • Recloses
  • Measurements don’t update

Nominal

50 kW

0 kW?

0 kW?

Or maybe 10 kw shared?

From

And this one is wrong?

50 of 65

15 kW

19.7 kW

2 kW

2 kW

2 kW

20 kW

26.3 kW

0 kW

6 kW

6 kW

26 kW

  • Recloses
  • Measurements don’t update

Nominal

50 kW

50 kW - 6 = 46 remain

Proportions were:

Bottom = 20/(41-6)->26.3

Top = 15/(41-6)->19.7

51 of 65

15 kW

19.7 kW

2 kW

2 kW

2 kW

20 kW

26.3 kW

0 kW

6 kW

6 kW

26 kW

Fault still exists, we reopen

Nominal

50 kW

Save “last energized” value

With last energized we can tell if a tie can

Take the load

But 19.7 is not a good value.

We shouldn’t have saved it, we should have

Kept 15!

52 of 65

15 kW

19.7 kW

2 kW

2 kW

2 kW

20 kW

26.3 kW

0 kW

6 kW

6 kW

26 kW

Problem:

  1. How do you detect this?
  2. How do you calculate the which measurements to trust?
  3. Can you do it fast?

Nominal

50 kW

53 of 65

15 kW

19.7 kW

2 kW

2 kW

2 kW

20 kW

26.3 kW

0 kW

6 kW

6 kW

26 kW

Problem:

  • How do you detect this?
  • How do you calculate the which measurements to trust?
  • Can you do it fast?

Nominal

50 kW

State: Closed

State: Closed

State: Closed

State: Closed

State: Closed

6 kW

These are “SCADA points”

Status values: On/Off, Open/Closed

Analog values: 0,1,1.1,-1 etc

They are measurements that get “scanned” and updated. We receive those updates when they change values.

54 of 65

15 kW

19.7 kW

2 kW

2 kW

2 kW

20 kW

26.3 kW

Analog:

10 sec

Everything has a timestamp

  1. If a state change is after an analog, that analog is suspicious
  2. But, a state change only impact analogs in a direct up/down line

Nominal

50 kW

State: 20 sec

State: 0 sec

State: 0 sec

State: 0 sec

Analog:

12 sec

Analog:

10 sec

Analog:

4 sec

55 of 65

Misc Thoughts

56 of 65

Unexpected Problems

  • Working with code that no one understands (this black box, numbers go in, stuff comes out, how we get it is a big ?? but it works, so don’t touch it)
  • Company specific nomenclature and topics makes looking up something hard if not impossible
  • Solving problems where the solution is entirely from your own head, with no real external input. (My first “project” was, a customer has this regulator that has a response curve the looks like this, well what are the parameters and is there more info? No just the pixelated graph)
  • Customers ask for a solution that is too specific, work with them to get to where they want. Convince them how what they want is either impossible(because of code architecture, physically impossible, or can be done but only if we change X to Y)

57 of 65

What a PhD brings

  • I can work on my own with very little external input. I don’t need to constantly go back and ask for guidance. Just layout the problem and I can (generally) take it to the end.
  • Our system is very complex, hundreds of thousands of lines of code for just my team. Given a single input point, I can muddle my way through end-to-end via abstraction and logical inference that come directly from what I learned throughout grad school.
  • Can breakdown a complex system into logical components and fill them in as needed. And argue through unexpected interactions between parts(the hardest of bugs to fix)
  • Mentoring new hires feels very much like teaching undergrads(because most of them are!). An interesting change here is the transition from teaching them to relying on them.

58 of 65

Misc advice

  • There’s more than just data science jobs out there. There are many slots for a mathematician in engineering companies
  • In roles I’ve had, I can generally surprise people with the kinds of problems we can solve.
  • In my current role, I “built out” my experience from a single point. I poked and prodded into every space to where I became the expert in many areas and, critically, can sniff out and find areas of improvement. “This algorithm is very slow and repeats logic that can be inferred”. “This area, if changed to do X can assume Y and be faster”.
  • Advocate for yourself and your own work. Speak out on what you’ve done (we do bi-weekly demos, I made sure to always demo something, in that way people outside my team came to know me, even during COVID)

59 of 65

Demo?

60 of 65

Questions?

  • How did I get/find my internships?
  • How did I learn to program?
  • How did I find my job?
  • Navigating salary discussion?
  • Looking for a job while having a job?
  • Discuss power flow/linear algebra comments(about how to improve a thing that’s 10+ years old)
  • Discuss optimization reality, how it actually works? How I helped shape it(or the lack thereof)
  • What’s software development like? General day(s)?

61 of 65

End

62 of 65

Problem #4

Investigating reliability and planning

63 of 65

Test future planned changes to the grid

Increased loading

New grid components

How in sync are fault protection devices?

Study historical data

64 of 65

Test future planned changes to the grid

These tests can involve perform thousands of tests on similar systems, how can we minimize the time of this?

65 of 65

Small Problem 1

Coloring