原始文件(SVG文件,尺寸为422 × 421像素,文件大小:26 KB)


摘要

描述
English: Cobweb plot of , an extension of the Collatz map to the real line, studied by Marc Chamberland. The orbit of the starting point is shown in red, with values .
日期
来源 自己的作品
作者 Hugo Spinelli
SVG开发
InfoField
 
SVG的源代码为有效代码
 
矢量图使用Inkscape创作。
源代码
InfoField
Try it here (permalink). Cleaned up with Inkscape afterwards.
SageMath code
var('x')
f = (x/2)*cos(pi*x/2)^2 + ((3*x + 1)/2)*sin(pi*x/2)^2
f_latex = r'$\frac{x}{2}\cdot\cos^2\left(\frac{\pi x}{2}\right) \,+\, \frac{3x + 1}{2}\cdot\sin^2\left(\frac{\pi x}{2}\right)$'

def cobweb(f, x, xmin, xmax, max_iter=100, f_latex=None):
    p = plot(f, (xmin, xmax), ymin=xmin, ymax=xmax, aspect_ratio=1, legend_label=f_latex)
    p += plot(lambda x: x, xmin=xmin, xmax=xmax, color='gray')
    path = [(x, 0)]
    for k in range(max_iter):
        y = f(x=x)
        path.append((x, y))
        x = y
        path.append((x, x))
        if (x, x) in path[:-1]:
            break
    p += line(path, rgbcolor=(1, 0, 0))
    return p

x0 = 10
xmin, xmax = 0, 12
p = cobweb(f, x=x0, xmin=xmin, xmax=xmax, f_latex=f_latex)
config = dict(
    aspect_ratio=1, legend_font_size=13.5, legend_handlelength=1.5, legend_borderpad=0.3, legend_loc='upper left',
    ticks=[[xmin..xmax], [xmin..xmax]], tick_formatter='latex', ticks_integer=True,
    gridlines=True, gridlinesstyle={'linestyle': ':'}
)
show(p, **config)
p.save('Collatz_Cobweb.svg', **config)

许可协议

我,本作品著作权人,特此采用以下许可协议发表本作品:
Creative Commons CC-Zero 本作品采用知识共享CC0 1.0 通用公有领域贡献许可协议授权。
采用本宣告发表本作品的人,已在法律允许的范围内,通过在全世界放弃其对本作品拥有的著作权法规定的所有权利(包括所有相关权利),将本作品贡献至公有领域。您可以复制、修改、传播和表演本作品,将其用于商业目的,无需要求授权。

说明

添加一行文字以描述该文件所表现的内容
Cobweb plot of Chamberland's extension of the Collatz map, with the orbit of the starting point x = 10.

此文件中描述的项目

描繪內容

image/svg+xml

851e6b2d103653e07f4c8714fcb238e86bbb5b19

26,657 字节

421 像素

422 像素

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2023年10月5日 (四) 21:392023年10月5日 (四) 21:39版本的缩略图422 × 421(26 KB)Hugo SpinelliUploaded own work with UploadWizard

以下页面使用本文件:

全域文件用途

以下其他wiki使用此文件:

元数据