1:39

And using the models that we already have derived,

Â we can actually come up with the full equations,

Â differential and difference equation with constraints that govern this whole system.

Â So we can assume here that we have a general plant with an input.

Â Its output is a function of the state and its Y.

Â The input to the system is,

Â being the ADC, is V S,

Â the output is M S,

Â and there are events that occur when Tau S is equal to T S star.

Â In the other side,

Â we have Tau H and we have here an input which will

Â be V H and an output that will be M H. For the cyber,

Â we can have different type of situations.

Â Imagine that we have a finite-state machine where you have Q plus equal to delta Q,

Â V where this is the input and that the output theta is given by kappa of Q,

Â where kappa defines the output.

Â So this interconnection is

Â defined by the following assignment.

Â So the input to the converter is assigned to the output of the physical.

Â The input to the cyber is assigned to the output of a converter from analog to digital,

Â the input to the digital to analog is assigned to the output of a cyber,

Â and then the input to the physics is assigned to

Â the output of the converter from digital to analog.

Â With those assignments and the individual models,

Â we can actually arrive to the equations for the full system,

Â and these equations will be also given by differential and difference equation.

Â The one thing that you need to realize here is that we have two different events.

Â One of the events is when the timer Tau S,

Â which is T S star,

Â and the other event is when the timer Tau H reaches Tau H star,

Â and this could occur simultaneously,

Â which is very unlikely, or independently.

Â So we need to handle all the possible situations.

Â Certainly, when there are no events,

Â which corresponds to the case where Tau S is in zero to

Â T S star and Tau H is in zero to T H star,

Â then what we are going to have here is

Â a variation of these variables according to the laws that were already described.

Â So, the only thing we need to keep in mind here are the assignments.

Â Since the input to the physics assigned to the memory M H,

Â this is what we should write here,

Â the next state is Tau S dot which should be equal to one.

Â We will have also Tau H dot equal to one.

Â We will have M S dot equal to zero and we will have M H dot equal to zero.

Â And because the cyber is given by a finite-state machine and the variable

Â there is Q which doesn't change in between updates is going to have Q dot equal to zero.

Â Now the events will be given when Tau S is equal to

Â T S star or when Tau H is equal to T H star.

Â So we need to post-process here the events or handle the events,

Â so we are going to consider first the case of Tau S equal to

Â Tau S star and Tau H in the range of no events,

Â and then we can do the case where Tau S is in the range of

Â no events and then Tau H is equal to T H star.

Â And we could do also the case where the two of them occur,

Â but you will see what will happen.

Â So when the events occur,

Â we need to come up with an update law

Â for all these variables.

Â So we're going to have one right

Â here and fill them up.

Â The first one I would like to process is the one corresponding to sampling.

Â When sampling occurs, Z does not change because Z is part of the model,

Â of the physics, so it should be reset.

Â The same occurs when the other occurs.

Â Okay, but let's go back to this.

Â When this sampling event occurs,

Â we already said that the input to the ADC will be

Â used to update this quantity M S,

Â so that will be equal to Y.

Â We are not having an update of this block,

Â so this body will remain the same and this time it will remain the same.

Â However, since we have reached an event because of this condition,

Â we will reset this to zero.

Â And as we did for the implementation of the FSM,

Â we can use now here the update of Q to be delta

Â Q to the input V which is equal to M S. Similarly,

Â for the other case,

Â the timer that corresponds to the event will need to be reset to zero.

Â The input to that block will reset to the output of the machine,

Â in this case, the cyber component,

Â and the other variables will remain the same.

Â What you can expect now is that when the two events occur at the same time,

Â which can be written down,

Â you will have that this and this update

Â occur as well as this and this update because of these mechanisms,

Â and because of the implementation of the finite-state machine,

Â this event will occur as well.

Â And that will give us the full model of this feedback coming from sample and hold

Â where now we will have to design these parameters in order to get a property,

Â for instance, that this state Z converges to a certain value.

Â