April 01, 2024

Electricity production from fossil fuels is among the main contributors to global warming. To suppress climate change, energy-efficient systems, devices, and technologies must be implemented. This study investigates strategies for minimizing Joule losses in resistive random access memory (ReRAM) cells, which are also referred to as memristive devices. The basic question that we ask is what is the optimal driving protocol to switch a memristive device from one state to another. In the case of ideal memristors, in the most basic scenario, the optimal protocol is determined by solving a variational problem without constraints with the help of the Euler-Lagrange equation. In the case of memristive systems, for the same situation, the optimal protocol is found using the method of Lagrange multipliers. We demonstrate the advantages of our approaches through specific examples and compare our results with those of switching with constant voltage or current. Our findings suggest that voltage or current control can be used to reduce Joule losses in emerging memory devices.

Memristors, memristive systems, switching, optimal control, functional optimization

The problem of memristive switching optimization has a few facets. Minimizing Joule heat, switching time, or a combination of the two are possibilities. Furthermore, memristive devices can be described using ideal models [1], memristive models [2]–[4], or probabilistic models [5]–[8]. Lastly, the optimization problem can be formulated with application-specific constraints and/or physics-based constraints. The highest voltage that can be used in the circuit or the compliance current to prevent the device from being damaged are the constraint examples.

To proceed, we shall first introduce memristive devices [2] and their certain subset known as ideal memristors [1]. The voltage-controlled memristive devices are defined by the set of equations [2] \[\begin{align} I(t)&=&R^{-1}_M\left(\boldsymbol{x},V \right)V(t), \tag{1}\\ \dot{\boldsymbol{x}}&=&\boldsymbol{f}\left(\boldsymbol{x},V\right), \tag{2} \end{align}\] where \(V\) and \(I\) are the voltage across and current through the device, respectively, \(R_M\left( \boldsymbol{x}, V\right)\) is the memristance (memory resistance), \(\boldsymbol{x}\) is a vector of \(n\) internal state variables, and \(\boldsymbol{f}\left(\boldsymbol{x}, V\right)\) is a vector function. The current-controlled memristive devices are defined similarly [2]. In the above set, Eq. (1 ) is the generalized Ohm’s law, while Eq. (2 ) is the state equation. The latter defines the evolution of the internal state variable or variables.

In ideal memristors [1], the state evolution function is often proportional to the current. Consequently, the internal state variable \(x\) is proportional to the charge \(q\). In addition, it is common to set the proportionality coefficient to one. In this case, the internal state variable is simply the charge flown through the
device from an initial moment of time. In what follows, the response of such *ideal* devices is described in terms of a generalized Ohm’s law \[V=R_M\left(q \right)I(t),
\label{eq:ideal}\tag{3}\] where the memristance, \(R_M\), is a function of charge. Although this model is quite abstract (physical devices behave substantially differently from the ideal ones [9]–[11]), its straightforward structure is advantageous for
analytical calculations.

In this paper, we apply the calculus of variations and optimal control theory to the problem of memristive switching. We have derived the optimal driving protocols for the following optimization problems:

unconstrained switching of ideal memristors within a fixed interval of time (Subsec. 2.1.1);

unconstrained switching of ideal memristors within a variable interval of time (Subsec. 2.1.3);

unconstrained switching of memristive systems within a fixed interval of time (Subsec. 2.2.1);

switching of ideal memristors within a fixed interval of time in the presence of a constraint (Subsec. 3.1).

An interesting finding is that, in unconstrained ideal memristor problems, the optimal trajectory corresponds to Joule losses occurring at a consistent rate (see Theorems 1 and 2 below). We compare our derived switching protocols to the cases of constant voltage or current. Our results show that the voltage or current control can be used to reduce Joule losses in emerging ReRAM circuits and systems.

This paper is structured as follows. Sec. 2 is devoted to unconstrained optimization problems. Within Sec. 2, Subsec. 2.1 focuses on ideal memristors, while Subsec. 2.2 is dedicated to memristive systems. Constrained switching is discussed in Sec. 3. Examples of optimal switching are given in Subsec. 2.1.2, Subsec. 2.1.3, Subsec. 2.2.2, and Sec. 3.1.2 where the calculus of variations and optimal control theory are applied to linear ideal memristors and memristive systems with a threshold. The paper concludes with a summary.

