<<

Nonlinear Dyn https://doi.org/10.1007/s11071-018-4622-2

ORIGINAL PAPER

On choosing state variables for piecewise-smooth dynamical system simulations

Jin-Song Pei · Joseph P. Wright · François Gay-Balmaz · James L. Beck · Michael D. Todd

Received: 11 May 2018 / Accepted: 2 October 2018 © Springer Nature B.V. 2018

Abstract Choosing state variables in a state-space order to develop accurate and efficient time integra- representation of a nonlinear dynamical system is a tion, we incorporate MATLAB’s state event location nonunique procedure for a given input–output rela- algorithm, which is a mathematically sound numerical tionship and therefore a potentially challenging task. solver that deserves to be better known in the engi- It can be even more challenging when there are neering mechanics community. We show that differ- piecewise-defined restoring , as in bilinear hys- ent choices of state variables can affect state event teresis or Bouc–Wen models, which are just two of implementation, which in turn can significantly affect many such engineering mechanics models. Using vari- accuracy and efficiency, as judged by tolerance propor- ous piecewise-smooth models, we make use of flow- tionality and work–accuracy diagrams. Programming and effort-controlled system concepts, common to details of state event location are included to facili- bond graph theory, to initiate our selec- tate application to other models involving piecewise- tion task, and we view numerical simulation as being defined restoring forces. In particular, one version of within the framework of hybrid dynamical systems. In the Bouc–Wen–Baber–Noori (BWBN) class of mod- els is implemented as a demonstration. J.-S. Pei (B) School of Civil Engineering and Environmental Science, Keywords Restoring model · Bilinear hysteresis University of Oklahoma, Norman, Oklahoma 73019-1024, model · Bouc–Wen model · BWBN model · Hybrid USA · · e-mail: [email protected] dynamical system State event location algorithm Bond graph theory · Flow-controlled system · J. P. Wright Division of Applied Science, Weidlinger Associates Inc., Effort-controlled system New York, NY 10005, USA F. Gay-Balmaz CNRS LMD IPSL, Ecole Normale Supérieure de Paris, 24 1 Introduction Rue Lhomond, 75005 Paris, France J. L. Beck 1.1 Motivating example: state event location Department of Computing and Mathematical Sciences, algorithm California Institute of Technology, Mail Code 9-94, Pasadena, CA 91125, USA This study builds on previous work developing accurate M. D. Todd and efficient numerical methods for simulating nonlin- Department of Structural Engineering, University of California, San Diego, 9500 Gilman Drive, ear dynamical systems that include piecewise-defined Mail Code 0085, La Jolla, CA 92093, USA restoring forces [34]. Throughout this paper, the fol- 123 J.-S. Pei et al. lowing equation of motion is used based on Newton’s Solved restoring force-displacement relation 1.5 second law:

1 mx¨ + r = u (1) (xy, ry) 0.5 where x = x(t) is the displacement of the m at time t, x¨ is the , r is the restoring force 0 generated by the elements connected to the mass that = ( ) tends to restore it to its neutral position and u u t Restoring force -0.5 is an arbitrary excitation force applied to the mass. For (-xy,- ry) example, Eq. (1) could describe steady-state or tran- -1 Time selected by MATLAB ode45 sient dynamic response due to either force or base exci- Event Type #1 solved by MATLAB ode45 = Event Type #2 solved by MATLAB ode45 tation. For simplicity in this study, we set mass m 1, -1.5 x(0) = 0, x˙(0) = 0 unless otherwise specified. -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 Displacement In this study, r = r(x) is a piecewise function of x, making the dynamical system a hybrid dynamical Fig. 1 Trilinear elastic model: central piece has stiffness k = 1; system, meaning a system with interactions of both the two other pieces have αk = 0.3; this result comes from SDOF subjected to one cycle of sinusoidal excitation force u(t) (shown continuous and discrete state/algebraic variables. We at top of Fig. 2); simulation used “event option” under MATLAB assume that the displacement, and restoring ode45 with RelTol = 10−3 and AbsTol = 10−12. Event Types force are continuous functions of time, meaning the #1 and 2 are defined in Eqs. (2)and(3), respectively transition from one piece to the next is continuous, and that they are differentiable within each piece. However, the instantaneous stiffness, defined piecewise as dr/dx, quantities (displacement, velocity and restoring force may change abruptly from piece to piece. As needed in this example). This algorithm was implemented by herein, we will review ideas and supply the required combining the event option with ode45 in MATLAB. definitions as they apply to a specific hybrid dynamical For the trilinear elastic model in Fig. 1, the event option system (e.g., [11,30]). needs to implement two event functions: In [34], we focused on the Ramberg–Osgood model which has a piecewise-smooth algebraic form r = Event Type #1 : x(t) − xy = 0(2) r(x). In this study, more complicated models such Event Type #2 : x(t) + x = 0(3) as bilinear hysteresis or Bouc–Wen models [4,6,7,31] y will be investigated, where r is defined piecewise in either algebraic or differential format. which are solved for the time instances when these As a motivating example involving “state event loca- event functions are satisfied so that the numerical inte- tion” [27], we present results of a single-degree-of- gration will stop and then restart at all time instances freedom (SDOF) simulation with the trilinear elastic that are discovered (i.e., not known apriori) in the pro- model shown in Fig. 1. The force–displacement rela- cess of numerical simulation. These events are called tion, r versus x, is defined by three linear pieces joined state events as they are functions of the state variables at two points (xy, ry) and (− xy, − ry), with xy = 0.75 (x in this case). and ry = 0.75 where xy denotes yield displacement Figure 2 presents simulation results for the trilinear and ry denotes yield force. Thus, the slope of the cen- elastic model. Time instances corresponding to the two tral piece defines a spring stiffness k = 1. The two types of event are highlighted in both Figs. 1 and 2. other pieces have equal stiffness values αk = 0.3. Although this is a simple model, with the excitation We utilize the state event algorithm in [27] for accu- force u(t) being the smooth sinusoid shown at the top racy and efficiency reasons. This algorithm ends time of Fig. 2, the seemingly simple idea of state event loca- stepping “exactly” (within an approximation error) at tion requires care to be taken before, during and after each time when yield displacement occurs, such a any event occurs. The procedure was discussed in [34] time being called an “event,” and then restarts there using both the Ramberg–Osgood and Bingham models, with accurately calculated values of all time-dependent and will be further elucidated in this study using other 123 On choosing state variables

Time history of prescribed excitation force 1 chosen as state variables when formulating the state Prescribed excitation time history 0.5 equations corresponding to Eq. (1): 0     ( ) -0.5 = y 1 = x y ( ) ˙ (5) Excitation Force -1 y 2 x 0 102030405060708090100       Time y˙(1) x˙ y(2) y˙ = = = = f (y, u, t) Time history of solved displacement y˙( ) x¨ 1 ( − ( ( ))) 2 2 m u r y 1 Time selected by MATLAB ode45 1 Event Type #1 solved by MATLAB ode45 (6) Event Type #2 solved by MATLAB ode45 0 -1 This choice of state variables and corresponding pair of

Displacement -2 first-order ODEs was used when implementing the state 0 102030405060708090100 Time event location algorithm for the example just presented. Time history of solved velocity In particular, the displacement x(t) was used in defining 0.4 the two event functions, which satisfies a MATLAB 0.2 0 requirement, namely that event functions need to be -0.2 defined as (simple) functions of the state variables. Velocity -0.4 For piecewise restoring force models that are more 0 102030405060708090100 complicated, appropriate choices of state variables are Time Time history of solved restoring force not always this straightforward. Reference [33] vividly 2 acknowledges this fundamental challenge concerning 1 state-space formulation: “It is, however, impossible to 0 deduce apriori, in physical terms, what will be the -1 state. This, indeed, is a very difficult problem even for Restoring force -2 0 102030405060708090100 relatively simple systems, and it appears to be the cause Time for much of the reluctance of introducing this concept Fig. 2 Results from SDOF simulation with trilinear elastic in physics.” model shown in Fig. 1; simulation used sinusoidal excitation Table 1 offers motivating examples of four ways of force u(t) shown at top and “event option” under MATLAB choosing state variables for two different basic (lin- = −3 = −12 ode45 with RelTol 10 and AbsTol 10 . Event Types ear) dynamical systems: (a) a mass in series with a #1 and 2 are defined in Eqs. (2)and(3), respectively Kelvin model (also called Kelvin–Voigt)and (b) a mass in series with a Maxwell model. A Kelvin model has more complicated models. More information concern- a spring and dashpot in parallel, whereas a Maxwell ing the algorithm itself is given in Sect. 2.1. model has a spring and dashpot in series. Often when modeling a dynamical system, numer- ous choices of state variables are possible, although 1.2 Motivating example: choices of state variables many are not straightforward, nor even physically or computationally convenient. The text and “Appendix A” State-space representation has been the cornerstone provide additional discussion and examples, particu- for both theoretical and numerical studies of nonlinear larly Sect. 2.2 (flow- and effort-controlled systems) and dynamical systems. Loosely speaking, state variables Sect. 4 (Bouc–Wen model), where the first and second for a dynamical system can be used to model the sys- columns in Table 1 will be elaborated in Sect. 2.2. tem as a set of first-order ordinary differential equations (ODE) called state equations: 1.3 Contributions and structure of this paper y˙ = f (y, u, t) (4) This paper builds on previous work [34] promoting the where u is an input vector (includes initial conditions) use of hybrid dynamical systems for nonlinear hys- and y is a state vector containing all state variables. teresis modeling. The utilization of a state event loca- For example, displacement and velocity are commonly tion algorithm is validated here for various piecewise- 123 J.-S. Pei et al.

Table 1 Possible choices of state variables for basic (linear) dynamical systems Choice State variable (a) Flow-controlled: mass + kelvin (b) Effort-controlled: Mass + Maxwell k u(t) kc u(t) m m c             x 01 0 01 0 0  1(F) y = y˙ = y + u y˙ = y + u + udt 1 x˙ 1 − k − c 1 1 1 − k − k 1 1 1    m m   m     m c   m  m p 01 0 0  01 0  2(E) y = y˙ = y + u + udt y˙ = y + udt 2 r 2 − k − c 2 c k 2 − k − k 2 k    m m  m m  m c  m x 0 − 1 1  0 −1 1  3(M) y = y˙ = m y + m udt y˙ = y + m udt 3 p 3 k − c 3 c 3 k − k 3 0    m   m   c    ˙ − 1 1 0 −1 1 = x ˙ = 0 m + m ˙ = + m 4(M) y4 y4 − c y3 c u y4 − k y4 u r k m m k c 0

