PWLCM分段线性混沌映射

混沌映射是生成混沌序列的一种方法,常见的混沌映射方式有 Logistic映射、Tent映射、Lorenz映射,而PWLCM(Piecewise Linear Chaotic Map,分段线性混沌映射)作为混沌映射的典型代表,数学形式简单,具有遍历性和随机性。其公式定义描述如下:


x ( t + 1 ) = { x ( t ) p , p ≤ x ( t ) < p x ( t ) − p 0.5 − p , p ≤ x ( t ) < 0.5 1 − p − x ( t ) 0.5 − p , 0.5 ≤ x ( t ) < 1 − p 1 − x ( t ) p , 1 − p ≤ x ( t ) < 1 \begin{equation} x(t+1)=\left\{ \begin{array}{lr} \frac{x(t)}{p}, p \le x(t) \lt p \\ \frac{x(t)-p}{0.5-p}, p \le x(t) \lt 0.5 \\ \frac{1-p-x(t)}{0.5-p}, 0.5 \le x(t) \lt 1-p \\ \frac{1-x(t)}{p}, 1-p \le x(t) \lt 1 \end{array} \right . \end{equation} x(t+1)= px(t),px(t)<p0.5px(t)p,px(t)<0.50.5p1px(t),0.5x(t)<1pp1x(t),1px(t)<1
其中, p是该映射的控制参数, p ∈ [ 0 , 1 ] p \in [0,1] p[0,1] ; x(t) 为产生的随机迭代值, x ( t ) ∈ [ 0 , 1 ] x(t) \in [0,1] x(t)[0,1]

下图是PWLCM混沌系统产生的伪随机序列的分布图,从图中可以看出PWLCM混沌映射产生的伪随机序列非常均匀。
在这里插入图片描述

python代码
import sys
import matplotlib.pyplot as plt
import cv2
import numpy as np

from matplotlib import rcParams
#设置绘图字体大小、格式等
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号
# plt.xticks(fontproperties='Times New Roman', size=14)
# plt.yticks(fontproperties='Times New Roman', size=14)
#10.5pt=14px=5号
config = {
            "font.family": 'serif',
            "font.size": 10.5,
            "mathtext.fontset": 'stix',
            "font.serif": ['SimSun'],
         }
rcParams.update(config)
def pwlcm(x0, p, T):
    x = np.array([])
    y = np.array([])
    for i in range(T):
        if x0 >= 0 and x0 < p:
            x0 = x0 / p
        elif x0 >= p and x0 < 0.5:
            x0 = (x0 - p) / (0.5 - p)
        elif x0 >= 0.5 and x0 < 1 - p:
            x0 = (1 - p - x0) / (0.5 - p)
        elif x0 >= (1 - p) and x0 < 1:
            x0 = (1 - x0) / p
        x = np.append(x, i)
        y = np.append(y, x0)
    return x, y


def main():
    # 设置迭代次数
    T = 10000
    p = 0.3456789012
    x0 = 0.1234567890
    x, y = pwlcm(x0, p, T)
    # 绘制图像
    plt.scatter(x, y, s=1, marker='.')
    #设置斜体
    plt.xlabel("$\mathit{t}$",)
    plt.ylabel("$\mathit{x_t}$",)
    plt.show()


if __name__ == '__main__':
    main()

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

z2bns

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值