| Scilab Reference Manual | 
|---|
dassl — differential algebraic equation
[r [,hd]]=dassl(x0,t0,t [,atol,[rtol]],res [,jac] [,info] [,hd])
| x0 | : is either y0 (ydot0 is estimated by dassl with zero as first estimate) or the matrix [y0 ydot0]. g(t,y0,ydot0) must be equal to zero. If you only know an estimate of ydot0 set info(7)=1 
  | ||||||||||||||
| t0 | : real number is the initial instant. | ||||||||||||||
| t | : real scalar or vector. Gives instants for which you want the solution. Note that you can get solution at each dassl's step point by setting info(2)=1. | ||||||||||||||
| atol,rtol | : real scalars or column vectors of same size as y. atol,rtol give respectively absolute and relative error tolerances of solution. If vectors the tolerances are specified for each component of y. | ||||||||||||||
| res | : external (function or list or string). Computes the value of g(t,y,ydot). 
  | ||||||||||||||
| jac | : external (function or list or string). Computes the value of dg/dy+cj*dg/dydot for a given value of parameter cj 
  | ||||||||||||||
| info | : list which contains 7 elements, default value is list([],0,[],[],[],0,0); 
  | ||||||||||||||
| hd | : real vector which allows to store the dassl context and to resume integration | ||||||||||||||
| r | : real matrix . Each column is the vector [t;x(t);xdot(t)] where t is time index for which the solution had been computed | 
Solution of the implicit differential equation
    g(t,y,ydot)=0
    y(t0)=y0  and   ydot(t0)=ydot0
   
    Detailed examples are given in SCIDIR/tests/dassldasrt.tst
 deff('[r,ires]=chemres(t,y,yd)',[
         'r(1)=-0.04*y(1)+1d4*y(2)*y(3)-yd(1);';
         'r(2)=0.04*y(1)-1d4*y(2)*y(3)-3d7*y(2)*y(2)-yd(2);'
         'r(3)=y(1)+y(2)+y(3)-1;'
         'ires=0']);
 deff('[pd]=chemjac(x,y,yd,cj)',[
         'pd=[-0.04-cj , 1d4*y(3)               , 1d4*y(2);';
         '0.04    ,-1d4*y(3)-2*3d7*y(2)-cj ,-1d4*y(2);';
         '1       , 1                      , 1       ]'])
y0=[1;0;0];
yd0=[-0.04;0.04;0];
t=[1.d-5:0.02:.4,0.41:.1:4,40,400,4000,40000,4d5,4d6,4d7,4d8,4d9,4d10];
y=dassl([y0,yd0],0,t,chemres);
info=list([],0,[],[],[],0,0);
info(2)=1;
y=dassl([y0,yd0],0,4d10,chemres,info);
y=dassl([y0,yd0],0,4d10,chemres,chemjac,info);
 
  | << dasrt | datafit >> |