<jupyter_start><jupyter_text>单位面积谱效率性能的仿真<jupyter_code>from udntools.utils import ase_theory_gaussian
from udntools.utils import ase_theory_uniform
import numpy as np
import matplotlib.pyplot as plt
# lambda_s 0.0001 ~ 0.1 
# sigma = 5, 10 inf


lambda_s = np.arange(0.00001, 0.01 + 0.00001 + 0.001, 0.001)

ase_3 = ase_theory_gaussian(lambda_s, 4.0, 3.0)
ase_5 = ase_theory_gaussian(lambda_s, 4.0, 5.0)
ase_10 = ase_theory_gaussian(lambda_s, 4.0, 10.0)
ase_inf = ase_theory_uniform(lambda_s, 4.0)

# 设定颜色

color = ['r', 'g', 'b', 'k']
# 画图
color = ['r', 'g', 'b', 'violet']
marker = ['o', '<', '>', 's']
# 使能中文字体
# -*- coding:utf-8 -*-
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号

# 图片大小
fig = plt.figure(figsize=(6, 5))

f3, = plt.plot(lambda_s, ase_3, color[3], marker=marker[3])
f5, = plt.plot(lambda_s, ase_5, color[0], marker=marker[0])
f10, = plt.plot(lambda_s, ase_10, color[1], marker=marker[1])
finf, = plt.plot(lambda_s, ase_inf, color[2], marker=marker[2])

# 加图例
plt.legend(handles=[f3,
                    f5,
                    f10,
                    finf], 
           labels=["$\sigma$ = 3.0",
                   "$\sigma$ = 5.0",
                   "$\sigma$ = 10.0",
                   r"均匀分布的情况"], 
           loc='best',
           prop={'size': 11})

# 加x，y轴标签
plt.xlabel("微基站的密度($\mathrm{m}^{-2}$)",
           fontproperties = 'SimHei', size=13)
plt.ylabel("区域谱效率($bps/\mathrm{Hz}/\mathrm{m}^{2}$)",
           fontproperties = 'SimHei', size=13)

plt.xlim(0, 0.01)
plt.ylim(0, 0.04)
plt.grid(True)

# 存储成为pdf
fig.savefig('ase_sigma_lambda.pdf')
fig.savefig('ase_sigma_lambda.png')

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19011627906976744, 'fraction_numerical': 0.056976744186046514, 'mean_word_length': 3.187347931873479, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '649129', 'license': 'MIT', 'n_tokens_mistral': 850, 'n_tokens_neox': 794, 'n_words': 124, 'path': 'examples/ase_sim/ase_sim.ipynb', 'repo_name': 'JimyMa/UniformBSGaussianUE', 'size': '1720'}