Let us first consider the problem of minimization of Joule losses in the switching of ideal memristors. Without loss of generality, the ideal memristors are described by Eq. (3 ). In this case, the energy cost for switching from one state to another is a functional with respect to the charge trajectory \(q(t)\). This trajectory links the initial state of memristor, \(R_i\), at the initial moment of time, \(t_i\), with its final state, \(R_f\), at the final moment of time, \(t=t_f\). For a given \(q(t)\), the Joule heat, \(Q[q(t)]\), is expressed by \[Q[q(t)]=\int\limits_{(q_i,t_i)}^{(q_f,t_f)}\dot{q}^2R_M(q)\textrm{d}t, \label{eq:1}\tag{4}\] where \(q_{i/f}\) is the initial/final charge (\(R_M(q_{i/f})=R_{i/f}\)), and it is assumed that \(R_M(q)\) is known. Our goal is to find the optimal trajectory, \(q_{opt}(t)\), that minimizes the Joul heat functional, Eq. (4 ), see the illustration in Fig. 1.

In principle, this problem is similar to the principle of least action in classical mechanics [12]. Therefore, to determine the optimal trajectory we use the Euler-Lagrange equation that leads to the equation of motion \[\ddot{q}R_M(q)+\frac{1}{2}\dot{q}^2\frac{\textrm{d}R_M(q)}{\textrm{d}q}=0. \label{eq:2}\tag{5}\] The first integral of Eq. (5 ), \[\dot{q}\sqrt{R_M(q)}=C_1, \label{eq:3}\tag{6}\] can be integrated leading to \[\int \sqrt{R_M(q)}\textrm{d}q=C_1\int\textrm{d}t=C_1t+C_2, \label{eq:integral}\tag{7}\] where \(C_1\) and \(C_2\) are constants.

Note that the first integral, Eq. (6 ), is nothing else than the conserved “kinetic energy”, \(R_M(q)\dot{q}^2\), for the Joule heat functional, Eq. (4 ). In the present context, it represents the power that is constant along the optimal trajectory. This observation is formulated in the following theorem.

**Theorem 1.** *The optimal trajectory minimizing Joule losses in ideal memristors is characterized by constant power (in unconstrained problems).*

As an example of the above equations, consider the minimization of Joule losses in linear memristors. Let us assume that in the region of interest, the memristance \(R_M(q)\) can be approximated by a linear function, \[R_M(q)=a+bq. \label{Linear95memristor}\tag{8}\] Here, \(a\) and \(b\) are constants. In this case, the integral in Eq. (7 ) can be easily evaluated and Eq. (7 ) is rewritten as \[\frac{2}{3b}\left(a+bq(t) \right)^{\frac{3}{2}}=C_1t+C_2.\] Next, the integration constants \(C_1\) and \(C_2\) are found using the initial and final point of the trajectory (see Eq. (4 ) and Fig. 1). Explicitly, the charge trajectory minimizing the Joule losses is \[\begin{align} q_{opt}(t)&=&\frac{1}{b}\left[ \frac{3b}{2}\left( C_1t+C_2\right)\right]^\frac{2}{3}-\frac{a}{b} = \label{eq:8}\\ && =\frac{1}{b}\left[ \frac{R_i^\frac{3}{2}(t_f-t)+R_f^\frac{3}{2}(t-t_i)}{t_f-t_i} \right]^\frac{2}{3}-\frac{a}{b}.\nonumber \end{align}\tag{9}\] The current corresponding to \(q_{opt} (t)\) is \[I_{opt}(t)= \frac{2}{3b} \frac{R_f^\frac{3}{2}-R_i^\frac{3}{2}}{t_f-t_i} \left[ \frac{R_i^\frac{3}{2}(t_f-t)+R_f^\frac{3}{2}(t-t_i)}{t_f-t_i} \right]^{-\frac{1}{3}} \label{eq:9}\tag{10}\] and total Joule heat generated during the switching is \[Q_{opt}= \left(\frac{2}{3b}\right)^2 \frac{\left(R_f^\frac{3}{2}-R_i^\frac{3}{2}\right)^2}{t_f-t_i}. \label{eq:10}\tag{11}\] Using Eq. (6 ) it is not difficult to verify that Theorem 1 is satisfied by \(q_{opt} (t)\).

It is interesting to compare \(Q_{opt}\) for the optimal trajectory (Eq. (11 )) to the Joule heat for the trajectory connecting \((q_i,t_i)\) to \((q_f,t_f)\) linearly, \[q_{I=\textrm{const}}(t)=q_i\frac{t_f-t}{t_f-t_i}+q_f\frac{t-t_i}{t_f-t_i}.\] We note that this case corresponds to driving by a constant current. Using Eq. (4 ) one finds \[Q_{I=\textrm{const}}= \frac{1}{2b^2} \frac{(R_f^2-R_i^2)(R_f-R_i)}{t_f-t_i}. \label{eq:12}\tag{12}\] It can be directly verified that the heat \(Q_{I=\textrm{const}}\) is always greater than the optimal Joule heat, \(Q_{I=\textrm{const}}>Q_{opt}\), for all values \(R_f\neq R_i\) and \(t_f>t_i\) as it should be.