defined constitutive models. Furthermore, bond graph tion is done by computing a mesh of time points that theory is introduced to directly benefit the implementa- are generated adaptively, normally not at a fixed time tion of the state event location algorithm. More specif- step. Great care and significant effort were taken to cor- ically, flow- versus effort-controlled system classifi- rect discontinuity sticking, which is a numerical prob- cation is applied to systematically generate different lem caused by algebraic variable(s) not being updated choices of state variables, which are further tested properly at a state event location [34]. through programming and quantitative measures of Following [34], the accuracy of our numerical solu- computational efficiency. Even though the primary tions is assessed by studying the global error (GE) of focus is on the state event location algorithm, this study the displacement at a specific time tn: not only exercises the flow- versus effort-controlled systems classification, but also provides theoretical dis- GE(t ) =|ˆx(t ) − x(t )| (7) cussion of them. For both simulation and classifica- n n n tion, there exist nonunique choices of state variables for piecewise-defined models. where x(tn) is the exact displacement at tn and xˆ(tn) is Section 1, where a simple trilinear elastic model was the approximated displacement at that time. Since the presented to illustrate state event location, serves as exact displacement is unknown (in most cases), a highly an introduction. Section 2 discusses quantitative mea- converged numerical solution is obtained by using a sures of computational performance (tolerance propor- very small value of the relative tolerance parameter tionality, work–accuracy diagrams), flow- and effort- called RelTol in MATLAB. In order to control approx- controlled systems, and the essential elements in hybrid imation errors and assess accuracy in our numerical dynamical system modeling that are relevant to this work, we fix the value of AbsTol to a very small value study. Sections 3 and 4 focus on a comprehensive study while allowing RelTol to take on a wide range of values of bilinear hysteresis and Bouc–Wen models, respec- down to the fixed value of AbsTol. tively. Section 5 is dedicated to guidelines on choices The algorithm behind the event option under ode45 of state variables. Section 6 concludes this study. is considered quite robust according to some stud- ies [9,21] and reviewed in [34]. For example, con- 2 Theoretical issues tinuing our discussion of the trilinear elastic model in Fig. 1,Fig.3 shows results for a wide range of RelTol 2.1 Discontinuity sticking correction and performance values, with algorithmic robustness being evident for measures for state event location algorithm RelTol < 10−3 (approx.) based on the identified num- ber of Event #1 and #2 defined earlier and convergence MATLAB’s ode45 uses a pair of Runge–Kutta formu- of the identified time of each event. The results in Fig. 2 las due to Dormand and Prince [8]. Numerical integra- correspond to RelTol = 10−3. 123 On choosing state variables

-2 0.5 6 -4 0 4 -6

state event -8 -0.5 2 Event Type #1 Event Type #2

log10 of GE -10 0 -1 -14 -12 -10 -8 -6 -4 -2 -12 Number of All Events log10 of RelTol -14 log10 of Elapsed Time -1.5 Time of First Event Type #1 Time of Last Event Type #1 -15 -10 -5 0 -15 -10 -5 0 14.7335 42 log10 of RelTol log10 of GE 14.7330 40 4 4.5 14.7325 38 3.5 4 14.7320

14.7315 36 3 3.5 -15 -10 -5 0 -15 -10 -5 0 log10 of RelTol log10 of RelTol 2.5 3 Successful FE Time of First Event Type #2 Time of Last Event Type #2 Unsuccessful FE log10 of Number

61.695 87.69 log10 of Number 2 2.5 61.690 87.68 -15 -10 -5 0 -15 -10 -5 0 61.685 log10 of GE log10 of GE 87.67 61.680 61.675 87.66 Fig. 4 Tolerance proportionality (upper left) and work–accuracy 61.670 87.65 diagrams (the rest) for the trilinear elastic model in Fig. 1,where -15 -10 -5 0 -15 -10 -5 0 log10 of RelTol log10 of RelTol GE and FE stand for global error and function evaluation, respec- tively Fig. 3 Number of state events and their event time values plotted against MATLAB ode45 RelTol for the trilinear elastic model in Fig. 1. Event Types #1 and 2 are defined in Eqs. (2)and(3), advanced systems, e.g., [24,25]). Following the format respectively of Fig. 1 in [29], Fig. 5 depicts Paynter’s tetrahedron of state [22,23] for (a) electrical circuits, which can Following our work in [34], tolerance proportion- be translated to mechanical systems using (b) force– ality (TP) and work–accuracy diagrams arealsopro- analogy, and (c) force–current analogy. vided here to demonstrate the computational stability For mechanical systems, a commonly chosen pair and efficiency of state event location. TP measures of state variables is velocity (called flow in bond graph the relationship between GE and RelTol for explicit, theory) and displacement (the time integral of flow), as adaptive Runge–Kutta time-stepping methods, while in Eq. (5) or Choice No. 1 in Table 1. An alternative pair ( ) work–accuracy diagram measures computational sta- of state variables is restoring force r t (called effort in bility. For example, above the upper left plot in Fig. 4, bond graph theory) and corresponding “” p the TP slope is 0.965, obtained by a straight line fit to (e.g., [16]) where the TP data. This slope is quite close to one, which  indicates very good computational stability for this t p(t) = r(τ)dτ (8) series of trilinear elastic model simulations. Also, the −∞ work–accuracy diagrams for elapsed time, successful and unsuccessful function evaluations (FE) are all quite as in Choice No. 2 in Table 1. The name momentum smooth, which again affirms good computational sta- for p(t) is in accord with [16]. Not to be confused with bility. momentum mx˙, p will be renamed as “g-momentum” herein, where “g” is short for “generalized” follow- ing [22]. For the autonomous case (u = 0) of Eq. (1), 2.2 Flow- versus effort-controlled systems Eq. (8) holds with p =−mx˙ if the system is initially at rest but at a displaced position. The state variable alternatives in Table 1 are obtained, Kelvin and Maxwell models, the two systems in first, by applying bond graph theory, especially recent Table 1, form a dual in the sense that the connectivity research on flow- and effort-controlled system classi- of elements in parallel and series corresponds, respec- fication (e.g., the memristor, memcapacitor and their tively, to flow- and effort-controlled classification of 123 J.-S. Pei et al.

. v r x

Resistor Damper Spring Damper . Mass . . . dv = R di dq = C dv dr = c d x dx = 1/k dr dx = 1/c dr dp = m dx dx = x dt dp = r dt dj = v dt

. . i dq = i dt q x dx = x dt x r dp = r dt p

Memristor Memristor Memristor Mass Spring dj (q) = M(q) dq . dp(x) = M(x) dx dx(p) = M(p) dp dj = L di dp = m d x dx = 1/k d r dq(j) = W(j) dj dx(p) = W(p) dp dp(x) = W(x) dx

j p x (a) (b) (c)

Fig. 5 Planar depiction of Paynter’s tetrahedron of state for the four fundamental a electrical circuit elements following Fig. 1 in [29], b mechanical system elements using force–voltage analogy and c mechanical system elements using force–current analogy systems. In (a) flow-controlled system, a mass plus a Choice No. 4, which is used, for example, in the Bouc– Kelvin model, the natural state variables are displace- Wen model [3], does not fit naturally into bound graph ment x and velocity x˙. These state variables should theory in the form given, and is a mixed (M) sys- be solved (or calculated) first from force equilibrium, tem. However, the Bouc–Wen model can be written which is typically expressed as an ODE involving these in effort-controlled form, consistent with bond graph state variables. In contrast, in (b) effort-controlled sys- theory [24]. tem, a mass plus a Maxwell model, the natural state The motivating examples in Table 1, albeit being variables are g-momentum p and restoring force r. linear, reveal that various possibilities do exist to select These state variables should be solved (or calculated) state variables and their corresponding state equations. first from deformation compatibility, which is often In particular, there are alternatives to displacement and expressed as another ODE involving the state variables. velocity which are often used in practice. These two choices, which are labeled as (a) and (b) in To complement Table 1, additional examples of Table 1, are from the perspective of flow- and effort- nonunique state-space representations are given in controlled classification, and are so indicated by (F) Tables 2 and 3 in “Appendix A.” For brevity, derivations for all these expressions are not provided in this paper; and (E), respectively. however, key technical details start with manipulating There is a well-established procedure under bond Eq. (1)asfollows: graph theory on how to assign and then (if possi-   ble) reduce state variables in writing up system equa- ¨ = − ⇒ ¨ = ( − ) m = ⇒a constant tions for numerical simulation (or even skipping system mx u r mxdt u r dt   equations) [16,22,23]. The key idea in bond graph the- ˙( ) = ˙( ) + − ory is to identify storage elements, and m x t mx 0 udt rdt (9)   momentum springs, in a system, and then assign energy storage impulse g-momentum variables, namely g-momenta and displacements for masses and springs, respectively, before other details are carried out. This means that the first choices for state Equation (9) indicates that p, a kinetic quantity, variables would be the integral of the internal forces and and x˙, a kinematic quantity, are related (principle displacements, a mixture of effort- and flow-controlled of impulse–momentum) and so are not independent, variables. Hence, this choice of state variables leads to a which has two implications: so-called mixed (M) system. Returning to the examples 1. A state variable vector y does not need to have in Table 1, the state variables would be g-momentum p all four vertices in Paynter’s tetrahedron of state, and displacement x, which is Choice No. 3 in Table 1. x, x˙, p, r, the fact of which can be verified in 123 On choosing state variables

Tables 1, 2 and 3. To obtain state equations with are the governing equation. This state equation full rank, one cannot have x˙ and p coexisting in is called a flow map. Algebraic equation(s) may one state variable vector as long as Eq. (1) holds. be needed as well so the flow map consists of 2. All state equations in Table 1 can be made equiva- differential–algebraic equations (DAEs). lent. We have the following pairs: 4. Event An event is when the mode makes a transition from one status to another. It is also called an edge, Choice #1 (F) ↔ #3 (M) by replacing x˙ with p or a jump. It is normally a state event defined by Choice #2 (E) ↔ #4 (M) by replacing p with x˙ state variables—sometimes, algebraic variable(s), Choice #3 (M) ↔ #4 (M) by adjusting the order as well. of state variables 5. Event Function An event function defines a crite- With the equivalency of these pairs in place, it can be rion for an event’s occurrence. It is also called a seen that Choices #1 (F) and #2 (E) can be made equiva- guard. It is defined by using state variables—and lent, leading ultimately to the equivalency of all choices sometimes, algebraic variable(s), as well. in Table 1, meaning that the solution of any choice is 6. Reset Map A reset map defines mathematically how mathematically the same as any other. However, for the process of reset takes place right after an event. nonlinear models, one choice of state variables may be In general, a reset map can include both state and superior to another, based on physical reasoning, inter- algebraic variables. pretation of experimental results, and even on numeri- cal convenience (including accuracy and efficiency). These components are applied to both bilinear hys- teresis and Bouc–Wen models in Sects. 3 and 4, respec- tively. 2.3 Proposed components for hybrid systems

