Showing posts with label chaos. Show all posts
Showing posts with label chaos. Show all posts

Saturday, February 28, 2026

TI-84 Plus CE: Logistic Map

TI-84 Plus CE: Logistic Map


It feels like forever since I with the TI-84 Plus CE.


Introduction


The program LOGISTIC plots the sequence


x = r * x * (1 – x)


where x is initially in the interval (0, 1) and r is a parameter. The sequence traces out the path of recursion.


Depending on the value of r, the sequence can eventually stabilize to a single point, fluctuate then stabilize, eventually bounce between two stable points, or going into the chaos. The higher the r, chance of the latter two possibilities increase. Typically, for any r < 3, the sequence will most likely stabilize.



TI-84 Plus CE Program: LOGISTIC.8xp


Type: TI-Basic Program


ClrHome

Disp “LOGISTIC MAP”

Disp “X1=R*X0*(1-X0)”

Seq

FnOff

Menu(“LAMBDA (R)”, “ENTER”, 1, “RANDOM”, 2)

Lbl 1

Input “0<R≤4: “, R

Goto A

Lbl 2

randInt(1,80) / 20 → R

Pause R

Goto A

Lbl A

Menu(“U(1)=”, ”ENTER”, 3, “RANDOM”, 4)

Lbl 3

Input “U(1)? “, U

Goto B

Lbl 4

rand → U

Pause U

Goto B

Lbl B

{U} → u(nMin)

SEQ(n+1)

“R*u(n)*(1-u(n))” → u

FnOn 1

1 → nMin

50 → nMax

0 → Ymin

1 → Ymax

0 → Xmin

50 → Xmax

DispGraph



Notes:


The Time setting is assumed: x-axis = n, y-axis = u__n


nMin: Sets the counter and the index of the first argument. Typically the counter starts with 0 or 1. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 4. nMin.


Seq: Sets Sequence mode.


I use R for λ since the TI-84 does not have Greek characters (except for π and σ).


randInt(1,80) / 20 → R: Selects random values from 0.05 and 4 with a tick mark of 0.05.


u(nMin): Store the initial conditions. The conditions are entered as a list, even there is only one initial condition. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 1. u(nMin)


SEQ(n+1): In the program editor, I had to select this from the catalog. It is listed under “SEQ(n+1) Type”. This allows for the recurring sequence to be in the format u(n+1) = f(u(n),n).

“R*u(n)*(1-u(n))” → u: The u is type from the keyboard: [ 2nd ] [ 7 ].

FnOn 1: Turns the sequence u(n) on.



Examples




Left: r = 3.67, initial point = 0.2. This looks like total chaos as n grows.


Right: r = 3.1, initial point = 0.5. This sequence does not converge to a single value, but eventually provides a bifurcation between two points.


Caution: If r is too high, even if the u(1) is with in the interval [0, 1], the sequence can “escape” and an overflow can occur. I don’t recommend an r higher than 4.


Source


“Logistic map”. Wikipedia https://en.wikipedia.org/wiki/Logistic_map Retrieved October 20, 2025.



Eddie


All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Monday, May 27, 2019

Fractal Plots: TI-84 Plus CE and HP Prime

Fractal Plots:  TI-84  Plus CE and HP Prime

Introduction

The program CHAOS1 plots a fractal to simulate a Julia Set.  Given the complex numbers z_k and c, repeats the equation:

z_n = z_n-1 + c^2

The program will ask for a sample graphing space with the a border B.  The viewing window will be set up as:

Xmin = -B
Xmax = B
Ymin = -B
Ymax = B

The program CHAOS1 will also as for the number of points (G), this will determine the number of points plotted in the graph.  The higher G is, the more detailed the fractal is; however, the plot will take longer to complete.

We start with each point on the graph z_0 = a + b*i, where i = √-1.  Then we calculate:

z_1 = z_0^2 + c
z_2 = z_1^2 + c
z_3 = z_2^2 + c
and so on.

For each z_0, we have two possibilities for the repeated calculations:

1.  |z_n| = abs(z_n) eventually goes towards infinity or

2.  |z_n| = abs(z_n) eventually settles (or converges) to a specific point.

A color is assigned to each point z_0.  The color is determined by the amount of iterations it takes to reach |z| > 2.  For such points that fit criteria 2, and never reaches |z| >2, the point is colored black.  This method creates the Julia set for any given c.

For the program CHAOS1, I set up a rank of colors to plot each point, and arbitrary pick a maximum amount of iterations.  For example, I picked 9 colors for the TI-84 Plus CE version.  Hence for each point, if |z| ≤ 2 after 9 iterations, color the point black.

Obviously the more levels (colors) we have, the more accurate our fractal is.  With the programs listed, you can adjust the number of colors.   Keep in mind the TI-84 Plus CE has up to 15 colors, the Casio fx-CG50 has up to 7, and the HP Prime's colors have 256 levels of red, green, and blue.

You can download CHAOS1 for both the TI-84 Plus CE and HP Prime here:
https://drive.google.com/open?id=1A06e_pAPk7fMik07Pbi1tyjbLSUkVUN2

TI-84 Plus CE Program CHAOS1  (File:  CHAOS1.8xp)

For the Ti-84 Plus CE, I recommend the number of grid points of no more than 75.

The list of colors that I use in this code is:

