The purpose of this exercise is to complete the deterministic simulation of the system. The simulation is contained in the file "NetworkSimRun.m" and comprises the following parts:

  1. initializiation
    1. get network parameters using function "getNetworkPars"
    2. compute initial state using load flow method
    3. perturb parameters
    4. initialize trajectory arrays and current variable values
  2. compute instantaneous changes
    1. compute the changes in algebraic states and state derivatives caused by changes in static or dynamic parameters
    2. compute events fired as a result of the change in algebraic states
    3. compute supervisor allowed events Gam
    4. execute possible events from Gam
    5. update dynamic parameters z
    6. compute the changes in algebraic states and state derivatives caused by changes in static or dynamic
    7. repeat until no new events are fired
  3. compute the continuous changes
    1. execute dae solver ode15i
    2. if event is fired during execution, return to compute instantaneous changes
    3. if no event is fired before t = tF, deterministic simulation is complete

For today you will need the following Matlab functions:

You will also need the following updated functions:

In order to test your deterministic simulation, use the following data file:

Once you download the above functions, you will need to complete one more function to run NetworkSimRun.

The objective of this exercise is to complete this function: function [x0,d0,p0,z0] = getNetworkX0(-4,p0,z0,St,Co,fnames,options). Use the load flow method from Exercise 4 to complete this function.

At the end of the exercise confirm your results by uploading the validation data file and comparing the trajectories therein with trajectories computed by your simulator for Dat(:,10).