Hybrid dynamical systems, or hybrid systems in short, 3 Bilinear hysteresis model deal with the interaction between continuous and dis- crete time variables. Different research communities 3.1 Bilinear hysteresis model: analysis approach hybrid systems from different angles and with different agendas. In [30], a hybrid automaton is Bilinear hysteresis models (e.g., [6,7]) are popular for defined formally by a septuple and includes the use modeling plastic deformation. The four modes,ItoIV, of differential–algebraic equations (DAEs). The def- defined in [15] are illustrated first by using a simulated inition in [11], on the other hand, seems simpler and example in Fig. 6a to replace the cartoon in Fig. 1(a) involves six components with differential inclusion uti- in [15], and also by a mode transition diagram extended lized. We will focus on the following components for a slightly from Fig. 1(b) in [15]—with details substanti- typical hybrid dynamical system by applying the defi- ated in Table 4 in “Appendix B.” These details closely nition in [11] but with some amendments: follow the hybrid system components elaborated above so that the hybrid system concept directly facilitates the = ( ) 1. Mode A piecewise-defined r r x model corre- understanding and programming. The four algebraic sponds to a collection of discrete characteristic sta- equations given in Eq. (2) in [15] are rewritten in a tuses that the model has, called modes. For exam- slightly more general form as follows: ple, in the trilinear elastic example, one can say that there are two modes when either k = 1orαk = 0.3 Mode I: r = k(x − x0) (10) applies. Normally, a transition diagram is used to Mode II: r = αkx − (1 − α)r (11) illustrate the relationships among multiple modes. y = ( − ) 2. Domain Within a mode, there are state variable(s) Mode III: r k x x0 (12) and perhaps algebraic variable(s). A domain is a Mode IV: r = αkx + (1 − α)ry (13) region where the time evolution of the state vari- able(s) and perhaps algebraic variables’ values are where k, ry and α are system properties similar to the given by a specified mode. trilinear example in Fig. 1, and x0 = x0(t) is a quan- 3. Flow map Within a mode, the state variables are tity that changes as the simulation proceeds, starting continuous and smooth when the state equation(s) with x0(0) = 0. It is the reset map that updates the 123 J.-S. Pei et al.

Fig. 6 Bilinear hysteretic model following a II flow-controlled formulation. IV a Illustration of hysteresis 2 4

loops using a simulated Restoring force 6 result. b Mode transition -x III I y diagram; see Table 4 for 1 3 I III 7 to 8 x of Mode III Displacement 0 x of Mode I 1 0 II -r 8 5 y IV

(a) (b)

value of x0 through the memory parameters Hl , Hu called “partially effort-controlled.” The two formula- and O in programming, details of which are given in tions have their own state variables, event functions, “Appendix B.” flow map and reset map, but the modes and events are AsshowninFig.6a, Modes II and IV are the low and the same for the same applied force u(t). The partially high envelope as defined in Eqs. (11) and (13), respec- effort-controlled scheme is simpler to implement and tively. Modes I and III, however, cannot be grasped more efficient in performance. comprehensively from Fig. 6a, which does not cover Regarding the mixed (M) formulation, the bilinear all possible behaviors of these two modes. hysteresis model can be treated as a “Jenkin’s ele- The comprehensive depiction of Modes I and III is ment” and a linear spring connected in parallel, whose in Fig. 6b in conjunction with Table 4. Mode I can both response is illustrated in blue in Fig. 7a and decom- stem from (8 ) and return to (1 ) Mode IV; however, posed in Fig. 7b. The linear spring is used to capture Mode I can only jump to (2 ) Mode II but Mode II the hardening effect (whose response is plotted in red cannot jump to Mode I. When Mode I has an unfulfilled in Fig. 7b), while the Jenkin’s element is another linear return to Mode IV, an internal loop (still on the same spring and a Coulomb damper connected in series, an straight line) forms (3 ). Conversely, Mode III can both effort-controlled device (whose response is plotted in stem from (4 ) and return to (6 ) Mode II; however, black in Fig. 7b). Thus, the bilinear hysteresis model Mode III can only jump to (5 ) Mode IV but Mode can be implemented as a mixed device (flow- and effort- IV cannot jump to Mode III. When Mode III has an controlled mixture), called partially effort-controlled. unfulfilled return to Mode II, an internal loop (still on When the bilinear model is treated as a “Jenkin’s the same straight line) forms (7 ). Therefore, Modes I element” and a linear spring (for hardening effect) con- and III are not the same – even when Eqs. (10) and (12) nected in parallel, we have: appear the same (where x0 is actually being reset). It is tempting to think that these four piecewise- r = r1 + r2 = r1 + αkx (14) defined formulas for r(t) could be readily embedded in a flow-controlled setting with displacement and veloc- where r1 and r2 represent the contribution to the restor- ity as state variables, such as Eqs. (5) and (6), and imple- ing force from the Jenkin’s element and linear spring, mented as was done for the Ramberg–Osgood model respectively. in [34]. However, bilinear hysteresis has more com- plicated events, event functions (for MATLAB imple- mentation) and reset map, leading to an implementa- 3.2 Bilinear hysteresis model: programming tion similar in kind, but not in detail, to the Ramberg– Osgood model. Due to this complexity, we examined Equations (5) and (6) are rewritten into the following: several formulations and ultimately implemented two: (1) a flow-controlled formulation (F) and (2) a mixed flow- and effort-controlled formulation (M), herein

123 On choosing state variables

II IV 2 4

Restoring force IV 6

-x III I Restoring force y III I 3 I III 7 x of Mode III Displacement 0 x of Mode I 1 0 Displacement II -r 8 5 y II IV

(a) (b) (c)

Fig. 7 Bilinear hysteretic model following a partially effort-controlled formulation. a Illustration of hysteresis loops using a simulated result. b An equivalent sum for hysteresis loops. c Mode transition diagram; see Table 4 for 1 to 8

    where tag2 is the same mode indicator explained in y (1) x y = F = , (15) Table 5 with the differential equations corresponding F y (2) x˙  F      to Eqs. (10)–(13). y˙ (1) x˙ y (2) For bilinear hysteresis, three types of events and y˙ = F = = F (16) F ˙ ( ) ¨ 1 ( − ) event functions are needed, two of which involve dis- yF 2 x m u r placement x(t) while the third type is a so-called velocity-turning point, meaning a time when the veloc- = ( , ) where r r x x0 and the subscript F is for flow- ity is zero: controlled. To complete the flow map, the algebraic equations corresponding to Eqs. (10)–(13)aregiven Event Type #3 :˙x(t) = 0 (19) in Table 5 in “Appendix B,” using tag2, a mode indi- cator established in [34], and O, a programming nota- tion for one of the memory parameters in this study The F and M events (including Event Types #1 and #2 (see “Appendix B”). that are not presented here), event functions and reset For the mixed (M) formulation, the flow map is given maps are given in Table 4 in “Appendix B” covering all by: allowed mode transitions, from I to II, I to IV,II to III, III to IV,III to II and IV to I. The columns “direction” con- ⎧ ⎫ ⎧ ⎫ tain the information on domain for programming. The ( ) ⎪ yM 1 ⎪ ⎪ x ⎪ F and M reset maps are more complicated than the reset ⎪ ⎪ ⎪ ⎪ ⎨ yM(2) ⎬ ⎨ x˙ ⎬ map for the trilinear elastic model. In the mixed (M) = ( ) = = + , yM ⎪ yM 3 ⎪ ⎪ p p1 p2 ⎪ (17) formulation, the switching values of tag2 are fewer and ⎪ ( ) ⎪ ⎪ ⎪ ⎩⎪ yM 4 ⎭⎪ ⎩⎪r1 ⎭⎪ the reset map is significantly simpler (without involv- yM(5) r2 ing updating the memory parameters Hl , Hu and O ⎧ ⎫ ⎧ ⎫ † ˙ ( ) ˙ as indicated in in Table 4), in comparison with the ⎪ yM 1 ⎪ ⎪ x ⎪ ⎪ ⎪ ⎪ ⎪ flow-controlled (F) formulation. ⎨ y˙M(2) ⎬ ⎨ x¨ ⎬ For both the F and M formulations (flow-controlled y˙M = y˙M(3) = r = r1 + r2 ⎪ ⎪ ⎪ ⎪ and partially effort-controlled) and as illustrated in ⎪ y˙M(4) ⎪ ⎪r˙1 ⎪ ⎩ ⎭ ⎩ ⎭ Fig. 8, main.m runs the ode45 solver, where the option y˙M(5) r˙2 ⎧ ⎫ of “options” is activated so that Events.m and Out- ⎪ y (2) ⎪ ⎪ M ⎪ putFcn.m are invoked. The three event functions are ⎨⎪ 1 ( ( ) − ( ) − ( )) ⎬⎪ m u t yM 4 yM 5 defined inside Events.m, while all outputs are recorded = ( ) + ( ) ⎪ yM 4 yM 5 ⎪ (18) by using OutputFcn.m whenever there is a successful ⎪ ( − )( − α) ( ) ⎪ ⎩⎪ 1 tag2 1 kyM 2 ⎭⎪ time step under ode45. For the F formulation, the right- α ( ) kyM 2 hand side of Eq. (16) including the piecewise algebraic 123 J.-S. Pei et al.

2a 2b 3 4a 4b 2a 4b

1 state event location 1 state event location OutputFcn.m Events.m OutputFcn.m Events.m 1 2a state variables 1 2a state variables “[t, x, te, xe] = ... 2b algebraic variable r “[t, x, te, xe] = ...

ode45 (at myfun options)” 3 memory parameters ode45 (at myfun options)” main.m main.m 4a tag 1 2a 4a 2a 4b 2a 2b 3 4a 4b 4b tag 2 2a 4b 4b tag 2 myfun.m 3 myfun.m

(a) (b)

Fig. 8 Illustrations of the interactions among all MATLAB m-files. a Flow-controlled. b Partially effort-controlled equations given in Table 5 in “Appendix B” is computed Two numerical examples with their performance in myfun.m. For the M formulation, the right-hand side measures are presented in Figs. 9, 10, 11 and 12.It of Eq. (18) is computed in myfun.m. can be seen that the partially effort-controlled formula- As an adaptive time-stepping scheme, ode45 in tion (M) reduces computational time, while other per- MATLAB does not have fixed time steps. Control of formance measures are similar, showing computational time stepping is done through specifying RelTol— robustness in both cases. and—MaxStep and InitialStep via odeset. While the former has been investigated using tolerance propor- tionality (TP), the effect of the latter two become essential when simulating more complicated transient 4 Bouc–Wen model response of the bilinear hysteresis model, e.g., Fig. 22 in [15]. 4.1 Bouc–Wen model: analysis For both formulations, the system parameters are m, k, α, xy and ry (with ry = kxy). Additional pro- The formula for the Bouc–Wen model is given as fol- gramming details are given in “Appendix B” using the lows: programming jargon and notation established in [34]. − r˙ = Ax˙ − γ |˙x||r|n 1r − βx˙|r|n = h(x˙, r) (20)

