# Using a Cable-Driven Parallel Robot with Applications in 3D Concrete Printing
## 4 Dual Simplex Algorithm for the Optimization of Cable Tension, Taking into Account Cable Sagging
### Optimization Cable Tension
: Weak duality: _If \(\boldsymbol{\tau}\) is a feasible solution of \(\mathrm{P}\), and \(\boldsymbol{u}\) is a feasible solution of \(\mathrm{D}\), then \(\boldsymbol{b}^{\mathrm{T}}\boldsymbol{u}\leq\boldsymbol{c}^{\mathrm{T}} \boldsymbol{\tau}\)._  
**Theorem 2**. : Strong duality: _If problem \(P\) has an optimal solution, then problem \(D\) also has an optimal solution. Moreover, the respective optimal solution values are equal to one another._  
In Theorem 1, if there exists a pair of \(\mathbf{u}\) and \(\boldsymbol{\tau}\), making \(\mathbf{b}^{\mathrm{T}}\mathbf{u}=\mathbf{c}^{\mathbf{T}}\boldsymbol{\tau}\), then \(\boldsymbol{\tau}\) and \(\mathbf{u}\) are solutions of \(\mathrm{P}\) and \(\mathrm{D}\), respectively. Besides, a complementary slackness condition can be used to check the optimal property of \(\boldsymbol{\tau}\) and \(\mathbf{u}\). The complementary slackness condition is presented in Theorem 3. **Theorem 3**. : _Let \(\boldsymbol{\tau}\) and \(\boldsymbol{u}\) be feasible solutions to \(P\) and \(D\), respectively. Then, \(\boldsymbol{\tau}\) and \(\boldsymbol{u}\) are the optimal solutions for each problem if and only if \(\boldsymbol{u}^{\mathrm{T}}(\boldsymbol{A}\boldsymbol{\tau}-\boldsymbol{b})=0\) and \((\boldsymbol{c}-\boldsymbol{A}^{\mathrm{T}}\boldsymbol{u})^{\mathrm{T}} \boldsymbol{\tau}=0\)._  
Theorem 3 can be used to establish the optimal property of a solution \(\boldsymbol{\tau}\) (\(\boldsymbol{\tau}\geq\boldsymbol{0}\)); if problem \(\mathrm{B}\) is in the standard form, this solution satisfies the first complementary slackness condition. Assume that \(\boldsymbol{\tau}_{\mathrm{i}}>\boldsymbol{0}\) form the second condition we obtain; we then obtain a system of equations, including the equations \(\mathbf{A}_{\mathrm{ij}}^{\mathrm{T}}\mathbf{u}=\mathbf{c}_{\mathrm{i}}\) corresponding to \(\boldsymbol{\tau}_{\mathrm{i}}>\boldsymbol{0}\). If the solution satisfies the first constraint of the dual problem and the total cost is the same cost of the primal problem, then \(\mathbf{\tau}\) is an optimal solution to the original linear programming. Three Karush-Kuhn-Tucker (KKT) conditions for a linear programming (LP) problem show on the following theorem:  
**Theorem 4. ** KKT optimality conditions for LP: _Given a linear programming problem \(\mathbf{P}\), the vector \(\mathbf{\tau}\) is an optimal solution to \(\mathbf{P}\) if and only if there exist vectors \(\mathbf{u}\) and \(\mathbf{r}\) such that:_  
1. \(\mathbf{A}\mathbf{\tau}=\mathbf{b}\)_;_ \(\mathbf{\tau}\geq\mathbf{0}\) _(primal feasibility);_
2. \(\mathbf{A}^{\rm T}\mathbf{u}+\mathbf{r}=\mathbf{c}\)_;_ \(\mathbf{r}\geq\mathbf{0}\) _(dual feasibility);_
3. \(\mathbf{r}^{\rm T}\mathbf{\tau}=0\) _(complementary slackness)._  
In this study, matrix \(\mathbf{A}\) is of full rank m (m = 6 \(<\) n = 8). Let matrix \(\mathbf{B}\) be the basic matrix created by six independent linear columns of \(\mathbf{A}^{\rm T}\) and matrix \(\mathbf{N}\) is a non-basic matrix containing the remaining two columns of \(\mathbf{A}\). The solution vector \(\mathbf{\tau}\) is separated into two parts, \(\mathbf{\tau}_{B}=\mathbf{B}^{-1}\mathbf{b}=(\mathbf{\tau}_{1}\), \(\mathbf{\tau}_{2}\),..., \(\mathbf{\tau}_{6})^{T}\) and \(\mathbf{\tau}_{N}=(\mathbf{\tau}_{7}\), \(\mathbf{\tau}_{8})^{T}=\mathbf{0}\), called the \"basic\" and \"non-basic\" solutions, respectively. The cost vector \(\mathbf{c}^{\rm T}=[\mathbf{c}_{\rm B}\ \mathbf{c}_{\rm N}]\) is also partitioned into a basic \(\mathbf{c}_{\rm B}\) and a non-basic \(\mathbf{c}_{\rm N}\) matrix related to the solutions \(\mathbf{\tau}_{\rm B}\) and \(\mathbf{\tau}_{\rm N}\). Assuming that \(\mathbf{u}\) is the dual solution of the base matrix \(\mathbf{B}\), we have \(\mathbf{A}^{\rm T}\mathbf{u}\leq\mathbf{c}\) and \(\mathbf{u}^{\rm T}=\mathbf{c}^{\rm T}\mathbf{b}^{-1}\).