1
dassl Scilab Group Scilab Function dassl
3
dassl - differential algebraic equation
6
[r [,hd]]=dassl(x0,t0,t [,atol,[rtol]],res [,jac] [,info] [,hd])
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
13
y0 : real column vector of initial conditions.
15
ydot0 : real column vector of the time derivative of y at
16
t0 (may be an estimate).
18
t0 : real number is the initial instant.
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.
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
29
res : external (function or list or string). Computes the value
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
39
list : it must be as follows:
42
where the calling sequence of the function res is now
44
r=res(t,y,ydot,x1,x2,...)
45
res still returns r=g(t,y,ydot) as a function of
48
string : it must refer to the name of a fortran subroutine
49
(see source code of of Ex-dassl.f in routines/defaut/).
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
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
59
list : it must be as follows
62
where the calling sequence of the function jac is now
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,...).
69
: it must refer to the name of a fortran subroutine (see
70
source code of Ex-dassl.f in routines/defaut/).
72
info : list which contains 7 elements, default value is
73
list([],0,[],[],[],0,0);
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.
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).
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)=[].
88
info(4) : real scalar which gives the maximum step size. Set
89
info(4)=[] if no limitation.
91
info(5) : real scalar which gives the initial step size. Set
92
info(4)=[] if not specified.
94
info(6) : set info(6)=1 if the solution is known to be non
95
negative, else set info(6)=0.
97
info(7) : set info(7)=1 if ydot0 is just an estimation,
98
info(7)=0 if g(t0,y0,ydot0)=0.
100
hd : real vector which allows to store the dassl context and to
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
107
Solution of the implicit differential equation
110
y(t0)=y0 and ydot(t0)=ydot0
111
Detailed examples are given in SCIDIR/tests/dassldasrt.tst
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;'
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);';
126
t=[1.d-5:0.02:.4,0.41:.1:4,40,400,4000,40000,4d5,4d6,4d7,4d8,4d9,4d10];
129
y=dassl([y0,yd0],0,t,chemres);
131
info=list([],0,[],[],[],0,0);
133
y=dassl([y0,yd0],0,4d10,chemres,info);
134
y=dassl([y0,yd0],0,4d10,chemres,chemjac,info);
136
ode, dasrt, impl, fort, link, external