mathematica中的参数分形维代码

我是Mathematica的初学者。 我在mathematica中编写代码来查找参数分形维数。 但它不起作用。 有人能解释我错在哪里吗? 我的代码是:

delta[0] = 0.001
lambda[0] = 0
div = 0.0009
a = 2
b = 2
terms = 100
fx[0] = NSum[1/n^b, {n, 1, terms}]
fy[0] = 0
For[i = 1, i < 11, i++,
 delta[i] = delta[i - 1] + div;
 j = 0
    While[lambda[j] <= Pi,
     j = j + 1;
     lambda[j] = lambda[j - 1] + delta[i];
     fx[j] = NSum[Cos[n^a*lambda[j]]/n^b, {n, 1, terms}]; 
     fy[j] = NSum[Sin[n^a*lambda[j]]/n^b, {n, 1, terms}];
     deltaL[j] = Sqrt[[fx[j] - fx[j - 1]]^2 + [fy[j] - fy[j - 1]]^2];
     ]
    Ldelta[i] = Sum[deltaL[j], {j, 1, 10}];
 ]
data = Table[{Log[delta[i]], Log[Ldelta[i]]}, {i, 1, 10}]
line = Fit[data, {1, x}, x]
ListPlot[data]
链接地址: http://www.djcxy.com/p/65293.html

上一篇: parametric fractal dimension code in mathematica

下一篇: Statistic estimation of total nodes in a tree where edge traversal is expensive