1
.TH dasrt G "June 1993" "Scilab Group" "Scilab Function"
4
dasrt - DAE solver with zero crossing
7
[r,nn,[,hd]]=dasrt(x0,t0,t [,atol,[rtol]],res [,jac],ng, surf [,info] [,hd])
12
: is either \fVy0\fR (\fVydot0\fR is estimated by \fVdassl\fR with zero as first estimate) or the matrix \fV[y0 ydot0]\fR.
13
\fVg(t,y0,ydot0)\fR must be equal to zero. If you only know an estimate
14
of \fVydot0\fR set \fVinfo(7)=1\fR
18
: real column vector of initial conditions.
21
: real column vector of the time derivative of \fVy\fR at \fVt0\fR
26
: real number is the initial instant.
29
: 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 \fVinfo(2)=1\fR.
32
: a vector with two entries \fV[times num]\fR \fVtimes\fR is the value
33
of the time at which the surface is crossed, \fVnum\fR is the number
34
of the crossed surface
37
: real scalars or column vectors of same size as \fVy\fR. \fVatol,rtol\fR give respectively absolute and relative error tolerances of solution.
38
If vectors the tolerances are specified for each component of \fVy\fR.
41
: external (function or list or string). Computes the value of \fVg(t,y,ydot)\fR.
45
: Its calling sequence must be \fV[r,ires]=res(t,y,ydot)\fR
46
and \fVres\fR must return the residue \fVr=g(t,y,ydot)\fR and error flag
47
\fVires\fR. \fVires = 0\fR if \fVres\fR succeeds to compute \fVr\fR, \fV=-1\fR
48
if residue is locally not defined for \fV(t,y,ydot)\fR, \fV=-2\fR if
49
parameters are out of admissible range.
52
: it must be as follows:
56
where the calling sequence of the function \fVres\fR is now
58
r=res(t,y,ydot,x1,x2,...)
60
\fVres\fR still returns \fVr=g(t,y,ydot)\fR as a function of
61
\fV(t,y,ydot,x1,x2,...)\fR.
64
: it must refer to the name of
65
a fortran subroutine (see source code of \fVfresd.f\fR).
69
: external (function or list or string). Computes the value
70
of \fVdg/dy+cj*dg/dydot\fR for a given value of parameter \fVcj\fR
74
: Its calling sequence must be \fVr=jac(t,y,ydot,cj)\fR
75
and the \fVjac\fR function must return
76
\fVr=dg(t,y,ydot)/dy+cj*dg(t,y,ydot)/dydot\fR where \fVcj\fR is a real scalar
79
: it must be as follows
83
where the calling sequence of the function \fVjac\fR is now
85
r=jac(t,y,ydot,x1,x2,...)
87
\fVjac\fR still returns \fVdg/dy+cj*dg/dydot\fR as a function of
88
\fV(t,y,ydot,cj,x1,x2,...)\fR.
91
: it must refer to the name of a fortran subroutine
92
(see source code of \fVjacdd.f\fR).
96
: external (function or list or string). Computes the value
97
of the column vector \fVsurf(t,y)\fR with ng components.
98
Each component defines a surface.
102
: Its calling sequence must be \fVsurf(t,y)\fR
105
: it must be as follows
109
where the calling sequence of the function \fVsurf\fR is now
111
r=surf(t,y,x1,x2,...)
115
: it must refer to the name of a fortran subroutine
116
(see source code of \fVfsurfd.f\fR) in directory \fVSCDIR/default\fR
120
: list which contains \fV7\fR elements, default value is list([],0,[],[],[],0,0)
124
: real scalar which gives the maximum time for which \fVg\fR is allowed
125
to be evaluated or an empty matrix \fV[]\fR if no limits imposed for time.
128
: flag which indicates if \fVdassl\fR returns its intermediate
129
computed values (\fVflag=1\fR) or only the user specified time point
130
values (\fVflag=0\fR).
133
: \fV2\fR components vector which give the definition \fV[ml,mu]\fR of band
134
matrix computed by \fVjac\fR;
135
\fVr(i - j + ml + mu + 1,j) = "dg(i)/dy(j)+cj*dg(i)/dydot(j)"\fR.
136
If \fVjac\fR returns a full matrix set \fVinfo(3)=[]\fR.
139
: real scalar which gives the maximum step size. Set \fVinfo(4)=[]\fR if no
143
: real scalar which gives the initial step size. Set \fVinfo(4)=[]\fR if
147
: set \fVinfo(6)=1\fR if the solution is known to be non negative,
148
else set \fVinfo(6)=0\fR.
151
: set \fVinfo(7)=1\fR if \fVydot0\fR is just an estimation, \fVinfo(7)=0\fR
152
if \fVg(t0,y0,ydot0)=0\fR.
156
: real vector which allows to store the \fVdassl\fR context and to
160
: real matrix . Each column is the vector [t;x(t);xdot(t)] where t is time
161
index for which the solution had been computed
163
Solution of the implicit differential equation
166
y(t0)=y0 and ydot(t0)=ydot0
168
Returns the surface crossing instants and the number of the
169
surface reached in \fVnn\fR.
171
Detailed examples can be found in SCIDIR/tests/dassldasrt.tst
174
//dy/dt = ((2*log(y)+8)/t -5)*y, y(1) = 1, 1<=t<=6
175
//g1 = ((2*log(y)+8)/t - 5)*y
176
//g2 = log(y) - 2.2491
177
y0=1;t=2:6;t0=1;y0d=3;
178
atol=1.d-6;rtol=0;ng=2;
180
deff('[delta,ires]=res1(t,y,ydot)','ires=0;delta=ydot-((2*log(y)+8)/t-5)*y')
181
deff('[rts]=gr1(t,y)','rts=[((2*log(y)+8)/t-5)*y;log(y)-2.2491]')
183
[yy,nn]=dasrt([y0,y0d],t0,t,atol,rtol,res1,ng,gr1);
184
//(Should return nn=[2.4698972 2])
187
ode, dassl, impl, fort, link, external