# A New Modified Non-Approximative Method for Dynamic Systems Direct Calculation
## 3 Problem Solution and Simulation Example
### Direct Non-Approximative Method of Calculation
\begin{bmatrix}x_{1}\\ x_{2}\end{bmatrix} _{\tau}=\mathbf{G}_{\tau} \begin{bmatrix}u_{1}\\ u_{2}\end{bmatrix} _{0}\] (28b) for Figure 3b. Figure 3: Waveforms of system energy under switching off (**a**) and switching on of excitation function (**b**). Going back, consequently, the calculation for \(\mathbf{x}_{n}\) using \(\mathbf{F}_{\tau},\ \mathbf{G}_{\tau}\) is:  
\[\mathbf{x}_{n}=\left(\mathbf{F}_{\tau}\right)^{n}\!\!\mathbf{x}_{0}+\sum_{m=0}^{n-1}\mathbf{F}_{ \tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}. \tag{29}\]  
Combining Equations (26) and (29), we can obtain [9]:  
\[\mathbf{x}_{n+k}=\mathbf{F}_{k}(\mathbf{F}_{\tau})^{n}\mathbf{x}_{0}+\mathbf{F}_{k}\sum_{m=0}^{n-1} \mathbf{F}_{\tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}.\] (29a) where \[\mathbf{F}_{k}=\left(\mathbf{F}_{\Delta}\right)^{k}\]. Thus, it is sufficient to compute the matrices \(\mathbf{F}_{\tau},\ \mathbf{G}_{\tau}\) (27) for the first long jump (\(\tau\) or \(T/2\)). The time of calculation using the above equations is a rather big one. Therefore, a modified approach was used. Therefore, starting from Equation (24a) but considering step \(n\) equal to the repetitive period (\(\tau\) or \(T/2\)) of the sequence of the excitation function, we obtain:  
\[\mathbf{x}_{n+1}=\mathbf{F}_{\text{per}}\mathbf{x}_{n}+\mathbf{G}_{\text{per}}\mathbf{u}_{n} \tag{29b}\]  
where \(\mathbf{F}_{\text{per}},\ \mathbf{G}_{\text{per}}\) are \(\mathbf{F}_{\tau},\ \mathbf{G}_{\tau}\) or \(\mathbf{F}_{T/2},\ \mathbf{G}_{T/2}\). Now, we can imply the z-transform for the direct determination of \(\mathbf{x}_{n}\) vector [6; 7; 9; 11]. \[z\mathbf{X}(z)=\mathbf{F}_{\tau}\mathbf{X}(z)+\mathbf{G}_{\tau}\mathbf{U}(z)\] (30a) or \[z\mathbf{X}(z)=\mathbf{F}_{T/2}\mathbf{X}(z)+\mathbf{G}_{T/2}\mathbf{U}(z)\] (30b) Thus, \[\mathbf{X}(z)=\frac{\mathbf{G}_{\tau}\mathbf{U}(z)}{(z\mathbf{E}-\mathbf{F}_{\tau})}\] (31a) or \[\mathbf{X}(z)=\frac{\mathbf{G}_{\tau/2}\mathbf{U}(z)}{(z\mathbf{E}-\mathbf{F}_{T/2})},\] (31b) where \[z\mathbf{E}\equiv\mathbf{z}\]. _A._ _Case of_ \(u_{1}(t)=U,\ u_{2}(t)=0\)  
Applying the z-transform (Equation (31a)) yields:  
\[\mathbf{x}_{n}=\left(\mathbf{F}_{\tau}\right)^{n}\!\!\mathbf{x}_{0}+\sum_{m=0}^{n-1}\mathbf{F}_{ \tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}. \tag{29}\]0  
Applying the inverse z-transform using the Cauchy residue theorem gives:  
\[\mathbf{x}_{n}=\left(\mathbf{F}_{\tau}\right)^{n}\!\!\mathbf{x}_{0}+\sum_{m=0}^{n-1}\mathbf{F}_{ \tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}. \tag{29}\]1  
where \(\mathbf{z}_{j}\) is the \(j\)-th root of the denominator of Equation (30b), i.e., \(\mathbf{z}_{1}=\mathbf{F}_{\tau}\), \(\mathbf{z}_{2}=\mathbf{E}\). Then,  
\[\mathbf{x}_{n}=\left(\mathbf{F}_{\tau}\right)^{n}\!\!\mathbf{x}_{0}+\sum_{m=0}^{n-1}\mathbf{F}_{ \tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}. \tag{29}\]2  
Pseudo-code for the computational algorithm is as follows, Algorithm 1. The results of this case using Equation (31) are given in \[\mathbf{x}_{n}=\left(\mathbf{F}_{\tau}\right)^{n}\!\!\mathbf{x}_{0}+\sum_{m=0}^{n-1}\mathbf{F}_{ \tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}. \tag{29}\]3  
In this case, when \(u_{1}(t)=U,\ u_{2}(t)=0\), it is also possible to perform the calculation with step \(k\) and matrix \(F_{\Delta},G_{\Delta}\) instead of \(F_{\tau},G_{\tau}\). Then,  
\[\mathbf{x}_{n}=\left(\mathbf{F}_{\tau}\right)^{n}\!\!\mathbf{x}_{0}+\sum_{m=0}^{n-1}\mathbf{F}_{ \tau}^{\,n-m-1}\mathbf{G}_{\tau}\{\mathbf{u}_{m}\}. \tag{29}\]4  
Such a calculation (35) is optimized, and the calculation time is minimized because of the term total sum in Equation (26b), so there is no need to perform it. Therefore, using Equations (35) or (26), we can easily calculate matrices \(\mathbf{F}_{\tau},\mathbf{G}_{\tau}\) for step \(k=\tau/h\) and, consequently, calculate the state variables \(\mathbf{x}_{n}\) at discrete instants \(n\propto\tau\) by using Equation (35). Table 6 lists the values of variables \(x_{1}(t)\) and \(x_{2}(t)\) at discrete time instant \(t=k.h\) for \(u_{1}(t)=U\).