~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/nonlinear/dassl.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dassl            Scilab Group            Scilab Function              dassl
2
 
NAME
3
 
   dassl - differential algebraic equation
4
 
  
5
 
CALLING SEQUENCE
6
 
 [r [,hd]]=dassl(x0,t0,t [,atol,[rtol]],res [,jac] [,info] [,hd])
7
 
PARAMETERS
8
 
 x0         : is either y0 (ydot0 is estimated by dassl with zero as first
9
 
            estimate) or the matrix [y0 ydot0].  g(t,y0,ydot0) must be
10
 
            equal to zero. If you only know an estimate  of ydot0 set
11
 
            info(7)=1
12
 
            
13
 
           y0         : real column vector  of initial conditions.
14
 
                      
15
 
           ydot0      : real column vector of the time derivative of y at
16
 
                      t0 (may be an estimate).
17
 
                      
18
 
 t0         : real number is the initial instant.
19
 
            
20
 
 t          : real scalar or vector. Gives instants for which you want the
21
 
            solution. Note that you can get solution at each dassl's step
22
 
            point by setting info(2)=1.
23
 
            
24
 
 atol,rtol  : real scalars or column vectors of same size as y. atol,rtol
25
 
            give respectively  absolute and relative error tolerances of
26
 
            solution.  If vectors the tolerances are specified for each
27
 
            component of y.
28
 
            
29
 
 res        : external (function or list or string). Computes the  value
30
 
            of g(t,y,ydot).
31
 
            
32
 
           function : Its calling sequence must be [r,ires]=res(t,y,ydot)
33
 
                    and res must return the residue r=g(t,y,ydot)  and
34
 
                    error flag  ires. ires = 0 if res succeeds to compute
35
 
                    r, =-1  if residue is locally not defined for
36
 
                    (t,y,ydot), =-2 if  parameters are out of admissible
37
 
                    range.
38
 
                    
39
 
           list     : it must be as follows:
40
 
                    
41
 
                   list(res,x1,x2,...)
42
 
                   where the calling sequence of the function res is now
43
 
                    
44
 
                   r=res(t,y,ydot,x1,x2,...)
45
 
                   res still returns r=g(t,y,ydot) as a function of
46
 
                    (t,y,ydot,x1,x2,...).
47
 
                    
48
 
           string   : it must refer to the name of a fortran subroutine
49
 
                    (see source code of of Ex-dassl.f in routines/defaut/).
50
 
                    
51
 
 jac        : external (function or list or string). Computes the  value 
52
 
            of dg/dy+cj*dg/dydot for a given value of parameter cj
53
 
            
54
 
           function : Its calling sequence must be r=jac(t,y,ydot,cj) and
55
 
                    the jac function must return
56
 
                    r=dg(t,y,ydot)/dy+cj*dg(t,y,ydot)/dydot where cj is a
57
 
                    real scalar
58
 
                    
59
 
           list     : it must be as follows
60
 
                    
61
 
                   list(jac,x1,x2,...)
62
 
                   where the calling sequence of the function jac is now
63
 
                    
64
 
                   r=jac(t,y,ydot,x1,x2,...)
65
 
                   jac still returns dg/dy+cj*dg/dydot as a function of
66
 
                    (t,y,ydot,cj,x1,x2,...).
67
 
                    
68
 
           character string
69
 
                               : it must refer to the name of a fortran subroutine  (see
70
 
                    source code of Ex-dassl.f in routines/defaut/).
71
 
                    
72
 
 info       : list which contains 7 elements, default value is
73
 
            list([],0,[],[],[],0,0);
74
 
            
75
 
           info(1)  : real scalar which gives the maximum time for which g
76
 
                    is allowed  to be evaluated or an empty matrix [] if no
77
 
                    limits imposed for time.
78
 
                    
79
 
           info(2)  : flag which indicates if dassl returns its
80
 
                    intermediate  computed values (flag=1) or only the user
81
 
                    specified time point  values (flag=0).
82
 
                    
83
 
           info(3)  : 2 components vector which give the definition
84
 
                    [ml,mu] of band  matrix computed by jac; r(i - j + ml +
85
 
                    mu + 1,j) = "dg(i)/dy(j)+cj*dg(i)/dydot(j)".  If jac
86
 
                    returns a full matrix set info(3)=[].
87
 
                    
88
 
           info(4)  : real scalar which gives the maximum step size. Set
89
 
                    info(4)=[] if no  limitation.
90
 
                    
91
 
           info(5)  : real scalar which gives the initial step size. Set
92
 
                    info(4)=[] if  not specified.
93
 
                    
94
 
           info(6)  : set info(6)=1 if the solution is known to be non
95
 
                    negative,  else set info(6)=0.
96
 
                    
97
 
           info(7)  : set info(7)=1 if ydot0 is just an estimation,
98
 
                    info(7)=0 if g(t0,y0,ydot0)=0.
99
 
                    
100
 
 hd         : real vector which allows to store the dassl context and to 
101
 
            resume integration
102
 
            
103
 
 r          : real matrix . Each column is the vector [t;x(t);xdot(t)]
104
 
            where t is time index for which the solution had been computed
105
 
            
106
 
DESCRIPTION
107
 
   Solution of the implicit differential equation
108
 
  
109
 
     g(t,y,ydot)=0
110
 
     y(t0)=y0  and   ydot(t0)=ydot0
111
 
   Detailed examples are given in SCIDIR/tests/dassldasrt.tst
112
 
  
113
 
EXAMPLES
114
 
  deff('[r,ires]=chemres(t,y,yd)',[
115
 
          'r(1)=-0.04*y(1)+1d4*y(2)*y(3)-yd(1);';
116
 
          'r(2)=0.04*y(1)-1d4*y(2)*y(3)-3d7*y(2)*y(2)-yd(2);'
117
 
          'r(3)=y(1)+y(2)+y(3)-1;'
118
 
          'ires=0']);
119
 
  deff('[pd]=chemjac(x,y,yd,cj)',[
120
 
          'pd=[-0.04-cj , 1d4*y(3)               , 1d4*y(2);';
121
 
          '0.04    ,-1d4*y(3)-2*3d7*y(2)-cj ,-1d4*y(2);';
122
 
          '1       , 1                      , 1       ]'])
123
 
 
124
 
 y0=[1;0;0];
125
 
 yd0=[-0.04;0.04;0];
126
 
 t=[1.d-5:0.02:.4,0.41:.1:4,40,400,4000,40000,4d5,4d6,4d7,4d8,4d9,4d10];
127
 
 
128
 
 
129
 
 y=dassl([y0,yd0],0,t,chemres);
130
 
 
131
 
 info=list([],0,[],[],[],0,0);
132
 
 info(2)=1;
133
 
 y=dassl([y0,yd0],0,4d10,chemres,info);
134
 
 y=dassl([y0,yd0],0,4d10,chemres,chemjac,info);
135
 
SEE ALSO
136
 
   ode, dasrt, impl, fort, link, external 
137