In the previous article I had found three unstable equilibria. But that conclusion left open the most interesting question: once the trajectory moves away from an equilibrium, where does it go? It could diverge, reach a periodic orbit or explore a bounded region with a more complex structure. I want to reproduce the first numerical experiment on the circuit, published by Takashi Matsumoto in 1984, and compare what I obtain with the original images.

The historical figure shows two regions in which the motion winds and some transitions between them. They are not two different oscillators: all the coordinates belong to the same autonomous system. At this stage I am not yet looking for a proof of chaos. First I want to check whether, starting from the equations and parameters stated by Matsumoto, I can find the same structure in phase space.

1. The historical model, without replacing the parameters

I start again from report UCB/ERL M84/36, equation (1) on page 2 of the text (page 4 of the PDF), and the three-segment characteristic of Figure 1(b). To avoid confusing this replication with a simulation of Zhong and Ayrom’s physical circuit, I use only the numerical coordinates of Matsumoto’s model.

\[ g(v_1)=-0.1v_1-1.95\bigl(|v_1+1|-|v_1-1|\bigr). \]

This compact expression represents three continuous lines: slope −4 between −1 and +1 and slope −0.1 in the outer regions. Substituting the coefficients into the differential equations:

\[ \begin{aligned} \dot v_1&=10[0.7(v_2-v_1)-g(v_1)],\\ \dot v_2&=0.5[0.7(v_1-v_2)+i_L],\\ \dot i_L&=-7v_2 . \end{aligned} \]

The state is the vector of the two voltages and the inductor current, with Matsumoto’s sign convention. The three equilibria are those computed in article 03. For the computation I choose the initial condition [0.1; 0; 0]: a perturbation of the origin. If I used exactly (0,0,0), the derivatives would be zero and the integrator would have no reason to move the trajectory. I do not attribute my initial condition to the historical source: the step of 0.02 and the parameters are stated in the report, while the initial condition and the duration of this replication are choices of our numerical experiment.

2. Integrating as in 1984: fourth-order Runge–Kutta

The report specifies a fourth-order Runge–Kutta method with a step of 0.02. In this version of GX-TXT, Math Numeric exposes an adaptive ODE solver, but not a classic fixed-step RK4 mode. To reproduce the historical method exactly I therefore used an Octave script registered in the GX-TXT session. The script contains only the definition of the model, the recurrence of the method, the checks and the calls to the public APIs for publishing the results. It does not build graphs with an external renderer and does not write the scientific files of the session directly.

I denote by \(\mathbf{s}\) the state vector and by \(F(t,\mathbf{s})\) the system of the three derivatives. The method evaluates the field at four positions:

\[ \begin{aligned} k_1&=F(t_n,s_n),\\ k_2&=F(t_n+h/2,s_n+hk_1/2),\\ k_3&=F(t_n+h/2,s_n+hk_2/2),\\ k_4&=F(t_n+h,s_n+hk_3),\\ s_{n+1}&=s_n+\frac{h}{6}(k_1+2k_2+2k_3+k_4). \end{aligned} \]

It is important that each evaluation uses all three components of the vector at the same stage. I do not update one variable and then immediately use its new value to update the others. For each step, the method obtains a complete state at the end of the interval.

I registered and ran the RK4 Octave script in the session. This is the core of the procedure, with the RHS function returning the vector of the three derivatives:

g = @(x) -0.1*x-1.95*(abs(x+1)-abs(x-1));
rhs = @(t,s) [10*(0.7*(s(2)-s(1))-g(s(1)));
              0.5*(0.7*(s(1)-s(2))+s(3));
              -7*s(2)];
k1 = rhs(t(k),s);
k2 = rhs(t(k)+step/2,s+step*k1/2);
k3 = rhs(t(k)+step/2,s+step*k2/2);
k4 = rhs(t(k)+step,s+step*k3);
S(k+1,:) = (s+step*(k1+2*k2+2*k3+k4)/6).';

The duration is 1000 in the numerical units of the report. I repeated the simulation with h=0.02 and h=0.01, without changing the initial conditions. A check stops the computation if the solution is not finite or if a coordinate exceeds 1000 in magnitude; it is not a saturation mechanism and does not modify the equations. It did not trigger for either integration. The data also include the initial transient: I use t≥200 only as a selection for the projections of the attractor, not as a deletion of rows.

ParameterRK4 replicationRK4 check
Step0.020.01
Interval0–10000–1000
Total samples50,001100,001
Samples from t=20040,00180,001
Initial condition(0.1; 0; 0)(0.1; 0; 0)

Keeping the result as a scientific Dataset

