In this video, we would like to model in the Hybrid Equation Toolbox, the model of a network, that in this case could be transmitting information received from the output of a physical component, a plant of a system. And we are going to do that with the idea of having a window of when the events will occur. Remember the model we described in a previous lecture, in a previous video, we have a signal that is applied to the network and that signal gets to the end of the network after some time. That time is governed by a timer. The timer that decreases linearly, and when the timer expires, which is when it reaches zero, it's reset to a value that belongs to the window TN min, TN max, here it is. When that happens in the event of resetting that follows that particular event, I'd say T1, will occur no sooner than TN min and no later than TN max. And that's one way to model this uncertainty of when the events are going to occur within a window. So the way we're going to do that is by using the models that we are already creating in the Hybrid Equation Toolbox for the subtle physical system simulation. And we want to make sure, as we said, the output of a physical components, so this is the physical component given by one of the other modules in the toolbox. This is a state X, which is multiplied by a constant, which will have to regenerate the output. So this you can think as the output M times the state of a plant to generate the output Y. That signal Y, will be what is being given to the network, and the network every event corresponding to a timer and expiring will sample this signal and put it in the memory state corresponding to the component for that in the state of the network. Also the network has a timer that triggers the events. So, you're going to initialize these, and then we are going to look at the internals of those blocks. So, in these initialization file, what I have is this is going to be the horizon, the maximum time in-between events will be 10 seconds and the minimum time will be 0.2 seconds. And the way that we actually create these events according to these parameters is by creating a sequence of time TK that are being generated beforehand, but these are different every time that a simulation is being run. So therefore, one will we be actually generating solutions or picking a specific solution to the nondeterministic model of the network. And then, the initial conditions will be given according to these values that we have right here. We will need to have, also you need your conditions for the timer. So these are the conditions here, and for to the measurements of the output of the sample of your output. For tanking resource, the network model also includes parameter J that is going to actually be useful in triggering the event internally. We don't need to get into the details of that. So let's run this script that initializes all these variables including the times that you have communication events which again, will change when we run this another time. And now, open the network model and simulate. Now is running. It's a pretty long simulation. And now we can plot the results. And this is essentially, signal's that we are sampling and sending essential network in a periodic fashion according to this timer. So what you see right here is the state Z1, the system is state Z1 and that is the signal that we are measuring because our choice of the matrix M is actually (1,0,0,0). Therefore the first state of the plant state Z is being measured by the network. And every time that there is a expiration of a timer of a network, that is a transmission of that value, until the next event occurs when the other value is transmitted and so on. As you can see there is no periodicity here of these events. What we go into in the future video is to connect these to an estimate whether that based on this sample, a periodic samples of the output of a system can reconstruct this state. I think that will be actually exponentially under certain conditions. But let's not get ahead of ourselves and then go into here, we'll more than able to understand what is going on. So the most interesting thing is when the next events are scheduled and that's so they jump map. And this function jump map is actually doing that for us. It takes the range of maximum minimum in the window and this function here, but actually, what is being used is the sequence of times that were actually defined at the initialization of the system simulation. And as you see here, the memory state is reset to the input, but the next event is going to go according to the new value of the timer, tau, and that's given by this particular choice, and that's why we use account J, which actually gets incremented sequentially to pick a new value of the new time until the next event happens, and that time by construction initialization file is within the window Tmin, Tmax. The other pieces of the implementation we'll expect events when we have tau_s which is the timer less or equal to zero, where there is no jumps, and the flow set is counting time downfall tau_s with a minus one derivative under the variables which are memory states or counters are and discrete time are with derivative equal to zero. So, this is the result of sampling with a network a periodically, the output of a plant.