where A, γ , β and n are model parameters (see 3.3 Bilinear hysteresis model: comparison between F Eq.(5.24) in [13], which is based on [32]). Note that and M formulations any elastic term, such as kx, added to r just adds k to A in Eq. (20) and so can be absorbed in A without any The choice of state variables is straightforward for the loss of generality. Because the absolute-value expres- flow-controlled formulation (F), although enabling the sions |˙x| and |r| in Eq. (20) induce discontinuities, they event functions and reset maps under the existing MAT- are treated as state events x˙(t) = 0 and r(t) = 0inthis LAB ode45 setting turns out to be nontrivial, as illus- study. For comparison purposes, we also present simu- trated in Fig. 8a. lation results where these discontinuities are ignored— For the flow-controlled formulation (F), there is by omitting state event coding—leading to reduced strong coupling among all four MATLABm-files, mak- accuracy and computational efficiency. ing the programming somewhat challenging. Figure 8a Using Eq. (9) and the sign function (sgn), Eq. (20) uses arrows to show the data flow. In contrast, the pro- can be rewritten as follows: gramming of the partially effort-controlled formulation     r˙ = A − γ sgn(xr˙ ) + β |r|n x˙, (M) is simpler than the flow-controlled formulation (F).    There is no strong coupling among all four MATLAB 1 t t x˙ = u(τ)dτ − p +˙x(0), where p = r(τ)dτ m-files, making the programming straightforward. Fig- m 0 0 ure 8b uses arrows to show the data flow. (21) 123 On choosing state variables

Time history of prescribed excitation force Time history of prescribed excitation force 1 4 Prescribed excitation time history Prescribed excitation time history 0.5 2

0 0

-0.5 -2 Excitation Force Excitation Force -1 -4 0 102030405060708090100 0 50 100 150 200 250 300 Time Time Time history of solved displacement Time history of solved displacement 2 10

1 5

0 0 Time selected by MATLAB ode45 Event Type #1 solved by MATLAB ode45 -1 Event Type #2 solved by MATLAB ode45 -5 Event Type #3 solved by MATLAB ode45 Displacement Displacement -2 -10 0 102030405060708090100 0 50 100 150 200 250 300 Time Time Time history of solved velocity Time history of solved velocity 0.4 1.5 Time selected by MATLAB ode45 0.2 1 Event Type #1 solved by MATLAB ode45 Event Type #2 solved by MATLAB ode45 0.5 Event Type #3 solved by MATLAB ode45 0 0 -0.2 Velocity

Velocity -0.5 -0.4 -1 0 102030405060708090100 0 50 100 150 200 250 300 Time Time Time history of solved restoring force Time history of solved restoring force 2 4

1 2

0 0

-1 -2 Restoring force Restoring force -2 -4 0 102030405060708090100 0 50 100 150 200 250 300 Time Time (a) (b)

Fig. 9 Bilinear hysteresis model with k = 1, α = 0.3and (F) are presented here; the partially effort-controlled results ry = 0.75 subject to different excitations and simulated using (M) are the same. Event Types #1 to 3 are defined in Table 4 the “event option” under MATLABode45, where RelTol = 10−3 in “Appendix B.” a One cycle of sinusoidal excitation. b An and AbsTol = 10−12: time histories. The flow-controlled results amplitude-modulated sine excitation

Thus, r˙ is now expressed as a function of p and r. Writ- where F+(r) and F−(r) are the integrals with zero ini- ten this way, it is evident that the Bouc–Wen element tial conditions. A qualitative discussion of the pair of can be viewed as an effort-controlled device. Eqs. (22) and (23) is given as follows: Following [25], we have the following pair of equa- tions: – A load versus displacement (r vs. x)plotofthe Bouc–Wen model can have a piecewise definition  following the sign of x˙. The stiffness is entirely a 1 function of r. This implies first the following fact: x = r + x+( ) n−1 n d 0 A − γ |r| r − β|r| At any point on the loading path (x0, r0), the stiff-  F+(r) + x+(0), when x˙ > 0(22)ness is always calculated by either Eqs. (22)or(23)  ˙ 1 depending on the sign of x. This means that there x = dr + x−(0) are only two stiffness values for (x , r ): one for all A + γ |r|n−1r − β|r|n 0 0 loading paths and the other for all unloading paths.  ( ) + ( ), ˙ < F− r x− 0 when x 0 (23) This also implies that parallel loading or unload- 123 J.-S. Pei et al.

Solved hysteretic loops Solved hysteretic loops 3 1.5

1 2

0.5 1

0 0 Restoring force Restoring force -0.5 -1

-2 -1 Time selected by MATLAB ode45 Time selected by MATLAB ode45 Event Type #1 solved by MATLAB ode45 Event Type #1 solved by MATLAB ode45 Event Type #2 solved by MATLAB ode45 Event Type #2 solved by MATLAB ode45 Event Type #3 solved by MATLAB ode45 Event Type #3 solved by MATLAB ode45 -1.5 -3 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -10-8-6-4-20 2 4 6 8 Displacement Displacement (a) (b)

Fig. 10 Bilinear hysteresis model with k = 1, α = 0.3and results (F) are presented here; the partially effort-controlled ry = 0.75 subject to different excitations and simulated using the results (M) are the same. Event Types #1 to 3 are defined in “event option” under MATLAB ode45, where RelTol = 10−3 Table 4 in “Appendix B.” a One cycle of sinusoidal excitation. and AbsTol = 10−12: hysteresis loops. The flow-controlled b An amplitude-modulated sine excitation

-2 0.5 3.6 -2 1 4.5 -4 3.4 -4 -6 0.5 4 0 -6 3.2 -8 -8 0 3.5 -10 3 -0.5 -10 log10 of GE -12 2.8 log10 of GE -0.5 3 -12 -14 log10 of Elapsed Time -1 2.6 -14 log10 of Elapsed Time -1 2.5 -15 -10 -5 0 -15 -10 -5 -15 -10 -5 -15 -10 -5 0 -14 -12 -10 -8 -6 -4 -2 -14 -12 -10 -8 -6 -4 -2 log10 of Number Successful FE log10 of RelTol log10 of GE log10 of GE log10 of RelTol log10 of GE log10 of Number Successful FE log10 of GE

flow-controlled (F) flow-controlled (F) partially effort-controlled (M) partially effort-controlled (M) (a) (b)

Fig. 11 Bilinear hysteresis model with k = 1, α = 0.3and partially effort-controlled (M) simulations are compared here, ry = 0.75 subject to different excitations and simulated using where GE and FE stand for global error and function evalua- the “event option” under MATLABode45, where RelTol = 10−3 tion, respectively. a One cycle of sinusoidal excitation. b An and AbsTol = 10−12: tolerance proportionality (TP) and work– amplitude-modulated sine excitation accuracy diagrams. The results from flow-controlled (F) and

ing paths are within the same range of r but for – There are no viscous terms, linear or non- different ranges of x. linear. Having said this, the Bouc–Wen model is – The original Bouc–Wen formula has now been rate-independent, which is often used in conjunc- rewritten into a piecewise expression for the stiff- tion with viscous damping, i.e., to combine with ness plus x˙ = 0 ⇒r ˙ = 0. This means that, rate-dependent components. Rate independency of essentially, the Bouc–Wen model represents a non- the Bouc–Wen model is consistent with what is linear spring whose stiffness is piecewise-defined claimed in [20]. with the velocity being the switching mechanism.

123 On choosing state variables

50 50 state event state event 40 40 Event Type #1 Event Type #1 Event Type #2 Event Type #2 30 Event Type #3 30 Event Type #3 20 20

10 10 Number of All Events Number of All Events 0 0 -14 -12 -10 -8 -6 -4 -2 -14 -12 -10 -8 -6 -4 -2 log10 of RelTol log10 of RelTol Time of First Event Type #1 Time of Last Event Type #1 Time of First Event #1 Time of Last Event #1 111.390 290.769 111.390 290.769

290.768 290.768 111.385 111.385 290.767 290.767 290.766 111.380 111.380 290.766 290.765

111.375 290.764 111.375 290.765 -15 -10 -5 0 -15 -10 -5 0 -15 -10 -5 0 -15 -10 -5 0 log10 of RelTol log10 of RelTol log10 of RelTol log10 of RelTol Time of First Event Type #2 Time of Last Event Type #2 Time of First Event #2 Time of Last Event #2 74.85 269.458 74.86 269.458

269.456 74.85 269.456 74.84 269.454 74.84 269.454 74.83 269.452 74.83 269.452 74.82 269.450 74.82 269.450

74.81 269.448 74.81 269.448 -15 -10 -5 0 -15 -10 -5 0 -15 -10 -5 0 -15 -10 -5 0 log10 of RelTol log10 of RelTol log10 of RelTol log10 of RelTol Time of First Event Type #3 Time of Last Event Type #3 Time of First Event #3 Time of Last Event #3 31.96 287.196 31.96 287.196

287.194 31.95 287.194 31.95 287.192 31.94 287.192 31.94 287.190 31.93 287.190 31.93 287.188 31.92 287.188

31.92 287.186 31.91 287.186 -15 -10 -5 0 -15 -10 -5 0 -15 -10 -5 0 -15 -10 -5 0 log10 of RelTol log10 of RelTol log10 of RelTol log10 of RelTol (a) (b)

Fig. 12 Bilinear hysteresis model with k = 1, α = 0.3and time values plotted against MATLABode45 RelTol. Event Types ry = 0.75 subject to the amplitude-modulated sine excitation #1 to 3 are defined in Table 4 in “Appendix B.” a Flow-controlled. and simulated using the “event option” under MATLAB ode45, b Partially effort-controlled where AbsTol = 10−12: number of state events and their event

4.2 Bouc–Wen model: programming x>˙ 0, r>0 x˙ One way of programming the Bouc–Wen model with Event Type #1 no state events considered at all is as follows, a version Mode 2 Mode 1 of which is denoted by “A” herein: ⎧ ⎫ ⎧ ⎫ ⎨ yA(1) ⎬ ⎨ x ⎬ = ( ) = ˙ , yA ⎩ yA 2 ⎭ ⎩ x ⎭ r yA(3) r ⎧ ⎫ ⎧ ⎫ ⎨ ˙ ( ) ⎬ ⎨ ˙ ⎬ y 1 x Event Type #3 A Event Type #3 y˙ = y˙ (2) = x¨ A ⎩ A ⎭ ⎩ ⎭ Mode 1 Mode 2 y˙A(3) r˙ ⎧ ⎫ Event Type #2 ⎨ yA(2) ⎬ = 1 ( ( ) − ( )) ⎩ m u t yA 3 ⎭ n−1 n x<˙ 0, r<0 AyA(2) − γ |yA(2)||yA(3)| yA(3) − β yA(2)|yA(3)| (24) Fig. 13 Modes and domains for the Bouc–Wen model to be When considering state events, the modes and associated with Eq. (26) domain are illustrated in Fig. 13: 123 J.-S. Pei et al.