Publication takes place through DATASET_PUBLICATION_API_v2: I prepare a writer, declare the sample dimension and four variables, write the columns and finalise the publication. I used HDF5 in both cases. The variables are t, v1, v2 and iL; all have numerical unit 1, with descriptive labels, because the historical parameters do not represent an SI bill of materials. The metadata keep the method, step, initial condition and proposed time selection.

Figure 2 also shows the Dataset of the adaptive check, which I will discuss later. The data all belong to the same scientific session, but each trajectory has its own identity: chua.matsumoto.rk4_h002, chua.matsumoto.rk4_h001 and chua.matsumoto.rk45_short. There is no need to export and re-import CSV files between different tools.

3. From the four columns to the three planes of the attractor

Time is needed to build the trajectory, but it does not have to be the horizontal axis of the graph. Each row contains a complete state, and I can plot one coordinate against another. In the GX-TXT XY graph I select the Dataset of the RK4 with step 0.02 and bind the X and Y variables as in the following figure.

For Matsumoto’s Figure 2(a) I set X=iL and Y=v1. In the native graph I applied the row filter t between_inclusive 200 1000. The settings were created through PLOT_DATASET_API_v4 of Scientific Dataset Plot 4.4.3 and then checked in the series editor. I use scatter, because in a phase diagram X is not necessarily monotonic: arbitrarily joining points after sorting them along the horizontal axis would produce a false trajectory. The native point reduction concerns only the display; it does not modify the HDF5 data. I do not interpret the apparent density of points in the reduced graph as a probability of residence.

The visual comparison between Figures 1 and 4 is the first result I was looking for. I find the two main regions, one positive and the other negative in v1, with transitions in the intermediate zone. The shapes and orientation of the two lobes are compatible with the historical projection. The original graph, however, also includes the external hyperbolic periodic orbit mentioned in the report: I did not compute that specific orbit with a Newton method and I do not claim to reproduce it with my integration.

Figures 5 and 6 correspond to the other two planes observed by Matsumoto, (iL,v2) and (v2,v1). They show how much the appearance of the dynamics changes when the same trajectory is projected. The fact that in Figure 5 the lobes appear partly overlapping does not mean that the system has changed regime; it is the effect of the projection. The plane of the two voltages is the one we will be able to observe directly with an oscilloscope in XY mode, when we build the physical circuit.

I also compared the extremes of the three coordinates on the rows with t≥200. They are not guaranteed mathematical bounds of the attractor, but the minima and maxima of the samples actually integrated.

Variableh=0.02: min…maxh=0.01: min…max
v1−12.1050…12.1239−12.1241…12.1178
v2−5.1365…5.1192−5.1306…5.1364
iL−24.1605…24.0945−24.1391…24.1611

In the report Matsumoto observes that, for the attractor studied, the magnitude of v1 stays below 14. Our samples after the transient are compatible with this observation. The three-segment model, however, is not globally dissipative for every initial state: the author himself discusses the possibility of divergence and a modified law to bound the behaviour at large values. I did not replace the original law with the modified one.

4. What happens over time?

A projection does not show in which order the points are visited. So I go back to the graph of the first voltage, choosing the numerical interval 200–260 and keeping the order of the Dataset.

Here we see something that the phase diagram does not tell on its own. The voltage makes a few turns in the positive region, then moves to the negative one; it alternates groups of oscillations of different durations. This is consistent with the local reading of the eigenvalues in article 03: near each lateral equilibrium there is an unstable complex pair, which favours an oscillating departure. When the trajectory crosses the breakpoint of the characteristic, the dynamical field that governs it changes. However, a behaviour that looks irregular over a finite interval does not rigorously distinguish a chaotic attractor from a long periodic orbit. I will come back to this problem with return maps and chaos indicators.

5. Halving the step and checking the start of the motion

Replicating the historical method does not on its own guarantee numerical accuracy. The characteristic is continuous, but its derivative changes abruptly at the breakpoints. The classic fourth order assumes sufficient smoothness; crossing these breakpoints can alter the behaviour of the errors. To check the computation I compared the integrations with h and h/2 at the same instants. I also used the native ODE solver of Math Numeric 1.67.0.

The second Octave RK45 comparison script uses the same RHS function and the same initial condition. It registers a callback with gxtxt_callback_register and invokes the public NUMERIC_API_v1/foundation operation, ode family and solve action. The callback represents only the circuit equations; the actual solver on the Bridge path is the adaptive SciPy-based RK45, as documented by the API. I am not calling SciPy directly outside the framework. I limited this check to t=0…2 because the repeated Bridge crossings add a cost to every evaluation and the local comparison is sufficient for its purpose.

handle = gxtxt_callback_register(rhs);
r = gxtxt_api_call('NUMERIC_API_v1','foundation', ...
  {'ode','solve',handle,(0:0.02:2)',[0.1;0;0], ...
   struct('reltol',1e-9,'abstol',1e-11,'max_step',0.02)});
