| 第135行: |
第135行: |
| | 首先,为了能够复现以下所有结果,我们给出了利用[[Mathematica]]软件这个迭代过程的代码如下: | | 首先,为了能够复现以下所有结果,我们给出了利用[[Mathematica]]软件这个迭代过程的代码如下: |
| | | | |
| − | μ=0.9;x0=0.1;
| + | <syntaxhighlight lang="Mathematica"> |
| − | NestList[μ # (1 - #) &, x0, 100]
| + | μ=0.9;x0=0.1; |
| − | | + | NestList[μ # (1 - #) &, x0, 100] |
| | + | </syntaxhighlight> |
| | | | |
| | | | |
| 第250行: |
第251行: |
| | 图6中显示的每一个参数<math>\mu</math>所对应的迭代的极限行为。在相同的参数下,我们通过从不同的初始值(共有1000个)开始迭代足够多的次数(T=2000次),记录下这些数据点对应的<math>x(T)</math>值。为了让显示效果更好看,我们对处于相同区域的数据点进行了归并,从而可以用某一点灰度的大小来表示该区域数据点的多少。最后的[[Mathematica]]代码如下所示: | | 图6中显示的每一个参数<math>\mu</math>所对应的迭代的极限行为。在相同的参数下,我们通过从不同的初始值(共有1000个)开始迭代足够多的次数(T=2000次),记录下这些数据点对应的<math>x(T)</math>值。为了让显示效果更好看,我们对处于相同区域的数据点进行了归并,从而可以用某一点灰度的大小来表示该区域数据点的多少。最后的[[Mathematica]]代码如下所示: |
| | | | |
| | + | <syntaxhighlight lang="Mathematica"> |
| | interval = 0.001; | | interval = 0.001; |
| | results = Reverse[Transpose[Table[ | | results = Reverse[Transpose[Table[ |
| 第264行: |
第266行: |
| | 0.9 (Length[results] - 1) + 1, (Length[results] - 1)/4}], | | 0.9 (Length[results] - 1) + 1, (Length[results] - 1)/4}], |
| | Table[{i, | | Table[{i, |
| − | N[2.9 + (i - 1)*(4 - 2.9)/(Length[results<nowiki>[[</nowiki>1<nowiki>]]</nowiki>] - 1), | + | N[2.9 + (i - 1)*(4 - 2.9)/(Length[results[[1]]] - 1), |
| − | 1]}, {i, (3 - 2.9) (Length[results<nowiki>[[</nowiki>1<nowiki>]]</nowiki>] - 1)/(4 - 2.9) + 1, | + | 1]}, {i, (3 - 2.9) (Length[results[[1]]] - 1)/(4 - 2.9) + 1, |
| − | Length[results<nowiki>[[</nowiki>1<nowiki>]]</nowiki>], (Length[results<nowiki>[[</nowiki>1<nowiki>]]</nowiki>] - 1)/5}]}] | + | Length[results[[1]]], (Length[results[[1]]] - 1)/5}]}] |
| − | | + | </syntaxhighlight> |
| | 其中1000为初始值的个数,2000为迭代的时间步。interval为区域的划分尺度。 | | 其中1000为初始值的个数,2000为迭代的时间步。interval为区域的划分尺度。 |
| | | | |