Memristor Modeling in MATLAB®&Simulink
Memristor Modeling in MATLAB®&Simulink
Memristor Modeling in MATLAB®&Simulink
1 Introduction
The contemporary analogue electronics uses the three elementary passive elements resistor, capacitor and inductor (ideal lumped parameter elements), see Fig.1.
theoretically no energy to conserve the information (only for recording and reading).
M= d dq
v
R= dv di
d L= di
q
C= dq dv
dv = Rdi
q
i
dq = Cdv
q
M
= f (q)
d = Ldi
d = Mdq
Fig.2. The memristor and a passive elements quaternion. Thus, the memristor is able to conserve the information of the total amount of charge passed. Its resistance can be continuously changed within certain boundaries with the passing current. Yet one year after publishing the article [1] the systems from other technical branches, embodying the analogical memristive behavior [2], were described. Then, Leon Chua tried to generalize the whole problem in [3]. The crucial turn was reached in 2008, when a team of scientists of Hewlett Packard laboratories constructed the first real memristor [4]. All the known information is that it is a nano-component made of TiO2 titanium oxide
ISBN: 978-960-474-297-4
62
about 10 to 30 nm thick, gripped between two platinum electrodes. A part of the titan layer is depleted of the oxygen atoms and has semiconductor behavior. The other part serves as an insulator. The working principle of memristor is that the width of the semiconductor layer is modulated by the passing current. At present, a significant amount of works concerning memristor both abroad and in the Czech Republic was written, for example [5]-[8]. Interesting articles were published by Biolek in [6] and [7], where he defines one of the first SPICE memristor models and tries to generalize the whole problem of memristive behavior. In the works cited, there can also be found a mathematical memristor model which serves as the default for the modeling in MATLAB&Simulink system. In this article, we focus on the memristor modeling in MATLAB system. We have not found a lot of similar works so far, therefore we assume that this is one of the first publications of the models and simulations described below. The idea of implementing a memristor into the mentioned system is led by effort to enrich this powerful tool with the modern and perspective component.
v (t ) = Rmem (x ) i(t ) ,
(1)
and undoped) and x = w / D (0,1) . Except the Ohms law it is necessary to describe the dependence between the passing current i and the x state. Recently this dynamic state equation looks like this:
dx RON = kf ( x )i (t ), k = v 2 dt D
(2)
where v 10 14 m 2 s 1V 1 is so-called dopant mobility. The limiting values of the memristor resistance for w = 0 a w = D are marked with ROFF a RON . For the total resistance can be written:
(3)
The function f ( x ) in the relation (2) is so-called window function and models the non-linearities of the charge carrier transport in the nano-component. In the literature, there can be found more terms, we prefer the one proposed in [6]:
f ( x ) = 1 (2 x 1) ,
2p
(4)
where p is an integer. The equations (1) to (4) represent the mathematical memristor model according to the present knowledge. They will be used for the actual values of the constants and parameters mentioned. For the purposes of this article the description above is fully sufficient. Those interested in detail we devise to the works cited, or the internet.
w
doped undoped
v
Fig.3. Basic geometrical image of the memristor according to HP laboratories. The basic relation between the exciting voltage and memristor current is the Ohms law:
ISBN: 978-960-474-297-4
63
More about choosing can be read in the following text. The previous lines define the concrete values of needed parameters and the time axis.
H (z ) =
z , z 1
(5)
0.5
2.5
Imem [A]
2 0
-2 0
0.5
x [-]
Fig.5. Memristor key time courses simulation. The model was accurately tested and tuned. Fig. 5. and Fig. 6. show the results of the simulation for the given input harmonic voltage. The results are fully adequate to the published outputs. It appears that with the ODE solver appropriately chosen, the presented approach is suitable for modeling of similar systems. The source text construction can be also modified. It is possible to divide it into two m-files, which is suitable in the case of work with more extensive systems for easier tuning of separate parts of models. In the need of speed it is more suitable to maintain one m-file.
x 10 1 Imem [A] 0 -1 -1 x 10 4 Charge [As]
-5 -4
Fig.4. Memristor model in MATLAB environment. The RINIT resistor expresses the beginning value of the memristor resistance. ODE solver ode23t calls the function ODE_Memri_A as its output parameters. It returns back the variables marked with [t,x]. The output is therefore the time course of the x state, see (2). The vector of the memristor passing current is calculated from it. The energizing quantity is the harmonic course of the V voltage with the amplitude of 1V and the frequency of 1Hz . Thus, the model could be finished but if the vectors of voltage and course are known it is very handy to try to calculate the charge and flux vectors, for they describe the memristor explicitly. According to the theory, for the charge and flux vectors calculation the indefinite integration is necessary. Using our experience, we chose the IIR type digital filter for these operations. To maintain the scale, the filter command is then multiplied by the sampling period. The digital filter itself has the system function:
Hysteresis loop
-0.5
0.5
0.05
0.1
0.25
0.3
ISBN: 978-960-474-297-4
64
the value of 0,015. Other setting parameters were left implicit. It is obvious that even this ODE solver type leads to the right and accurate results. The obvious advantage of this modeling approach is its relative simplicity, descriptiveness and speed. More attention has to be paid to the adjustment of separate blocks and simulation parameters. The exciting harmonic voltage source has the same parameters as in the previous model.
Fig.7. Memristor model in Simulink system. The appropriate blocks show the mathematical model given by (2) to (4) equations.
Rmem
(6)
k & x
For better understanding, the description arrangement for (6) is presented as it leads directly to the block formalism. The model includes also the initiating condition of the integrator for which is given:
x0 =
f (x )
The other constants remain from the previous model. The simulation results are the same as the previous model. When tuning the models in Simulink environment it is necessary to observe the parameters settings for the ODE solution. In our case we chose ode45 (Dormand-Prince) type of ODE solver which employs explicit Runge-Kuth method. Maximum step on the time axis was limited with
Fig.8. Principle memristor scheme in Simscape. For the concrete set voltage value it is needed to compute the value of current passing the memristor according to the equations above (2) to (4), (6)
ISBN: 978-960-474-297-4
65
respectively. This is presented in the scheme as a variable potentiometer. It could appear that this potentiometer serves as a mere illustration but it appeared very useful just in the field of physical modeling. In the Electrical Elements library in the Simcape system, there is a component called Variable Resistor. It includes three terminals. Two are the input and output of the resistor, the third is the regulatory input which allows direct regulating of the resistors resistance dependent on the random variable principle (signal). This component offers direct employment for the construction of the memristor model according to Fig. 8. Fig. 9 shows the complete physical memristor model. There are the blocks for the mathematical model implementation and other blocks without principle meaning. They only secure the right model function, or the junction between the physical and the Simulink blocks. Except the blocks of drawing on the right, the physical model concretizes directly the scheme in Fig. 8. The current and voltage values are scanned with the Current Sensor and Voltage Sensor blocks. This is the peculiarity of modeling in Simscape system as well as the SimulinkSimscape convertors (PSS blocks).
Model in the Fig. 9 is an agreeable demonstration of combined use of Simulink a Simscape blocks. Thus, the given system becomes significantly efficient and powerful. Like in the Simulink model, in this case is the integration provided with 1 / s integrator blocks. The concrete constants values are identical with the previous model including the initial value x0 . The source of harmonically variable voltage is here provided with Simscape block (AC Voltage Source). The simulation outputs are the same as the models described above.
Fig.10. Transient analysis outputs in Micro-Cap 9. The second way was comparing with the SPICE model output which was implemented in the well-known MicroCap simulation system. Our working place is equipped with it. All the results of modeling and simulations were checked and confirmed in detail. For further information see [8]. Fig. 10 shows the SPICE model Micro-Cap 9 simulation. We do not mention further information
ISBN: 978-960-474-297-4
66
References:
[1] CHUA, L.O. Memristor the missing circuit element. IEEE Trans. Circuit Theory, 1971, vol. CT18, no. 5, p. 507-519. [2] OSTER, G.F., AUSLANDER, D.M. The Memristor. A New Bond GRAPH Element. Trans. ASME on Dynamical Systems, Measurement and Control, vol. 94, No. 3, 1972, p. 249-252. [3] CHUA, L.O., KANG, S.M. Memristive Devices and Systems. In Proceedings of the IEEE, vol. 64, no. 2, February 1976, s. 209-223. [4] STRUKOV, D.B., SNIDER, G.S., STEWARD, D.R., WILLIAMS, R.S. The missing memristor found. Nature, 2008, vol. 453, 1 May 2008, p. 80-83. [5] WILLIAMS, R.S. How we found the missing memristor. IEEE Spectrum, 12/01/2008, p. 1-11, www.spectrum.ieee.org/print/7024. [6] BIOLEK, Zdenk, BIOLEK, Dalibor, BIOLKOV, Viera. SPICE Model of Memristor with Nonlinear Dopant Drift. Radioengineering, 2009, vol. 18, no. 2, p. 210-214. ISSN 1210-2512. [7] BIOLEK, Dalibor, BIOLEK, Zdenk, BIOLKOV, Viera. Memristor a jeho msto v teorii obvod. Slaboproud obzor, 2009, vol. 65, no. 2, p. P1-P16. ISSN 0037-668X. [8] BENDERLI, S., WEY, T.A. On SPICE macromodelling of TiO2 memristors. Electronics Letters, vol. 45, no. 7, March 26, 2009, p. 377-379.
4 Conclusion
At the time of writing this article, the professional community expected the results of the first manufactured pieces of memristor. As soon as the vital data are available it will be possible to execute concrete identification of the mentioned models and thus to solve the whole problem of modeling.
Fig.11. Memristor as a subsystem in Simulink. Fig. 11 shows the final memristor appearance as a subsystem. The user can click with the mouse on its block and input values of the aforementioned characteristics transparently in a new window. From the numerous published works, we recommend the aforementioned HP company internet pages:
http://www.hpl.hp.com/news/2008/apr-jun/memristor_faq.html.
Acknowledgements
This work has been supported by research program of Brno University of Defence, No. FVT0000403, Czech Republic and University of Defence MATLAB Group (UDeMAG). MATLAB, Simulink and SimscapeTM are registered trademark of The MathWorks, Inc.
ISBN: 978-960-474-297-4
67