e762e2a2ec8eea87c60688ad042bb8fc212af645
[scilab.git] / scilab / modules / differential_equations / help / en_US / daskr.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2013 - Scilab Enterprises
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.
9  * The terms are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="daskr" xml:lang="en">
14     <refnamediv>
15         <refname>daskr</refname>
16         <refpurpose>DAE solver with zero crossing</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>[r, nn [, hd]] = daskr(x0, t0, t [, atol [, rtol]], res [, jac], ng, surf [, info [, psol] [, jac]] [, hd])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>x0</term>
27                 <listitem>
28                     <para>
29                         is either <literal>y0</literal> (<literal>ydot0</literal> is
30                         estimated by <literal>dassl</literal> with zero as first estimate)
31                         or the matrix <literal>[y0 ydot0]</literal>.
32                         <literal>g(t,y0,ydot0)</literal> must be equal to zero. If you only
33                         know an estimate of <literal>ydot0</literal> set
34                         <literal>info(7)=1</literal>.
35                     </para>
36                     <variablelist>
37                         <varlistentry>
38                             <term>y0</term>
39                             <listitem>
40                                 <para>a real column vector of initial conditions.</para>
41                             </listitem>
42                         </varlistentry>
43                         <varlistentry>
44                             <term>ydot0</term>
45                             <listitem>
46                                 <para>a real column vector of the time derivative of
47                                     <literal>y</literal> at <literal>t0</literal> (may be an
48                                     estimate).
49                                 </para>
50                             </listitem>
51                         </varlistentry>
52                     </variablelist>
53                 </listitem>
54             </varlistentry>
55             <varlistentry>
56                 <term>t0</term>
57                 <listitem>
58                     <para>a real number, it is the initial instant.</para>
59                 </listitem>
60             </varlistentry>
61             <varlistentry>
62                 <term>t</term>
63                 <listitem>
64                     <para>a real scalar or vector. Gives instants for which you want the
65                         solution. Note that you can get solution at each dassl's step point
66                         by setting <literal>info(2)=1</literal>.
67                     </para>
68                 </listitem>
69             </varlistentry>
70             <varlistentry>
71                 <term>nn</term>
72                 <listitem>
73                     <para>
74                         a vector with two entries <literal>[times num]</literal>
75                         <literal>times</literal> is the value of the time at which the
76                         surface is crossed, <literal>num</literal> is the number of the
77                         crossed surface.
78                     </para>
79                 </listitem>
80             </varlistentry>
81             <varlistentry>
82                 <term>atol, rtol</term>
83                 <listitem>
84                     <para>real scalars or column vectors of same size as
85                         <literal>y</literal>. <literal>atol, rtol</literal> give respectively
86                         absolute and relative error tolerances of solution. If vectors the
87                         tolerances are specified for each component of
88                         <literal>y</literal>.
89                     </para>
90                 </listitem>
91             </varlistentry>
92             <varlistentry>
93                 <term>res</term>
94                 <listitem>
95                     <para>
96                         <link linkend="external">external</link> (function or list or string). Computes the value of
97                         <literal>g(t,y,ydot)</literal>. It may be :
98                     </para>
99                     <itemizedlist>
100                         <listitem>
101                             <para>A Scilab function.</para>
102                             <para>Its calling sequence must be
103                                 <literal>[r,ires]=res(t,y,ydot)</literal> and
104                                 <literal>res</literal> must return the residual
105                                 <literal>r=g(t,y,ydot)</literal> and error flag
106                                 <literal>ires</literal>. <literal>ires = 0</literal> if
107                                 <literal>res</literal> succeeds to compute <literal>r</literal>,
108                                 <literal>=-1</literal> if residual is locally not defined for
109                                 <literal>(t,y,ydot)</literal>, <literal>=-2</literal> if
110                                 parameters are out of admissible range.
111                             </para>
112                         </listitem>
113                         <listitem>
114                             <para>A list.</para>
115                             <para>This form allows to pass parameters other than t,y,ydot to
116                                 the function. It must be as follows:
117                             </para>
118                             <programlisting role="no-scilab-exec"><![CDATA[
119 list(res,x1,x2,...)
120  ]]></programlisting>
121                             <para>where the calling sequence of the function
122                                 <literal>res</literal> is now
123                             </para>
124                             <programlisting role="no-scilab-exec"><![CDATA[
125 r=res(t,y,ydot,x1,x2,...)
126  ]]></programlisting>
127                             <para>
128                                 <literal>res</literal> still returns
129                                 <literal>r=g(t,y,ydot)</literal> as a function of
130                                 <literal>(t,y,ydot,x1,x2,...)</literal>.
131                             </para>
132                             <para>Warning: this form must not be used if there is no extra
133                                 argument to pass to <literal>the function.</literal>
134                             </para>
135                         </listitem>
136                         <listitem>
137                             <para>A string.</para>
138                             <para>It must refer to the name of a C or Fortran subroutine
139                                 linked with Scilab.
140                             </para>
141                             <para>In C The calling sequence must be:</para>
142                             <programlisting role="no-scilab-exec"><![CDATA[
143 void res(double *t, double y[], double yd[], double r[],
144          int *ires, double rpar[], int ipar[])
145  ]]></programlisting>
146                             <para>In Fortran it must be:</para>
147                             <programlisting role="no-scilab-exec"><![CDATA[
148 subroutine res(t,y,yd,r,ires,rpar,ipar)
149 double precision t, y(*),yd(*),r(*),rpar(*)
150 integer ires,ipar(*)
151  ]]></programlisting>
152                             <para>
153                                 The <literal>rpar</literal> and <literal>ipar</literal> arrays must be present but cannot be
154                                 used.
155                             </para>
156                         </listitem>
157                     </itemizedlist>
158                 </listitem>
159             </varlistentry>
160             <varlistentry>
161                 <term>jac</term>
162                 <listitem>
163                     <para>
164                         <link linkend="external">external</link> (function or list or string). Computes the value of
165                         <literal>dg/dy + cj*dg/dydot</literal> for a given value of parameter
166                         <literal>cj</literal>.
167                     </para>
168                     <itemizedlist>
169                         <listitem>
170                             <para>A Scilab function.</para>
171                             <para>Its calling sequence must be
172                                 <literal>r=jac(t,y,ydot,cj)</literal> and the
173                                 <literal>jac</literal> function must return
174                                 <literal>r=dg(t,y,ydot)/dy+cj*dg(t,y,ydot)/dydot</literal> where
175                                 <literal>cj</literal> is a real scalar.
176                             </para>
177                         </listitem>
178                         <listitem>
179                             <para>A list.</para>
180                             <para>It must be as follows</para>
181                             <programlisting role="no-scilab-exec"><![CDATA[
182 list(jac,x1,x2,...)
183  ]]></programlisting>
184                             <para>where the calling sequence of the function
185                                 <literal>jac</literal> is now
186                             </para>
187                             <programlisting role="no-scilab-exec"><![CDATA[
188 r=jac(t,y,ydot,cj,x1,x2,...)
189  ]]></programlisting>
190                             <para>
191                                 <literal>jac</literal> still returns
192                                 <literal>dg/dy + cj*dg/dydot</literal> as a function of
193                                 <literal>(t,y,ydot,cj,x1,x2,...)</literal>.
194                             </para>
195                         </listitem>
196                         <listitem>
197                             <para>A character string.</para>
198                             <para>It must refer to the name of a Fortran subroutine linked
199                                 with scilab
200                             </para>
201                             <para>In C The calling sequence must be:</para>
202                             <programlisting role="no-scilab-exec"><![CDATA[
203 void jac(double *t, double y[], double yd[], double pd[],
204          double *cj, double rpar[], int ipar[])
205  ]]></programlisting>
206                             <para>In Fortran it must be:</para>
207                             <programlisting role="no-scilab-exec"><![CDATA[
208 subroutine jac(t,y,yd,pd,cj,rpar,ipar)
209 double precision t, y(*),yd(*),pd(*),cj,rpar(*)
210 integer ipar(*)
211  ]]></programlisting>
212                         </listitem>
213                     </itemizedlist>
214                 </listitem>
215             </varlistentry>
216             <varlistentry>
217                 <term>surf</term>
218                 <listitem>
219                     <para>
220                         <link linkend="external">external</link> (function or list or string). Computes the value of
221                         the column vector <literal>surf(t,y)</literal> with
222                         <literal>ng</literal> components. Each component defines a surface.
223                         It may be defined by:
224                     </para>
225                     <itemizedlist>
226                         <listitem>
227                             <para>A Scilab function.</para>
228                             <para>Its calling sequence must be
229                                 <literal>surf(t,y)</literal>
230                             </para>
231                         </listitem>
232                         <listitem>
233                             <para>A list.</para>
234                             <para>It must be as follows</para>
235                             <programlisting role="no-scilab-exec"><![CDATA[
236 list(surf,x1,x2,...)
237  ]]></programlisting>
238                             <para>where the calling sequence of the function
239                                 <literal>surf</literal> is now
240                             </para>
241                             <programlisting role="no-scilab-exec"><![CDATA[
242 r=surf(t,y,x1,x2,...)
243  ]]></programlisting>
244                         </listitem>
245                         <listitem>
246                             <para>A character string.</para>
247                             <para>It must refer to the name of a Fortran subroutine linked
248                                 with scilab.
249                             </para>
250                             <para>In C the calling sequence must be:</para>
251                             <programlisting role="no-scilab-exec"><![CDATA[
252 void surf(int *ny, double *t, double y[], int *ng, double gout[])
253  ]]></programlisting>
254                             <para>In Fortran it must be:</para>
255                             <programlisting role="no-scilab-exec"><![CDATA[
256 subroutine surf(ny,t,y,ng,gout)
257 double precision t, y(*),gout(*)
258 integer ny,ng
259  ]]></programlisting>
260                         </listitem>
261                     </itemizedlist>
262                 </listitem>
263             </varlistentry>
264             <varlistentry>
265                 <term>info</term>
266                 <listitem>
267                     <para>
268                         list which contains <literal>14</literal> elements. Default
269                         value is <literal>list([],0,[],[],[],0,[],0,[],0,[],[],[],1)</literal>.
270                     </para>
271                     <variablelist>
272                         <varlistentry>
273                             <term>info(1)</term>
274                             <listitem>
275                                 <para>real scalar which gives the maximum time for which
276                                     <literal>g</literal> is allowed to be evaluated or an empty
277                                     matrix <literal>[]</literal> if no limits imposed for
278                                     time.
279                                 </para>
280                             </listitem>
281                         </varlistentry>
282                         <varlistentry>
283                             <term>info(2)</term>
284                             <listitem>
285                                 <para>
286                                     flag which indicates if <literal>dassl</literal> returns
287                                     its intermediate computed values (<literal>flag=1</literal>)
288                                     or only the user specified time point values
289                                     (<literal>flag=0</literal>).
290                                 </para>
291                             </listitem>
292                         </varlistentry>
293                         <varlistentry>
294                             <term>info(3)</term>
295                             <listitem>
296                                 <para>
297                                     <literal>2</literal> components vector which give the
298                                     definition <literal>[ml,mu]</literal> of band matrix computed
299                                     by <literal>jac</literal>; <literal>r(i - j + ml + mu + 1,j) =
300                                         "dg(i)/dy(j)+cj*dg(i)/dydot(j)"
301                                     </literal>
302                                     . If <literal>jac</literal> returns a full matrix set
303                                     <literal>info(3)=[]</literal>.
304                                     Treat as dummmy if
305                                     <literal>info(8)=1</literal>.
306                                 </para>
307                             </listitem>
308                         </varlistentry>
309                         <varlistentry>
310                             <term>info(4)</term>
311                             <listitem>
312                                 <para>real scalar which gives the maximum step size. Set
313                                     <literal>info(4)=[]</literal> if no limitation.
314                                 </para>
315                             </listitem>
316                         </varlistentry>
317                         <varlistentry>
318                             <term>info(5)</term>
319                             <listitem>
320                                 <para>real scalar which gives the initial step size. Set
321                                     <literal>info(5)=[]</literal> if not specified.
322                                 </para>
323                             </listitem>
324                         </varlistentry>
325                         <varlistentry>
326                             <term>info(6)</term>
327                             <listitem>
328                                 <para>
329                                     set <literal>info(6)=1</literal> if the solution is
330                                     known to be non negative, else set
331                                     <literal>info(6)=0</literal>.
332                                 </para>
333                             </listitem>
334                         </varlistentry>
335                         <varlistentry>
336                             <term>info(7)</term>
337                             <listitem>
338                                 <para>
339                                     if ydot0 is set so that
340                                     <literal>g(t0,y0,ydot0)=0</literal> then set
341                                     <literal>info(7)=[]</literal>. Otherwise, set
342                                     <literal>info(7)=[+-1, ..., +-1]</literal>, with
343                                     <literal>info(7)(i)=1</literal> if y(i) is a differential variable and
344                                     <literal>info(7)(i)=-1</literal> if y(i) is an algebraic variable
345                                     (if its derivatives do not appear explicitly in the function g(t,y,ydot)).
346                                 </para>
347                             </listitem>
348                         </varlistentry>
349                         <varlistentry>
350                             <term>info(8)</term>
351                             <listitem>
352                                 <para>
353                                     direct / Krylov. Set <literal>info(8)=1</literal> and provide a routine in <literal>psol</literal>
354                                     if you want the solver to use Krylov iterations, else (dassl's direct method) set
355                                     <literal>info(8)=0</literal>.
356                                 </para>
357                             </listitem>
358                         </varlistentry>
359                         <varlistentry>
360                             <term>info(9)</term>
361                             <listitem>
362                                 <para>
363                                     Krylov parameters. Treat as dummy argument if you have set
364                                     <literal>info(8)=0</literal>. Otherwise, set
365                                     <literal>info(9)=[maxl kmp nrmax epli]</literal>, where:
366                                 </para>
367                                 <para>
368                                     - maxl = maximum number of iterations in the SPIGMR algorithm (default
369                                     <literal>min(5,neq)</literal>),
370                                 </para>
371                                 <para>
372                                     - kmp = number of vectors on which orthogonalization is done in the SPIGMR algorithm
373                                     (default maxl),
374                                 </para>
375                                 <para>
376                                     - nrmax = maximum number of restarts of the SPIGMR algorithm per nonlinear iteration
377                                     (default <literal>5</literal>),
378                                 </para>
379                                 <para>
380                                     - epli = convergence test constant in SPIGMR algorithm (default <literal>0.05</literal>).
381                                 </para>
382                             </listitem>
383                         </varlistentry>
384                         <varlistentry>
385                             <term>info(10)</term>
386                             <listitem>
387                                 <para>
388                                     initial conditions. Treat as dummy argument if
389                                     <literal>info(7)=[]</literal>. Set
390                                     <literal>info(10)=1</literal> if the solver should stop right after
391                                     computation of the initial conditions, else set
392                                     <literal>info(10)=0</literal>.
393                                 </para>
394                             </listitem>
395                         </varlistentry>
396                         <varlistentry>
397                             <term>info(11)</term>
398                             <listitem>
399                                 <para>
400                                     preconditioner computation and LU-factorisation routine for <literal>psol</literal>.
401                                     Treat as dummy argument if <literal>info(8)=0</literal>. Set
402                                     <literal>info(11)=1</literal> and provide a <literal>pjac</literal> routine if the
403                                     <link linkend="external">external</link> <literal>psol</literal> should use a specific routine, else set
404                                     <literal>info(11)=0</literal>.
405                                 </para>
406                             </listitem>
407                         </varlistentry>
408                         <varlistentry>
409                             <term>info(12)</term>
410                             <listitem>
411                                 <para>
412                                     if you wish to control errors locally on all the variables then set
413                                     <literal>info(12)=[]</literal>. Otherwise, set
414                                     <literal>info(12)=[+-1, ..., +-1]</literal>, with
415                                     <literal>info(12)(i)=1</literal> if y(i) is a differential variable and
416                                     <literal>info(12)(i)=-1</literal> if y(i) is an algebraic variable
417                                     (if its derivatives do not appear explicitly in the function g(t,y,ydot)).
418                                 </para>
419                             </listitem>
420                         </varlistentry>
421                         <varlistentry>
422                             <term>info(13)</term>
423                             <listitem>
424                                 <para>
425                                     heuristic parameters. Treat as dummy argument if
426                                     <literal>info(7)=[]</literal>. Otherwise, set
427                                     <literal>info(13)=[mxnit mxnj mxnh lsoff stptol epinit]</literal>, where:
428                                 </para>
429                                 <para>
430                                     - mxnit = maximum number of Newton iterations per Jacobian or preconditioner evaluation (default
431                                     <literal>5</literal> if <literal>info(8)=0</literal>, <literal>15</literal> otherwise),
432                                 </para>
433                                 <para>
434                                     - mxnj = maximum number of Jacobian or preconditioner evaluations (default
435                                     <literal>6</literal> if <literal>info(8)=0</literal>, <literal>2</literal> otherwise),
436                                 </para>
437                                 <para>
438                                     - mxnh = maximum number of values of the artificial stepsize parameter H to be tried if info(7) &#8800; [] (default
439                                     <literal>5</literal>),
440                                 </para>
441                                 <para>
442                                     - lsoff = flag to turn off the linesearch algorithm (lsoff = 0 means linesearch is on, lsoff = 1 means it is turned off)
443                                     (default <literal>0</literal>),
444                                 </para>
445                                 <para>
446                                     - stptol = minimum scaled step in linesearch algorithm (default <literal>(unit roundoff)^(2/3)</literal>),
447                                 </para>
448                                 <para>
449                                     - epinit = swing factor in the Newton iteration convergence test (default <literal>0.01</literal>).
450                                 </para>
451                             </listitem>
452                         </varlistentry>
453                         <varlistentry>
454                             <term>info(14)</term>
455                             <listitem>
456                                 <para>
457                                     verbosity. Set <literal>info(14)=1</literal> for minimal extra printing,
458                                     <literal>info(14)=2</literal> for full printing, else set
459                                     <literal>info(14)=0</literal>.
460                                 </para>
461                             </listitem>
462                         </varlistentry>
463                     </variablelist>
464                 </listitem>
465             </varlistentry>
466             <varlistentry>
467                 <term>psol</term>
468                 <listitem>
469                     <para>
470                         <link linkend="external">external</link> (function or list or string). Solves a linear system
471                         <literal>P*x = b</literal>, with P being the preconditioner that routine <literal>pjac</literal>
472                         computed beforehand and stocked in wp and iwp.
473                     </para>
474                     <itemizedlist>
475                         <listitem>
476                             <para>A Scilab function.</para>
477                             <para>Its calling sequence must be
478                                 <literal>[r,ier] = psol(neq,R,iR,b)</literal> and the
479                                 <literal>psol</literal> function must return the solution of that system in
480                                 <literal>r</literal> and an error flag <literal>ier</literal>.
481                             </para>
482                         </listitem>
483                         <listitem>
484                             <para>A list.</para>
485                             <para>It must be as follows</para>
486                             <programlisting role="no-scilab-exec"><![CDATA[
487 list(psol,x1,x2,...)
488  ]]></programlisting>
489                             <para>where the calling sequence of the function
490                                 <literal>psol</literal> is now
491                             </para>
492                             <programlisting role="no-scilab-exec"><![CDATA[
493 psol(R,iR,b,x1,x2,...)
494  ]]></programlisting>
495                             <para>
496                                 <literal>psol</literal> still returns the solution in <literal>r</literal>.
497                             </para>
498                         </listitem>
499                         <listitem>
500                             <para>A character string.</para>
501                             <para>It must refer to the name of a Fortran subroutine linked
502                                 with scilab
503                             </para>
504                             <para>In C The calling sequence must be:</para>
505                             <programlisting role="no-scilab-exec"><![CDATA[
506 void psol (int*neq, double*t, double*y, double*ydot, double*savr,
507   double*wk, double*cj, double*wght, double*wp, int*iwp, double*b, double*eplin, int*ier, double*rpar, int*ipar)
508  ]]></programlisting>
509                             where the arrays <literal>wp</literal> and <literal>iwp</literal> contain matrix elements of preconditioner
510                             <literal>P</literal> in compressed row format.
511                             <para>In Fortran it must be:</para>
512                             <programlisting role="no-scilab-exec"><![CDATA[
513 subroutine psol (neq, t, y, ydot, savr, wk, cj, wght,
514   wp, iwp, b, eplin, ier, rpar, ipar)
515 double precision t,y(*),ydot(*),savr(*),wk(*),cj,wght(*),wp(*),
516   b(*),eplin,rpar(*)
517 integer neq,iwp(*),ier,ipar(*)
518  ]]></programlisting>
519                         </listitem>
520                     </itemizedlist>
521                 </listitem>
522             </varlistentry>
523             <varlistentry>
524                 <term>pjac</term>
525                 <listitem>
526                     <para>
527                         <link linkend="external">external</link> (function or list or string). Computes the value of
528                         <literal>dg/dy + cj*dg/dydot</literal> for a given value of parameter
529                         <literal>cj</literal> and LU-factorises it in double and int arrays.
530                     </para>
531                     <itemizedlist>
532                         <listitem>
533                             <para>A Scilab function.</para>
534                             <para>Its calling sequence must be
535                                 <literal>[R,iR,ier] = pjac(neq,t,y,ydot,h,cj)</literal> and in return,
536                                 the arrays R and iR must contain all preconditioner information in compressed sparse row format.
537                             </para>
538                         </listitem>
539                         <listitem>
540                             <para>A list.</para>
541                             <para>It must be as follows</para>
542                             <programlisting role="no-scilab-exec"><![CDATA[
543 list(pjac,x1,x2,...)
544  ]]></programlisting>
545                             <para>where the calling sequence of the function
546                                 <literal>pjac</literal> is now
547                             </para>
548                             <programlisting role="no-scilab-exec"><![CDATA[
549 pjac(neq,t,y,ydot,h,cj,x1,x2,...)
550  ]]></programlisting>
551                             <para>
552                                 <literal>pjac</literal> still returns factorised
553                                 <literal>dg/dy + cj*dg/dydot</literal> as a function of
554                                 <literal>(neq,t,y,ydot,h,cj,x1,x2,...)</literal>.
555                             </para>
556                         </listitem>
557                         <listitem>
558                             <para>A character string.</para>
559                             <para>It must refer to the name of a Fortran subroutine linked
560                                 with scilab
561                             </para>
562                             <para>In C The calling sequence must be:</para>
563                             <programlisting role="no-scilab-exec"><![CDATA[
564 void pjac (double*res, int*ires, int*neq, double*t, double*y, double*ydot, double*rewt, double*savr,
565 double*wk, double*h, double*cj, double*wp, int*iwp, int*ier, double*rpar, int*ipar)
566  ]]></programlisting>
567                             <para>In Fortran it must be:</para>
568                             <programlisting role="no-scilab-exec"><![CDATA[
569 subroutine pjac (res, ires, neq, t, y, ydot, rewt, savr,
570   wk, h, cj, wp, iwp, ier, rpar, ipar)
571 double precision res(*), t, y(*), ydot(*), rewt(*), savr(*),
572   wk(*), h, cj, wp(*), rpar(*)
573 integer ires, neq, iwp(*), ier, ipar(*)
574  ]]></programlisting>
575                         </listitem>
576                     </itemizedlist>
577                 </listitem>
578             </varlistentry>
579             <varlistentry>
580                 <term>hd</term>
581                 <listitem>
582                     <para>
583                         real vector which allows to store the <literal>dassl</literal>
584                         context and to resume integration.
585                     </para>
586                 </listitem>
587             </varlistentry>
588             <varlistentry>
589                 <term>r</term>
590                 <listitem>
591                     <para>
592                         real matrix . Each column is the vector <literal>[t;x(t);xdot(t)]</literal> where
593                         <literal>t</literal> is time index for which the solution had been computed.
594                     </para>
595                 </listitem>
596             </varlistentry>
597         </variablelist>
598     </refsection>
599     <refsection>
600         <title>Description</title>
601         <para>Solution of the implicit differential equation.</para>
602         <programlisting role="no-scilab-exec"><![CDATA[
603 g(t,y,ydot) = 0
604 y(t0) = y0  and   ydot(t0) = ydot0
605  ]]></programlisting>
606         <para>Returns the surface crossing instants and the number of the surface
607             reached in <literal>nn</literal>.
608         </para>
609         <para>Detailed examples can be found in SCI/modules/differential_equations/tests/unit_tests/daskr.tst</para>
610     </refsection>
611     <refsection>
612         <title>Examples</title>
613         <programlisting role="example"><![CDATA[
614 // dy/dt = ((2*log(y)+8)/t -5)*y,  y(1) = 1,  1 <= t <=6
615 // g1 = ((2*log(y)+8)/t - 5)*y
616 // g2 = log(y) - 2.2491
617 y0 = 1; t = 2:6; t0 = 1; y0d = 3;
618 atol = 1.d-6; rtol = 0; ng = 2;
619
620 deff('[delta,ires] = res1(t,y,ydot)','ires = 0; delta = ydot-((2*log(y)+8)/t-5)*y')
621 deff('[rts] = gr1(t,y)','rts = [((2*log(y)+8)/t-5)*y; log(y)-2.2491]')
622
623 [yy,nn] = daskr([y0,y0d],t0,t,atol,rtol,res1,ng,gr1);
624 nn
625
626 // Should return nn = [2.4698972 2]
627  ]]></programlisting>
628     </refsection>
629     <refsection role="see also">
630         <title>See Also</title>
631         <simplelist type="inline">
632             <member>
633                 <link linkend="ode">ode</link>
634             </member>
635             <member>
636                 <link linkend="dasrt">dasrt</link>
637             </member>
638             <member>
639                 <link linkend="dassl">dassl</link>
640             </member>
641             <member>
642                 <link linkend="impl">impl</link>
643             </member>
644             <member>
645                 <link linkend="fort">fort</link>
646             </member>
647             <member>
648                 <link linkend="link">link</link>
649             </member>
650             <member>
651                 <link linkend="external">external</link>
652             </member>
653         </simplelist>
654     </refsection>
655     <refsection>
656         <title>History</title>
657         <revhistory>
658             <revision>
659                 <revnumber>5.5.0</revnumber>
660                 <revdescription>daskr solver added</revdescription>
661             </revision>
662         </revhistory>
663     </refsection>
664 </refentry>