When the memristor is driven by a constant voltage \(V\), the Ohm’s law is simply the differential equation \(\dot{q}R_M(q)=V\) having the solution \[q_{V=\textrm{const}}(t)=\frac{-a+\sqrt{R_i^2+2bV(t-t_i)}}{b}.\] Interestingly, in this case the total Joule heat is the same as in the case of constant current, Eq. (12 ). As the voltage as a function of switching time interval can be written as \[V=\frac{1}{2b}\frac{R_f^2-R_i^2}{t_f-t_i},\] another expression for \(Q_{V=\textrm{const}}\) is \[Q_{V=\textrm{const}}=\frac{V(R_f-R_i)}{b}.\]

Certain results found for linear memristors are shown graphically in Fig. 2. In particular, switching of linear memristors using optimal control reduces Joule losses by up to a factor of \(8/9\) or approximately 11% compared to switching with constant voltage or current. Figure 2 (a) shows that reducing Joule losses is achieved by increasing the current \(I\) when the resistance \(R_M\) is smaller, and vice versa.

Equations (11 ) and (12 ) suggest that Joule losses can be minimized by increasing the switching time. However, in numerous applications, a high operating frequency is essential. In this part of the paper, we explore how to reconcile the conflicting demands of low losses and rapid switching.

Thus, we would like to find the trajectory that minimizes Joule losses and switching time simultaneously. For this purpose, the cost functional can be selected as \[F=f(Q[q(t)])+g(t_f-t_i),\] where \(f(x)\) and \(g(x)\) are monotonously increasing functions, and \(Q[q(t)]\) is given by Eq. (4 ). In the linear case, the cost functional is simply \[F=w_1Q[q(t)]+w_2\cdot (t_f-t_i), \label{eq:14}\tag{13}\] where \(w_i\) are the positive weights (distinct units).

To find the minimum value of the cost functional, we independently vary \(q(t)\) and \(t_f\). The variation of \(q(t)\) gives the same Eq. (5 ), and the variation of \(t_f\) gives the additional equation \[\left.\left(w_2-w_1 \dot{q}^2R_M(q)\right)\right|_{t=t_f}=0, \label{eq:15}\tag{14}\] which, according to Eq. (6 ), can be simplified to \(w_2=w_1 C_1^2\). As the first integral of Eq. (5 ) is given by the same Eq. (6 ), the power is constant along the optimal trajectory. Therefore, we state the following theorem.

**Theorem 2.** *The optimal trajectory minimizing Joule losses and switching time in ideal memristors is characterized by constant power (in unconstrained problems).*

Returning to the example in Subsec. 2.1.2, we can use Eq. (11 ) to express the power in Eq. (14 ) and eventually obtain the optimal time \[(t_f-t_i)_{opt}=\sqrt{\frac{w_1}{w_2}}\frac{2}{3b}\left(R_f^\frac{3}{2}-R_i^\frac{3}{2}\right).\] At this value of \(t_f-t_i\), \[Q_{opt}=\sqrt{\frac{w_2}{w_1}}\frac{2}{3b}\left(R_f^\frac{3}{2}-R_i^\frac{3}{2}\right).\]

Next, we consider a voltage-controlled memristive device satisfying Eqs. (1 )-(2 ). In the following discussion, we focus on a scenario with a single internal state variable. However, our primary equations can be adapted to more complex situations.

Our aim is to identify the most efficient driving protocol that minimizes Joule losses when the device switches from \(x(t_i)=x_i\) to \(x(t_f)=x_f\). Mathematically, we consider a model with the Joule heat functional defined by \[Q=\int\limits_{t_i}^{t_f}\frac{V^2(t)}{R_M(x)}\textrm{d}t \;\; \rightarrow \;\; \textrm{min},\] where \(x\) is the function of time according to Eq. (2 ).

According to the general scheme [13], the Lagrangian function is written as \[\mathcal{L}=\lambda_0\int\limits_{t_i}^{t_f}\frac{V^2(t)}{R_M(x)}\textrm{d}t+\int\limits_{t_i}^{t_f}\Lambda(t)\left[ \dot{x}(t)-f(x,V)\right]\textrm{d}t+l, \label{funct95Lagr}\tag{15}\] where \(\lambda_0\) and \(l\) are constants, and \(\Lambda(t)\) is a function of time known as the Lagrange multiplier. From (15 ), the Lagrangian is \[L(x,\dot{x}, V,\Lambda)=\lambda_0\frac{V^2(t)}{R_M(x)}+\Lambda(t)\left[ \dot{x}(t)-f(x,V)\right].\] The necessary conditions for an extrema are the following [13]:

