Previous Next Contents

18  Tools for dynamical systems

18.1   artest arnold dynamical system




CALLING SEQUENCE  :

artest(f_l,[odem,xdim,npts])
arnold(t,x)
iarf([a])



PARAMETERS :




DESCRIPTION :

A call to the function artest() will interactively display a phase portrait of a the following dynamical system :
      ydot(1)=a(1)*cos(y(2)) +a(2)*sin(y(3))
      ydot(2)=a(3)*cos(y(3)) +a(4)*sin(y(1))
      ydot(3)=a(5)*cos(y(1)) +a(6)*sin(y(2))



See Also : portr3d X, ode X, chaintest X, lotest X



18.2   bifish shows a bifurcation diagram in a fish population discrete time model




CALLING SEQUENCE :

bifish([f_ch])



PARAMETERS :




DESCRIPTION :

The dynamical system fish is the following :
           y=b*exp(-0.1*(x(k)_1+x(k)_2));
           x(k+1)=[ y 2*y ; s 0.0]*x(k);
and the parameters s evolves to show the bifurcation diagram. fishr and fishr2 are constructed as above but with added white noises.
        fishr
        y=b*exp(-0.1*(xk(1)+xk(2))) 
        xkp1=[ y 2*y ; s*(1+0.1*(rand()-0.5)) 0.0]*xk

        fishr2
        z=exp(-0.1*(xk(1)+xk(2))) 
        xkp1=[ b*z**(1+0.1*(rand()-0.5)) 2*b*z**(1+0.1*(rand()-0.5)) ; s 0.0]*xk
The three macros fish, fishr, fishr2 are loaded in Scilab when calling bifish.


See Also : ode X



18.3   boucle phase portrait of a dynamical system with observer




CALLING SEQUENCE :

[]=boucle(fch,[abruit,xdim,npts,farrow])



PARAMETERS :




DESCRIPTION :

Phase portrait of dynamical systems.


See Also : portrait X, ode X, obscont1 X



18.4   chaintest a three-species food chain model




CALLING SEQUENCE :

chaintest([f_l,b1,odem,xdim,npts])
[xdot]=chain(t,x)
[z1]=ch_f1(u)
[z2]=ch_f2(u)



PARAMETERS :




DESCRIPTION :

A call to the function chaintest() will interactively display a phase portrait of a three-species food chain model given by:
        ff1= f1(x(1))
        ff2= f2(x(2))

        xdot1= x(1)*(1-x(1)) - ff1*x(2)
        xdot2= ff1*x(2) -  ff2*x(3) - 0.4*x(2)
        xdot3= ff2*x(3) - 0.01*x(3)
and
        f1(u)=5*u/(1+b1*u)
        f2(u)z2=0.1*u/(1+2*u)
The default value for b1 is 3.0.

The Scilab macros chain(t,x)
,f1(u),f2(u) code the dynamical system


See Also : portr3d X, ode X



18.5   gpeche a fishing program




CALLING SEQUENCE :

[xk,ukp1]=gpeche(uk,pasg)
[ut]=peche(t)
[pdot]=pechep(t,p)



DESCRIPTION :

gpeche Iterates a gradient method on a fishing problem Computes the trajectory associated to the command law uk prints the cost value and computes a new control.



18.6   fusee a set of Scilab macro for a landing rocket problem




FUSEE :

[xdot]=fusee(t,x)
Dynamical motion equation for the rocket


FINIT :

finit()
Initialises the following parameters for rocket landing.


FUSEEGRAD :

[ukp1]=fuseegrad(niter,ukp1,pasg)



DESCRIPTION :

Iterate a gradient method and returns the computed control.


FUSEEP :

[pdot]=fuseep(t,p)



DESCRIPTION :

adjoint equation for the landing rocket problem.


POUSSE :

[ut]=pousse(t)
return the value of a piece wise constant control build on the discrete control uk


UBANG :

[uk]=ubang(tf,tcom)
returns a bang-bang control, 0 form time 0 to tcom and 1 form tcom to tf.


FCOUT :

[c,xk,pk,ukp1]=fcout(tf,uk,pasg)



DESCRITION :

optimise the following cost function by gradient iterations.
c = -m(tf) + C*( h(tf)**2 + v(tf)**2)



SFUSEE :

[]=sfusee(tau,h0,v0,m0,Tf)



DESCRIPTION  :

computes the rocket trajectory when a bang-bang control is used tau is the commutation time.


EQUAD :




DESCRIPTION :

[xk,pk]=equad(tf,uk)
Computes the state and adjoint state of the rocket system for a given control ur.


TRAJ :

[xt]=traj(t)
returns a piece wise value of the mass evolution.



18.7   lotest demo of the Lorenz attractor




CALLING SEQUENCE  :

[]=lotest([f_l,odem,xdim,npts,pinit])
[y]=lorenz(t,x)
[]=ilo(sig,ro,beta)
[]=ilof(sig,ro,beta)



PARAMETERS :




DESCRIPTION :

A call to the function lotest() will interactively display a phase portrait of a the following dynamical system
        y(1)=sig*(x(2)-x(1));
        y(2)=ro*x(1) -x(2)-x(1)*x(3);
        y(3)=-beta*x(3)+x(1)*x(2);



