# A Perturbation and Symmetry-Based Analysis of Mobile Malware Dynamics in Smartphone Networks
## 6 Optimal Control Strategy Framework  
### Control Problem Formulation and Implementation  
The \(M_{sigr}\) model describes malware dynamics via the ordinary differential equations:  
Figure 8: Reflection symmetry around disease-free equilibrium; time evolution of \(M_{i}\) for symmetric initial conditions; time evolution of \(m_{s}\) for symmetric initial conditions. Figure 7: Symmetry analysis of the \(M_{sigr}\) model: (**a**) phase dynamics near the disease-free equilibrium and (**b**) investigation of approximate scaling symmetry. \[\dot{M}_{s}(t) =\lambda-\Pi_{eff}(t)M_{s}(t)M_{i}(t)-\delta_{1}M_{s}(t) \tag{25}\] \[\dot{M}_{i}(t) =\Gamma_{eff}(t)M_{s}(t)M_{i}(t)-(\theta_{1,eff}(t)+\theta_{2})M_{ i}(t)-\delta_{1}M_{i}(t)-\delta_{2}M_{i}(t)\] \[\dot{M}_{q}(t) =\theta_{1,eff}(t)M_{i}(t)-qM_{q}(t)-\delta_{1}M_{q}(t)-\delta_{3 }M_{q}(t)\] \[\dot{M}_{r}(t) =qM_{q}(t)+\theta_{2}M_{i}(t)-\delta_{1}M_{r}(t)\]  
Time-dependent controls \(u_{1}(t)\) and \(u_{2}(t)\) are introduced to modify the system dynamics. The first control \(u_{1}(t)\) reduces the contact rate through cybersecurity interventions such as network isolation protocols, application store security filters, and user behavior modification through awareness campaigns. The effective contact rate becomes \(\Pi_{eff}(t)=\Pi_{base}(1-u_{1}(t))\), with \(0\leq u_{1}(t)\leq u_{1,max}=0.8\). The second control \(u_{2}(t)\) enhances quarantine capabilities through automated malware detection and device isolation, rapid response security protocols, and accelerated forensic analysis. This yields an enhanced quarantine rate \(\theta_{1,eff}(t)=\theta_{1,base}+u_{2}(t)\), with \(0\leq u_{2}(t)\leq u_{2,max}=0.5\). The rationale for this dual-control approach is based on the epidemiological principle that effective containment requires both transmission reduction and rapid isolation of infected entities. The optimal control problem aims to find admissible controls \((u_{1}^{*}(t),u_{2}^{*}(t))\) that minimize the objective functional \(J\) over \([0,T]\):  
\[J[u_{1},u_{2}]=\int_{0}^{T}\biggl{(}A_{1}M_{i}(t)+A_{2}M_{q}(t)+\frac{B_{1}}{ 2}u_{1}(t)^{2}+\frac{B_{2}}{2}u_{2}(t)^{2}\biggr{)}dt \tag{26}\]  
where \(A_{1}=10\) represents the weight for infected population cost, \(A_{2}=5\) denotes the weight for quarantined population cost, \(B_{1}=100\) is the cost weight for contact reduction control, and \(B_{2}=150\) is the cost weight for quarantine enhancement control. This problem is subject to the state equations and given initial conditions. A direct numerical method is employed for solution implementation. The control functions \(u_{1}(t)\) and \(u_{2}(t)\) are discretized into \(N_{int}=50\) piecewise constant values \(\{u_{1,k},u_{2,k}\}\) over subintervals of \([0,T]\), where \(T=50\) days. For any set of these discretized control values, the state ODE system is numerically integrated using an RK45 method via scipy.integrate.solve_ivp with relative tolerance \(rtol=1\times 10^{-8}\) and absolute tolerance \(atol=1\times 10^{-10}\). The objective functional \(J\) is then approximated using the trapezoidal rule via numpy.trapz. A nonlinear programming solver SLSQP via scipy.optimize.minimize is utilized to find the optimal set of discretized control values \(\{u_{1,k}^{*},u_{2,k}^{*}\}\) that minimize \(J\), subject to the defined bounds on \(u_{j,k}\), with maximum iterations set to 1000 and convergence tolerance of \(1\times 10^{-8}\). The existence of such an optimal control is generally supported by the convexity of \(J\) with respect to the controls due to the quadratic terms and the boundedness of the state variables within the model's feasible region. The summary of this technique is provided in Algorithm 1. The resulting optimal control profiles \(u_{1}^{*}(t)\) and \(u_{2}^{*}(t)\), along with the corresponding state trajectories under optimal control and the minimized \(J^{*}\) value, allow for quantitative assessment of intervention strategies by comparing them against scenarios without control based on the chosen cost weights.