Euler-Lagrange equation: \(\textrm{d}\left( \partial L/\partial \dot{x} \right) /\textrm{d} t= \partial L/\partial x\);

Stationary condition with respect to \(V\): \(\partial L/\partial V=0\);

Transversality conditions \(L'_{\dot{x}}(t_i)=l'_{x(t_i)}\) and \(L'_{\dot{x}}(t_f)=-l'_{x(t_f)}\), where \(l=\lambda_i x(t_i)+\lambda_fx(t_f)\) is the terminant.

The last condition leads to \(\Lambda(t_i)=\lambda_i\) and \(\Lambda(t_f)=\lambda_f\). As \(\lambda_i\) and \(\lambda_f\) are arbitrary constants, these conditions can be omitted. Therefore, our optimization problem is defined by the following set of equations: \[\begin{align} \Lambda(t)&=&\lambda_0\frac{2 V(t)}{R_M(x)f'_{V}(x,V)}, \tag{16}\\ \frac{\textrm{d} \Lambda(t)}{\textrm{d} t}&=&\lambda_0V^2(t)\frac{\textrm{d}}{\textrm{d} x}\left[ \frac{1}{R_M(x)} \right]-\Lambda (t)f'_x(x,V), \tag{17}\\ \frac{\textrm{d} x(t)}{\textrm{d} t}&=&f(x,V), \tag{18}\\ x(t_i) &=& x_i \; , \; x(t_f) = x_f. \tag{19} \end{align}\]

Here, we show that Eq. (5 ) for ideal memristors in Subsec. 2.1.1 can be derived directly from Eqs. (16 )-(19 ). For this purpose, using \(f(x,V)=V/R_M(x)\) we first obtain the partial derivatives \(f'_V=1/R_M(x)\) and \(f'_x=-R_M'(x)V/R_M^2(x)\). Substituting these partial derivatives into Eq. (16 ) yields \[\Lambda(t)=2\lambda_0\frac{V(t)}{R_M(x)/R_M(x)}=2\lambda_0V(t). \label{eq:17}\tag{20}\] Using Eq. (20 ), Eq. (17 ) can be rewritten as \[\dot{V}(t)=\frac{1}{2} V^2(t) \frac{R_M'(x)}{R_M^2(x)}. \label{eq:18}\tag{21}\] Taking into account that \(V(t)=R_M(q)\dot{q}\), Eq. (21 ) leads to \[\ddot q R_M(q)+\frac{1}{2}\left( \dot{q}\right)^2\frac{\textrm{d} R_M}{\textrm{d}q}=0,\] which is precisely Eq. (5 ) in Subsec. 2.1.1. Therefore, the results presented in Subsecs. 2.1.1 and 2.1.1 remain consistent when applying our comprehensive optimization theory formulated for the memristive devices in the current subsection.

Traditional experimental memristive devices [14], [15] demonstrate switching with a threshold, since it is essential for nonvolatile information storage. In the following, we apply the optimization approach from Subsec. 2.2.1 to a memristive device described by a model featuring a threshold. Specifically, we consider a device described by the equations [3] \[\begin{align} R_M(x)&=&R_{on}+x(R_{off}-R_{on}) , \label{eq:Rx} \\ \frac{\textrm{d}x}{\textrm{d}t}&=& \begin{cases} k(V-V_{on}), & V>V_{on}>0,\\ 0, & V_{off}\leq V \leq V_{on},\\ k(V-V_{off}), & V<V_{off}<0, \end{cases} \end{align}\tag{22}\] where \(k>0\) is the constant, \(R_{on}\) and \(R_{off}\) are the on-state and off-state resistances, and \(V_{on}\) and \(V_{off}\) are the thresholds. According to the equations above, when the voltage is greater than \(V_{on}\), the memristive system switches to the high-resistance state, \(R_{off}\).