gxtxt_callback_release(handle);

The complete attached code checks success, dimensions and time correspondence, and releases the callback even in case of error. The requested times are the 101 common samples spaced 0.02 apart; they are not necessarily the internal steps of the adaptive solver. The comparisons read the already published RK4 Datasets through Canonical Dataset API v2. The error reported here is the maximum absolute difference between the coordinates of the methods at the common times, not a certified estimate of the global error of the solution.

Maximum difference on t=0…2RK4 h=0.02 vs RK45RK4 h=0.01 vs RK45
v10.0076267890.000856009
v20.0004235670.000050638
iL0.0016181050.000193425

The overlap in Figure 8 makes it hard to tell the curves apart by eye, but the table shows the difference decreasing by almost an order of magnitude when I halve h. I cannot impose an exact factor of 16: the trajectory crosses a breakpoint of the nonlinear law and the RK45 reference is itself a numerical integration, not the exact solution.

The long-time check is different. If the motion is chaotic, even small numerical perturbations can lead to different sequences of lobe visits. So I do not expect the h/2 solution to follow the same points as the h solution at t=1000. Instead I compare the structure, the region explored and, in the future, the distributions and the dynamical indicators. Figure 9 keeps the two-lobe shape, and the extremes of the samples remain close to those of the first computation. This is a useful numerical check, but not a proof of convergence of the attracting set nor a measurement of the Lyapunov exponent.

6. Bringing the three projections together

I can represent the three coordinates simultaneously in three-dimensional space. With PLOT_DATASET_API_v4 I created an independent XYZ graph, choosing v1, v2 and iL and the scatter3 type. In this graph I keep the whole interval t=0…1000, including the transient, and use the native stride reduction with a target of 10,000 points. The full Dataset remains unchanged.

To read the coordinates more easily I set a regular grid with symmetric limits: from −15 to +15 for vC1 (step 3), from −6 to +6 for vC2 (step 1) and from −30 to +30 for iL (step 5). I reduced the relative size of the labels and adapted the markers to the final resolution. The graphics engine may omit some numerical labels to avoid overlaps, without removing the corresponding grid lines.

In the Plots tab I select the XYZ graph, enable the 3D button and open the interactive scientific view with a double click. I use Save High-Resolution Image as Dataset…, choose 4K — 3840 × 2160, assign an identifier to the new image Dataset and press Render & Publish Dataset. I then rotate the view with the navigation controls and repeat the export with a second identifier. The two PNGs are produced by the native graphics engine at the requested resolution, not enlarged from a screenshot. GX-TXT keeps the images and the metadata of the view.

The two views show how the regions that took different shapes in the three planes belong to a single structure in phase space. The coloured coordinate is iL, not time: the colours do not indicate the direction of travel. The representation does not build surfaces by artificially interpolating the space between the points. The two lobes are not two solid volumes or two new elements of the circuit.

7. What I obtained, and what remains to be proven

I reproduced the shape of Matsumoto’s double scroll using the system and the method stated in his publication. I checked the qualitative robustness of the shape when halving the step and compared the initial stretch with the adaptive solver of the framework. I kept all the states and the native GX-TXT graphs, so that I can return to the results without rebuilding the Datasets from images.

I have not yet established the basin of attraction, computed the external hyperbolic periodic orbit or rigorously verified the chaotic character through quantitative indicators. Nor have I simulated here the five-segment circuit with physical components. In the next article I will vary a coupling parameter and try to understand how the dynamical regimes change. Only after that will I tackle the tools that make it possible to distinguish periodicity and chaos quantitatively.

Reproducible material

The attached scripts are intended for the GX-TXT DEV112 P012 Octave Script Workspace (working installation with the Algebra, 232 and 233 micropatches). In a new session you first need the document Dataset with ID 1984_matsumoto_chaotic_attractor_techreport, then register and run the first script and, after it has finished, the second. The publications have fixed IDs: repeat in an empty session so as not to overwrite existing results. The graphs were produced through the public Plot Dataset v4 API, keeping the declared coordinates and filters. No new external solver is needed.

Historical RK4 script and halved step · Adaptive comparison script

Reference

T. Matsumoto, A Chaotic Attractor from Chua’s Circuit, technical report UCB/ERL M84/36 (1984); IEEE Transactions on Circuits and Systems 31(12), 1055–1058, DOI. The historical figure is credited to its source.

#Chua circuit #deterministic chaos #double scroll #GNU Octave #GX-TXT #Runge-Kutta

Other steps of this project

Leave a Reply

Your email address will not be published. Required fields are marked *