⎧ ⎫ ⎧ ⎫ ⎪ ( ) ⎪ ⎪ ⎪ Equation (21) indicates that only p and r are needed ⎨ yC 1 ⎬ ⎨ x ⎬ yC = y (2) = x˙ , as state variables. Assuming y(1) = p and y(2) = ⎩⎪ C ⎭⎪ ⎩⎪ ⎭⎪ yC(3) r r, the state event associated with r can then be taken ⎧ ⎫ ⎧ ⎫ ⎪ ˙ ( ) ⎪ ⎪ ˙ ⎪ care of easily, whereas the state event associated with ⎨ yC 1 ⎬ ⎨ x ⎬ y˙C = y˙ (2) = x¨ x˙ would meet a challenge by utilizing Eq. (9): ⎩⎪ C ⎭⎪ ⎩⎪ ⎭⎪ y˙C(3) r˙ ⎧ ⎫ ⎨⎪ yC(2) ⎬⎪ = 1 (u(t) − y (3)) ⎩⎪ m C ⎭⎪   ( ) − γ ( )| ( )|n−1 ( ) − β ( )| ( )|n 1 AyC 2 tag2 yC 2 yC 3 yC 3 yC 2 yC 3 x˙ = 0 ⇒ (u − r) dt = 0 ⇒ y(1) = udt (27) m with an event function as follows:

y (2) = 0 (28) This, however, goes beyond the allowed forms of event C functions in MATLAB’s state event location algorithm when y (2) is either ascending or descending, belong- according to [27]. Having said this, x˙ will be included C ing to the third type of state event, and tag =−tag . as a state variable instead. The last state variable x 2 2 is simply added to obtain the displacement. The pro- posed revision is given as follows, an option of which 4.3 Bouc–Wen model: results and comparisons is denoted as “B” herein. The flow map under Option B is given as follows: Figures 14 and 15 present a set of simulation results under Option B. The same amplitude-modulated sine excitation was used. All three types of state events were ⎧ ⎫ ⎧ ⎫ ⎧ ⎫ ⎧ ⎫ detected. ⎨ yB(1) ⎬ ⎨ x ⎬ ⎨ y˙B(1) ⎬ ⎨ x˙ ⎬ = ( ) = ˙ , ˙ = ˙ ( ) = ¨ A comparison is made among three options: A. no yB ⎩ yB 2 ⎭ ⎩ x ⎭ yB ⎩ yB 2 ⎭ ⎩ x ⎭ y (3) r y˙ (3) r˙ state events considered at all, B. all three types of ⎧ B B ⎫ ⎪ y (2) ⎪ state events considered, and C. only one out of three ⎨⎪ B ⎬⎪ 1 ( ( ) − ( )) types of state events considered; the results are pre- = m u t yB 3 ⎪ ( ) − γ ( )( ( ))n−1 ( ) ⎪ ⎩⎪ AyB 2 tag2 yB 2 tag3 yB 3 yB 3 ⎭⎪ sented in Fig. 16 using tolerance proportionality and −β ( )( ( ))n yB 2 tag3 yB 3 work–accuracy diagrams. It can be seen that, first, (25) the utilization of state event location algorithm does improve computational accuracy and reduce compu- tational effort measured by both number of function evaluation and computational time—when compared with the events, event functions and reset map given as to omitting the state event location algorithm. This is follows: the very motivation of our work. It can be seen that, ⎧ : ( ) = ( ) = ⎨ Event Type #1 yB 3 0 when yB 3 is ascending tag3 1 : ( ) = ( ) =− ⎩ Event Type #2 yB 3 0 when yB 3 is descending tag3 1 (26) : ( ) = ( ) =− Event Type #3 yB 2 0 when yB 2 is either ascending or descending tag2 tag2

One drawback in automation is to assign initial val- next, when not all types of state events are considered, ues to tag2 and tag3. Note that tag1 is used for correcting the TP and work–accuracy diagrams may not change discontinuity sticking, which will not be used for state obviously from those—except with small GE values— variables. when all types of state events are correctly considered. To achieve a better understanding of the importance This indicates the importance of having a good under- of all state events, we intentionally ignore the first two standing and doing a thorough job when implementing restoring force events. When we do so, we have the state event location algorithm because mistakes made following option denoted as “C”: may not be easy to detect. 123 On choosing state variables

Time history of prescribed excitation force Solved hysteretic loops 4 1 Prescribed excitation time history 2 0.8 0 0.6 -2 Time selected by MATLAB ode45 0.4 Event Type #1 solved by MATLAB ode45 Excitation Force -4 Event Type #2 solved by MATLAB ode45 0 50 100 150 200 250 300 Event Type #3 solved by MATLAB ode45 Time 0.2 Time history of solved displacement 0 1000 Time selected by MATLAB ode45 Event Type #1 solved by MATLAB ode45 -0.2 500 Event Type #2 solved by MATLAB ode45 Event Type #3 solved by MATLAB ode45 Restoring force -0.4 0 -0.6 Displacement -500 0 50 100 150 200 250 300 -0.8 Time -1 Time history of solved velocity -400 -200 0 200 400 600 800 40 Displacement 20 0 = . γ = . -20 Fig. 15 Bouc–Wen (BW) model with A 0 5, 0 25, β = 0.25 and n = 1 subject to the amplitude-modulated sine Velocity -40 -60 excitation and simulated under Option B using the “event option” 0 50 100 150 200 250 300 under MATLAB ode45, where AbsTol = 10−12 and RelTol = Time 10−3: hysteresis loops. Event Types #1 to 3 are defined in Eq. (26) Time history of solved restoring force 1 0.5 0    − -0.5 x˙ − ν β|˙x||z|n 1z + γ x˙|z|n ˙ = ( ) Restoring force z h z (30) -1 0 50 100 150 200 250 300 η Time

= . γ = . Fig. 14 Bouc–Wen (BW) model with A 0 5, 0 25, where the quantities h, η and ν are time varying and β = 0.25 and n = 1 subject to identical amplitude-modulated sine and simulated under Option B using the “event option” under defined further using equations to be incorporated later MATLAB ode45, where AbsTol = 10−12 and RelTol = 10−3: on, while β, n and γ are model parameters with fixed time histories. Event Types #1 to 3 are defined in Eq. (26) values. It should be noted that, for historical reasons, the β and γ parameters in this subsection, starting at Eq. (30), are reversed from those of the Bouc–Wen 4.4 Bouc–Wen–Baber–Noori Model model in Sect. 4.1, starting at Eq. (20). Connecting a BWBN model to a mass to form a The Bouc–Wen–Baber–Noori (BWBN) model has SDOF system, an elegant choice is to formulate the been popular. There are slightly different versions used equations as differential–algebraic equations (DAEs) and here we follow that in [10], where the model is specified below. Equation (31) is a state equation, while considered to be a parallel connection between a linear Eq. (32) is a coupled algebraic equation—both are in α spring with stiffness k and a hysteresis model. The vector form. total restoring force is thus a sum of the linear spring restoring force αkx and the nonlinear restoring force ⎧ ⎫ ⎧ ⎫ ⎧ ⎫ ⎧ ⎫ ⎪ y( ) ⎪ ⎪ x ⎪ ⎪ y˙( ) ⎪ ⎪ x˙ ⎪ ⎨⎪ 1 ⎬⎪ ⎨⎪ ⎬⎪ ⎨⎪ 1 ⎬⎪ ⎨⎪ ⎬⎪ of the hysteresis model, the latter of which is scaled by ( ) ˙ ˙( ) ¨ = y 2 = x , ˙ = y 2 = x using the coefficient (1 − α)k,asshowninEq.(29). y ⎪ ( ) ⎪ ⎪ ⎪ y ⎪ ˙( ) ⎪ ⎪ ˙ ⎪ ⎩⎪ y 3 ⎭⎪ ⎩⎪ z ⎭⎪ ⎩⎪ y 3 ⎭⎪ ⎩⎪ z ⎭⎪ y(4) ε y˙(4) ε˙ ⎧ ⎫ ( ) r = αkx + (1 − α)kz (29) ⎪ y 2 ⎪ ⎪ 1 ( ( ) − w( )) ⎪ ⎨ m u t 1  ⎬ = w(7) ( ) − w( ) β ( )( ( ))n−1 ( ) ⎪ w(2) y 2 3 tag2 y 2 tag3 y 3 y 3 ⎪ α ⎪ +γ ( )( ( ))n ⎪ where and k are model parameters with fixed values. ⎩⎪ y 2 tag3 y 3 ⎭⎪ z is a state variable having the same physical unit as the (1 − α)ky(2)y(3) displacement: (31) 123 J.-S. Pei et al.

Fig. 16 Bouc–Wen (BW) model subject to identical (a) (b) (c) 5 0.5 4 amplitude-modulated sine excitation and simulated under Options A–C in terms 0 0 3.5 of tolerance proportionality (a) and work–accuracy -5 diagrams (b, c), where GE -0.5 3 and FE stand for global log10 of GE error and function -10 log10 of Elapsed Time evaluation, respectively. -1 2.5 -15 -10 -5 0 -10 -5 0 5 -10 -5 0 5 Only time histories under

log10 of RelTol log10 of GE log10 of Number Successful FE log10 of GE Option B are presented in Fig. 14 Option A without events Option B with Event Types #1-3 Option C with Event Type #3 only

