Large-Scale Electromagnetic Transient (EMT) Simulation using Simscape - MATLAB & Simulink
Video Player is loading.
Current Time 0:00
Duration 47:07
Loaded: 0.35%
Stream Type LIVE
Remaining Time 47:07
 
1x
  • descriptions off, selected
  • en (Main), selected
    Video length is 47:07

    Large-Scale Electromagnetic Transient (EMT) Simulation using Simscape

    Overview

    In this webinar, we will show how MATLAB and Simscape can be used to model and simulate large-scale electromagnetic transient (EMT) power systems. Through a worked example of an IEEE test feeder network with 900+ three-phase buses, we will show how to:

    • Programmatically build an EMT model using MATLAB and Simscape Electrical.
    • Implement different data saving strategies.
    • Include a large-penetration of inverter-based resources, modeled as ideal power converters.
    • Perform fault studies.
    • Explore the impact of parameter uncertainty on system response.
    • Define and run multiple operational scenarios.

    Highlights

    You will learn how to:    

    • Programmatically build an EMT model using MATLAB and Simscape Electrical.
    • Implement different data saving strategies.
    • Include a large-penetration of inverter-based resources, modeled as ideal power converters.
    • Perform fault studies.
    • Explore the impact of parameter uncertainty on system response.
    • Define and run multiple operational scenarios.

    About the Presenters

    Graham Dudgeon is Consultant Product Manager for Electrical Technology at MathWorks. Over the last two decades Graham has supported several industries in the Electrical Technology area, including Aerospace, Marine, Automotive, Industrial Automation, Medical Devices and Power & Utilities. Graham’s technical experience covers - Transmission & Distribution, Grid Integration, Renewable Energy, Power Conversion, Motors & Drives, Microgrids, Electric Aircraft, Electric Ship and Electric Vehicle, with an emphasis on system modeling and simulation, control design, real-time simulation, and data analytics. Prior to joining MathWorks, Graham was Senior Research Fellow at the Rolls-Royce University Technology Centre in Electrical Power Systems at the University of Strathclyde in Scotland, UK.

    Mohsen Aleenejad joined MathWorks as a Senior Application Engineer in 2020. He supports customers from Energy and Power areas as well as Industrial Automation with a focus on Power Electronics and Power System applications. Mohsen has a Ph.D. in Power Electronics from the University of Kansas, where he specialized in modeling and control of multi-level power converters and fault tolerant operation of power electronics systems. Later, he started a Postdoctoral Researcher position with New York University, where he was collaborating with Boeing Company on building an Active Load Profiler for testing the Aircraft's power sources. Before joining MathWorks, he was working as a senior power electronics engineer with a focus on renewable energy systems at InnoCit LLC, and Active Front End motor drive at PowerItPerfect Inc.

    Recorded: 18 Apr 2024

    Hello, everyone, and welcome to this webinar on large-scale electromagnetic transient, or EMT, simulation using Simscape. My name is Graham Dudgeon. I'm a consultant product manager for electrical technology at MathWorks.

    Hello, everyone. My name is Mohsen, Mohsen Aleenejad, and I'm a senior application engineer here at MathWorks.

    Here is an overview of our presentation today. We'll first verbally discuss the motivation for large-scale EMT simulation. Mohsen will then take over, and he will talk about how to programmatically build an EMT model using MATLAB and Simscape Electrical. Mohsen is going to be looking specifically at the IEEE European Test Feeder. Now, that is a quasi-steady model as published, but we're using it to build an EMT model. It's a good larger-scale model for us to look at to show the benefit of programmatic build.

    We'll also be looking at how to implement different data-saving strategies. As you go to scale, then data saving becomes very important, and the number of signals you're logging, how you're logging them, the time steps you're using, the duration of the simulation-- all that comes into play. I'm then going to take over, and I'll talk about how we can look at-- including a large penetration of inverter-based resources. And we're going to specifically look at ideal power converters, so ideal Voltage Source Converters, but I will be emulating the effect of power electronic switching, so more of that later.

    And then the final three points really I'm going to consider together. So we're going to look at how to implement a large-scale system for fault studies, exploring the impact of parameter uncertainty on system response, in particular with that case, the fault resistance, and also how we can use MATLAB and parallel computing to define and run multiple operational scenarios.

    So in terms of the motivation, why is large-scale EMT becoming a big deal? Well, the primary reason is because of the increased penetration of inverter-based resources on wide-area electric grids. Now, with the larger penetration of these power converters, you've got very fast-acting response, potentially, a broad range of different types of control actions-- the two standard ones for consideration are grid forming, grid following, but there's a number of different control activities that can be implemented as well.

    And so there's this great wealth of potential dynamic response, which really does require point-on-wave or EMT simulation to capture effectively. And because we're seeing that penetration of IBRs, inverter-based resources, increasing, it's starting to affect the broad response of larger electric grids in terms of stability, speed of response, operational characteristics, and so on. So that's what's motivating the use of larger-scale EMT simulation.

    Now, I would like to acknowledge the data source for the example that Mohsen is going to talk through and I will then extend. So the IEEE European Test Feeder-- so the data is available at the link here, so we would certainly encourage you to go to this source to get the data for that network. And as I briefly mentioned, because the published results are for quasi-static power flow, as published, it's a 24-hour period with one-minute load changes. So that's 1,440 load changes.

    We're actually using it on EMT, and so we're doing the PQ load changes every three cycles, and then we're waiting one cycle to take the measurement of where the system ended up. So we can still do a comparison like-for-like, as it were, between the EMT and the RMS model.

    On the right here, this figure-- this is relative error of the published results for the three voltages on load 1, load 32, and load 53, and this is a comparison between what we got from the EMT simulation and the published quasi-static results. And you can see that we are within 0.1% relative error, so we're happy with the accuracy. But I will now stop talking and pass over to Mohsen, who is going to talk about the IEEE benchmark in more detail.

    OK, I'm going to start talking about modeling large scale-power system simulations with Simscape Electrical. Here, what you're looking at is an IEEE European Test Feeder with Simscape components. Here, you see we have four segments of our physical power system. We have 906 buses in total. And I'll be talking and explaining why we have four segments in a bit, but the main thing or the end goal is to show you how programmatically we can build a system like this and then run this model within the Simulink environment and start analyzing the largest scale power system simulation.

    For example, if we wanted to see the behavior of-- EMT behavior of the currents between buses number 1 and 2, we could come here inside Simulink Data Inspector and see the EMT behavior of those currents in here. We could zoom in and see the behavior while the simulation is running. This simulation-- the sample time for that is 50 microseconds, and we are supposed to run it for 86 seconds.

    And I'll let this simulation continue running, and I think most of you guys, when you join a webinar about large-scale modeling and simulation, you're well aware of the importance of this subject and how time consuming the process of manually modeling a large-scale system like this is. For those who are not familiar with this space, I should say, in general, one of the biggest pains in this workflow is modeling itself. A big portion of a given project, like, around 70%, 80% of the time you spend on the entire project, is the modeling portion of that before you can even start analyzing or getting something useful-- some useful information about the system.

    So this is one of the biggest pains that we have currently uncovered in this area, and we want to address this concern through the APIs and programmatic model building that we have inside MATLAB environment. So if I go back to my Simulink model and open up one of these segments, you will find more details about each segment, including all the buses we have, all the lines we have. If I zoom in around this area, you'll see we have a subsystem which has taken all of the references which are coming from the control subsystem, and everything is matrix indices. Nothing has been named manually.

    And this lets us to use the vectorizing power of MATLAB later for modeling different scenarios. We'll be talking about it in a little bit in more details. Voltage measurements, the same thing, build automatically, and if I double-click, for example, in this from block, there is this hyperlink. I can click on that. It takes me to that specific busbar. The voltage measurements are coming from three voltage measurements, and we have three Controlled Current Sources, which takes those information from current references, from control unit, control subsystem, and it is simulating the active and reactive powers through these current sources.

    So you see right now we have busbar number 1 here, busbar number 2 in here. This is the source busbar. Between these buses we have our line, coupled line. If you remember, earlier I was showing three current waveform, and these three three-phase currents are coming from three current sensors. And if I double-click on this coupled line, you'll see everything has been named as a parameter automatically. Nothing is a numeric value or these components has not been modified by hand.

    One very important feature is this configurability inside Simscape, and we have two options. And right now, it's our runtime parameter. Runtime parameters in Simscape-- this is an essential value, especially in large-scale modeling topics. So what does runtime parameter mean in Simscape? We have two options for the Simscape parameters.

    One is compile time parameter, meaning that you can change these parameters before compilation, and runtime parameter, which means you can modify it even after compilation. Before running your model again, you can change it without needing a recompile. This is very suitable for parameter variation studies, so electrical parameters, being able to modify them without triggering a recompile, being able to connect assets by using runtime parameter-- that's a huge value.

    We'll be talking about that later in Graham's portion, but if you are doing large-scale simulation where you are modeling at scale, you want to ultimately take your network model and compile it as a mix file so that you don't need to compile it again. So runtime parameter is an essential part of this workflow, and if you are doing anything with modeling at a scale where you trigger a recompile, then probably you know the pain better than me. You may be spending hours of waiting time for recompiling that model, so you can run your simulation at large scale one more time.

    So now I want to go back to the higher top level and talk about the control unit that I was talking about, the PQ loads, and using the vectorizing power of our MATLAB environment. As I mentioned earlier, MATLAB vectorizing capability gives you full control over implementing different control scenarios for evaluating your large-scale power system.

    We are taking some voltage measurements here, combining all of those voltages from those four different segments, and here we are selecting 55 of those loads. Later, I'll show you those busbars, why we are selecting those. Between over 2,700 signals that we have, you are just selecting 55 of them. And these voltages here-- these are in alternating waveform domain. Now we want to convert it to vectors, so control will be so much easier for us in vector domain.

    By using this Fourier analysis, we can take the fundamental amplitude of the main harmonic and the phase shift of that component, and we can calculate the reference current that we have for each of those 55 buses. And after that, we can convert it back into alternating waveform for references that we have inside each of these buses, so we are trying to convert AC waveforms into vectors so we could we could use all those numbers we have as indexes for different buses and do the control automatically.

    We don't want to manually change the references that we have inside each of those busbars. This is the vectorizing power of MATLAB. And also, here we have another block, another subsystem, which does the monitoring work of the simulation. So we are taking voltages, and we can compare our results to the benchmark result.

    Now that I showed you the end model, probably you started thinking about how we can programmatically build a larger scale system, a huge system like this, inside MATLAB. So for that, I'm going to go to my MATLAB window and open up this live script, and inside this live script, we have some explanations about what we are trying to achieve in here.

    And one good thing about live script is that you can have text, code, and figures inside the same environment. So I did run this live script before to show out the results because I wanted to save some time for explaining more important stuff. If I wanted to go through this build process while I'm presenting for the webinar, it would take me more than 20 minutes, so I did run it before this webinar. And all the results are saved in here, so I can show it to you.

    The first line of code that we have in here-- it does the split. It does the segmenting part of the build process. All we need to provide to this script-- inside this live script, we are calling back some other .m files, and inside this script, we have a function, which uses MATLAB graph objects to split our entire-- the whole system into four different segments. All we provide is the number of buses and the number of desired segments, and it does the split for us.

    And it tells us, OK, segment number 1 has 277 buses while segment number 4 has over 100 buses less than bus number 1. And the reason behind it is that you are having a unique physical system, and we cannot-- probably it is almost impossible to have four identical segments or four segments with same number of buses. And if we have different number of buses in each segment, that's not a problem.

    On top of the number of buses in each segment, it is showing us which buses are the points of connections between two segments which are next to each other. For example, buses number 1-- segments number 1 and 2 are connected through bus number 134.

    And if we go back to the main model, you can see these two segments are connected through bus number 134 in here, and this connection has been done by using two Simulink signals, not Simscape signals. So we have four independent Simscape networks as referenced models in here, and we are transferring some useful information from that busbar 134 by using a unit delay into segment number 1.

    And if I go under this subsystem segment number 1 and if I zoom in a little bit around this area, you can see that bus number 134-- it is connected to a VV coupler block, and this VV coupler block is receiving the voltage measurement as Simulink signals from that unit delay, used as an input, and those voltage measurements are in DQ domain.

    We are using Inverse Park Transform to make it abc, and now we are using a Controlled Voltage Source, a resistance, and a measurement, and we measure the current going through this resistor, multiplying that by the value of that resistance to cancel out that value, subtract it from the measurement from these two points, and transfer it back as DQ voltages to the other network in here. So in this way, we can share the useful information about the voltage value of that busbar into the next busbar.

    So I had to explain this a little bit in details to show you how we connect those four segments, which are independent Simscape networks, in here. And now, if I go back to my live script and scroll down a little bit more, we are receiving-- we are loading some useful information about the physical network itself in here. Before building the networks, we need to know at least some information about the busbars. Where is the location of those busbars? What is the inductance and resistance of those busbars?

    So those information could be imported inside workspace from different sources of data. For example, you could have Excel file. We had some Excel file. We loaded that information, and now we have it inside our workspace. And if I wanted to quickly show you some of them, for example, the information about the buses that we have the number of the buses, we have 906 different buses in here.

    And each of these buses-- we can see X, Y-coordinates of them, number of phases, and for the lines, we have the number of phases for different lines, which are the busbars-- line starts from one busbar and ends to the other busbar, so those information and the length of that and the line code, which is provided in here. If the line code is this, those are the impedances and resistances that we have. We have different types of line codes in here.

    And one thing I wanted to talk about in more details was that the number of that 55 buses that I was showing you earlier with indexes-- we were picking those buses from over 2,700 voltage measurements that we have, and these 55 buses are the buses that they have a load type-- a PQ load type, and the information about active and reactive power is provided here.

    So we needed those indices to kind of select the voltages and generate our reference currents from our control subsystem. With that, I'm going to go back to my live script, and after loading those necessary physical characteristics that we have for our large-scale system, we are using tic toc information before calling this function, which is generating four segments for us.

    And if I open up that live script-- that .m file in here, you can see it is showing us different useful information, for example, where is the location of each of those buses, how we place those buses. I'm going to show you, for example, how we place the buses. But there is one more useful information in here, and that's the configuration setting for solver parameters that we have for each of those networks. These are not default settings that we use for solver configuration of a Simscape network.

    The default setting doesn't work. For large-scale power system simulation purposes, we have to use this setting in here, and another thing that I wanted to talk about is these files that we provided as supporting files. We had a number of different bus types. What I was showing you was using-- if you remember, it was using three Controlled Current Sources, which you can find it inside this subsystem. And that's the configuration of the bus that I was using in the first part of this presentation.

    But in the second part of the presentation, Graham is using another type of busbar, which has more configurability. You can connect or disconnect these voltage sources. Graham is going to talk about it in more details. But this bus, for example-- it could be used for simulating the behavior of inverter-based resources. So this works as an average value without showing the DC side of the work, and we have a few options in here.

    The other thing is this piece of .m files that we have in here-- for example, for placement of the buses, we have different-- I don't want to talk about the details of the codes that we have in this project, but in your free time, you can take a look at those files. And if you have any questions, you can reach out to us.

    And one other thing I wanted to talk about is that the time that we have spent on building each of these segments, which is given here-- buses are done. Lines are done, each step completed. It gives us a report and at the end-- saying that, OK, segment 1 complete-- and at the end, we see over 10 minutes we have spent on building these four segments. And now we are compiling those segments just for once and putting those references-- those segments into these referenced subsystems, and one more important setting we need to take care is this bus that we need to use to select accelerator mode in here.

    And also, the settings of my system, which I have inside my main Simulink model-- we need to change one setting in here, and that's about reference models, model referencing. And we should select this option. Rebuild? Never. We are not going to rebuild our reference subsystems because we want to save some time. Whenever we change a parameter, we don't want to recompile it to save some time.

    So that's another thing I wanted to quickly talk about, and last thing I need to mention is data saving. One approach was simply showing our results in Simulink Data Inspector. Whatever signal you want to show, you can select that signal, come here inside Simulation tab, and check this bus, this icon, which is similar to Wi-Fi icon. If you do that, there is this icon in here. If you click on that, it's going to take you to this Data Inspector. That's one way.

    But the more important way of showing signals is by using Simulink buses. And here, at this specific bus, you can see we have over 200 signals. 212 voltage measurements are listed in here. Right now we are selecting all of those in here. But let's say you don't need to monitor all of those measurements. You care about some of those signals more than the others.

    In that case, you can simply remove those signals which are not necessary for you and select only one of them, and then when you have only one of those voltage measurements, now you can come here and send it to a file and save it inside your local drive or your local disk. You can double-click on that, give the file a name, and tell it which variable you are saving in here.

    And that's going to save all necessary information you need to know about your large-scale power system in here. And also, if 50 microsecond is too much for you for dating your data, you can simply use a rate transition block and rate your output at smaller steps. For example, if 0.1 millisecond is enough for you, you can save with a slower rate or lower resolution and save it into the disk.

    The last thing I wanted to show is the results. After saving the data, if I go back to my live script in here and scroll down all the way, these are the results that we get. And compare it with the benchmark, and you can see the relative error is less than 0.1%, which is showing that everything, including the segmenting and vectorizing and everything, is working really accurate. And with that, I'm going to hand it back to Graham, where he wants to explain more about IVR and establishing the system from zero and also fault analysis studies. Graham?

    In this section, we're going to look at incorporating Voltage Source Converters-- inverter-based resources into the IEEE European Test Feeder. So I've got the same structure that we're showing before for the benchmark, four segments where the bus layout, the lines-- they're all configured exactly the same. But what has changed with this-- let me just quickly show you.

    If I go under segment 1, I'm just going to zoom in. I'll go to bus 1. And when we're looking at the benchmark, you may remember it was Controlled Current Sources we were using, and that's a good, effective way to look at PQ loads. But now, because we've got a Voltage Source Converter, we have Controlled Voltage Sources, so Three-Phase Controlled Voltage Source, and a ground resistance-- the ground resistance becomes important when we have power converter emulation going on. That's a runtime parameter, which we can modify to fit our needs.

    And we also have this aerial line, now we've set resistance and inductance to be runtime parameters, meaning we can modify them without recompiling the network. They all have unique parameters for each bus, so every bus, so all 906 buses, have the Controlled Voltage Sources and the aerial line, which gives us full coverage of where we want to connect those inverter-based resources.

    If we are connecting an inverter-based resource, we set the resistance to the value that would be appropriate for the connected asset. If we are disconnecting, we set this resistance to be somewhat large value, 1 megaohm or larger, so it is effectively disconnected. It's still there, but it's disconnected. But this does mean we have full coverage for this model architecture where we can change the position of inverter-based resources, and we do not trigger a recompile of our main model. And that's where the advantage lies in this case.

    OK, now I have started the simulation, and one thing I'll point out-- this simulation does take about two minutes to initialize before it starts running, but now we're up and running. And what you can see is we have-- if I just zoom in here, we have 102 grid-connected assets here with three-phase, so 306 signal lines in total. Now let me show you what's going on under this block PQ, and I'll talk a little bit more about the structure, about how we can effectively create control structures and reuse them across multiple connected assets.

    So we're focusing just connecting on segment 4 here. Well, let me go under and show you this. So I've got all the elements in place for the control scheme, well, at least the basic control scheme, for PQ, PQ reference. So this is grid following control. I have my inner loop with current control, which is setting my DQO, voltages which I am then converting to three-phase.

    Now, things to point out-- I have created vectorized blocks. So you can see here that I've got 102 units coming in, 102 locations, and 3 by 102, so vectorized signals coming in. And I've got single blocks, so I've effectively got 102 control systems here. But using the vectorized components, I just have to implement that control once and reuse it. That may not always be appropriate but certainly something that's highly valuable when you're conducting studies like this.

    I also have a modular multilevel control emulation. So I've set a number of cells at 50, carrier frequency at 500 hertz for phase-shifted PWM. I'll show you the effect of that, but let me just get to the Data Inspector and show you some things while it's running so you can get a feel as well for the simulation speed.

    OK, so first of all, let me just go to the substation current. Let me just change the colors here, RGB, and show you these. You see this ramping up. Notice that? Let's talk a little bit about why that's happening in just a minute, but there you go. You're getting a good idea of the speed of simulation there.

    Notice harmonic contamination on this as well because there is harmonic effect coming in with the MMC emulation. I'll talk a little bit more about that. But we are getting the substation current here. We're seeing harmonic contamination, and so everything's looking OK there. You see the raw speed of simulation as well. I'm going to stop this, go back in, and show you a couple more things with this.

    So I set this up very specific way so I could see various things. Let me go to the voltage references, so the signals that are going into the Controlled Voltage Sources. As you can see, there's 102 of them. I'll just choose A, B, and C. Again, I'll just redo the colors, RGB.

    All right, so prior to 0.3 seconds, I've got pure sinusoids. So I'm just doing an average value type study, but then I switch in the MMC emulation of 0.3 seconds. And so you can see here we've got that emulated response, 50 cells, 500 hertz, phase shift PWM. So we can emulate that. We can construct that harmonic signature and feed that into our large-scale network.

    See those harmonics? We're at 50 microseconds timestep, so we're OK at this point. You would choose your timestep as well, depending on the harmonic signatures you're looking at. But emulating power converter response through Voltage Source Converters is very powerful, but you may also want to do the full model as well and hook that in. You'll have these options, but emulation was good for this study.

    So just to recap this one-- 102 MMCs connected to your grid. So how do we define that? How does this all work? Well, with these bus selectors, with this bus selector here, I can select the buses that I want to connect to. I can either do it manually through this UI, or I can do it programmatically.

    Now, the PQ block-- I have a callback, so let me just show you the callback. If I right-click, if I go to properties, callbacks, and an init function. So I wrote some code which executes before the simulation starts. I'm not going to dwell on this code, but I want to just explain what it does.

    It parses the bus selector, which I have used to select the buses I want to connect my grid connected assets to. It then sets all the appropriate indexing in the system for that, and I'm just going to scroll down. Please excuse us. Just to re-emphasize, you can ask us for these scripts and models. We will send them to you on request, so you can take a look at this at your leisure.

    But I just want to get down to this point here where I'm actually setting the Rg and Lg values at the ground as well to appropriate values for the grid-connected assets. I mentioned before that if an asset is not connected, it's resistance will be set to a high value, and we can do that programmatically.

    Final point about this-- we saw the substation current and ramping up, so what's the mechanism of that? Well, I very simplistically set active power references on each asset, which are time-delayed. So there's my reference for asset 1, and 0.3 is where the MM-CM simulation kicks in-- that's why you see the distortion there-- bus unit 2 or asset 2, asset 3, asset 4, asset 5, et cetera.

    And you can see the overshoot with the control systems. So I'm just incrementally stepping them to 20 kilowatts in this case, and the combined effect is we've got a ramp on our substation current. So that's what's going on there, so we have the ability to either interact with our power system through Controlled Current Sources or through Controlled Voltage Sources. When we are looking at IBRs, grid-connected assets, we have that flexibility to do that. So I hope this example has conveyed some of that to you.

    My final example will be looking at faults. For our discussion on fault studies, I'm going to just stick to one segment, segment 1 of the 906 bus. The reason is when you put faults in, things take a bit longer, and so it's effective, I think, just to look at segment 1 for the purposes of this section. So let me just show you again the segment.

    So it's the same architecture again in terms of its layout, and the buses and the lines is all the same. But what's different this time is we now have reference signals for circuit breakers. Let me just double-click on this. I've put in, like, 27 three-phase circuit breakers. Let me just go to one, bus 243. I'm just following the Goto and From blocks.

    So again it's a different bus. We've seen the bus that has the Controlled Current Sources where we've done the benchmark evaluation. We've seen where we have Controlled Voltage Sources for when we're looking at voltage source inverter-based resources, and this one-- we've got circuit breakers, three individual circuit breakers in each of the phases, a ground resistance, and we can control these circuit breakers.

    And we have parameterized an on resistance and the off conductance using runtime parameters, so we may vary those. OK, so I'm just going to run this and get this going, and then I'll show you some results in the Data Inspector, then explain what's happening with this particular scenario. So there it is. It's up and running.

    I'm going to look at the substation current. In this case, again, I'm just going to get these colors, RGB, and we'll take a look at those. So what I'm doing in this case-- I'm just sequentially going through faults. So I'm going through abc on the first bus, abc on the second bus, and just two cycles. So basically, engage the fault, and then disengage the fault.

    And that's all I'm doing here, and so I can see various fault levels for the parameterization I'm using. And I can just run faults one at a time, fairly straightforward here. There's nothing else in this network. It's just the network with the source at the substation, which is actually embedded into the network this time, and I'm just faulting things one at a time.

    But I want to think about how to do things programmatically. We're not just going to run one fault scenario. We want to have flexibility over that. And so I would like to show you how we set-- how we set that up. OK, so what I have here is just a basic script where I'm running for scenarios. So let me explain what's happening here with the time vectors.

    You'll see I've got two different types of time vector. First of all, I've got this linspace where I'm just stepping from zero to five seconds with 81 steps. What I'm doing with this is I'm just saying, I'm going to start engaging and disengaging these faults at different times, so 81 faults, and then when they're engaged as dictated by this time vector. So this is when I'm stepping through each one individually, so abc, abc, et cetera.

    The next one, where I've got three time vectors that are the same but I'm running them for a third of the time, what I'm basically-- or the third of the number of elements. What I'm doing here is I'm actually engaging abc at the same time, so a three-phase to ground fault. So that's the difference between the first linspace, which is single-phase faults sequentially done, same thing, vector, three-phase fault sequentially done, then single-phase fault, three-phase fault. And it's just one way of doing it. There are different ways of making sure you're triggering those faults appropriately, but I find that to be convenient for demonstration.

    The other part of this, which will change is on resistance of the fault. So the first two scenarios, my on resistance is 10 microohms, and then my next two is 1 ohm. What we then do is we create simulation objects. So I'm just looping through the my scenarios, and we're not limited to four. I've only done for demonstration purposes. You could do potentially hundreds or thousands or millions of scenarios.

    But you can create these simulation objects in one, and what I do is say, OK, for the first scenario, set my variable to the appropriate time vector, set my on resistance to the appropriate resistance value, and you do that for each scenario. When you have your simulation objects, just use parsing, and feed in the simulation objects. And just let it go, and it will then run with Parallel Computing Toolbox. It will run these scenarios on multiple cores, a so-called embarrassingly parallel implementation. Then everything is saved in this out_multi data structure.

    All right. Let me just bring my MATLAB command window over. I'm just getting the screen-- so you can see here I've got that history of running the simulation, so I've completed four simulation runs. It was running on parallel workers. Now out_multi contains the data, so let's take a look at a couple of those scenarios. And let's look at scenario number 1.

    So this is where we're doing the sequential single-phase fault, abc, abc, so you can see that that's just going as expected. Let's now look at the second, which is the three-phase faults. And you can see here-- oh, let's just get back to that. You can see here we have the three-phase faults being applied sequentially.

    So a basic example, but I hope that conveys the way in which we can do multiple scenarios. So I hope you got some value from my sections, the Voltage Source Converter, and also the fault studies and then the setting up operational scenarios programmatically, looking at parametric variation as well as operational variation. And with that, I will pass back to Mohsen.

    OK. In summary, we talked about how we can programmatically build a model instead of manually building by hand. We talked about creating a generic model by using Simscape's runtime parameter. Then you only compile your model once for different model use cases, and you recompile the small Simulink-based control subsystem.

    We talked about data saving and parameterization. We showed how we can have fixed PQ load subsystems or we can have IBRs connected to each of the busbars. We talked about MATLAB vectorization that can be used for control purposes, controlling several buses by simply changing the indices of one matrix or one block inside the control subsystem. This concludes our webinar. Thank you so much.

    View more related videos