For the sake of definiteness, let us consider the transition \(x_i\rightarrow x_f\) at \(V>V_{on}\). As \(f(x,V)=k(V-V_{on})\), Eqs. (16 )-(18 ) take the form \[\begin{align} \Lambda(t)&=&2\lambda_0\frac{V(t)}{kR_M(x)}, \tag{23}\\ \frac{\textrm{d} \Lambda(t)}{\textrm{d} t}&=&-\lambda_0V^2(t)\frac{R_M'(x)}{R_M^2(x)}, \tag{24}\\ \frac{\textrm{d} x(t)}{\textrm{d} t}&=&k(V-V_{on}). \tag{25} \end{align}\] Next, without the loss of generality, we set \(\lambda_0=1\). Substituting \(V(t)/R_M(x)\) from Eq. (23 ) into Eq. (24 ) we arrive at \[\frac{\textrm{d} \Lambda(t)}{\textrm{d} t}=-R_M'(x)\left(\frac{k}{2} \right)^2\Lambda^2(t). \label{eq:40}\tag{26}\] The solution to equation (26 ) can be expressed as \[\Lambda(t)=\frac{1}{\frac{k^2}{4}R_M'(x)t+C_1} \label{eq:28},\tag{27}\] where \(C_1\) is the integration constant.

Using (23 ) we obtain the following expression for the voltage \[V(t)=\frac{k}{2}\frac{R_M(x)}{\frac{k^2}{4}R_M'(x)t+C_1} \label{eq:29}\tag{28}\] that can be further simplified using the linear dependence of \(R_M\) on \(x\), Eq. (22 ). The substitution of (28 ) and (22 ) into the state equation (25 ) leads to \[\frac{\textrm{d}x}{\textrm{d}t}=\frac{2R_{on}}{R_M'(x)(t+t_0)}-kV_{on}+\frac{2}{t+t_0}x, \label{eq:x}\tag{29}\] where \(t_0=4C_1/(k^2R_M'(x))\) is employed for compactness in place of \(C_1\).

The solution of Eq. (29 ) can be written as \[x(t)=C(t+t_0)^2+kV_{on}(t+t_0)-\frac{R_{on}}{R_M'(x)},\] where \(C\) is an arbitrary constant. Consequently, \[R_M(t)=CR'(x)(t+t_0)^2+kR_M'(x)V_{on}(t+t_0). \label{eq:45}\tag{30}\] The values of the arbitrary constants \(C\) and \(t_0\) can be determined by setting \(R_M(t_i)\) equal to \(R_i\) and \(R_M(t_f)\) equal to \(R_f\).

The voltage as a function of time is found by utilizing Eq. (27 ), which yields \[\begin{align} V(t)&=&2V_{on}+\frac{2C}{k}(t+t_0), \label{eq:47} \\ I(t)&=&\frac{2}{kR_M'(x)}\frac{1}{t+t_0}. \end{align}\tag{31}\] According to Eq. (31 ) the control voltage is a linear function of time.

Using the initial and final resistances, one can obtain \[\label{C} C=\frac{R_f+R_i-\sqrt{4R_iR_f+[kV_{on}R_M'(x)(t_f-t_i)]^2}}{R_M'(x)(t_f-t_i)^2}\tag{32}\] and \[t_0=\frac{1}{2C}\left\{\frac{R_f-R_i}{(t_f-t_i)R_M'(x)}-kV_{on}\right\}-\frac{t_f+t_i}{2}.\]

Note that we must discard the solution with the positive sign of the root in Eq. (32 ), as it does not satisfy the inequality \(V(t)>V_{on}\) that we considered from the very beginning of this section.

Finally, the Joule heat is expressed by \[Q_{opt}=\frac{4}{k^2R_M'(x)}\left[ C\left( t_f-t_i \right) + kV_{on}\ln\left(\frac{t_f+t_0}{t_i+t_0}\right)\right] .\]

Fig. 3 (a) exemplifies the time dependence of the memristance for several driving protocols. We note that in the cases of optimal control, constant voltage control, and constant current control, the memristance increases quadratically (Eq. (30 )), linearly, and exponentially with time, respectively. Based on the information presented in Fig. 3 (b), the use of optimal control has the potential to decrease Joule losses by approximately 27% compared to switching based on constant voltage and by approximately 35% in contrast to switching based on constant current.

Let us now address a more complex case involving the optimal control of memristive switching while taking into account inequality constraints. Specifically, we will focus on the case of an ideal memristor with a current constraint, where we assume that the current \(I(t)\) passing through the device is limited by a critical (complience) current \(I_c\), such that \(| I(t)| \leq I_c\). Consequently, we are interested in minimizing Joule losses, which can be expressed through the functional (4 ), while also imposing the current limiting constraint \(| \dot{q} | \leq I_c\).

It is evident that when the critical current \(I_c\) is sufficiently large, the solution of the problem is determined by the same Euler-Lagrange Eq. (5 ). The situation becomes more complicated
when the current, calculated using the solution derived from Eq. (7 ) with specified boundary conditions, exceeds the critical current at least at a certain point in time. In such a situation, it becomes necessary to
incorporate Pontryagin’s principle of maximum (minimum) to determine the optimal control \(q(t)\). To facilitate this, it is convenient to introduce a new variable \(u\) following the
definition ^{3} \[u=\dot{q}.
\label{eq:u95def}\tag{33}\] This way we transfer the constraints into the configuration space \[|u|\leq I_c. \label{eq:restrict}\tag{34}\]

The Lagrangian function for this optimal problem is written as (see [13]) \[\mathcal{L}=\int\limits_{t_i}^{t_f} \left[\lambda_0 R_M(q)u^2+p(t)\left( \dot{q}(t)-u\right)\right]\textrm{d}t+l, \label{funct95Lagr2}\tag{35}\] where constant \(\lambda_0\geq 0\) and function \(p(t)\) are the unknown Lagrange multipliers. In the subsequent discussion, we omit the term \(l=\lambda_i q(t_i)+\lambda_f q(t_f)\) from the Lagrangian function (35 ) since the transversality conditions associated with it do not impose any limitations on the solution of the problem under consideration.

The optimal control must satisfy not only Euler-Lagrange equation with respect to \(q\), \[\lambda_0 R_M'(q)u^2-\frac{\textrm{d}p(t)}{\textrm{d}t}=0, \label{Euler-Lagrange2}\tag{36}\] but also the Pontryagin’s principle of maximum (minimum) with respect to \(u\), \[\min_{|\eta|\leq I_c}\left[\lambda_0 R_M(q(t))\eta^2-p(t)\eta\right]= \lambda_0 R_M(q(t))u^2-p(t)u. \label{pontryagin}\tag{37}\] The last condition implies that, at any instant \(t\), the optimal control \(u(t)\) minimizes the expression in Eq. (35 ) within the range \(-I_c\leq u\leq I_c\) for the optimal solution \(q(t)\) and \(p(t)\).

Let us first examine the specific case of \(\lambda_0=0\). Considering the Euler-Lagrange equation (36 ), it follows that \(p(t)\) is constant. Applying Pontryagin’s principle (37 ) with \(\lambda_0=0\), we can determine the optimal control for the function \(u(t)=I_c\textrm{sign } p(t)=\pm I_c\). Therefore, in the case where \(\lambda_0=0\), the constant maximum current \(\dot{q}=u=\pm I_c\) is maintained throughout the entire duration of the memristor switching.

This special solution is only possible under certain boundary conditions, specifically when \((q_f-q_i)/(t_f-t_i)=\pm I_c\). If this condition is not satisfied, this particular solution is not viable, and \(\lambda_0>0\). Furthermore, we can assume \(\lambda_0=1\) in the following discussion without loss of generality.

The minimization of the quadratic function in the LHS of Eq. (37 ) gives the following optimal control for the function \(u(t)\): \[\begin{align} \label{eq:u95opt} u(t)&=& \begin{cases} \frac{p(t)}{2R_M(q)}, & \textrm{if } \frac{|p(t)|}{2R_M(q)} < I_c,\\ I_c\textrm{sign } p(t), & \textrm{otherwise}. \end{cases}\; . \end{align}\tag{38}\]

The system of equations (33 ), (36 ), with \(\lambda_0=1\), and (38 ) fully determines the optimal switching of the ideal memristor. It is evident that the current \(u(t)\) satisfies the constraints specified in Eq. (34 ). Furthermore, by eliminating the Lagrange multiplier \(p(t)\) from Euler-Lagrange equation (Eq. (36 )) using Eq. (38 ) for \(u(t)<I_c\), we obtain the optimal trajectory for the ideal memristor without constraints, as expected. Therefore, it is apparent that achieving optimal control for the ideal memristor under current restrictions generally involves a smooth and continuous connection of the solution characterized by constant power (refer to Eq. (7 )) with the solution represented by the maximum possible current \(q=\pm I_c t+C_3\), where \(C_3\) is an arbitrary constant.

We will illustrate the method discussed above by considering the switching of a linear memristor, considered previously in Subsec. 2.1.2. However, now we also assume that the maximum possible current is limited by the critical (compliance) value \(I_c\). It is also assumed that during the time period from \(t_i=0\) to \(t_f\), the memristance changes from \(R_M(0)=R_i\) to \(R_M(t_f)=R_f>R_i\). Furthermore, we consider the most interesting case where at the initial moment of time the optimal unrestricted current \(I_{opt}(t=t_i)\), given by Eq. (10 ), greater than \(I_c\). This corresponds to the following inequality: \[\label{ineq} 2 \frac{R_f^{3/2}-R_i^{3/2}}{3bt_f\sqrt{R_i}}>I_c.\tag{39}\]

Following the previous discussion, to minimize Joule heat, it is necessary to apply the highest current \(I_c\) for a duration of up to \(t_c\). In the case of the linear memristor described by Eq. (8 ), this leads to the following resistance change: \[R_M(t)=R_i+bI_c t, \;\;\; \textrm{for }0\leq t\leq t_c. \label{eq:59}\tag{40}\] Starting at \(t=t_c\), the optimal solution is given by Eq. (9 ): \[R_M(t)= \left[ \frac{R_c^\frac{3}{2}(t_f-t)+R_f^\frac{3}{2}(t-t_c)}{t_f-t_c} \right]^{\frac{2}{3}},\;\; \textrm{for }t_c\leq t\leq t_f, \label{eq:60}\tag{41}\] where resistance \(R_c=R_M(t_c)\) calculated with the use of Eq. (40 ).

The values of the parameters \(t_c\) and \(R_c\) need to be determined from the continuity condition of the memristance, \(R_M(t)\), and the current, \(I(t)=\dot{R}_M/b\), at the instant \(t_c\) when the control change occurs. This leads to the following equations for \(R_c\) and \(t_c\): \[\sqrt{R_c^3}-3(R_i+bI_ct_f)\sqrt{R_c}+2\sqrt{R_f^3}=0, \label{RcEq}\tag{42}\] and \[t_c=\frac{R_c-R_i}{bI_c}. \label{tcEq}\tag{43}\]

Note that an obvious condition must be met for the final state, \(R_f\), to be reachable from the initial state, \(R_i\), during time interval \(t_f\) due to the existance of the maximum possible current \(I_c\): \[R_f<R_i+bI_c t_f \;. \label{ineq2}\tag{44}\] This inequality guarantees the existence of two positive roots of Eq. (42 ), the smallest of which is smaller than \(R_f\), while the other is larger. This smallest positive root of Eq. (42 ) determines the resistance \(R_c\) and moment of time \(t_c\) (see Eq. (43 )), where the optimal control changes. Note that the inequality (39 ) guarantees that \(R_c>R_i\).

Fig. 4 illustrates our results on the optimal control of an ideal linear memristor with a current constraint. Fig. 4b represents memristance as a function of time calculated by using Eqs. (40 ), (41 ) for the case of constrained switching and by using Eqs. (8 ), (9 ) for the case of unconstrained switching. The corresponding currents, which are proportional to the derivatives of the memristances with respect to time, are presented in Fig. 4a. Clearly, for the used set of parameters, inequalities (39 ) and (44 ) are satisfied. Thus, it allows us to find the only solution of Eqs. (42 ) and (43 ), \(R_c/R_f=0.34\) and \(t_c/t_f=0.26\), which determines the resistance and time moment of control change for this set of parameters.

In principle, the general approach developed for memristive systems in Subsec. 2.2 combined with the Pontryagin principle (which we used for the analysis of the switching of ideal memristors with a current constraint in Sect. 3.1) can be employed to optimize the switching of memristive devices (Eqs. (1 ) and (2 )) in the presence of constraints. However, our derivations in Subsec. 3.1 suggest that optimal switching protocols, in fact, can be obtained using a simplified approach, at least in certain cases. Such cases include (but are not limited to) some simple (first-order) memristive models and unidirectional switching.

Consider, for example, measurements involving current compliance (see Eq. (34 )). The idea is to link the two operational conditions, specifically, with and without current compliance. First of all, one can consider the unconstrained scenario (using the approach outlined in Subsec. 2.2). If Eq. (34 ) holds consistently, then the solutions for both constrained and unconstrained problems coincide. Otherwise, the solutions with and without the constraint should be combined while adhering to the criteria of (i) maintaining the continuity of the control parameter and (ii) minimizing Joule losses.

In this study, novel strategies have been devised to reduce Joule losses that arise when memristive devices are switched. Various hypothetical scenarios have been examined, and substantial energy savings have been shown to be possible by following specific driving protocols proposed in this research. Our study lays the foundation for future investigations into optimizing the operational conditions of memristive devices, which could potentially be adapted for other memory circuit elements [16] with suitable modifications. The practical implications of this work can be significant, as implementing the protocols outlined here could enhance the efficiency of memristive systems and related technologies such as in-memory computing and neuromorphic computing, to name a few.

The authors thank Alon Ascoli for early-stage discussion and encouragement.

[1]

L. O. Chua, “Memristor - the missing circuit element,” *IEEE Transactions on Circuit Theory*, vol. 18, pp. 507–519, 1971.

[2]

L. O. Chua and S. M. Kang, “Memristive devices and systems,” *Proceedings of IEEE*, vol. 64, pp. 209–223, 1976.

[3]

Y. V. Pershin, S. La Fontaine, and M. Di Ventra, “Memristive model of amoeba learning,” *Phys. Rev. E*, vol. 80, p. 021926, 2009.

[4]

S. Kvatinsky, E. G. Friedman, A. Kolodny, and U. C. Weiser, “Team: Threshold adaptive memristor model,” *IEEE transactions on circuits and systems I: regular papers*,
vol. 60, no. 1, pp. 211–221, 2012.

[5]

V. J. Dowling, V. A. Slipko, and Y. V. Pershin, “Probabilistic memristive networks: Application of a master equation to networks of binary ReRAM
cells,” *Chaos, Solitons & Fractals*, vol. 142, p. 110385, 2021.

[6]

V. Dowling, V. Slipko, and Y. Pershin, “Modeling networks of probabilistic memristors in spice,” *Radioengineering*, vol. 30, pp. 157–163, 04 2021.

[7]

V. Ntinas, A. Rubio, and G. C. Sirakoulis, “Probabilistic resistive switching device modeling based on markov jump processes,” *IEEE Access*, vol. 9, pp. 983–988,
2021.

[8]

V. A. Slipko and Y. V. Pershin, “Probabilistic model of resistance jumps in memristive devices,” *Phys. Rev. E*, vol. 107, p. 064117, 2023.

[9]

Y. V. Pershin and M. Di Ventra, “A simple test for ideal memristors,” *J. Phys. D: Appl. Phys.*, vol. 52, p. 01LT01, 2018.

[10]

J. Kim, Y. V. Pershin, M. Yin, T. Datta, and M. Di Ventra, “An experimental proof that resistance-switching memory cells are not memristors,” *Advanced Electronic
Materials*, vol. 6, no. 7, p. 2000010, 2020.

[11]

M. Di Ventra and Y. V. Pershin, *Memristors and Memelements: Mathematics, Physics and Fiction*.1em plus 0.5em minus 0.4emSpringer Nature, 2023.

[12]

H. Goldstein, C. Poole, and J. Safko, *Classical mechanics*.1em plus 0.5em minus 0.4emPearson, 2001.

[13]

V. Alekseev, *Optimal Control*, ser. Contemporary Soviet mathematics.1em plus 0.5em minus 0.4emSpringer US, 2013.

[14]

M.-K. Song, J.-H. Kang, X. Zhang, W. Ji, A. Ascoli, I. Messaris, A. S. Demirkol, B. Dong, S. Aggarwal, W. Wan, S.-M. Hong, S. G. Cardwell, I. Boybat, J.-S. Seo, J.-S. Lee, M. Lanza,
H. Yeon, M. Onen, J. Li, B. Yildiz, J. A. Del Alamo, S. Kim, S. Choi, G. Milano, C. Ricciardi, L. Alff, Y. Chai, Z. Wang, H. Bhaskaran, M. C. Hersam, D. Strukov, H.-S. P. Wong, I. Valov, B. Gao, H. Wu, R. Tetzlaff, A. Sebastian, W. Lu, L. Chua, J. J. Yang,
and J. Kim, “Recent advances and future prospects for memristive materials, devices, and systems,” *ACS Nano*, vol. 17, pp. 11 994–12 039, 2023.

[15]

J. Kim, V. J. Dowling, T. Datta, and Y. V. Pershin, “Whisky-born memristor,” *physica status solidi (a)*, vol. 220, no. 11, p. 2200643, 2023.

[16]

M. Di Ventra, Y. V. Pershin, and L. O. Chua, “Circuit elements with memory: Memristors, memcapacitors, and meminductors,” *Proc. IEEE*,
vol. 97, no. 10, pp. 1717–1724, 2009.

V. A. Slipko is with the Institute of Physics, Opole University, Opole 45-052, Poland (e-mail: vslipko@uni.opole.pl)↩︎

Y. V. Pershin is with the Department of Physics and Astronomy, University of South Carolina, Columbia, SC 29208 USA (e-mail: pershin@physics.sc.edu)↩︎

It is evident that the definition of \(u\) is identical to the current. Nevertheless, a distinct notation is required since, in Pontryagin’s principle, \(u\) is treated as an independent variable.↩︎