⎧ ⎫ α + ( − α) ⎧ ⎫ ⎧ ⎫ ⎪ kx 1 kz ⎪ [t,y,te,ye] = ode45(@myfun,[tstart,tfinal],y0, ⎪ w(1) ⎪ ⎪ r ⎪ ⎪ + δ ε ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 1 η ⎪ options,w) ⎪ w(2) ⎪ ⎪ η ⎪ ⎪ + δ ε ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 1 ν ⎪ [value, isterminal, direction] = Events(t,y,w) ⎨⎪ w(3) ⎬⎪ ⎨⎪ ν ⎬⎪ ⎨⎪   1 ⎬⎪ 1 n ydot = myfun(t,y,w) w = w(4) = zu = ν(β+γ)  status = OutputFcn(t,y,flag,w) ⎪ ⎪ ⎪ ⎪ ⎪ −pε ⎪ ⎪ w(5) ⎪ ⎪ ζ ⎪ ⎪ ζ1 1 − e ⎪ ⎪ ⎪ ⎪ 1 ⎪ ⎪ 0 ⎪ ⎪ w(6) ⎪ ⎪ ζ2 ⎪ ⎪ ( 0 + δ ε)(λ + ζ1) ⎪ Figures 17 and 18 present a set of simulation results ⎩ ⎭ ⎩ ⎭ ⎪ 2 ⎪ w(7) h ⎩⎪ −[zsgn(x˙)−qzu ] ⎭⎪ ζ 2 using the system parameter values in Fig. 10(b) of [10] 1 − ζ1e 2 ⎧ ⎫ except for k. Their performance measures are presented ⎪ αky(1) + (1 − α)ky(3) ⎪ ⎪ ⎪ in Figs. 19 and 20. Defining MaxStep becomes essen- ⎪ 1 + δη y(4) ⎪ ⎪ ⎪ tial in this numerical example. ⎪ 1 + δν y(4) ⎪ ⎨⎪   1 ⎬⎪ 1 n = w(3)(β+γ) (32) ⎪   ⎪ ⎪ ζ 1 − e−py(4) ⎪ ⎪ 10 ⎪ 5 Discussion ⎪ ( + δ ( ))(λ + w( )) ⎪ ⎪ 0 y 4 5 ⎪ ⎪ − ( ) − w( ) 2 ⎪ ⎩⎪ [y 3 tag2 q 4 ] ⎭⎪ 1 − w(5)e w(6)2 5.1 Guidelines where ε stands for hysteretic energy, defined as ε(t) = t Some guidelines concerning choices of state variables (1 − α)k z(τ)x˙(τ)dτ; r stands for restoring force; η 0 are summarized here and will be further validated in and ν are time-varying stiffness and strength degrada- future work: tion parameters, respectively, and h is a pinching func- tion, which requires time-varying quantities zu, ζ1 and 1. To apply Paynter’s tetrahedron of state using ζ α β γ δ δ ζ 2 to define it. Overall, , k, , n, , η, ν, q, 10 , p, energy/ variables, we have the following two 0, δ , λ are system parameters. chains of kinematic and kinetic variables aligned In terms of implementing this model under MAT- with each other:  LAB ode45 solver, all codes for the BW model under dt acceleration, x¨ −→ velocity, Option “B” can be adopted as is, except for two updates:   First, Eq. (31) is keyed into myfun.m after Eq. (32). dt dt x˙ −→ displacement, x −→ , a (33) Discontinuity sticking is corrected as verified. Next, rate of change in restoring force, following the recommendation in MATLAB, it is of   dt dt critical importance to put the algebraic variable w at r˙ −→ restoring force, r −→ g-momentum, p the end of the argument lists of the four m-files as  dt follows: −→ time integral of g-momentum,ρ (34)

123 On choosing state variables

Time history of prescribed excitation force Solved hysteretic loops 4 1 Prescribed excitation time history Time selected by MATLAB ode45 2 Event Type #1 solved by MATLAB ode45 0.8 Event Type #2 solved by MATLAB ode45 0 Event Type #3 solved by MATLAB ode45 0.6 -2 0.4

Excitation Force -4 0 50 100 150 200 250 300 Time 0.2 Time history of solved displacement 0 20 10 -0.2 Restoring force 0 -0.4 Time selected by MATLAB ode45 -10 Event Type #1 solved by MATLAB ode45 Event Type #2 solved by MATLAB ode45 -20 Event Type #3 solved by MATLAB ode45 -0.6

Displacement -30 0 50 100 150 200 250 300 -0.8 Time -1 Time history of solved velocity -30 -25 -20 -15 -10 -5 0 5 10 15 20 4 Displacement 2 0 Fig. 18 Bouc–Wen–Baber–Noori (BWBN) models with α = . = β = . = γ =− . δ = . δ = . -2 0 1, k 1, 1 5, n 1, 0 5, η 0 05, ν 0 005, Velocity q = 0.1, ζ1 = 0.97, p = 1, 0 = 0.2, δ = 0.002 and λ = 0.1 -4 0 0 50 100 150 200 250 300 subject to an amplitude-modulated sine and simulated using the Time “event option” under MATLAB ode45, where AbsTol = 10−12, Time history of solved restoring force RelTol = 10−3 and MaxStep = 10−1: hysteresis loops. Event 1 Types #1 to 3 are defined in Eq. (26) 0.5 0 -0.5 in modeling should be included in the state vari-

Restoring force -1 able derivative vector. 0 50 100 150 200 250 300 Time – When we utilize the state event location algo- rithm, we need to make the variable that defines α = Fig. 17 Bouc–Wen–Baber–Noori (BWBN) models with the event function a state variable—not a time 0.1, k = 1, β = 1.5, n = 1, γ =−0.5, δη = 0.05, δν = 0.005, = . ζ = . = = . δ = . λ = . derivative of a state variable. This means that q 0 1, 10 0 97, p 1, 0 0 2, 0 002 and 0 1 subject to an amplitude-modulated sine and simulated using the we cannot utilize the variable with the highest “event option” under MATLAB ode45, where AbsTol = 10−12, order in the system dynamics to define an event = −3 = −1 RelTol 10 and MaxStep 10 : time histories. Event function. Types #1 to 3 are defined in Eq. (26) – Whenever x˙ is a state variable, then p does not need to be a state variable, and vice versa. This where absement a and time integral of g-momentum comes from Eq. (9) which shows that x˙ and p ρ are not used in this study. Subsequently, the equa- are not independent state variables, based on tion of motion can be integrated step-by-step as fol- Newton’s second law in Eq. (1). lows:

        ... dt dt dt dt m x =˙u −˙r −→ mx¨ = u − r −→ mx˙ = udt − p −→ mx = udtdt − ρ −→ ma = udtdtdt − ρdt (35)

We make the following additional comments: 2. It is important to reiterate the need to effectively – The variable with the lowest order time deriva- address discontinuities in a model, whenever appli- tive in the system dynamics that we care about cable. Velocity x˙ is often required for the state event in modeling should be included in the state vari- location for piecewise-defined loading and unload- able vector. ing branches in ther−x plane. Given Eq. (9), when- – The variable with the highest order time deriva- ever there is only one mass connected in series with tive in the system dynamics that we care about the rest of the assembly, x˙ and p cannot coexist in 123 J.-S. Pei et al.

-6 0.7 30 -7 state event 0.6 Event Type #1 20 Event Type #2 -8 0.5 Event Type #3 -9 0.4 10 -10 0.3 log10 of GE 0 -11 0.2 -14 -12 -10 -8 -6 -4 -2 Number of All Events -12 log10 of Elapsed Time 0.1 log10 of RelTol -15 -10 -5 0 -12 -10 -8 -6

Variation of First Event Type #1 Variation of Last Event Type #1 log10 of RelTol log10 of GE Time = 98.9070 Time = 286.2068 -9 -8 4 4.7 × 10 × 10 2 5 3.9 4.6 0 0 3.8 4.5 -2 3.7 4.4 -4 -5 3.6 4.3 -6 -10

-15 -10 -5 0 -15 -10 -5 0 Successful FE 3.5 Unsuccessful FE 4.2 log10 of Number log10 of RelTol log10 of RelTol log10 of Number 3.4 4.1 -12 -10 -8 -6 -12 -10 -8 -6 Variation of First Event Type #2 Variation of Last Event Type #2 log10 of GE log10 of GE Time = 49.7760 Time = 241.1848 × 10-9 × 10-8 10 10 Fig. 20 Tolerance proportionality (upper left) and work– accuracy diagrams (the rest) for the BWBN model in Fig. 18, 5 5 where GE and FE stand for global error and function evaluation, respectively 0 0 -15 -10 -5 0 -15 -10 -5 0 log10 of RelTol log10 of RelTol force-state mapping alone due to the mismatch of Variation of First Event Type #3 Variation of Last Event Type #3 Time = 32.7039 Time = 280.9137 the nature of the inputs and outputs. × 10-8 × 10-8 3 6 4. Conversions of state variables can be carried out as 2 4 follows: 1 2         0 0 d x Eq. (9) x t x˙ Eq. (9) p -1 -2 −→ −→d −→ (36) -15 -10 -5 0 -15 -10 -5 0 x˙ p r r log10 of RelTol log10 of RelTol

Fig. 19 Number of state events and the event time errors plotted implies that if x˙ and r can serve as state variables, against MATLAB ode45 RelTol for the BWBN model in Fig. 18, then the flow-controlled system can be considered where there are three, three and 24 Types #1, 2 and 3 events effort-controlled. To do so, as indicated in the equa- throughout, respectively, to make a total of 30 events throughout. Event Types #1 to 3 are defined in Eq. (26) tion above, the rate of change seems essential for this system, given the use of time differentiation for state variables. the state variable vector for the state equations to          be independent, so p will be replaced with x˙ and p Eq. (9) x˙ dt x Eq. (9) x −→ −→ −→ (37) thus will not appear in the state variable vector in r r p x˙ models with discontinuity. This explains, to some extent, why p is not popular for the choice of state implies that if x and p can serve as state variables, variables. then the effort-controlled system can be considered 3. The force-state mapping comes in handy for flow- flow-controlled. To do so, as indicated in the equa- controlled systems to map some kinematic quan- tion above, a memory effect seems essential for this tities to some kinetic ones. When there is a need system, given the use of time integral for state vari- for the inverse map (kinetic quantities to kinematic ables. ones) as in effort-controlled systems, it would not 5. If an algebraic variable is needed to define an event be rational if the force-state mapping technique is function, then the algebraic variable may be imple- still adopted. Similarly, when dealing with mixed mented via a global variable under MATLAB. All systems, mapping kinematic and kinetic quantities algebraic variables should be made into an alge- into each other, it may not be proper to use the braic vector that is carried over through all MAT- 123 On choosing state variables

Time history of prescribed excitation force LAB m-files as demonstrated in Sect. 4.4 for the 1 Prescribed excitation time history BWBN model. 0.5 0 -0.5

Excitation Force -1 5.2 The r˙ = h(x˙, r) formulation 0 102030405060708090100 Time Time history of solved displacement First, some review of the history is given here: [1,2] 2 Time selected by MATLAB ode45 especially [3] using the Bouc–Wen and a “slip-lock” 1 Event Type #1 solved by MATLAB ode45 Event Type #2 solved by MATLAB ode45 model to capture pinching hysteresis are frequently 0 cited for the origin of this formulation. In fact, the -1

Displacement -2 theoretical justification cited in [3]is[5], which actu- 0 102030405060708090100 ally gives a more general formulation making r˙ a Time ˙ Time history of solved velocity function of x, x, r and a dynamic internal variable 0.4 vector used to capture the path dependency of the 0.2 model. 0 ˙ = ( ˙, ) One major application of r h x r is the Bouc– -0.2 Velocity Wen model. A review paper [17] on system identifica- -0.4 0 102030405060708090100 tion for nonlinear systems introduces this formulation Time for the Bouc–Wen model. In this study, we showed that Time history of solved restoring force the Bouc–Wenmodel is an effort-controlled model with 2 p and r as its state variables, but it has two types of dis- 1 continuities, leading to selecting x˙ as an additional state 0 -1 variable. Given the dependence between x˙ and p shown

