Discrete-event system

System

The components that could serve as a functional whole can be seen as one system.

There will be the input vector u(t), the state vector x(t) and the output vector y(t) in one system. 

\dot{x}(t)= f(x(t),u(t),t)

y(t)=g(x(t),u(t),t)

And x(t) contains essential information that can guarantee: if you know the u(t) and x(t), then you could know all information after instant t. 

Stationary & Dynamic System

Stationary system is the system that the output in the instant time t is totally independent of the input before the time t. For example, in the mass-spring system, if we give a displacement of the object ( seen as the input ), we know the amplitude of the sinusoidal movement is this distance, which means it's not a stationary system. But the spring itself can be considered as the stationary system. 

Dynamic system means the output in the instant time t is influenced by the input and the original state. 

Time-variant & Time-invariant System

If for every t and \tau, and any equal input u, we could get the equation: 

g(x(t+\tau ),u(t+\tau),t+\tau)=g(x(t),u(t),t)

Then we could say it's time-invariant system. 

Linear system &  Non-linear system

If the system could meet the following equation (both functions of f(x,u,t) and g(x,u,t) ):

g(\alpha _1u_1+\alpha_2u_2)=\alpha_1 g(u_1) +\alpha_2 g(u_2)

then this is a linear system, 

And the relationship between the input, output and state could be: 

\dot{x}(t) = A(t)x(t) + B(t)u(t)

y(t) = C(t)x(t) + D(t)u(t)

And it's also the time-invariant system, we could get: 

\dot{x}(t) = Ax(t) + Bu(t)

y(t) = Cx(t) + Du(t)

Continuous & Discrete Event System 

If the state is continuous, eg. the physical variant: velocity, acceleration, it can change in any real number, the system is the continuous event system. Many physical problems are continuos system and can be solved by differential equations.

But the computer and many relative components appears, the 0-1 system has discrete states. It can be only considered as discrete event system.

Continuous & Discrete Time system

In the physical problem, we could get the variants value in every time, and the time is continuous. However, sometimes, we just look as things at certain time such as 11:00 o'clock, 12:00 o'clock. The time is discrete. 

Time & Event Driven System

In some systems, the change of the states are not driven by the time, and it's driven by the events. So we could say it's an event-driven system.

Deterministic & Stochastic System

In strochastic system, there exists more than one output that is random. 

Three Type Of Discrete Event System

Language (just the order of events), timed language (the order of events and time points of events), stochastic timed language ( probability of every order of timed events that happened  )

Building Block of Discrete Event System 

There are two key points in the discrete event system: state S and event E (which will change the state)

Queueing System

1. Entities that do the waiting in the quest for resources. Because the resources are limited, entities have to wait, such as people waiting for bank serves, the information waiting for being processed by CPU. So the entities are the fluxes in the system, which can be measures as one standard of the state.

2. Resources that deal with entities and is scarce compared with entities. such as the bank counter or the CPU. So the resources are considered to be stationary and receive entities, deal with entities and sent entities to the next place (outside of the system, or next queue, other resource)

3.Space where entities wait for resource in order, such as the queue in the bank, or the buffer in the computer. So queue is usual in the real world, queues receive entities and sent entities to next place. And it takes time. Sometimes there is the maximum for the queue, then it rejects for receiving entities.  

Therefore, the problem is the tradeoff between efficiency and cost. The entities should be satisfied well, resources will be efficiently used and the cost of this system is acceptable. 

In the QUEUE, it could receive the customer (E, or can be considered as customer arrivals) and sent the customer to the server(E, can be considered as server receive a new custom). The state of the QUEUE is the number of the customer inside(S). Moveover, because the queue is passive, we often consider the event belongs to other object. So the event relevant to the queue will be Customer arrival from outside(E) and Server receiving a new customer(E).

For the Server, it could receive the customer(E) and send the customer to the next place(E). The state of the server will be idle(S) and busy(S). Sometimes, if the next place of this Server is another server and another server is working, even this server has finished its work, it still could not sent the customer outside and have to wait. So this will be one more state and event. Finish the service(E) and send the customer(E) will be seperate. And busy(S) and waiting for sending(S) will be two states. 

However, in many cases, there will no receiving a new customer from the queue(E), because there may be a default rule that when the event( sent the customer to the next place) happened, a new customer will automatically sent to the server. That is to say, if we know 

What's more, the networks in the Queue system can be complicated. So there will be order discipline that define the order of customers in different queues getting into the same server. 

Example: Database Systems

Problem of queueing in multi-Transactions.

Transaction 1: read_1(record a), read_1(b)

Transaction 2: read_2(a),write_2(a),read_2(b),write_2(b)  ( change 100$ from a to b )

If these two transactions interleave in this queue: 

read_2(a),write_2(a), read_1(a),read_1(b), read_2(b),write_2(b),

we could find after changing the record a in the transaction ( write_2(a) ), reading record a and b will make the sum money imbalance. 

