Dynamic Analysis and Control of a Financial System with Chaotic Behavior Including Fractional Order

: This paper presents the results of investigating the dynamics of an economic system with chaotic behavior and a suboptimal control proposal to suppress the chaotic behavior. Numerical results using phase portraits, bifurcation diagrams, Lyapunov exponents, and 0-1 testing conﬁrmed chaotic and hyperchaotic behavior. The results also proved the effectiveness of the control, showing errors below 1%, even in cases where the control design is subject to parametric errors. Additionally, an investigation of the system in fractional order is included, demonstrating that the system has periodic, constant, or chaotic behavior for speciﬁc values of the order of the derivative.


Introduction
In recent years, modeling financial and economic systems with chaotic behavior as non-linear systems has aroused the interest of researchers in various fields of knowledge [1].Financial systems are intricate non-linear systems that interact with the environment and contain many complex factors, making it practically impossible to make convincing economic predictions for financial systems with chaotic behavior, justifying the relevance of studying their dynamics and control projects [2][3][4][5][6][7].
Following this trend, the number of investigations seeking to explain the influence of structural variations, uncertainties in microeconomic and macroeconomic variations, irregular increases, and effects of parameters on the dynamics of financial and economic systems has grown, as well as the emergence of chaotic behavior [8,9].The non-linearities and chaotic behavior of stock markets have been investigated by [10,11].The authors concluded that the analyzed action systems have a chaotic behavior and that their non-linearities must be considered.In this sense, the dynamic analysis of an economic system with this type of behavior is presented in [5].Phase diagrams, bifurcation diagrams, and time histories are presented to prove the chaotic behavior.In [6] is given the dynamic model of an economic and financial system oscillator based on the theory of automatic control systems.Computational results indicate that the proposed model makes generating chaotic economic variations and their synchronization in a set of coupled economic variations possible.
Studies demonstrate that the behavior of economic and financial systems in the present can be affected by the history of variables such as exchange rates, gross domestic product, interest rates, production, and stock prices.This memory effect can last for long periods, meaning that past behaviors can interfere with economic systems' current and future behavior, thus correlating past economic disturbances with future economic variations [12].According to [12], the fact that economic variables have long memories makes fractional calculus adequate to study the dynamic behavior of economic systems.Thus, the number of investigations of applying a fractional order in financial and economic systems dynamics The 0-1 method and the analysis of the system's behavior for variations in fractional order are also presented.Section 3 describes the proposed control, considering integer order and fractional order.This section also demonstrates the robustness of the control for parametric variations and its effectiveness in controlling the system in fractional order.Finally, Section 4 presents the conclusions and final considerations.

Dynamic Analysis
In this section, the dynamic analysis of a financial system is presented, represented by a mathematical model with three degrees of freedom; it was also recently considered in [5,7].

Mathematical Model
Equation (1) represents the economic and financial model proposed by [5] and investigated in this paper. .
where the state (x 1 ) represents the interest rate, the state (x 2 ) represents the investment demand, and the state (x 3 ) the price index.The parameters a, b, c, d, e, f, and g are constants.
According to [5,7], it can be observed that the interest rate variation (x 1 ) is proportional to the price index (x 3 ), and that investment demand (x 2 ) influences the interest rate.If the investment demand exceeds the value of savings, the financial institution will increase the interest rate.If the investment demand is low, the value of savings may exceed the investment demand, leading to the need to reduce the interest rate to encourage loaning.
Regarding the parameters of Equation ( 1), (e) represents the natural growth rate of investment demand (x 2 ).If the interest rate increases, the investment will be negatively affected, showing that excessive need for investment (x 2 ) will lead to a decrease in the rate of change in investment demand, represented by the term −bx 2 2 , i.e., the rate of change in investment demand is negatively correlated with the square of the investment demand.
According to [5,7], the interest rate is negatively correlated with the price index variation rate given by (g).The price index variation rate decreases with the investment demand increase.It implies that increased investment demand leads to increased production, resulting in a price decrease.On the other hand, the decline in investment demand (x 2 ) causes a reduction in the number of products on the market, leading to an increase in the product's price.

Dynamic Analysis for Parametric Variations
To analyze the dynamic behavior of the system (1), initially, the parameters that represent the value of savings (a), the cost per investment (b), and the elasticity of demand in commercial markets (c) were varied.

