Re: Problems in plotting Lyapunov Exponents:
- To: mathgroup at smc.vnet.net
- Subject: [mg98737] Re: Problems in plotting Lyapunov Exponents:
- From: CreativeSolutionsNZ at gmail.com
- Date: Fri, 17 Apr 2009 04:29:15 -0400 (EDT)
- References: <gs47mm$7q5$1@smc.vnet.net> <gs6pnd$hbk$1@smc.vnet.net>
On Apr 16, 5:19 pm, dh <d... at metrohm.com> wrote:
> Hi,
>
> you should read the manual about "Compile".
>
> n and ndrop should be integer not complex numbers. Further you need to
>
> declare the complex list xlist.
>
> Here is a corrected version:
>
> =========================
=======
>
> LypHS = Compile[{l, xinit, {n, _Integer}, {ndrop, _Integer}},
>
> xlist = Drop[
>
> NestList[-30000 l + (1 - l) # + l*(2858.16/(# - 500)^0.82) &,
>
> xinit, n]
>
> , ndrop + 1];
>
> Apply[Plus, Log[Abs[(1 - l) - l (2343.71/(xlist - 500)^1.82)]]]/
>
> Length[xlist]
>
> , {{xlist, _Complex, 1}}];
>
> Plot[LypHS[l, 10, 5000, 100], {l, 0.0, 1.0}]
>
> =========================
========================
>
> Daniel
>
> CreativeSolution... at gmail.com wrote:
> > Hi
> > I have been trying to debug the following piece of code
> > to plot Lyapunov Exponents, but getting several errors.
> > -----------------------------------------------------------------------=
------------------------
> > In[1]:=LypHS=Compile[{l, xinit, {n, _Complex}, {ndrop, _Complex}},
> > xlist=Drop[
> > NestList[-30000l+(1-l)#+l*(2858.16/(#-500)^0.82)&, =
xinit,
> > n],
> > ndrop+1];
> > Apply[Plus, Log[Abs[(1-l)-l(2343.71/(xlist-500)^1.82)]]]/
> > Length[xlist]];
>
> > Plot[LypHS[l, 10, 5000, 100], {l, 0.0, 1.0}]
> > -----------------------------------------------------------------------=
------------------------
> > Can anyone try to run it and help me to fix these errors ?
> > Or is any better code is possible for this problem ?
> > Best regards.
> > -----------------------------------------------------------------------=
------------------------
Thanks a lot Daniel for fixing error in the code. Best regards.
---------------------------------------------------------------------------=
------------------------