restart:with(plottools): with(plots):
plotopts := -0.2..1.2, scaling = constrained;
it_vline := proc(x::float, n::nonnegint)
local xn;
if n=0 then
line([x, x], [x, f(x)]);
else
xn := (f@@n)(x);
line([xn, xn], [xn, f(xn)]);
end if;
end proc:
it_hline := proc(x::float, n::nonnegint)
local xn;
if n=0 then
line([x, f(x)], [f(x), f(x)]);
else
xn := (f@@n)(x);
line([xn, f(xn)], [f(xn), f(xn)]);
end if;
end proc:
first_n_lines := proc(x::float, n::nonnegint)
[seq(it_vline(x, i), i=0..floor(n/2)), seq(it_hline(x, i), i=0..floor(n-1)/2)];
end proc:
Hiperbolikus pontok k\303\266r\303\274li viselked\303\251s.
f := x-> (x^3+x)/2;
f := x-> (x^3+x)/2;
D(f)(0);
conv_anim := seq(display(plot({f, x->x}, plotopts), first_n_lines(.7, n)), n=0..10):
display(conv_anim, insequence = true);
conv_anim := seq(display(plot({f, x->x}, 0..2, 0..7, scaling=constrained), first_n_lines(1.01, n)), n=0..12):
display(conv_anim, insequence = true);
f := x-> -(x^3+x)/2;
f := x-> -(x^3+x)/2;
D(f)(0);
conv_anim := seq(display(plot({f, x->x}, -1..1, -1..1, scaling=constrained ), first_n_lines(.999, n)), n=0..30):
display(conv_anim, insequence = true);
f := x-> x^2+x;
f := x-> x^2+x;
D(f)(0);
conv_anim := seq(display(plot({f, x->x}, -1..1, -1..1, scaling=constrained ), first_n_lines(0.03, n)), n=0..47):
display(conv_anim, insequence = true);
conv_anim := seq(display(plot({f, x->x}, -.1..0.1, -.1..0.1, scaling=constrained ), first_n_lines(-.1, n)), n=0..100):
display(conv_anim, insequence = true);
Logisztikai f\303\274ggv\303\251ny
mu := 3.2:
f := x -> mu*x*(1-x);
fsolve(f(x)=x, x=0.5..1);
D(f)(%);
fsolve((f@@2)(x)=x);
conv_anim := seq(display(plot({f, x->x}, plotopts), first_n_lines(.87, n)), n=0..50):
display(conv_anim, insequence = true);
mu_anim := seq(display(plot({f, x->x}, plotopts), first_n_lines(.1, 50), textplot([0.25,1.1, typeset(`mu`=mu)])), mu=1..4, 0.02):
display(mu_anim, insequence = true);
Cantor-halmaz
mu := 4.1;
f := x -> 1.05 * (1-abs(2*x-1));
display(seq(display(plot({f@@n, x->1}, -.2..1.2, -1..3, numpoints=1000)), n=1..5), insequence=true);
plot(f@@6, 0..0.1, -1..2, numpoints=10000);