Dynamic Analysis for Parametric Variations
To analyze the dynamic behavior of the system (1), initially, the parameters that resent the value of savings (a), the cost per investment (b), and the elasticity of dema commercial markets (c) were varied.
Figure 1 shows the maximum values of the first two Lyapunov exponents, cons ing parameter variations: , and Analyzing the results presented in Figure 1, we can observe that system (1) has otic behavior for values of (c) close to 1 (Figure 1c,e) and that (c) is the most influe parameter for the chaotic behavior of the system.For the parameters 0.  Analyzing the results presented in Figure 1, we can observe that system (1) has chaotic behavior for values of (c) close to 1 (Figure 1c,e) and that (c) is the most influential parameter for the chaotic behavior of the system.For the parameters a = 0.3, b = 0.01, and c = 0.3, we have λ 1 = 0.21 (the first most prominent Lyapunov exponent) and λ 2 = 0.0002 (the second most prominent Lyapunov exponent).And according to [31], two positive Lyapunov exponents indicate hyperchaotic behavior.
Then, we considered the dynamic analysis of the system (1) for variations in parameter (e), which represents the natural growth rate of investment demand (x 2 ), parameter (f ), which corresponds to the coefficient of variation of the interest rate (x 1 ) depending on the price index (x 3 ), and parameter (g), which represents the price index reduction coefficient (x 3 ) related to the interest rate variation (x 1 ).
Figure 2 shows the maximum values of the first two Lyapunov exponents, considering a = 0.    Considering the new results for the largest Lyapunov exponent presented 2, it can be observed in the color bars that the variation of parameters (e), (f), and erated higher values of the first Lyapunov exponent.For a = 0.  Considering the new results for the largest Lyapunov exponent presented in Figure 2, it can be observed in the color bars that the variation of parameters (e), (f ), and (g) generated higher values of the first Lyapunov exponent.For a = 0.3, b = 0.01, c = 1, d = 0.05, e = 2.58, f = 2.1, g = 1, and h = 0.1, we have λ 1 = 0.2635 (first largest Lyapunov exponent) and λ 2 = 0.0002 (second largest Lyapunov exponent), values that indicate hyperchaotic behavior [36].
Figure 3 shows the time histories, and Figure 4 shows the phase diagrams for parameters a = 0.3, b = 0.01, c = 1, d = 0.05, e = 2.58, f = 2.1, g = 1, and h = 0.1.These values will be used in the rest of the paper.Figure 3 shows the time histories, and Figure 4 shows the phase diagrams fo eters a = 0.  (second largest Lyapunov exponent), values that indicate hyperch havior [36].
Figure 3 shows the time histories, and Figure 4 shows the phase diagrams fo eters a = 0.As can be seen in Figures 3 and 4, the system has a chaotic behavior and, according to the second largest Lyapunov exponent (λ 2 = 0.0002), the system also has a hyperchaotic behavior, which are undesirable behaviors for an economic system since its unpredictability makes planning for future investments difficult.
In Figure 5, we present the bifurcation diagrams for the state peaks (x 1 ), considering the parameters (a, b, c, e, f, and g) investigated in this work.The state (x 1 ) was considered in the analysis, as it is the state that represents the interest rate and thus represents an essential role in the investment process [7,15,37].
As can be seen in Figures 3 and 4, the system has a chaotic behavior and, a to the second largest Lyapunov exponent ( 2 0.0002 λ = ), the system also has a hyp behavior, which are undesirable behaviors for an economic system since its un bility makes planning for future investments difficult.
In Figure 5, we present the bifurcation diagrams for the state peaks ( 1 x ), co the parameters (a, b, c, e, f, and g) investigated in this work.The state ( 1x ) was co in the analysis, as it is the state that represents the interest rate and thus repr essential role in the investment process [7,15,37].As seen in Figure 5, parameters (a) and (b) did not significantly influence th behavior of the system.However, the influence of other parameters is evident; i ble to eliminate the chaotic behavior by considering variations in the paramete and g).
We can see in Figure 5e that parameter (e), which represents the natural gro of investment demand 2 x , plays a vital role in controlling chaotic behavior, as the maximum values of interest rates.It is possible to obtain a periodic behavior w below 5 units for  As seen in Figure 5, parameters (a) and (b) did not significantly influence the chaotic behavior of the system.However, the influence of other parameters is evident; it is possible to eliminate the chaotic behavior by considering variations in the parameters (c, e, f, and g).
We can see in Figure 5e that parameter (e), which represents the natural growth rate of investment demand x 2 , plays a vital role in controlling chaotic behavior, as well as in the maximum values of interest rates.It is possible to obtain a periodic behavior with rates below 5 units for e = [0.

Dynamic Analysis for Fractional Order
This section presents the dynamic analysis of the economic system in fractional order.We considered the Riemann-Liouville operator [34,38,39].The operator was considered because it is already well known and has been used efficiently in different types of systems, as it does not require the system to be continuous at the origin or to be differentiable [34].
The Riemann-Liouville operator is given by [38]: In case that q = 1, one has the usual derivative.In this paper, 0 < q ≤ 1 will be considered, as it is the interval normally used in economic and financial systems and is particularly relevant for the study of dynamics in fractional order.

Application of 0-1 Test
The 0-1 test is an efficient method for quantitatively determining the chaotic behavior of a database [40][41][42].It was proposed by [28,40], and successfully used in systems from different areas of knowledge, including economic and financial systems represented in fractional order [20,21,23,24].The method consists in determining a parameter, K = [0 : 1].The data are considered chaotic for values of K close to 1, whereas for values of K close to zero, a periodic behavior is considered [29][30][31][32].The 0-1 test is considered in this section; for analysis, the variable x 1 behavior was chosen, considering the systems (3).
Given any two vectors z and y, the covariance cov(z, y) and variance var(z) of n max elements are usually defined as [25]: Fractal Fract.2023, 7, 535 9 of 17 where z is the average of z(n) and y is the average of y(n).
In this paper, n = 10 4 and i = n 10 2 , . . ., n 10 .Figure 6 presents the state x 1 for variations in the order of the fractional derivative; q 1 = q 2 = q 3 = q = [0.7 : 1] was considered in the simulations.

(
)( ) where z is the average of z( ) n and y is the average of () yn .
It is possible see in Figure 6 results indicating that the order of the fractional derivative influences the dynamics of the system, which can be oscillatory and periodic (q = 0.85, q = 0.9, and q = 0.95), can stabilize at a fixed point (q = 0.7 and q = 0.75), or can be chaotic, as observed for the case of q = 0.80.The results presented demonstrate the influence of memory on the dynamics of the economic model (Equation ( 1)), confirming that past behaviors and results can influence present results and that the use of fractional order can be used to represent economic variables with memory.

Proposed Control by SDRE Control and Feedforward Control
The SDRE control was utilized to avoid the system's chaotic behavior.The objective was to establish a control so that the response of the controlled system (1) resulted in a desired state x * i (t) that was asymptotically stable.

Integer Order System
Equation (10) represents the system (1), with the introduction of control signal U: .
where: U = u + u * , u is the state feedback control, and u * is the feedforward control.The feedforward control is responsible for maintaining the system in a desired trajectory and is given by: x * 3 (11) where: x * 1 , x * 2 , and x * 3 are the desired states.We substituted (11) in (10) and considered defining the errors: The following system was obtained with regard to errors: .
The system ( 13) can be represented in matrix form: Control u is obtained from the following equation [34]: where P is a symmetric matrix, and is obtained from the algebraic Riccati equation: According to [33], the control u is suboptimal, minimizing the function: The matrices A and B of the system (15) are represented by: We defined Q and R matrices: First of all, it is crucial to define the desired states: x * 1 , x * 2 , and x * 3 .Analyzing the results of Figure 6a,b, we can see that x * 1 ≈ 5 when we consider the system memory.To keep the interest rate close to this value, we define x * 1 = 5 as desired in this paper.Setting up x * 1 = 5 as an equilibrium point, we obtain: x * 2 = 2.8284 and x * 3 = 4.8586.In Figure 7, we can observe the system without control and with control, where x * 1 , x * 2 , and x * 3 are the controlled states x 1 , x 2 , and x 3 , and are the states without control and with chaotic behavior.
The matrices A and B of the system (15) are repres We defined Q and R matrices:

R
First of all, it is crucial to define the desired states: x results of Figure 6a,b, we can see that * x are the controlled states 1 x , 2 x , and 3 x , and and with chaotic behavior.Figure 8 shows the control errors, the feedforward (u * ) and feedback (u) control signals, and the sum of the two control signals.Figure 9 shows the error and the control signal for the case of using only the control ( u ) obtained by the SDRE control.Analyzing the results presented in Figures 8 and 9, we verified that the com of the feedback control ( u ) with the feedforward control ( * u ) resulted in a redu in comparison to the system with only feedback control ( u ).The difference is p imperceptible, since the error was below 0.1% in both cases.And, according to [4 of up to 2% can be considered acceptable, indicating that the proposed control   Figure 9 shows the error and the control signal for the case of using only the f control ( u ) obtained by the SDRE control.Analyzing the results presented in Figures 8 and 9, we verified that the com of the feedback control ( u ) with the feedforward control ( * u ) resulted in a reduc in comparison to the system with only feedback control ( u ).The difference is pr imperceptible, since the error was below 0.1% in both cases.And, according to [43 of up to 2% can be considered acceptable, indicating that the proposed control e Analyzing the results presented in Figures 8 and 9, we verified that the combination of the feedback control (u) with the feedforward control (u * ) resulted in a reduced error in comparison to the system with only feedback control (u).The difference is practically imperceptible, since the error was below 0.1% in both cases.And, according to [43], errors of up to 2% can be considered acceptable, indicating that the proposed control exceeded the recommended rates.The error with the control U = u + u * was 21% smaller than the error obtained using the control U = u.

Parametric Sensitivity Analysis
To consider the effects of parameter uncertainties on the performance of the proposed control, we regarded that the parameters used in the control design as having a random error of 20%, a robustness analysis strategy similar to that used in [43].
Figure 10 shows the robustness of the proposed control when the parameters utilized in the control had random uncertainties.
the recommended rates.The error with the control * U = u + u was 21% small error obtained using the control U = u .

Parametric Sensitivity Analysis
To consider the effects of parameter uncertainties on the performance of th control, we regarded that the parameters used in the control design as having error of 20%, a robustness analysis strategy similar to that used in [43].
The following parameters were used in the matrix A (Equation ( 19)) feedforward control ( * u , Equation ( 11)): a 0.24 + 0.    Analyzing the results presented in Figure 10, we can conclude that the proposed control is robust to parametric variations both for the feedback control (u) and for the feedback and feedforward combination (U = u + u * ), because the error was well below 2% for both cases, proving the robustness of the control for parameter errors.

Fractional Order System
We next considered the inclusion of the U = u + u * control in the system (3): In Figure 11, we can observe the phase diagrams, the history in time for the system (21) with and without control, and the positioning errors for the proposed control, considering the case in which the system with the fractional order (q 1 = q 2 = q 3 = 0.8) has a chaotic behavior, as shown in Figure 6.x * 1 , x * 2 , and x * 3 were the controlled states x 1 , x 2 and x 3 , and the states of the system without the control signal and with chaotic behavior, as seen in Figure 11a.
Analyzing the results presented in Figure 10, we can conclude that the proposed trol is robust to parametric variations both for the feedback control ( u ) and for the f back and feedforward combination ( * U = u + u ), because the error was well below 2% both cases, proving the robustness of the control for parameter errors.

Fractional Order System
We next considered the inclusion of the * U = u + u control in the system (3): In Figure 11, we can observe the phase diagrams, the history in time for the sys (21) with and without control, and the positioning errors for the proposed control, sidering the case in which the system with the fractional order ( 1 2 3 0.8 q q q = = = ) h chaotic behavior, as shown in Figure 6.
x , and * 3 x were the controlled states 2 x and 3 x , and the states of the system without the control signal and with chaotic havior, as seen in Figure 11a.As shown in Figure 11, the proposed control is also efficient in controlling the fin cial system (1) in fractional order (3).The results showed that the steady-state error w well below 1%, demonstrating the robustness of the proposed control for variation fractional order.As shown in Figure 11, the proposed control is also efficient in controlling the financial system (1) in fractional order (3).The results showed that the steady-state error was well below 1%, demonstrating the robustness of the proposed control for variations in fractional order.

Conclusions
Integer and fractional order economic and financial systems with chaotic and hyperchaotic behavior were investigated, and a control design was proposed to suppress chaotic behavior.In this context, a numerical analysis was carried out to verify the influence of the system's parameters on the economic and financial dynamics, proving that it is possible to obtain constant, periodic, chaotic, and hyperchaotic behaviors with proper adjustments of the parameters.
With the use of bifurcation diagrams and with the calculation of the Lyapunov exponent, the results presented make it possible to obtain a source of information for new research and economic and financial projects.These results indicate the trend of behavior as well as the maximums for each of the studied states.
In addition to studying the parameters' influence on the system's dynamics, a numerical analysis of the fractional order was included, using the 0-1 test to determine whether the system is chaotic.Numerical results demonstrated that the system becomes constant, periodic, or chaotic for specific values of the fractional order, and that economic and financial memory affect current and future results.Considering the negative factors that chaotic behavior can generate in economic and financial systems, the proposed control proved to be effective in suppressing chaotic behavior.
Parametric sensitivity analysis confirmed the proposed control's robustness for integer and fractional orders.Numerical simulations also showed that it is possible to control the system only with the feedback control obtained by the suboptimal SDRE control.As a source of future work, a deeper analysis of the hyperchaotic behavior observed in this paper, both for integer and fractional orders, as well as other control techniques, can be highlighted.Other operators of the fractional order can also be considered, as well as using values of q > 1.

Supplementary Materials:
The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/fractalfract7070535/s1,S1: MATLAB R codes for generating the bifurcation diagram and Lyapunov exponents are available in the Supplementary Materials.
the price index (3x ), and parameter (g), which represents the price index reduct ficient ( 3 x ) related to the interest rate variation ( 1 x ).

Figure 2
Figure 2 shows the maximum values of the first two Lyapunov exponents, c ing 0.3 a = , 0.01 b = , and 0.3 c = , and variations in the parameters f =

Figure 3 .
Figure 3. (a) Time histories of the state x1; (b) time histories of the state x2; (c) time histo state x3.

Figure 3 .
Figure 3. (a) Time histories of the state x1; (b) time histories of the state x2; (c) time histo state x3.

1 x
Figure 6 presents the state 1 x for variations in the order of the fractional d

Figure 6 .
Figure 6.Time histories of state 1 x for

1 5x
≈ when we co keep the interest rate close to this value, we define * as an equilibrium point, we obtain: * 2 2.8284 x = In Figure 7, we can observe the system without contro * 2 x , and* 3

Figure 7 .
Figure 7. Time histories of the states x 1 , x 2 , and x 3 without control and x * 1 , x * 2 , and x * 3 with control.

FractalFigure 8 .
Figure 8 shows the control errors, the feedforward ( * u ) and feedback ( u

Figure 9 .
Figure 9.Time histories of the systems with control U = u . (a) Errors = − . (b) Signal of the control ( u ) by SDRE.

Figure 9
Figure9shows the error and the control signal for the case of using only the feedback control (u) obtained by the SDRE control.

Figure 8 Figure 8 .
Figure 8 shows the control errors, the feedforward ( * u ) and feedback ( u )

Figure 9 .
Figure 9.Time histories of the systems with control U = u . (a) Errors* 1 1 1 e x x = − , 2 e

Figure 10 Figure 10 .
Figure10shows the robustness of the proposed control when the paramet in the control had random uncertainties.
Uncertainty in parameters only of the feedforward control ( * u ).(c,d) Uncertainty in only of the feedback control ( u ). (e,f) Uncertainty in the parameters of the feedforward feedback control ( * U = u + u ).

Figure 10 .
Figure 10.Errors e 1 = x 1 − x * 1 , e 2 = x 2 − x * 2 , and e 3 = x 3 − x * 3 for uncertainty in parameters.(a,b) Uncertainty in parameters only of the feedforward control (u * ).(c,d) Uncertainty in parameters only of the feedback control (u).(e,f) Uncertainty in the parameters of the feedforward control and feedback control (U = u + u * ).

Author
Contributions: Conceptualization, A.M.T. and G.G.L.; methodology, J.M.B.; software, A.M.T.; validation, A.M.T., G.G.L. and M.E.K.F.; formal analysis, D.I.A.; investigation, A.M.T. and G.G.L.; writing-original draft preparation, A.M.T. and D.I.A.; writing-review and editing, M.E.K.F.; visualization, J.M.B.; supervision, A.M.T.All authors have read and agreed to the published version of the manuscript.Funding: This research received no external funding.Data Availability Statement: Not applicable.