Skip to content

ThomasThelen/Logistic-Map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Logistic Map

CodeFactor

Background

The logistic mapping is an easy recurrence relation that can be used to explore chaos.

This is a small program that generates the output of the relation (shown below), and then plots it.

Logistic Equation

Periodic Behavior

Explanation

The code can be broken into plotting code and the math code.

Plotting Code

I used gnuplot to plot the time series. C++ is notorious for having crappy, hard to use plotting libraries. The decision to use gnuplot is questionable, but I'm not going to re-write it.

We open a pipe to gnuplot, see here and pipe the data to the process in the Plot method.

Math Code

The math is fairly simple. The LogisticMap class represents a logistic map.

The heavy lifting is done in void LogisticMap::ComputeX(), which just computes the successive value by the rules of the logistic mapping.

Use

Chances are, you're looking at this as an example of how to impliment the logistic map. You're probably not here to actually run this code. But. If you want to, just create the LogisticMap object, call ComputeX on it, and then optionally plot with Plot.

About

Small class that represents a logistic mapping.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages