16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

344 CHAPTER 8. NONLINEAR DIAGNOSTIC TOOLS<br />

If d is not equal to zero, then f =ln(d) iscalculated. Ifd = 0, we would obtain<br />

f = ¡1. This latter situation is avoided by setting f = 0 in this case.<br />

> if d0 then f:=ln(d) else f=0 end if;<br />

To perform the sum in equation (8.18), the total is incremented by the value of<br />

f, and the inner loop ended.<br />

> total:=total+f;<br />

> end do:<br />

The counter c is incremented by one,<br />

> c:=c+1;<br />

and a list of points formed with a as the horizontal coordinate and ¸ =<br />

total=numpts as the vertical coordinate. This completes the evaluation of ¸<br />

in equation (8.18) for a given a value.<br />

> pts[c]:=[a,total/numpts]:<br />

> end do:<br />

The sequence of N = 480 points is plotted, the points being joined using a line<br />

style. Figure 8.14 shows the Lyapunov exponent ¸ for a =2:8 toa =4.<br />

> plot([seq(pts[i],i=1..N)],style=line,view=[Sa..Fa,-1.5..1],<br />

tickmarks=[3,3]);<br />

1<br />

0<br />

-1<br />

3 3.5 4<br />

Figure 8.14: Lyapunov exponent (vertical axis) for a =2:8 toa =4.<br />

If one compares the periodic windows where the Lyapunov exponent goes negative,<br />

there is good agreement with the bifurcation diagram, Figure 8.13, for<br />

the logistic map. Because the Lyapunov spikes are sometimes quite narrow, the<br />

agreement can be improved by zooming in on a particular a region by altering<br />

the values of Sa and Fa.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!