to share – to copy, distribute and transmit the work
to remix – to adapt the work
Under the following conditions:
attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
/*
https://math.stackexchange.com/questions/2453939/is-this-characteristic-of-tent-map-usually-observed
*/
kill(all);
remvalue(all);
ratprint:false; /* a message informing the user of the conversion of floating point numbers to rational numbers is displayed. */
display2d:false;
/* ---------- functions ---------------------------------------------------- */
/* https://en.wikipedia.org/wiki/Tent_map */
f(x) := if x<0.5 then m*x else m*(1-x) $
GivePoints(x0, iMax):= block(
[Points,i,Point],
i:0,
x:x0,
Point:[i,x],
Points:[Point],
while (i<iMax)
do
(
x:f(x),
i:i+1,
Point:[i,x],
Points:endcons(Point, Points)
),
return(Points)
)$
/* const */
m: bfloat(2.0);
iMax:100;
fpprec:5+round(iMax/3.6); /* the number of stored decimal digits will be equal to the current value of */
fpprintprec:fpprec;
bftrunc:false;
x0:bfloat(random(10^fpprec) / 10^fpprec) ; /*Robert Dodier : https://stackoverflow.com/questions/56826546/how-to-compute-random-bfloat-number-in-maxima-cas */
/*x0: bfloat(%pi)/6.0b0; */
Points:GivePoints(x0,iMax);
/* ------- draw --------------------------------------- */
load(draw);
path:"~/maxima/batch/tent/bf/bf2/"$ /* pwd, if empty then file is in a home dir , path should end with "/" */
draw2d(
user_preamble="set key top right; unset mouse; ",
terminal = 'svg,
file_name = sconcat(path,"p", string(fpprec),"_", string(float(x0))),
font_size = 20,
font = "Liberation Sans", /* https://commons.wikimedia.org/wiki/Help:SVG#Font_substitution_and_fallback_fonts */
title= sconcat("Time series of the Tent map for the parameter m=2.0 made with ", string(fpprec), " decimal digits"),
xlabel = "iteration ",
ylabel = "x",
dimensions = [1000, 1000],
yrange=[0,1],
color= blue,
point_type = filled_circle,
point_size = 0.2,
points_joined =true,
key = "",
points(Points)
)$
Captions
Time series of the Tent map for the parameter m=2.0 made with increased precision