1.  WHITE:  color value of 20
2. LTGRAY: color value of 21
3.  YELLOW: color value of 19
4.  ORANGE:  color value of 15
5.  BROWN: color value of 16
6.  GREEN: color value of 14
7.  LTBLUE:   color value of 18
8.  BLUE:  color value of 10
9.  BLACK: color value of 12

Note:  ⅈ represents √-1 ([Shift] [ 3 ])


Func: a+b ⅈ
FnOff: ClrDraw
Input "BORDER: ",B
Input "NO. GRID PTS: ",G
Input "PT C X+Yi: ", C
{20,21,19,15,16,14,18,10,12} → L6
dim(L6) → S
-B → Xmin: B → Xmax
-B → Ymin: B → Ymax
For(I, -B, B, 2B/G)
For(J, -B, B, 2B/G)
1 → K
I + J ⅈ→ Z
Lbl A
If abs(Z)>2 or K=S
Goto B
Z^2 + C → Z
1 + K → K
Goto A
Lbl B
L6(K) → L
Pt-On(I, J, 3, L)
End

Examples

B = 1, G = 75, C = -0.79 + 0.15i

B = 1, G = 75, C = 0.334 - 0.169i

HP Prime Program CHAOS1 (File:  CHAOS1.hpprgm)

I set 18 color levels, starting from white to black.   Because of the faster processor and calculating speed, I have increased the number of grid points to 500.  250 makes a picture with lines.

Note:  I use the parenthesis notation (x,y) for the complex number x + yi because the imaginary character i unfortunately does not transfer to computer text.  (updated 5/27/2019 - this allows for copying the code to the HP Prime connectivity kit/emulator)

EXPORT CHAOS1()
BEGIN
// 2019-05-19 EWS
LOCAL b,g,c,l6,s;
LOCAL i,k,j,z,l; 
STARTAPP("Function");
INPUT( {b, g, {c, [[0],[3]] }, "Fractal",
{ "Border: ", "Grid: ", "C: "},
{ "Min/Max - X/Y", "# Grid Pts", "C: x + yi " });
// size the screen
Xmin:=-b; Xmax:=b;
Ymin:=-b; Ymax:=b;
// clear the screen
RECT();
// list of colors
l6:= { #FFFFFFh, #C0C0C0h,
#D0D0D0h, #FFFF00h,
#B0B0B0h, #FF8000h,
#905000h, #400808h,
#00FF00h, #004060h,
#003000h, #00FFFFh,
#80D0FFh, #0000FFh,
#000080h, #400080h,
#404040h, #000000h};
// plotting
s:=SIZE(l6);

FOR i FROM -b TO b STEP (2*b)/g DO
FOR j FROM -b TO b STEP (2*b)/g DO 
k:=0;

REPEAT
k:=k+1;
IF k==1 THEN
z:=(i,j); 
ELSE
z: = z^2 + c;
END;
UNTIL ABS(z)>2 OR k==s;

l:=l6(k);
PIXON(i,j,l);
END;
END;

WAIT(0);
END;

Examples

B = 1, G = 500, C = 0.38 + 0.008i

B = 1, G = 500, C = -0.11 -0.8i

Have fun!  Explore the possibilities,

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.





Friday, August 17, 2012

Chaos and a War Against Set Theory?

This is Eddie, at the Friends Cafe at Monrovia, CA, enjoying lunch and a great Friday.

Chaos

Below are three pages from a beautiful book, "An Eye For Fractals" by Michael McGuire (1991). I got this from Book Alley in Pasadena, CA. Book Alley has every book ever written, or at least it felt like it when the aisles literally full with books.

My understanding of chaos theory and fractals is limited at this point. Making fractals involve applying repeating operations or calculations a lot (and yes this can include an infinite) of times and evaluating the results. Famous examples of fractals include the Koch Snowflake, Sierpniski Triangle (the TI-82 manual had a program to generate this), the Cantor Set, and the Barnsley Fern.

I have tried to plot the Madelbrot Set on a TI-84+, unsuccessfully.

Set Theory Is Evil!

Or this is what the publishers at the Christian publisher A Beka want us to think. I first heard of the publisher while I listening to episode #108 of Math/Maths Podcast. Clicking this sentence takes you to the Math/Maths podcast page. You can also download their podcast through iTunes.

They referred us to an article written by Maggie Koerth-Baker, which you can read by clicking here.

I agree with Koerth-Barker. The fundamentalist books are out of touch with reality and is a disguised as an attack on anyone and everyone who does not belong to the fundamentalist tribe. To exclude or twist facts to fit an ancient text and to teach it to children can pry the door to another Dark Age.

Mathematically, without set theory, we would be without, among other things, we would be without the ability to qualitatively compare groups of items, vector spaces, computing, and how to order objects of set. I would think that with A Beka's objection, we would not be able to tell which one of two members is greater or less - which would really screw up subtraction and the number line. However, while I was writing this blog entry, I was informed by Samuel Hansen (of the Math/Maths podcast) Twitter that their objection is to modern set - so ordering of numbers and basic math is OK. Thanks, Samuel.



Eddie


This blog is property of Edward Shore. © 2012


Python: Drawing a Ring of Circles

Python: Drawing a Ring of Circles The goal: Draw a number of circles that revolve around the origin (0,0). The center of each circle i...