# Dynamic Optimization of Data Packet-based Communication for PLC Visual Monitoring
## 2 Dynamic Optimization of Data Packet-based Communication for PLC Visual Monitoring
### Descriptions of Data Packet-based Communication
It can be re-written as \(D^{N}_{c}\triangleq\left\{P\middle|N/c=N/(c-1)\right\},\ \forall P\in\{1,2,\ldots,N\}\). Note that \(F(P)\) is for \(P\in D^{N}_{c}\), and it is monotonic increasing in \(D^{N}_{c}\). Thus \(J(P)\) is a saw-tooth function. For any \(P\), the corresponding local minimum for the saw-tooth function is:  
\[P^{-}\triangleq\min\left\{P\in D^{N}_{\left[\frac{N}{P}\right]}\right\}\] (19a) This minimum can be given analytically, i.e.,: \[P^{-}\triangleq\left[\frac{N}{\left[\frac{N}{P}\right]}\right]\] (19b) Regarding any \[N\], all local minima for the saw-tooth function are determined by: \[\overline{N}\triangleq\left\{\frac{N}{\left[\frac{N}{P}\right]}\middle|P\in\{1,2,\ldots,N\}\right\} \tag{19c}\]All local minima for the saw-tooth function in \(\left[P^{\prime}_{L},\ P^{\prime}_{U}\right]\) are shown as:  
\[D\triangleq\left\{\frac{N}{\left[\frac{N}{P}\right]}\middle|P\in\left\{P^{\prime} _{L},\ldots,P^{\prime}_{U}\right\}\right\}\] (20a) If \[N\] is a prime number, according to ( 17 ), the objective \[J(P)\] regarding \[N+1\] is alternatively considered within \[[2,N-1]\]. Hence the monotone is not guaranteed in boundary \[1\] and \[P^{-}\triangleq\left[\frac{N}{\left[\frac{N}{P}\right]}\right]\]0. Let's revise: \[P^{-}\triangleq\left[\frac{N}{\left[\frac{N}{P}\right]}\right]\]1 (20b) The minimum of \[P^{-}\triangleq\left[\frac{N}{\left[\frac{N}{P}\right]}\right]\]2 is based on ( 20a ) or ( 20b ), i.e., \[P^{-}\triangleq\left[\frac{N}{\left[\frac{N}{P}\right]}\right]\]3. It is worth noting that (1) the number of the local minimum for a saw-tooth function is much less than those in the feasible domain, and (2) the candidate space \(\left[P^{\prime}_{L},\ P^{\prime}_{U}\right]\) for searching the optimal point is largely reduced, even if \(N\) is a prime number. Next, let us consider the constrained problem (11). The upper bound constraints for the cognitive response (11) satisfies:  
\[P^{-}\triangleq\left[\frac{N}{\left[\frac{N}{P}\right]}\right]\]4  
**Lemma 3**. : An optimized solution mode for (11) satisfies:  
\[ \begin{split} P^{*}&=Arg\underset{P\in D^{\prime}}{ min}J(P)\\ D^{*}&\triangleq D\cap\left\{P\middle|P\leq P^{F} \right\}\end{split}  \tag{22}\]  
Initially, we try to give an explicit formula for optimal packing strategy. The two local minimum around \(P^{\prime}\) for \(J(P)\) are shown as:  
\[\left\{ \begin{array}{l}P^{\prime}_{-}\triangleq\min\left\{P\in D^{N}_{ \left[\frac{N}{P^{\prime}}\right]}\right\}\\ P^{\prime}_{+}\triangleq\min\left\{P\in D^{N}_{\left[\frac{N}{P^{\prime}} \right]-1}\right\}\end{array} \right.\] (23a) In case \[\frac{N}{P^{*}}-1=0\], it implies \[P^{\prime}_{+}=N\]. There is an analytical formula, i.e., : \[P^{\prime}_{-}=\frac{N}{\left[\frac{N}{P^{\prime}}\right]}\text{, }P^{\prime}_{+}= \frac{N}{\left[\frac{N}{P^{\prime}}\right]-1} \tag{23b}\]  
In view of the characteristics of the saw-tooth function, it can be deduced that the minimum of \(J(P)\) is most likely chosen from the candidate set shown below:  
\[D^{*}\triangleq\left\{P^{\prime}_{L},\ P^{\prime}_{-},\ P^{\prime}_{+},P^{ \prime}_{U}\right\} \tag{24}\]  
This obtained candidate set is very useful to provide support for site engineers to set the data packet size considering the communication performance of NCSs.