Restoring force -2 in Eq. (9), the necessary state variables for the Bouc– 0 102030405060708090100 Wen model then become x˙ and r. Consequently, the Time ˙ = ( ˙, ) governing state equation is in the form of r h x r . Fig. 21 To reveal the insight to the peculiar point in Fig. 3 and This is one rationale behind the r˙ = h(x˙, r) formu- as a counterpart for Fig. 2; simulation used sinusoidal excita- lation of the Bouc–Wen model. Another explanation tion force u(t) shown at top and “event option” under MATLAB = . = −12 follows from bond graph theory, which says to use x ode45 with RelTol 0 00077426 and AbsTol 10 .Event Types #1 and 2 are defined in Eqs. (2)and(3), respectively and p. Instead, we differentiate them once and use x˙ and r as state variables. A more general application of r˙ = h(x˙, r) may be 5.3 Complications with state event location algorithm deduced as follows using the pair of flow- and effort- controlled formulations: Examination of Fig. 3 shows that a particular value of RelTol caused the number of state events to reduce by two. For this RelTol value (0.00077426), the time Force-state mapping r = f (x, x˙) (38) histories are presented in Fig. 21 showing the loss ˙ = ( ˙, ) Formulation under discussion r h x r (39) of two Type #1 events. One remedy is to introduce MaxStep = 0.1. As Fig. 3 shows, this loss of two      events did not happen with other selected values of x˙ x = f , t , flow-controlled (40) RelTol, larger or smaller. To be studied in future work, x¨ x˙      this is an example of a numerical difficulty analogous r p to grazing bifurcation, mentioned in [34]. = g , t , effort-controlled (41) r˙ r By using Eq. (1), it can be seen that Eq. (38) is con- 5.4 Physically consistent models sistent with the flow-controlled formulation Eq. (40). By using Eq. (9), it can be seen that Eq. (39) is consis- Nonlinear constitutive models are notorious for allow- tent with Eq. (41). Equation (21) is such an example. ing physically inconsistent solutions to dynamic prob- 123 J.-S. Pei et al. lems, with nonuniqueness being just one of the under- – How can we select state variables that are not only lying issues [26]. Various authors have addressed phys- theoretically sound but also computationally fruit- ical inconsistencies in the Bouc–Wen family of mod- ful? Herein, a successful application of the state els; e.g., [12–14,18,28]. Before embarking on compu- event location algorithm and the ode45 solver has tations, with or without state event location techniques, been presented for some challenging piecewise- it is crucial to start with a well-posed model since oth- defined restoring force models. erwise the resulting simulations will have no practical – Does the choice of state variables for these models predictive value. imply a classification of these models, or should it be vice versa?

6 Conclusions There is no simple or one-size-fits-all answer to these fundamental questions. Different facets of these The need for a sufficient and efficient problem formu- questions have been demonstrated through case stud- lation of a system’s dynamics is of critical importance ies provided in this work and general guidelines are in many engineering mechanics applications, e.g., sys- also provided. The Bouc–Wen model and other models tem identification, damage detection and earthquake discussed herein (and elsewhere) can be implemented response simulation, among many others. Two char- without the state event location algorithm by choos- acteristics of some commonly used models have not ing the algorithmic time steps to be sufficiently small. been researched thoroughly: One is their flow-/effort- A key conclusion from our work is that the option controlled nature and the other, discontinuity in their of implementing the state event location algorithm is state questions. beneficial in reducing the computational burden while These two characteristics are coupled in numeri- providing the same level of accuracy. In the spirit of cal simulation of these models. Normally, one would reproducible computational research [19], the MAT- decide the state variables based on the flow-/effort- LAB code used in this work will be available upon controlled nature, when algebraic variables might exist request to the first author. as well. The “switching rules” and “switching timing” (i.e., the state event locations) can be decided efficiently Acknowledgements Dr. Pei would like to acknowledge the when we properly treat the discontinuity in the sim- hospitality of California Institute of Technology during her sab- ulation. Without a good understanding of these two batical leave for the completion of this study. Dr. Gay-Balmaz is partially supported by the ANR project GEOMFLUID, ANR- characteristics, inefficiency, inaccuracy and incorrect- 14-CE23-0002-01. ness in problem formulation of a system’s dynamics and model class building can be experienced. This is the motivation for us to study these two characteris- tics. In particular, the proper treatment of discontinu- A Appendix for Sect. 2.2 ities has been explored by us starting with [34]. We also explored the flow-/effort-controlled nature of some Tables 2 and 3 list nonunique state-space represen- models in [24,25]. tations of three- and four-parameter linear models, Choices for state variables are not unique as demon- respectively. strated in this study. This is not often made clear in applying state-space representations. Computationally, some choices are better than others in order to imple- ment the state event location algorithm. There are two questions of particular interest to us:

123 On choosing state variables

Table 2 State variables for the three-element models each connected with a mass

k2 k1 k1 u(t) u(t) m m

(a) c2 (b) k2 c2

k2 c1 c1 u(t) u(t) m m

(c) c2 (d) k2 c2

(a) Standard solid model #1 connected in series with a mass ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ x x˙ 01 0 x 0 y = ⎣ x˙ ⎦, y˙ = ⎣ x¨ ⎦ = ⎣ 00− 1 ⎦ ⎣ x˙ ⎦ + ⎣ 1 ⎦ u +m m r r˙ k1k2 k k1 k2 r 0 c2 1 c2 Alternatively by replacing x˙ with p equivalently ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ − 1 1 x x 0 m 0 x m  y = ⎣ p ⎦, y˙ = ⎣ r ⎦ = ⎣ 00 1⎦ ⎣ p ⎦ + ⎣ 0 ⎦ udt + r r˙ k1k2 − k1 k1 k2 r k1 c2 m c2 m (b) Standard solid model #2 connected in series with a mass ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ x x˙ 010 x 0 = ⎣ ˙ ⎦ ˙ = ⎣ ¨ ⎦ = ⎣ 00− 1 ⎦ ⎣ ˙ ⎦ + ⎣ 1 ⎦ y x , y x m x m u r r˙ k1k2 k + k − k2 r 0 c2 1 2 c2 Alternatively by replacing x˙ with p equivalently ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ − 1 1 x x 0 m 0 x m  y = ⎣ p ⎦, y˙ = ⎣ r ⎦ = ⎣ 001⎦ ⎣ p ⎦ + ⎣ 0 ⎦ udt + + r r˙ k1k2 − k1 k2 − k2 r k1 k2 c2 m c2 m (c) Standard fluid model #1 connected in series with a mass     ! "     k2 1 c1c2 k2c1 1 c1c2 r r˙ − + − + + r + y = , y˙ = = c1 c2 m c1 c2 c1 c2 + m c1 c2 u x˙ x¨ − 1 x˙ 1 m 0 m Alternatively by lowering the order of both y and y˙     ! "     k2 1 c1c2 k2c1 1 c1c2  p r − + − + + p + y = , y˙ = = c1 c2 m c1 c2 c1 c2 + m c1 c2 udt x x˙ − 1 x 1 m 0 m Alternatively in an entirely effort-controlled form          p r 01p 0 y = , y˙ = = +  r r˙ − k2 c1 − k2 − 1 c1c2 r k2 c1 udt + 1 c1c2 u m c1+c2 c1+c2 m c1+c2 m c1+c2 m c1+c2 Alternatively in an entirely flow-controlled form     ! "     x x˙ 01  x 0 y = , y˙ = = +  x˙ x¨ − k2 c1 − k2 + 1 c1c2 x˙ k2 udt + u m c1+c2 c1+c2 m c1+c2 m(c1+c2) m (d) Standard fluid model #2 connected in series with a mass     ! "     k2 c1 k2 c1 r r˙ − − (c1 + c2) r y = , y˙ = = c2 m c2 + m u x˙ x¨ − 1 x˙ 1 m 0 m Alternatively by lowering the order of both y and y˙     ! "     k2 c1 k2 c1  p r − − (c1 + c2) p y = , y˙ = = c2 m c2 + m udt x x˙ − 1 x 1 m 0 m

123 J.-S. Pei et al.

Table 2 continued

Alternatively in an entirely effort-controlled form          p r 01p 0 y = , y˙ = = + + + r r˙ − k2 c1 c2 − k2 − c1 r k2 c1 c2 udt + c1 u m c2 c2 m m c2 m Alternatively in an entirely flow-controlled form     ! "     x x˙ 01  x  0 y = , y˙ = = + + x˙ x¨ − k2 c1 c2 − k2 + c1 x˙ k2 udt + u m c1 c2 m mc2 m

Table 3 State variables for the four-element models each connected with a mass

k1 k2 1 1 u(t) k2 c2 u(t) k c m m c1 (a) (b) c2

k1 c1 k1 k2 u(t) u(t) m m

(c) k2 c2 (d) c1 c2

(a) A generalized Maxwell model connected in series with a mass ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ x x˙ 01 0x 0 ⎢ 1 ⎥ = ⎣ ˙ ⎦ ˙ = ⎣ ¨ ⎦ = ⎣ 00  − ⎦ ⎣ ˙ ⎦ + ⎣ 1 ⎦ y x , y x m x m u r r˙ k1k2 k 1 + k1 + c1 − k2 − c1 r c1 c2 2 k2 c2 c1 m m Alternatively by replacing x˙ with p equivalently ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ 0 − 1 0 x x ⎢ m ⎥ x y = ⎣ p ⎦, y˙ = ⎣ r ⎦ = ⎣ 00  1⎦ ⎣ p ⎦ r r˙ k1k2 − k2 1 + k1 + c1 − k2 − c1 r ⎡ c2 m ⎤k2 c2 c1 m 1 ⎢ m ⎥  + ⎣  0  ⎦ udt c1 u + k2 1 + k1 + c1 m m k2 c2 (b) A generalized Kelvin chain connected in series with a mass ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ 01 0 0 x x ⎢ ⎥ x = ⎣ ˙ ⎦ ˙ = ⎣ ¨ ⎦ = 00 − 1 ⎣ ˙ ⎦ + ⎣ 1 ⎦ y x , y x ⎣  m  ⎦ x m u r r˙ k1k2 k + m k1k2 k1 1 + k2 + c2 r − k1k2 udt c2 1 c1c2 c2 k1 c1 c1c2 Alternatively by replacing x˙ with p equivalently ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ 0 − 1 0 1 x x ⎢ m ⎥ x m  y = ⎣ p ⎦, y˙ = ⎣ r ⎦ = ⎣ 00 1 ⎦ ⎣ p ⎦ + ⎣ 0 ⎦ udt r r˙ k1k2 − k1 − k1k2 k1 1 + k2 + c2 r k1 c2 m c1c2 c2 k1 c1 m (c) Two Maxwell models connected in parallel—before being connected in series with a mass ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ 010 0 x x ⎢ ⎥ x = ⎣ ˙ ⎦ ˙ = ⎣ ¨ ⎦ = 00− 1 ⎣ ˙ ⎦ + ⎣ 1 ⎦ y x , y x ⎣   m ⎦ x mu r r˙ k k 1 + 1 k + k − m k1k2 − k1 − k2 r k1k2 udt 1 2 c1 c2 1 2 c1c2 c1 c2 c1c2