See Also : portr3d X, ode X, chaintest X, lotest X



18.8   mine a mining problem




CALLING SEQUENCE :

[cout,feed]=mine(n1,n2,uvect)



PARAMETERS :




DESCRIPTION :

Dynamic programming applied to an optimal extraction of ore in an opencast mine. The extraction is done as follows : the steam shovel move forward for (k=1,2,...,n2) at each step it takes the ore, then move up or down (or stay at the same level) according to the control value to reach another level at next step. The extraction process must maximise the following cost :
   -- n2-1
   \\
   /        f(x(k),k) + V_F(x,n2)
   -- k=1
with x(k+1)=x(k) + u. x(k) is the trajectory depth at step k (x=1 is the ground level). The instantaneous cost f(i,k) stands for the benefit of digging at depth i at position k. It must be given as a Scilab macro ff_o
[y]=ff_o(x,k)
and for efficiency ff_o must accept and return column vectors for x and y.

V_F(i,n2)
is a final cost which is set so as to impose the steam shovel to be at ground level at position n2


FF_O :




SHOWCOST :




CALLING SEQUENCE :

[]=showcost(n1,n2,teta,alpha)



DESCRIPTION :

Shows a 3D representation of the instantaneous cost.



18.9   obscont1 a controlled-observed system




CALLING SEQUENCE :

[macr]=obscont1(sysn)



PARAMETERS :




DESCRIPTION  :

This macros return a new function which computes the controlled observed version of a linearised system around the (xe,ue) point.

before calling this function, a noise vector br
should be created. the equilibrium point (xe,ue) should be given as a global Scilab. the linearised system $f,g,h$ and the two gain matrices l,k are returned as global Scilab data.



18.10   portr3d 3 dimensional phase portrait.




CALLING SEQUENCE :

[]=portr3d(f,[odem,xdim,npts,pinit])



PARAMETERS :




DESCRIPTION :

Interactive integration and display of a 3 dimensional phase portrait of a dynamical system dx/dt=f(t,x,[u]) (where u is an optional parameter )


See Also : ode X



18.11   portrait 2 dimensional phase portrait.




CALLING SEQUENCE :

[]=portrait(f,[odem,xdim,npts,pinit])



PARAMETERS :




DESCRIPTION :

Interactive integration and display of a 2 dimensional phase portrait of a dynamical system dx/dt=f(t,x,[u]) (where u is an optional parameter )


EXAMPLE :

a=rand(2,2)
deff('[ydot]=l_s(t,y)','ydot=a*y')
portrait(l_s)



See Also : ode X



18.12   recur a bilinear recurrent equation




CALLING SEQUENCE :

[y]=recur(x0,var,k,n)
[integr]=logr(k,var)



DESCRIPTION :

computes solutions of a bilinear recurrent equation
x(i+1)=-x(i)*(k + sqrt(var)*br(i))
with initial value x0 and driven by a white noise of variance var.

Trajectories are drawn and the empirical Lyapunov exponent is returned ( x(i)
is not to much different from exp(y*i) )

A theoretical computation of the Lyapunov exponent is given by
[integr]=logr(k,var)

18.13   systems a collection of dynamical system




CALLING SEQUENCE :

[]=systems()



DESCRIPTION :

A call to this function will load into Scilab a set of macros which describes dynamical systems. Their parameters can be initiated by calling the routine tdinit().


BIOREACT :

[ydot]=biorecat(t,x)
a bioreactor model,


COMPET :

[xdot]=compet(t,x [,u])
a competition model. x(1),x(2) stands for two populations which grows on a same resource. 1/u is the level of that resource ( 1 is the default value).
 
xdot=0*ones(2,1);
xdot(1) = ppr*x(1)*(1-x(1)/ppk) - u*ppa*x(1)*x(2) ,
xdot(2) = pps*x(2)*(1-x(2)/ppl) - u*ppb*x(1)*x(2) ,



CYCLLIM :

[xdot]=cycllim(t,x)
a model with a limit cycle
  xdot=a*x+qeps(1-||x||**2)x



LINEAR :

[xdot]=linear(t,x)
a linear system


BLINPER :

[xdot]=linper(t,x)
a linear system with quadratic perturbations.


POP :

[xdot]=pop(t,x)
a fish population model
xdot= 10*x*(1-x/K)- peche(t)*x



PROIE :

a Predator prey model with external insecticide.
[xdot]=p_p(t,x,[u]



LINCOM :

 
[xdot]=lincom(t,x,k)
linear system with a feedback
        xdot= a*x +b*(-k*x)



See Also : tdinit X



18.14   tangent linearization of a dynamical system at an equilibrium point




CALLING SEQUENCE :

[f,g,newm]=tangent(ff,xe,[ue])



PARAMETERS  :




DESCRIPTION  :

linearises around the equilibrium point (xe,ue) the vector field of the dynamical system given by a Scilab macro ff, xdot=ff(t,x,[u]). The dynamical system is supposed to be autonomous.



18.15   tdinit interactive initialisation of the tdcs dynamical systems




CALLING SEQUENCE  :

tdinit()



DESCRIPTION  :

This macro can be used to interactively define the parameters needed by the dynamical systems described in systems

1


See Also : portrait X, systems X


Previous Next Contents