In this paper, based on MacLaurin’s series and the Riccati equation, an algebraic quadratic equation will be developed and hence, its two roots, which represent the minimizing and maximizing optimal control matrices, would be deducted easier. Otherwise, a step-by-step algorithm to compute the control matrix for every step of time according to the preceding responses and a new signal pick will be explained. The proposed method presents a new discrete-time solution for the problem of optimal control in the linear or nonlinear cases of systems subjected to arbitrary signals. As an example, a system (structure) of three degrees of freedom, subjected to a strong earthquake is analyzed. The displacements versus time and the stiffness forces versus displacements of the system, for the two uncontrolled and controlled cases are graphically shown. Therefore, the curves of variations of the elements of the optimal control matrix versus discrete-time are also presented and clearly show the effect of the nonlinearity, of the system, which is the cause of the great responses in the uncontrolled case, and that it is optimally treated by the proposed solution. The results obtained clarify a great reduction of the controlled system results, in comparison with the uncontrolled system ones. The percentage of the differences between the controlled and uncontrolled results (displacements or stiffness forces) could even surpass 90 %, which demonstrates that the adopted solution is good even than that of the original ones of the differential or the algebraic Riccati equation.