123 On choosing state variables

Table 3 continued

Alternatively by replacing x˙ with p equivalently ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ 0 − 1 0 1 x x ⎢ m ⎥ x m  y = ⎣ p ⎦, y˙ = ⎣ r ⎦ = ⎣  001 ⎦ ⎣ p ⎦ + ⎣ 0 ⎦ udt + + r r˙ k k 1 + 1 − k1 k2 − k1k2 − k1 − k2 r k1 k2 1 2 c1 c2 m c1c2 c1 c2 m (d) Two Kelvin models connected in series—before being connected in series with a mass ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ x x˙ 01 0 x 0 y = ⎣ x˙ ⎦, y˙ = ⎣ x¨ ⎦ = ⎣ 00− 1 ⎦ ⎣ x˙ ⎦ + ⎣ 1 ⎦ u + +m m r r˙ k1k2 k1c2 k2c1 − k1 k2 r 0 c1+c2 c1+c2 c1+c2 Alternatively by replacing x˙ with p equivalently ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ˙ − 1 1 x x 0 m 0 x m  y = ⎣ p ⎦, y˙ = ⎣ r ⎦ = ⎣ 00 1⎦ ⎣ p ⎦ + ⎣ 0 ⎦ udt + + + r r˙ k1k2 − 1 k1c2 k2c1 − k1 k2 r 1 k1c2 k2c1 c1+c2 m c1+c2 c1+c2 m c1+c2

B Appendix for Sect. 3 and updated by tagging the entire solution history H in order to switch according to the correct logic and For the F formulation (flow-controlled) and according to correct discontinuity sticking. Hl , Hu and O are for to the programming framework in [34], our previous the lower (Mode II), upper (Mode IV) bound values in work, global variables are utilized for passing values of the event functions as in Table 4, and a constant in the restoring force r, memory parameters Hl , Hu and O, algebraic equations as in Table 5, respectively. tag1 is and tags tag1 and tag2 among different MATLAB m- used to mark each state event for correcting disconti- files. In particular, the memory parameters are obtained nuity sticking, while tag2 is an indicator for the mode.

Table 4 Events, event functions and reset maps for F and M formulations Transition Event Type Flow-controlled formulation (F) Partially effort-controlled formulation (M) Event function Direction Event function Direction

1 I → IV 1 yF(1) − Hu (end) = 0 + 1 yM(4) − (1 − α)ry = 0 + 1

2 I → II 2 yF(1) − Hl (end) = 0 −1 yM(4) + (1 − α)ry = 0 − 1

3 I → I3 yF(2) = 00yM(2) = 00 † 4 II → III 3 yF(2) = 00yM(2) = 00

5 III → IV 1 yF(1) − Hu (end) = 0 + 1 yM(4) − (1 − α)ry = 0 + 1

6 III → II 2 yF(1) − Hl (end) = 0 −1 yM(4) + (1 − α)ry = 0 − 1

7 III → III 3 yF(2) = 00yM(2) = 00 † 8 IV → I3 yF(2) = 00yM(2) = 00

† Need to reset Hl , Hu and O

Table 5 Algebraic and state equations in flow maps obtained from piecewise restoring force expressions for F and M formulations, respectively Mode Flow-controlled (F) Partially effort-controlled (M)

= ( ( ) − ( )) = ˙ ( ) = ( − )( − α) ( )) + α ( ) = I r k yF 1 O end ,withtag2 1 yM 3 1 tag2 1 kyM 2 kyM 2 , with tag2 0 =− + α ( ( ) + ) = ˙ ( ) = ( − )( − α) ( )) + α ( ) = II r ry k yF 1 xy , with tag2 2 yM 3 1 tag2 1 kyM 2 kyM 2 , with tag2 1 = ( ( ) − ( )) = ˙ ( ) = ( − )( − α) ( )) + α ( ) = III r k yF 1 O end ,withtag2 3 yM 3 1 tag2 1 kyM 2 kyM 2 , with tag2 0 = + α ( ( ) − ) = ˙ ( ) = ( − )( − α) ( )) + α ( ) = IV r ry k yF 1 xy , with tag2 4 yM 3 1 tag2 1 kyM 2 kyM 2 , with tag2 1

123 J.-S. Pei et al.

In terms of variables, x(t), x˙(t) and r(t) are continuous 16. Karnopp, D.C., Margolis, D.L., Rosenberg, R.C.: Sys- tem Dynamics: Modeling, Simulation, and Control of variables, while Hl , Hu, O,tag1 and tag2 are discrete variables. Mechatronics Systems, 5th edn. Wiley, Hoboken (2012) 17. Kerschen, G., Worden, K., Vakakis, A.F., Golinval, J.C.: For the M formulation (mixed, partially effort- Past, present and future of nonlinear system identification controlled) and as in our previous work, a global vari- in structural dynamics. Mech. Syst. Signal Process. 20, 505–592 (2006) able is utilized for passing values of tag2 among differ- ent MATLAB m-files. tag is an indicator for the mode 18. Kottari, A.K., Charalampakis, A.E., Koumousis, V.K.: A 2 consistent degrading Bouc-Wen model. Eng. Struct. 60, and is the only discrete variable to be taken care of. 235–240 (2014) 19. LeVeque, R.J.: Wave propagation software, computational science, and reproducible research. In: Proceedings of the International Congress of Mathematicians, European Math- References ematical Society, Madrid, Spain, pp. 1227–1253 (2006) 20. Oh, J., Bernstein, D.S.: Semilinear duhem model for rate- 1. Baber, T.T., Noori, M.N.: Random vibration of degrading, independent and rate-dependent hysteresis. IEEE Trans. pinching systems. ASCE J. Eng. Mech. 111(8), 1010–1026 Autom. Control 50(5), 631–645 (2005) (1985) 21. Park, T., Barton, P.I.: State event location in differential- 2. Baber, T.T., Noori, M.N.: Modeling general hysteresis algebraic models. ACM Trans. Model. Comput. Simul. behavior and random vibration application. ASME J. Vib. 6(2), 147–165 (1996) Acoust. Stress Reliab. Des. 108, 411–420 (1986) 22. Paynter, H.M.: Analysis and Design of Engineering Sys- 3. Benedettini, F., Capecchi, D., Vestroni, F.: Identification of tems: Class Notes for M.I.T. Course 2.751. M.I.T. Press, hysteretic oscillators under earthquake loading by nonpara- Cambridge (1961) metric models. ASCE J. Eng. Mech. 121(5), 606–612 (1995) 23. Paynter, H.M.: The gestation and birth of bond graphs. 4. Bouc, R.: Forced vibration of mechanical systems with https://www.me.utexas.edu/~longoria/paynter/hmp/Bond hysteresis. In: Proceedings of 4th Conference on Nonlinear graphs.html (2000) Oscillations (1967) 24. Pei, J.S., Wright, J.P., Todd, M.D., Masri, S.F., Gay-Balmaz, 5. Capecchi, D.: Accurate solutions and stability criterion for F.: Understanding memristors and memcapacitors for engi- periodic oscillations in hysteretic systems. Meccanica 25, neering mechanical applications. Nonlinear Dyn. 80(1), 159–167 (1990) 457–489 (2015) 6. Caughey, T.K.: Random excitation of a system with bilinear 25. Pei, J.S., Gay-Balmaz, F., Wright, J.P., Todd, M.D., hysteresis. J. Appl. Mech. 27, 649–652 (1960a) Masri, S.F.: Dual input–output pairs for modeling hys- 7. Caughey, T.K.: Sinusoidal excitation of a system with teresis inspired by mem-models. Nonlinear Dyn. 88(4), bilinear hysteresis. J. Appl. Mech. 27, 640–643 (1960b) 2435–2455 (2017) 8. Dormand, J.R., Prince, P.J.: A family of embedded Runge– 26. Sandler, I.S.: On the uniqueness and stability of endochronic Kutta formulae. J. Comput. Appl. Math. 6(1), 19–26 (1980) theories of materials behavior. ASME J. Appl. Mech. 45, 9. Esposito, J.M., Kumar, V.: A state event detection algorithm 263–266 (1978) for numerically simulating hybrid systems with model 27. Shampine, L., Gladwell, I., Brankin, R.: Reliable solution singularities. ACM Trans. Model. Comput. Simul. 17(1), of special event location problems for ODEs. ACM Trans. 1–22 (2007) Math. Softw. 17(1), 11–25 (1991) 10. Foliente, G.C.: Hysteresis modeling of wood joints and 28. Sivaselvan, M.V., Reinhorn, A.M.: Hysteretic models for structural systems. ASCE J. Struct. Eng. 121(6), 1013–1022 deteriorating inelastic structures. ASCE J. Eng. Mech. (1995) 126(6), 633–640 (2000) 11. Goebel, R., Sanfelice, R., Teel, A.: Hybrid dynamical 29. Strukov, D.B., Snider, G.S., Stewart, D.R., Williams, R.S.: systems. IEEE Control Syst. Mag. 28, 28–93 (2009) The missing memristor found. Nature 453, 80–83 (2008) 12. Ikhouane, F., Rodellar, J.: Physical consistency of the hys- 30. van der Schaft, A., Schumacher, H.: An Introduction to teretic Bouc-Wen model. IFAC Proc. Vol. 38(1), 874–879 Hybrid Dynamical Systems. Lecture Notes in Control and (2005) Information Sciences (Book 251). Springer, Berlin (1999) 13. Jayakumar, P.: Modeling and identification in structural 31. Wen, Y.K.: Method for random vibration of hysteretic dynamics. Ph.D. thesis, California Institute of Technology, systems. ASCE J. Eng. Mech. 102(2), 249–263 (1976) Pasadena, CA (1987) 32. Wen, Y.K.: Equivalent linearization for hysteretic systems 14. Jayakumar, P., Beck, J.L.: System identification using under random excitation. ASME J. Appl. Mech. 47, nonlinear structural models. In: Nake, H.G., Yao, J.T.P. 150–154 (1980) (eds.) Structural Safety Evaluation Based on System 33. Willems, J.C.: Dissipative dynamical systems part I: general Identification Approaches, Friedr. Vieweg & Sohn Braun- theory. Arch. Ration. Mech. Anal. 45, 321–351 (1972) schweig/Wiesbaden, Vieweg International Scientific Book 34. Wright, J.P., Pei, J.S.: Solving dynamical systems involving Series, vol Proceedings of the Workshop at Lambrecht/Pfalz, piecewise restoring force using state event location. ASCE pp 82–102 (1988) J. Eng. Mech. 138(8), 997–1020 (2012) 15. Kalmár-Nagy, T., Shekhawat, A.: Nonlinear dynamics of oscillators with bilinear hysteresis and sinusoidal excitation. Phys. D 238, 1768–1786 (2009) 123