BookmarkSubscribeRSS Feed

How to understand Chaos Theory Part 2: Using Logistic Map to visualize a Bifurcation

Started 4 weeks ago by
Modified 3 weeks ago by
Views 241

In this next series of my articles for Chaos Theory, we will be discussing how you can use chaotic data to create the unique form of a Bifurcation model. The relative simplicity of the logistic map makes it a widely used point of entry into a consideration of the concept of chaos. This is where a lot of the magic happens when forming the Bifurcation model. In summary, this model is the mathematical study of changes in the qualitative or topological structure of a set of given data points that meet the criteria of initial conditions.

 

A bifurcation occurs when a minor smooth change in a system's parameter values induces an abrupt 'qualitative' or topological change in its behavior.  Bifurcations can arise in continuous systems defined by ordinary, delay, or partial differential equations, as well as discrete systems. Henri Poincaré coined the term "bifurcation" in 1885, when he published the first mathematical article demonstrating such behavior.

For example, consider the buckling of a beam. If a small weight is placed on top of a beam, the beam can support the load and remain vertical. If the the load that is applied to beam is too heavy, the vertical position becomes unstable, and beam may buckle.

 

dm_1_Buckle.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

The weight plays a vital role of the control of parameter, and deflection of the beam from vertical plays the role of the dynamical variable x.

 

Generate Data 

 

In this section of the article, we use our previously generated data from the first series of this article "How to understand Chaos Theory using Logistic Map Equation" to start building the model. To summarize, we used data points from a set the initial conditions x=0.1 & r=3.2 and simulate 100 data points using a logistic map equation for the chaos theory shown in the figure below. We created visualization starting with r=3.2, 3.5, and 4.0 with each visualization iterating 100 data points. We will write python code to illustrate all the R-values showing the period doubling as the R-value increases. It correlates directly to the chaos that will occur in the illustration.

 

dm_2_LogisticMapEq.png

 

We will generate data and visualize the Bifurcation diagram using the SAS Viya Work Bench platform. SAS Viya Work Bench is a web-based interface that enables users to access and manage SAS Viya analytics tools and resources such as Jupyter Notebook, Jupyter Lab, and Visual Studio. It provides a centralized platform for data preparation, exploration, analysis, and visualization, as well as a collaborative environment where teams may work together on projects. The Work Bench integrates several data sources, analytical methods, and deployment options, allowing users to fully leverage SAS Viya's capabilities for advanced analytics and decision-making.

 

dm_3_SAS-Viya-Work-Bench-Screenshot-1024x426.png

 

Build model 

 

In this demonstration, we will be using the Jupyter Notebook to visualize the data created to form the Bifurcation Model. In the demo we be using the software packages NumPy  & Matplotlib. The NumPy function is the fundamental library for array containers in the Python  Scientific Computing stack and Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.

 

import numpy as np
import matplotlib.pyplot as plt
# Bifurcation Model
r_value = (3.2, 4) # Intervals for R-Value
accuracy = 0.0001
reps = 600 # Number of Repetitions
numtoplot = 300
lims = np.zeros(reps)
fig, biax = plt.subplots()
fig.set_size_inches(16, 9)
lims[0] = np.random.rand()
for r in np.arange(r_value[0],r_value[1], accuracy):
    for i in range(reps - 1):
        lims[i + 1] = r * lims[i] * (1 - lims[i])
    biax.plot([r] * numtoplot, lims[reps - numtoplot :], "b.", markersize=0.02)
biax.set(xlabel="R-Value", ylabel="Chaotic Values", title="logistic map")
plt.show()

 

dm_4_Chaotic-Map-1024x542.png

 

The python code generates a bifurcation diagram using the logistic map, a classic example of a dynamical system exhibiting chaotic behavior. The "R-value" defines the interval for the R-value, which is a parameter in the logistic map equation. The variable accuracy determines the step size for iterating over the R-value interval, reps specifies the number of iterations or repetitions for each R-value, and numtoplot specifies the number of points to plot on the bifurcation diagram. Next, in the code we initialize an array called lims with zeros using NumPy. This array will store the values generated by the logistic map equation during iterations. We use a nested loop to iterate over the R-value intervals with specified accuracy for quality data points.

 

Summary 

 

This study helps understand frequently asked question around the behavior of chaotic systems. This article acts as a doorway to understanding chaotic behavior and indicating a critical transition point in the overall structure of a chaotic system's behavior. Aside from their theoretical relevance, period-doubling bifurcations have practical implications in physics, ecology, climate modeling, and economics, where understanding system stability and transitions is critical for predictive modeling and decision-making processes. Researchers use mathematical models, simulations, and experimental observations to investigate and evaluate period-doubling bifurcations, therefore improving our understanding of complex system behavior and responses to parameter changes across time. Furthermore, the study of period-doubling bifurcations has led to the creation of improved analysis methodologies and tools, which empower scientists and engineers to predict and manage system dynamics in real-world scenarios effectively.

 

For more information:

Comments

I get an "Access Denied" message for the first article of the series. Any idea what might cause this?

The links are updated. Thanks for alerting us.

Version history
Last update:
3 weeks ago
Updated by:

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags