longrob

Mr. Robert Long

1409 Reputation

18 Badges

15 years, 18 days
Leeds, United Kingdom

Social Networks and Content at Maplesoft.com

Business Consultant Data Scientist Statistician

MaplePrimes Activity


These are replies submitted by longrob

@JoeKing 

First recall that the definition of the Lyapunov exponent, of a trajectory x0 under a map f(x) is

h(x[0]) = Limit((Sum(ln(abs(`f'`(x[j]))), j = 0 .. n-1))/n, n = infinity)

provided that this limit exists.

In Maple, a simple, though rather crude, way to do this is to approximate h(x0) by using a
finite sum of N terms in place of the infinite limit above, with N "large", after removing an
arbitrary number of transients . So, for the Ricker model, 

restart:
Digits:=15:
h:=0:x:=0.4:r:=3.0:N:=500:
f:=x->evalf(x*exp(r*(1-x))):
fp:=D(f):
for j from 1 to 100 do # Removes transients
x := f(x):
end do:
for j from 1 to N do
x := f(x):
h := evalf(h+ln(abs(fp(x)))):
end do:
h:=h/N;
                                 0.4204953492
 

 

@Alec Mihailovs 

Just to say that I don't think it's important to use the most recent version in teaching, since the fundamental methods and techniques that are learned by students don't, for the most part, need the latest versions. And this is underlined when new versions are released quite often as this would impart quite a burdon on the course teachers. The Open University is a distance learning institution and professionally printed and bound course books are supplied - it would also be a great financal burdon to have to reprint those every year or so, to cope with new versions of the software.

A few of other notes:

The OU also uses Maple extensively for it's masters level course "Advanced Mathematical Methods". Other OU undergraduate courses, where computer systems are much less part of the curriculum, use mathcad.

The University of Oxford perhaps one of the best in the world, let alone the UK, uses Maple (along with Matlab and Mathematica) at undergraduate level. One of the authors of MS325 is also an instructor at Oxford.

My tutor for MS325 was a lecturer at University of Leeds where he taught Maple amontg other things.

A quick google search reveals that other UK universities including Surrey, Lancaster, York and East Anglia are also using Maple.

 

Hi Alan, and welcome. Could you give us some more information please ?

@handyman

Following John May's suggestions, you could try this:

restart;

T := 150:
nA := 100:
TA := 1:
CA := 100:
TB := 30:
CB := 1:
T1 := 1:
C1 := 1/10:
T3 := 600:
C3 := 10:
T4 := 1000000:
C4 := 1:
T5 := 200:
C5 := 10:
T6 := 300:
C6 := 50:
krWL := 10:
krQD := 1:
a := CA*exp(-TA/T): 
b := CB*exp(-TB/T):
c := C1*exp(-T1/T):
d := C3*exp(-T3/T):
e := C4*exp(-T4/T):
f := krWL:
g := krQD:
h := nA:
k := C5*exp(-T5/T):
l := C6*exp(-T6/T):
G := 10^x:
sys:=0 = -a*(h-Y-X-Z-V+W)+b*Z, 0 = k*Y-l*V, 0 = d*Y-e*X-g*W*X/(W+X), 
0 = a*(h-Y-X-Z-V+W)+G-c*Z-b*Z, 0 = c*Z-d*Y+e*X-k*Y+l*V-f*W*Y/(W+Y):
fsolve({eval(sys,{x=1/2,T=150})},{V,W,X,Y,Z});
{V = .1204250545, W = -67.41719232, X = 0.5657371242e-1, Y = .3091414225, Z = 31.83428700}
 
Then for other x,T pairs you can use seq or a loop to call fsolve. 
 
 
 

 

@handyman

Following John May's suggestions, you could try this:

restart;

T := 150:
nA := 100:
TA := 1:
CA := 100:
TB := 30:
CB := 1:
T1 := 1:
C1 := 1/10:
T3 := 600:
C3 := 10:
T4 := 1000000:
C4 := 1:
T5 := 200:
C5 := 10:
T6 := 300:
C6 := 50:
krWL := 10:
krQD := 1:
a := CA*exp(-TA/T): 
b := CB*exp(-TB/T):
c := C1*exp(-T1/T):
d := C3*exp(-T3/T):
e := C4*exp(-T4/T):
f := krWL:
g := krQD:
h := nA:
k := C5*exp(-T5/T):
l := C6*exp(-T6/T):
G := 10^x:
sys:=0 = -a*(h-Y-X-Z-V+W)+b*Z, 0 = k*Y-l*V, 0 = d*Y-e*X-g*W*X/(W+X), 
0 = a*(h-Y-X-Z-V+W)+G-c*Z-b*Z, 0 = c*Z-d*Y+e*X-k*Y+l*V-f*W*Y/(W+Y):
fsolve({eval(sys,{x=1/2,T=150})},{V,W,X,Y,Z});
{V = .1204250545, W = -67.41719232, X = 0.5657371242e-1, Y = .3091414225, Z = 31.83428700}
 
Then for other x,T pairs you can use seq or a loop to call fsolve. 
 
 
 

 

Phaseamp isn't a new variable. It means "phase amplitude" and all sinusoides have a phase amplitude. It's just a different way of expressing them, which is what I thought you meant.

I may have misunderstood what you are trying to do, because your attachment was not easy to follow/recreate, since it's just an image and the text file is not Maple code. Can you post a *simple* example of what you have, and what you want ?

Phaseamp isn't a new variable. It means "phase amplitude" and all sinusoides have a phase amplitude. It's just a different way of expressing them, which is what I thought you meant.

I may have misunderstood what you are trying to do, because your attachment was not easy to follow/recreate, since it's just an image and the text file is not Maple code. Can you post a *simple* example of what you have, and what you want ?

What is s ? When you compute D1 and D3, you have integrands that depend on s, so the integrals can't be evaluated. That looks like the problem you posted about originally, and just making the integrations inert doesn't help because you need to evaluate them. Inert integration just produces an unevaluated integral.

This is really a system of equations, isn't it ? If so, then you should probably set it up that way in Maple.

What is s ? When you compute D1 and D3, you have integrands that depend on s, so the integrals can't be evaluated. That looks like the problem you posted about originally, and just making the integrations inert doesn't help because you need to evaluate them. Inert integration just produces an unevaluated integral.

This is really a system of equations, isn't it ? If so, then you should probably set it up that way in Maple.

I concur. Downthumbs seem to defeat the purpose of a collaborative peer-based user support/help community.

I can see a few problems in your code.

1. you are using various things before defining them - eg f and v (also, there may be confusion between v and the greek nu).
2. n and s are not defined. 
3. in the definition of D1 and D3 , I suspect inert integration is not really what you want.

It's not clear to me what you are trying to achieve in your worksheet. Could you give some background to this ?

I can see a few problems in your code.

1. you are using various things before defining them - eg f and v (also, there may be confusion between v and the greek nu).
2. n and s are not defined. 
3. in the definition of D1 and D3 , I suspect inert integration is not really what you want.

It's not clear to me what you are trying to achieve in your worksheet. Could you give some background to this ?

Could you post a plot of the data ?

Could you post a plot of the data ?

I'm sure someone will be able to help, but you need to post your code here.

5 6 7 8 9 10 11 Page 7 of 13