 So this is a really fun project as Richard mentioned. This is funded by CERC, the Strategic Energy Alliance. This is a cool project for a couple of reasons. One of which is that I get to work with Michael Wara. He's Stanford Woods Institute for the Environment and a lawyer by training and sort of avocation. And so he thinks a lot about the regulatory of policy issues. And so this is a cool project where we get to interface between modelers, you know, geeky large systems of equations, and the real kind of legal policy regulatory economic questions that drive utility decisions. Students in postdocs have been working in this. Mo and Luke are working in it currently. The bulk of the technical work was done by my fabulous former graduate student, Gregory Von Wald, who did this as a large part of his thesis work. Also collaborated with folks from Los Alamos National Lab, Anatoly Zlatnik, and Karthik Sundar. And they've been helping a bunch with the project. So lots of folks involved. Okay, so like why should we talk about gas in an increasingly renewable world? Obviously the world is moving towards renewables and renewables are growing very quickly. But gas demand is still increasing. We need clean, firm power generation. We want process heat without particulates in industrial regions. We want flexible backup for renewables. Ideally we'd have some redundant infrastructure. You know, things like the Texas Blackout, for example, during that cold spell are good examples. But how will we reconcile the need for gas system services with climate progress? And how much will electrification affect the demand for gas and the need for gas distribution systems? So we've got this massive system here. These are intra and interstate pipelines across the United States. And we can see here, you know, this massive buildout of a century or so of laying pipe in the ground. What are we going to do with this as electrification progresses? Is there a need for this? How much will we need? And what are we going to replace natural gas with in the long run if we need to replace it? There's a lot of constraints facing gas utility, both technical and regulatory factors. So on the technical side, you've got things like energy supply has to meet demand while meeting, you know, concerns about physical safety, deliverability, system integrity. Okay. These are actually sort of operationalized in terms of composition, heating value and contaminant standards. And often there's a whole sort of nested set of overlapping standards that kind of intersect with each other. And then, you know, those are sort of mediated by this social layer, which is utilities are required to serve customers to meet needs while keeping costs contained and doing it safely, right? And this is the, in the case of California, this is where the public utilities commission steps in and says, you can or can't invest in this infrastructure and recover those costs. And often, you know, what they can do is limited because of concerns about cost. As an example of like how these might, you know, it's like this is a fun case study we did from a former paper of Greg. We modeled the local gas system in Hanford, California, which is, we call it Cowtown, because it's in the central valley of California. There's probably more cows than humans, large dairy systems. And so basically, we put dairy, biogas digester injection points at major dairies. And then we modeled in, for example, October versus January, what would the heating value of gas be in the pipe system, right? And so by doing essentially mass balance on the nodes, we can track the compositional makeup by node. And you see here that actually the heating value changes over the course of the year, as more or less gas demand from, as actually the intersection of gas demand plus gas supply from the digesters. So it's just an example of what you sort of might face in a high renewable gas version of the future. So what you basically do is you do statistical analysis to create representative days by selecting template days. And here each template day has kind of got a color, right? So that's the representative for that particular type of day. And then you use that to paint in, you know, if you had a color for each particular day, it would, you know, you'd need 365 shades, each day is unique. What we instead do is say, okay, I'm going to paint in with the nearest day such that I only actually have to model, let's say, six, seven, eight days. We've tended to be able to solve with kind of a five to 10 day kind of timeframe. And we'll talk about the computational effort involved. But this is essentially done at each investment year. So in 2020, 2025, 2030, et cetera, you go through a new model this template year or this these template days over the course of the model year. Importantly, we use constraints to link days. So for example, these are the weekend days here, these different colors. So those actually the model statistically finds that weekend days are different. And so those are in a different color. What we can do actually we can track between days. And so for example, if you have less electricity demand on the weekend, you can create hydrogen or a synthetic gas product store that and use that gas during the week so we can track across days. Essentially the kind of yield and amount and storage both for batteries and gas. We do have power demand constraints at each node. So basically what you say is, you know, local generation minus what we ship out plus what we discharge. Essentially has to equal demand for consumption of power at the node and demand for production of of sin fuels at the node. This is the residual form of the constraint equation. You can move these two demand sides over. So this basically has to hold at each node. The gas flow constraints and the other are similar in a way. The flow is a function of squared pressure between the two nodes. And so along a pipe, basically the amount of flow is proportional to the squared pressure modulated of course by the diameter of the pipe and some other factors. And so we actually have a decision variable in units of differential squared pressure that we use and we're constrained to keep that within a min max. We can't have too large of a pressure gradient between two nodes. Gas constraint, let's see here. So this power balance is satisfied hourly. Now in reality we know power has to balance instantaneously on the grid but we use an hourly approximation of that. The gas system on the other hand, this only has to balance for each representative day. We could model this on an hourly basis but that would increase our number of variables fairly significantly. Okay so we applied this to a template electric gas system. So Anatoly and his coworkers at Los Alamos built this system and published it in a 2016 paper. This combines an IEEE 24 bus sort of standard electric network model. IEEE promulgates these sort of basic kind of vanilla scenarios and so they have different levels of scale and fidelity and folks who do electric system modeling will sort of model these. It's okay I modeled the IEEE standard 24 bus system. They then coupled that to this 25 node gas system with external sources of supply, compression, power to gas, etc. We do have electricity storage, power to gas, biomethane, etc. On there and we do have linkages for example here. This system here takes gas and injects it into this gas generator which produces power. Oh actually yeah right there. Similarly J24 connects to this one right here. So we have these two networks that are on top of each other and we need to satisfy demand for gas and power between them. Okay computational challenges. Gas flow direction is not known a priori. So before you solve a particular instance in this case the gas flow is resolved daily so a particular day. You won't necessarily know which direction on my map the gas is going to flow. Okay this makes the problem non-convex. What we do is we introduce what are called binary variables to indicate flow direction. So a one will be flowing one way, a zero will be flowing the other will be flowing the other direction. Okay this can be useful because for example I think this is quite important we may face the future we're in the summer and let's use California as a case study. We have significant excess generation of electricity in the south. Okay in the winter we may have significant excess electricity demand in the north right and then those aren't necessarily the same seasonally right. So those those sort of directional shifts required in energy may differ with the season. So ideally you could flip these and say okay if I'm modeling a winter day for example I could have the gas flowing in one direction. If I'm modeling a summer day the gas may flow in another direction. Okay because there may be a need to adjust these because we're basically harvesting resources in a more variable spatiotemporal sense. If I fix the flow direction say I'm going to predetermine which way the gas is going to flow and only allow it to flow in that direction our baseline model for modeling out to 2045 will take 40 minutes with 8 CPUs and 64 gigabytes of RAM. So that's a pretty typical laptop nice laptop but a laptop sort of scale an hour that's fine. Bidirectional never solved in pure form we had to set a termination criteria to say well when you get within 1% that's called an optimality gap consider that good enough and then it would finally solve in 14 hours with 128 core CPU and a terabyte of RAM. Okay so this is computationally crazy quite quickly. She set it to kill after 24 hours so before we set the termination criteria we never actually got it to solve with that bidirectional problem. So this can get pretty crazy thankfully at Stanford we have great computational resources and so we can just call a big they call it a big mem instance which is has this terabyte of RAM and 128 cores. Okay so what are some baseline results these are the peak week of demand for that same nodal structure and we just transplanted it into two locations we said mountain northwest coastal pacific. Okay so we took that pretended the same little or region was just you know sort of taken and plopped down into different locations and northwest this peak week this is the week of peak demand is what we're plotting here and it's 68 hours comes in the winter and you see pretty significant for example natural gas combined cycle loading you can see the solar profiles etc here's our peak week in the summer the coastal pacific case again a lot of natural gas solar and wind so these are the kinds of results you get negative here means we're basically consuming power in this case to make electrolytic hydrogen and storing into lithium ion battery are these basically storing in there you can see this shoulder effect here that's basically storing out of the battery so this is storing into the battery that's storing out of the battery so that's what battery load shifting looks like in this kind of model we're also tracking with each investment time period the share of appliances so this is really important when you're combining gas and electric systems and this is something that we didn't you know this was year two or three of Greg's thesis before we realized is you're seeing a condensation of you know three years of very hard work from a very smart guy Greg's when you know we get these students at Stanford where sometimes you're just like yeah okay you're smarter than me go run work on it teach me I really sharp guy you know so we're doing a lot of stuff in here and it's a monumental paper I mean the paper is just ridiculous anyway so we're tracking at the commercial sector in the residential sector basically on the cooling space and space heating and then water heating what are the shares of the appliances so you can see here in mountain northwest by the mid 2030s or so we've shifted entirely to electric heat pump water heating from gas water for example to meet the target okay so you can see these shifts in the appliance stock is tracking in each investment time period how many of each appliance type are there we can do a lot of case studies um boy they um uh you know that are of interest we can look at things like gas quality constraints look at shifts and appliances um you know look at shifts and understanding here's gas quality limits in this right uh set of profiles we have no gas quality restrictions and here we have a daily nodal gas quality restriction so this says every day at every node you must satisfy all gas quality restrictions which for example in this case I think is a 20 molar blend wall on hydrogen okay and so that says at every node at every day you cannot exceed 20 hydrogen okay this says no gas quality restrictions at all okay so in this case what you end up seeing is gas demand stays quite a bit higher here when we don't have those gas quality restrictions this is annual gas usage or generation and in this case where we have the gas quality restrictions by the later time period we end up using maybe half as much gas okay there are spatial effects of these gas quality limits oh and then in between case so no limits this is annual limits this says uh over the whole network over all the nodes over the whole year you can't exceed 20 hydrogen so this is an important question we need to face when we're thinking about advanced gas grids is how sort of tight do we want to be on these constraints so I just need to say well I can't exceed 20% on average over the course of the year because it's a long-term degradation effect or is it an acute effect where I say at no time can I exceed 20% in any location okay and that's this nodal hydrogen limit but you see here when we go to no hydrogen limits we get a lot of this bright green color that's hydrogen generation we need a lot more than over here on the right that node changes completely right and so limitations on the gas side actually affect geographically where things end up happening okay and that'll affect the flows what are the roles for appliance shifts this is amazing we just said here put in a constraint if you have a gas furnace you have to replace it with a gas another gas furnace you have a gas water heater you have to replace it with another gas water heater so we artificially limited the system in its ability to shift to an electric water heater or an electric heat pump and so you see pretty huge shifts to creating electromethane and electrolytic hydrogen in this case to satisfy that gas demand whereas the same exact scenario if we optimize for costs rather than forcing like appliance turnover then we we get much less of that and a lot more use of batteries oh this is this just shows up in a lot more investment for electromethane if we do this persistence appliance case steady predictability this one was kind of fun as the model is currently stated here's the policy target it's followed in this paper that we published already we'll open that up and explore it a little bit later but we need to in each of these years 2020 to 2045 meet this policy target we assume you know that in advance and it's certain and you're planning and investing such that you know that well as a utility operator do you actually know that you're certain that these targets are going to hold what if you're myopic and here myopic basically says I know what the target is in this year but I'm ignorant about what the target is going to be in the future I have no information and so in that case you get these shocks where instead of a steady shift to heat pumps you get these sort of shocks because you need to meet a certain target in a certain year and you didn't know ahead of time right so this is a work in progress we're exploring the dynamics of this sort of thing okay so five or ten minutes on a case study three minutes oh my lord five more minutes thank you Richard yeah scholar and a gentleman you are yeah yeah um so we're developing a for we we promised in the proposal that we do three regional case studies with us so rather than this toy I Tripoli bus we're going to do a northeast California and an ERCOT so basically we'll do three regional kind of case studies we're starting with the California model we have 17 building climate zones we have the electric network of you know all the high voltage transmission we have the gas a large-scale transmission gas network we have zip code level demand for electric and gas we have power plant level consumption from EIA form 860 aggregated again to these we're going to end up with like 17 climate zones are going to be our nodes amazingly you know we can get the power plants by notes so so climate zone two here that's all geothermal that's the geysers power plant climate zone six is Los Angeles coast of Los Angeles it's all gas right so depending this is the Mojave desert is all yellow that's solar so depending on the zone we have a mix of existing generators we can get demand side variation by hour from this model called res stock out of n real so for example here's a 24 hour profile of gas demand in 15 minute increments for a in-use load profile for CEC California energy commission building climate zone one and amazingly we know the shares of appliances and stocks because there's the residential appliance saturation study performed by the California energy commission which was a very detailed survey to go into thousands of homes and say okay do you have a heater if it's a heater is it electric is it gas etc so we actually have a really good breakdown by climate zone so once we have this and so basically we're building out a really detailed model for California where we're going to be able to do this I think there's a dozen this is where we and we just basically we just got our first sort of tranche of money and we're just sort of starting to do this in the last three to six months or so but I think there's a dozen interesting questions and I'll just leave it here basically you know what are the impacts of electrification incentives or subsidies how much alternative gas can be blended while meeting constraints we can do heating value constraints we can do max hydrogen constraints if you have a max hydrogen constraint then maybe you need to make synthetic methane well synthetic methane is thought to be more expensive right can rules at the new build stage have material impacts this is a huge important policy question a lot of the effort is focused on well if you're building a new home you should electrify the new home this is big efforts in california northeast europe other places that's fine and that sounds good and it's very cost effective right because you don't need to pay for the gas hookup right you avoid all that infrastructure expansion you say okay i'm just going to go with an electric build that makes a lot of sense but i have real real questions about whether that's going to do much because of our our low rate of housing turnover okay at least in california what are the impacts of municipal level gas ban so again if you ban new gas hookups what does that do wind is powered a gas a cost effective alternative to other forms of energy storage are we actually going to do that compared to batteries in our base cases we tend to do do a fair amount of power to gas power to hydrogen and sometimes power to methane but in what cases does that make sense are there equity impacts from the transition so are we going to basically uh you know result in large economic shifts and this is kind of a cool one can you know sort of stage conversion or pruning of the gas system reduce costs while maintaining servability or serviceability reliability right so can we say okay this region for example low demand high fixed cost because we have a large amount of infrastructure electrify that region selectively prune the gas network is that kind of strategy cheaper than trying to maintain the whole system and electrifying sort of randomly piecemeal along the way okay so this is a three-year project we're just getting started we're kind of six months in a ton of super interesting questions it's got the right mix of geeky and and sort of interesting for me i'm not i'm not inherently geeky i don't i don't geek out for the sake of it but this has a lot of i think super uh germane question so happy to take some questions i i'm pretty burnt through my time but i can maybe take one if richard if there's yeah sure that's fine yeah my unknown yeah so that's excellent question we don't have any of that in there right now an interesting way to do that would be to essentially stochastically knock out during some representative days this power line and what happens right we don't have great resolution on kind of the physics of power flow in order to really get at that you'd probably want to do a real ac power flow simulation which is a tricky thing ours is a much simpler power flow kind of model it's it's basically a dc optimal power flow and so i don't know that we could actually do that the way a electric system engineer would want to do that what we could do perhaps is say okay here are some case studies to create that seem like they create pinch points in our model take them to a more sophisticated grid simulation tool and try to model just those few hours right because this is hard enough to do with the very simple power flow physics right and so doing that at that more granular level would be super interesting right now um but yeah we haven't done it right now basically we just say demand has to be met in every hour but we don't have any stochastic failure or offline you know generators or or you know randomly offline power lines or anything like that but that would be a very cool thing to do may have big advantages for keeping the gas system going right you have these um unknown stochastic failures of the electric grid