So sometimes we could not make customers toallly in order so as to make result correct. 

Hybrid Systems

In some problems, discrete systems and continuous systems are mixed into one problem. They can be considered as different level of one problem. 

 We could make some commands through the interface, through which the commands can be changed into the signals and control the continuous controller and system. 

 Automata 

Strings and languages

Automata is the language that provides a way of describing the untimed discrete event system. 

We define every event as the alphabet number. And the sequence of the events will look like a string. And this string represents the sequence of the happening events.

\varepsilon: empty event

s: string or sequence of events.  |s| means the number of events in this sequence.

Concatenation:  cat(a,b) = ab, cat(ab,b)=abb ;

Kleene-closure: if E={a,b,c}, then E*={ \varepsilon ,a,b,c aa,ab,ac,ba,bb,bc,aaa,... }, contains all finite strings. But this set is infinite.

Terminology about strings: if tuv =s with t,u,v belongs to E*,

then, we could say:

t is the prefix of s; 

u is the substring of s;

v is the suffix of s;

moreover, we could say tu is the prefix of tuv, uv is the suffix of tuv and so on ( we could see empty event as the prefix or suffix too.)

L is the subset of the E*(which is the set of all events episode), and contains some strings.

Concatenation of string sets:

\mathbf{Let\ L_a,L_b \subseteq E^*,\ then \ L_aL_b:=\left \{ s\in E*:(s=s_as_b)\ and\ (s_a\in L_a)\ and\ (s_b\in L_b)\right \} }

Prefix_closure:

\mathbf{Let\ L\subseteq E^*, then \ \bar{L}: = \left \{ s \in{E^*}: (\exists t\in E*)| st\in L \right\}}

prefix-closure of L contains all prefix of strings in L.

If L = prefix-closure of L, then we could say L is prefix-closed. 

Kleene-closure:

\mathbf{Let\ L\in E^*,then\ L^*:=\left \{ \varepsilon \right \} \ \cup L\ \cup\ LL \cup LLL \ \cup...}

(L*)* = L*

Post-language: 

\mathbf{Let \ L\subseteq E^*\ and\ s\in \bar{L}, then \ L/s:=\left \{ { t\in E^*:st\ \in \ L }\right \}}

\mathbf{L/s\ =\ \phi ,if \ s\ \notin \ \bar{L}.}

 Projections of strings and languages

 P: E_l^*\rightarrow E^*_s \\ P(\varepsilon ) = \varepsilon \\ P(e) = e, \ if \ e\in \ E^*_s,\ else \ \varepsilon \\ P(se) = P(s)P(e),\ for\ s\in E^*_l,e\in E_l

P(s) wil be the concatenation of the every events in s string.

P^{-1}:E^*_s\rightarrow E^*_l \\ for \ L_s \subseteq E^*_s,\ P^{-1}(L_s)\ = \ \left \{ s \in E^*_l:\exists t \in L_s,P(s)=t \right \}

Example

Automata: state transition diagram: 

Transition function:  X\ ,\ E\ \rightarrow \ X:  we know current state and the event happening, then we obtain the next state, such as X = {x,y,z}, E = {a,b,g}, f(x,a) = x. 

The event may not change the state, but we say it change to tiself. And maybe two different events will make same states to the same states.(In this way, we may not be able to distinguish them by observations). In addition, it's partial function, which means we do not need to define for every event at each state.

initial state x_0, it will be identified by an arrow pointing into it. 

remarked states X_m\subseteq X. also means final states we expect. it will be identified by double circles. 

Deterministic automation

G={X,E,f,\Gamma ,x_0,X_m}: state machine ; generator 

X: the set of states

E: the set of events 

f: the function of completing state transition

\Gamma :X\rightarrow 2^E, which is the active event function. \Gamma (x) is the set of all events e for which f(x,e) is defined and it can be also called active event set.

x_0: the initial state. (usually only one state)

Xm: the set of marked states.

If X is the finite set, we call G a deterministic finite-state automaton, shortened as DFA

Languages represented by Automata

The language:

 \L(G):=\left \{ s\in E^*:f(x_0,s)\ is\ defined \right \}, includes all events starting at the initial state, which is the biggest event set in the G.

The language marked:

\L _m(G):=\left \{ s\in\L (G):f(x_0,s) \in X_m \right \}, includes all events, starting at the inital state and ending at marked states.

 If f is a total function, \L (G)\ =\ E^*.

Language Equivalence of Automata: 

G1 is equal to G2, when \L (G_1)=\L (G_2)\ and \ \L _m(G_1)=\L _m(G_2)

Blocking

\L _m(G)\subseteq \overline{L_m(G)}\subseteq L(G)

If there is no blocking (dead blocking and live blocking), \overline{L_m(G)} = L(G)

There are two types of blocking: liveblock(3,4), deadblock(5)

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值