[doc][equadif + polynomials] Unfold synopses + fix + improvements
[scilab.git] / scilab / modules / differential_equations / help / en_US / bvode.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) 2008 - INRIA
5  * ...
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="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="bvode" xml:lang="en">
18     <refnamediv>
19         <refname>bvode</refname>
20         <refpurpose>boundary value problems for ODE using collocation
21             method
22         </refpurpose>
23     </refnamediv>
24     <refnamediv xml:id="bvodeS">
25         <refname>bvodeS</refname>
26         <refpurpose>Simplified call to bvode</refpurpose>
27     </refnamediv>
28     <refsynopsisdiv>
29         <title>Syntax</title>
30         <synopsis>
31             zu = bvode(xpoints,N,m,x_low,x_up,zeta,ipar,ltol,tol,fixpnt,fsub,dfsub,gsub,dgsub,guess)
32         </synopsis>
33       <para></para>
34         <synopsis>
35             zu = bvodeS(xpoints,m,N,x_low,x_up,fsub,gsub,zeta, &lt;optional_args&gt;)
36         </synopsis>
37     </refsynopsisdiv>
38     <refsection>
39         <title>Arguments</title>
40         <variablelist>
41             <varlistentry>
42                 <term>zu</term>
43                 <listitem>
44                     <para>
45                         a column vector of size <literal>M</literal>. The solution of the ode evaluated
46                         on the mesh given by points. It contains  <literal>z(u(x))</literal> for each requested
47                         points.
48                     </para>
49                 </listitem>
50             </varlistentry>
51             <varlistentry>
52                 <term>xpoints</term>
53                 <listitem>
54                     <para>an array which gives the points for which we want to observe
55                         the solution.
56                     </para>
57                 </listitem>
58             </varlistentry>
59             <varlistentry>
60                 <term>N</term>
61                 <listitem>
62                     <para>a scalar with integer value, number of differential equations
63                         (<literal>N</literal> &lt;= 20).
64                     </para>
65                 </listitem>
66             </varlistentry>
67             <varlistentry>
68                 <term>m</term>
69                 <listitem>
70                     <para>
71                         a vector of size <literal>N</literal> with integer elements.
72                         It is the vector of order of each differential equation:
73                         <literal>m(i)</literal> gives the order of the <literal>i</literal>-th differential
74                         equation. In the following, <literal>M</literal> will represent the sum of the
75                         elements of <literal>m</literal>.
76                     </para>
77                 </listitem>
78             </varlistentry>
79             <varlistentry>
80                 <term>x_low</term>
81                 <listitem>
82                     <para>a scalar: left end of interval</para>
83                 </listitem>
84             </varlistentry>
85             <varlistentry>
86                 <term>x_up</term>
87                 <listitem>
88                     <para>a scalar: right end of interval</para>
89                 </listitem>
90             </varlistentry>
91             <varlistentry>
92                 <term>zeta</term>
93                 <listitem>
94                     <para>
95                         a vector of size <literal>M</literal>, <literal>zeta(j)</literal> gives <literal>j</literal>-th side
96                         condition point (boundary point). One must have <literal>x_low&lt;=zeta(j)
97                             &lt;=zeta(j+1)&lt;=x_up
98                         </literal>
99                     </para>
100                     <para>All side condition points must be mesh points in all meshes
101                         used, see description of <literal>ipar(11)</literal> and
102                         <literal>fixpnt</literal> below.
103                     </para>
104                 </listitem>
105             </varlistentry>
106             <varlistentry>
107                 <term>ipar</term>
108                 <listitem>
109                     <para>an array with 11 integer elements:</para>
110                     <para>
111                         <literal>[nonlin, collpnt, subint, ntol, ndimf, ndimi, iprint,
112                             iread, iguess, rstart,nfxpnt]
113                         </literal>
114                     </para>
115                     <variablelist>
116                         <varlistentry>
117                             <term>nonlin: ipar(1)</term>
118                             <listitem>
119                                 <para>0 if the problem is linear, 1 if the problem is
120                                     nonlinear
121                                 </para>
122                             </listitem>
123                         </varlistentry>
124                         <varlistentry>
125                             <term>collpnt: ipar(2)</term>
126                             <listitem>
127                                 <para>Gives the number of collocation points per subinterval
128                                     where <literal>max(m(j)) &lt;= collpnt &lt;= 7</literal>.
129                                 </para>
130                                 <para>
131                                     If <literal>ipar(2)=0</literal> then <literal>collpnt</literal> is set to  <literal>max( max(m(j))+1, 5-max(m(j)) )</literal>.
132                                 </para>
133                             </listitem>
134                         </varlistentry>
135                         <varlistentry>
136                             <term>subint: ipar(3)</term>
137                             <listitem>
138                                 <para>Gives the number of subintervals in the initial mesh. If
139                                     <literal>ipar(3) = 0</literal> then <literal>bvode</literal> arbitrarily sets
140                                     <literal>subint = 5</literal>.
141                                 </para>
142                             </listitem>
143                         </varlistentry>
144                         <varlistentry>
145                             <term>ntol: ipar(4)</term>
146                             <listitem>
147                                 <para>Gives the number of solution and derivative tolerances.
148                                     We require <literal>0 &lt; ntol &lt;= M</literal>. <literal>ipar(4)</literal>
149                                     must be set to the dimension of the <literal>tol</literal>
150                                     argument or to <literal>0</literal>. In the latter case the
151                                     actual value will automatically be set to
152                                     <literal>size(tol,'*')</literal>.
153                                 </para>
154                             </listitem>
155                         </varlistentry>
156                         <varlistentry>
157                             <term>ndimf: ipar(5)</term>
158                             <listitem>
159                                 <para>
160                                     Gives the dimension of <literal>fspace</literal> (a real
161                                     work array). Its value provides a constraint on <literal>nmax</literal> the
162                                     maximum number of subintervals.
163                                 </para>
164                                 <para>
165                                     The <literal>ipar(5)</literal> value must respect the constraint
166                                     <literal>ipar(5)&gt;=nmax*nsizef</literal> where
167                                     <literal>nsizef=4 + 3*M + (5+collpnt*N)*(collpnt*N+M) + (2*M-nrec)*2*M</literal>
168                                     (<literal>nrec</literal> is the number of right end boundary conditions).
169                                 </para>
170                             </listitem>
171                         </varlistentry>
172                         <varlistentry>
173                             <term>ndimi: ipar(6)</term>
174                             <listitem>
175                                 <para>
176                                     Gives the dimension of <literal>ispace</literal> (an integer work array).
177                                     Its value provides a constraint on <literal>nmax</literal>, the maximum number of
178                                     subintervals.
179                                 </para>
180                                 <para>
181                                     The <literal>ipar(6)</literal> value must respect the constraint
182                                     <literal>ipar(6)&gt;=nmax*nsizei</literal> where
183                                     <literal>nsizei= 3 + collpnt*N + M</literal>.
184                                 </para>
185                             </listitem>
186                         </varlistentry>
187                         <varlistentry>
188                             <term>iprint: ipar(7)</term>
189                             <listitem>
190                                 <para>output control, may take the following values:</para>
191                                 <variablelist>
192                                     <varlistentry>
193                                         <term>-1</term>
194                                         <listitem>
195                                             <para>for full diagnostic printout</para>
196                                         </listitem>
197                                     </varlistentry>
198                                     <varlistentry>
199                                         <term>0</term>
200                                         <listitem>
201                                             <para>for selected printout</para>
202                                         </listitem>
203                                     </varlistentry>
204                                     <varlistentry>
205                                         <term>1</term>
206                                         <listitem>
207                                             <para>for no printout</para>
208                                         </listitem>
209                                     </varlistentry>
210                                 </variablelist>
211                             </listitem>
212                         </varlistentry>
213                         <varlistentry>
214                             <term>iread: ipar(8)</term>
215                             <listitem>
216                                 <variablelist>
217                                     <varlistentry>
218                                         <term>= 0</term>
219                                         <listitem>
220                                             <para>
221                                                 causes <literal>bvode</literal> to generate a uniform initial
222                                                 mesh.
223                                             </para>
224                                         </listitem>
225                                     </varlistentry>
226                                     <varlistentry>
227                                         <term>= xx</term>
228                                         <listitem>
229                                             <para>Other values are not implemented yet in
230                                                 Scilab
231                                             </para>
232                                             <variablelist>
233                                                 <varlistentry>
234                                                     <term>= 1</term>
235                                                     <listitem>
236                                                         <para>
237                                                             if the initial mesh is provided by the user it is defined in <literal>fspace</literal> as follows: the mesh
238                                                             will occupy <literal>fspace(1), ..., fspace(n+1)</literal>. The user needs to supply only
239                                                             the interior mesh points <literal>fspace(j) = x(j),j = 2, ..., n</literal>.
240                                                         </para>
241                                                     </listitem>
242                                                 </varlistentry>
243                                                 <varlistentry>
244                                                     <term>= 2
245                                                     </term>
246                                                     <listitem>
247                                                         <para>
248                                                             if the initial mesh is supplied by the user as with <literal>ipar(8)=1</literal>, and
249                                                             in addition no adaptive mesh selection is to be done.
250                                                         </para>
251                                                     </listitem>
252                                                 </varlistentry>
253                                             </variablelist>
254                                         </listitem>
255                                     </varlistentry>
256                                 </variablelist>
257                             </listitem>
258                         </varlistentry>
259                         <varlistentry>
260                             <term>iguess: ipar(9)</term>
261                             <listitem>
262                                 <variablelist>
263                                     <varlistentry>
264                                         <term>= 0</term>
265                                         <listitem>
266                                             <para>if no initial guess for the solution is
267                                                 provided.
268                                             </para>
269                                         </listitem>
270                                     </varlistentry>
271                                     <varlistentry>
272                                         <term>= 1</term>
273                                         <listitem>
274                                             <para>if an initial guess is provided by the user
275                                                 through the argument <literal>guess</literal>.
276                                             </para>
277                                         </listitem>
278                                     </varlistentry>
279                                     <varlistentry>
280                                         <term>= 2</term>
281                                         <listitem>
282                                             <para>if an initial mesh and approximate solution
283                                                 coefficients are provided by the user in <literal>fspace</literal> (the
284                                                 former and new mesh are the same).
285                                             </para>
286                                         </listitem>
287                                     </varlistentry>
288                                     <varlistentry>
289                                         <term>= 3</term>
290                                         <listitem>
291                                             <para>if a former mesh and approximate solution
292                                                 coefficients are provided by the user in <literal>fspace</literal>, and the
293                                                 new mesh is to be taken twice as coarse; i.e. every
294                                                 second point from the former mesh.
295                                             </para>
296                                         </listitem>
297                                     </varlistentry>
298                                     <varlistentry>
299                                         <term>= 4</term>
300                                         <listitem>
301                                             <para>if in addition to a former initial mesh and
302                                                 approximate solution coefficients, a new mesh is
303                                                 provided in <literal>fspace</literal> as well (see description of output
304                                                 for further details on iguess = 2, 3 and 4).
305                                             </para>
306                                         </listitem>
307                                     </varlistentry>
308                                 </variablelist>
309                             </listitem>
310                         </varlistentry>
311                         <varlistentry>
312                             <term>ireg: ipar(10)</term>
313                             <listitem>
314                                 <variablelist>
315                                     <varlistentry>
316                                         <term>= 0</term>
317                                         <listitem>
318                                             <para>if the problem is regular</para>
319                                         </listitem>
320                                     </varlistentry>
321                                     <varlistentry>
322                                         <term>= 1</term>
323                                         <listitem>
324                                             <para>
325                                                 if the first relaxation factor is equal to <literal>ireg</literal>, and
326                                                 the nonlinear iteration does not rely on past convergence
327                                                 (use for an extra-sensitive nonlinear problem only)
328                                             </para>
329                                         </listitem>
330                                     </varlistentry>
331                                     <varlistentry>
332                                         <term>= 2</term>
333                                         <listitem>
334                                             <para>if we are to return immediately upon (a) two
335                                                 successive nonconvergences, or (b) after obtaining an error
336                                                 estimate for the first time.
337                                             </para>
338                                         </listitem>
339                                     </varlistentry>
340                                 </variablelist>
341                             </listitem>
342                         </varlistentry>
343                         <varlistentry>
344                             <term>nfxpnt: ipar(11)</term>
345                             <listitem>
346                                 <para>Gives the number of fixed points in the mesh other than
347                                     <literal>x_low</literal> and <literal>x_up</literal> (the
348                                     dimension of <literal>fixpnt</literal>).
349                                     <literal>ipar(11)</literal> must be set to the dimension of
350                                     the <literal>fixpnt</literal> argument or to
351                                     <literal>0</literal>. In the latter case the actual value will
352                                     automatically be set to
353                                     <literal>size(fixpnt,'*')</literal>.
354                                 </para>
355                             </listitem>
356                         </varlistentry>
357                     </variablelist>
358                 </listitem>
359             </varlistentry>
360             <varlistentry>
361                 <term>ltol</term>
362                 <listitem>
363                     <para>
364                         an array of dimension <literal>ntol=ipar(4)</literal>.
365                         <literal>ltol(j) = l</literal> specifies that the <literal>j</literal>-th tolerance in
366                         the <literal>tol</literal> array controls the error in the <literal>l</literal>-th
367                         component of
368                         <inlinemediaobject>
369                             <imageobject>
370                                 <imagedata>
371                                     <mml:math>
372                                         <mml:semantics>
373                                             <mml:mi>z</mml:mi>
374                                             <mml:mrow>
375                                                 <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>u</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
376                                             </mml:mrow>
377                                         </mml:semantics>
378                                     </mml:math>
379                                 </imagedata>
380                             </imageobject>
381                         </inlinemediaobject>
382                         .
383                         It is also required that:
384                     </para>
385                     <para>
386                         <literal>1 &lt;= ltol(1) &lt; ltol(2) &lt; ... &lt; ltol(ntol)
387                             &lt;= M
388                         </literal>
389                     </para>
390                 </listitem>
391             </varlistentry>
392             <varlistentry>
393                 <term>tol</term>
394                 <listitem>
395                     <para>
396                         an array of dimension <literal>ntol=ipar(4)</literal>.
397                     </para>
398                     <para>
399                         <literal>tol(j)</literal> is the error tolerance on the
400                         <literal>ltol(j)</literal>-th component of
401                         <inlinemediaobject>
402                             <imageobject>
403                                 <imagedata>
404                                     <mml:math>
405                                         <mml:semantics>
406                                             <mml:mi>z</mml:mi>
407                                             <mml:mrow>
408                                                 <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>u</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
409                                             </mml:mrow>
410                                         </mml:semantics>
411                                     </mml:math>
412                                 </imagedata>
413                             </imageobject>
414                         </inlinemediaobject>
415                         . Thus, the code attempts to satisfy
416                         <inlinemediaobject>
417                             <imageobject>
418                                 <imagedata>
419                                     <mml:math>
420                                         <mml:semantics>
421                                             <mml:mrow>
422                                                 <mml:mrow>
423                                                     <mml:mfenced mml:close="∣" mml:open="∣">
424                                                         <mml:msub>
425                                                             <mml:mrow>
426                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
427                                                                 <mml:mrow>
428                                                                     <mml:mi>z</mml:mi>
429                                                                     <mml:mrow>
430                                                                         <mml:mrow>
431                                                                             <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>v</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
432                                                                         </mml:mrow>
433                                                                         <mml:mo mml:stretchy="false">−</mml:mo><mml:mi>z</mml:mi>
434                                                                     </mml:mrow>
435                                                                     <mml:mrow>
436                                                                         <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>u</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
437                                                                     </mml:mrow>
438                                                                 </mml:mrow>
439                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
440                                                             </mml:mrow>
441                                                             <mml:mrow>
442                                                                 <mml:mi mml:fontstyle="italic">ltol</mml:mi>
443                                                                 <mml:mrow>
444                                                                     <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>j</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
445                                                                 </mml:mrow>
446                                                             </mml:mrow>
447                                                         </mml:msub>
448                                                     </mml:mfenced>
449                                                     <mml:mo mml:stretchy="false">≤</mml:mo><mml:mi mml:fontstyle="italic">tol</mml:mi>
450                                                 </mml:mrow>
451                                                 <mml:mrow>
452                                                     <mml:mrow>
453                                                         <mml:mrow>
454                                                             <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>j</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
455                                                         </mml:mrow>
456                                                         <mml:mo mml:stretchy="false">⋅</mml:mo>
457                                                         <mml:mfenced mml:close="∣" mml:open="∣">
458                                                             <mml:msub>
459                                                                 <mml:mrow>
460                                                                     <mml:mo mml:stretchy="false">(</mml:mo>
461                                                                     <mml:mrow>
462                                                                         <mml:mi>z</mml:mi>
463                                                                         <mml:mrow>
464                                                                             <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>u</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
465                                                                         </mml:mrow>
466                                                                     </mml:mrow>
467                                                                     <mml:mo mml:stretchy="false">)</mml:mo>
468                                                                 </mml:mrow>
469                                                                 <mml:mrow>
470                                                                     <mml:mi mml:fontstyle="italic">ltol</mml:mi>
471                                                                     <mml:mrow>
472                                                                         <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>j</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
473                                                                     </mml:mrow>
474                                                                 </mml:mrow>
475                                                             </mml:msub>
476                                                         </mml:mfenced>
477                                                     </mml:mrow>
478                                                     <mml:mo mml:stretchy="false">+</mml:mo><mml:mi mml:fontstyle="italic">tol</mml:mi>
479                                                 </mml:mrow>
480                                                 <mml:mrow>
481                                                     <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>j</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
482                                                 </mml:mrow>
483                                                 <mml:mi>,</mml:mi><mml:mi mml:fontstyle="normal">for</mml:mi>
484                                                 <mml:mrow>
485                                                     <mml:mi>j</mml:mi><mml:mo mml:stretchy="false">=</mml:mo><mml:mn>1</mml:mn>
486                                                 </mml:mrow>
487                                                 <mml:mi mml:fontstyle="normal">:</mml:mi><mml:mi mml:fontstyle="normal">ntol</mml:mi>
488                                             </mml:mrow>
489                                             <mml:annotation mml:encoding="StarMath 5.0">abs(z(v)-z(u))_{ltol(j)}
490                                                 &lt;= tol(j) cdot abs(z(u))_{ltol(j)} + tol(j), for
491                                                 j=1:ntol
492                                             </mml:annotation>
493                                         </mml:semantics>
494                                     </mml:math>
495                                 </imagedata>
496                             </imageobject>
497                         </inlinemediaobject>
498                         on each subinterval
499                     </para>
500                     <para>
501                         where
502                         <inlinemediaobject>
503                             <imageobject>
504                                 <imagedata>
505                                     <mml:math>
506                                         <mml:semantics>
507                                             <mml:mi>v</mml:mi>
508                                         </mml:semantics>
509                                     </mml:math>
510                                 </imagedata>
511                             </imageobject>
512                         </inlinemediaobject>
513                         is the approximate solution vector and
514                         <inlinemediaobject>
515                             <imageobject>
516                                 <imagedata>
517                                     <mml:math>
518                                         <mml:semantics>
519                                             <mml:mi>u</mml:mi>
520                                         </mml:semantics>
521                                     </mml:math>
522                                 </imagedata>
523                             </imageobject>
524                         </inlinemediaobject>
525                         is the
526                         exact solution (unknown).
527                     </para>
528                 </listitem>
529             </varlistentry>
530             <varlistentry>
531                 <term>fixpnt</term>
532                 <listitem>
533                     <para>
534                         an array of dimension <literal>nfxpnt=ipar(11)</literal>. It
535                         contains the points, other than <literal>x_low</literal> and
536                         <literal>x_up</literal>, which are to be included in every mesh. The
537                         code requires that all side condition points other than
538                         <literal>x_low</literal> and <literal>x_up</literal> (see
539                         description of <literal>zeta</literal>) be included as fixed points in
540                         <literal>fixpnt</literal>.
541                     </para>
542                 </listitem>
543             </varlistentry>
544             <varlistentry>
545                 <term>fsub</term>
546                 <listitem>
547                     <para>
548                         an <link linkend="external">external</link> used to evaluate
549                         the column vector <literal>f=</literal>
550                         <inlinemediaobject>
551                             <imageobject>
552                                 <imagedata>
553                                     <mml:math>
554                                         <mml:semantics>
555                                             <mml:mrow>
556                                                 <mml:mo mml:stretchy="false">[</mml:mo>
557                                                 <mml:mrow>
558                                                     <mml:msub>
559                                                         <mml:mi>f</mml:mi><mml:mn>1</mml:mn>
560                                                     </mml:msub>
561                                                     <mml:mrow>
562                                                         <mml:mo mml:stretchy="false">(</mml:mo>
563                                                         <mml:mrow>
564                                                             <mml:mi>x</mml:mi><mml:mi>,</mml:mi><mml:mi>z</mml:mi>
565                                                             <mml:mrow>
566                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
567                                                                 <mml:mrow>
568                                                                     <mml:mi>u</mml:mi>
569                                                                     <mml:mrow>
570                                                                         <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
571                                                                     </mml:mrow>
572                                                                 </mml:mrow>
573                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
574                                                             </mml:mrow>
575                                                         </mml:mrow>
576                                                         <mml:mo mml:stretchy="false">)</mml:mo>
577                                                     </mml:mrow>
578                                                     <mml:mi>;</mml:mi>
579                                                     <mml:msub>
580                                                         <mml:mi>f</mml:mi><mml:mn>2</mml:mn>
581                                                     </mml:msub>
582                                                     <mml:mrow>
583                                                         <mml:mo mml:stretchy="false">(</mml:mo>
584                                                         <mml:mrow>
585                                                             <mml:mi>x</mml:mi><mml:mi>,</mml:mi><mml:mi>z</mml:mi>
586                                                             <mml:mrow>
587                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
588                                                                 <mml:mrow>
589                                                                     <mml:mi>u</mml:mi>
590                                                                     <mml:mrow>
591                                                                         <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
592                                                                     </mml:mrow>
593                                                                 </mml:mrow>
594                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
595                                                             </mml:mrow>
596                                                         </mml:mrow>
597                                                         <mml:mo mml:stretchy="false">)</mml:mo>
598                                                     </mml:mrow>
599                                                     <mml:mi>,</mml:mi><mml:mo mml:stretchy="false">⋯</mml:mo><mml:mi>,</mml:mi>
600                                                     <mml:msub>
601                                                         <mml:mi>f</mml:mi><mml:mi>N</mml:mi>
602                                                     </mml:msub>
603                                                     <mml:mrow>
604                                                         <mml:mo mml:stretchy="false">(</mml:mo>
605                                                         <mml:mrow>
606                                                             <mml:mi>x</mml:mi><mml:mi>,</mml:mi><mml:mi>z</mml:mi>
607                                                             <mml:mrow>
608                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
609                                                                 <mml:mrow>
610                                                                     <mml:mi>u</mml:mi>
611                                                                     <mml:mrow>
612                                                                         <mml:mo mml:stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo mml:stretchy="false">)</mml:mo>
613                                                                     </mml:mrow>
614                                                                 </mml:mrow>
615                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
616                                                             </mml:mrow>
617                                                         </mml:mrow>
618                                                         <mml:mo mml:stretchy="false">)</mml:mo>
619                                                     </mml:mrow>
620                                                 </mml:mrow>
621                                                 <mml:mo mml:stretchy="false">]</mml:mo>
622                                             </mml:mrow>
623                                             <mml:annotation mml:encoding="StarMath 5.0">[f_1(x,z(u(x)));
624                                                 f_2(x,z(u(x))),dotsaxis,
625                                                 f_N(x,z(u(x)))]
626                                             </mml:annotation>
627                                         </mml:semantics>
628                                     </mml:math>
629                                 </imagedata>
630                             </imageobject>
631                         </inlinemediaobject>
632                         for any <literal>x</literal> such as <literal>x_low</literal> &lt;= <literal>x</literal> &lt;= <literal>x_up</literal>
633                         and for any <literal>z=z(u(x))</literal> (see description below).
634                     </para>
635                     <para>The external must have the headings:</para>
636                     <itemizedlist>
637                         <listitem>
638                             <para>In Fortran the calling sequence must be:</para>
639                             <screen><![CDATA[
640 subroutine fsub(x,zu,f)
641 double precision zu(*), f(*),x
642 ]]></screen>
643                         </listitem>
644                         <listitem>
645                             <para>In C the function prototype must be:</para>
646                             <screen><![CDATA[
647 void fsub(double *x, double *zu, double *f)
648 ]]></screen>
649                         </listitem>
650                         <listitem>
651                             <para>And in Scilab:</para>
652                             <screen><![CDATA[
653 function f = fsub(x,zu,parameters)
654 ]]></screen>
655                         </listitem>
656                     </itemizedlist>
657                 </listitem>
658             </varlistentry>
659             <varlistentry>
660                 <term>dfsub</term>
661                 <listitem>
662                     <para>
663                         an <link linkend="external">external</link> used to evaluate
664                         the Jacobian of <literal>f(x,z(u))</literal> at a point <literal>x</literal>. Where
665                         <literal>z(u(x))</literal> is defined as for <literal>fsub</literal>
666                         and the <literal>N</literal> by <literal>M</literal> array <literal>df</literal>
667                         should be filled by the partial derivatives of <literal>f</literal>:
668                     </para>
669                     <informalequation>
670                         <mediaobject>
671                             <imageobject>
672                                 <imagedata align="center">
673                                     <mml:math>
674                                         <mml:semantics>
675                                             <mml:mrow>
676                                                 <mml:mi mml:fontstyle="italic">df</mml:mi>
677                                                 <mml:mrow>
678                                                     <mml:mrow>
679                                                         <mml:mo mml:stretchy="false">(</mml:mo>
680                                                         <mml:mrow>
681                                                             <mml:mi>i</mml:mi>
682                                                             <mml:mi>,</mml:mi>
683                                                             <mml:mi>j</mml:mi>
684                                                         </mml:mrow>
685                                                         <mml:mo mml:stretchy="false">)</mml:mo>
686                                                     </mml:mrow>
687                                                     <mml:mo mml:stretchy="false">=</mml:mo>
688                                                     <mml:mfrac>
689                                                         <mml:mrow>
690                                                             <mml:mo mml:stretchy="false">∂</mml:mo>
691                                                             <mml:msub>
692                                                                 <mml:mi>f</mml:mi>
693                                                                 <mml:mi>i</mml:mi>
694                                                             </mml:msub>
695                                                         </mml:mrow>
696                                                         <mml:mrow>
697                                                             <mml:mo mml:stretchy="false">∂</mml:mo>
698                                                             <mml:msub>
699                                                                 <mml:mi>z</mml:mi>
700                                                                 <mml:mi>j</mml:mi>
701                                                             </mml:msub>
702                                                         </mml:mrow>
703                                                     </mml:mfrac>
704                                                 </mml:mrow>
705                                                 <mml:mtext> for
706                                                 </mml:mtext>
707                                                 <mml:mrow>
708                                                     <mml:mo mml:stretchy="true">{</mml:mo>
709                                                     <mml:mtable>
710                                                         <mml:mtr>
711                                                             <mml:mrow>
712                                                                 <mml:mrow>
713                                                                     <mml:mi>i</mml:mi>
714                                                                     <mml:mo mml:stretchy="false">=</mml:mo>
715                                                                     <mml:mn>1</mml:mn>
716                                                                 </mml:mrow>
717                                                                 <mml:mi mml:fontstyle="normal">:</mml:mi>
718                                                                 <mml:mi mml:fontstyle="italic">N</mml:mi>
719                                                             </mml:mrow>
720                                                         </mml:mtr>
721                                                         <mml:mtr>
722                                                             <mml:mrow>
723                                                                 <mml:mrow>
724                                                                     <mml:mi>j</mml:mi>
725                                                                     <mml:mo mml:stretchy="false">=</mml:mo>
726                                                                     <mml:mn>1</mml:mn>
727                                                                 </mml:mrow>
728                                                                 <mml:mi mml:fontstyle="normal">:</mml:mi>
729                                                                 <mml:mi mml:fontstyle="italic">M</mml:mi>
730                                                             </mml:mrow>
731                                                         </mml:mtr>
732                                                     </mml:mtable>
733                                                 </mml:mrow>
734                                             </mml:mrow>
735                                             <mml:annotation mml:encoding="StarMath 5.0">df(i,j)= {partial{f_i}} over
736                                                 {partial{z_j}} ~ for ~ left lbrace binom{i=1:N}{j=1:M} right
737                                                 none
738                                             </mml:annotation>
739                                         </mml:semantics>
740                                     </mml:math>
741                                 </imagedata>
742                             </imageobject>
743                         </mediaobject>
744                     </informalequation>
745                     <para>The external must have the headings:</para>
746                     <itemizedlist>
747                         <listitem>
748                             <para>In Fortran the calling sequence must be:</para>
749                             <screen><![CDATA[
750 subroutine dfsub(x,zu,df)
751 double precision zu(*), df(*),x
752 ]]></screen>
753                         </listitem>
754                         <listitem>
755                             <para>In C the function prototype must be:</para>
756                             <screen><![CDATA[
757 void dfsub(double *x, double *zu, double *df)
758 ]]></screen>
759                         </listitem>
760                         <listitem>
761                             <para>And in Scilab:</para>
762                             <screen><![CDATA[
763 function df = dfsub(x,zu,parameters)
764 ]]></screen>
765                         </listitem>
766                     </itemizedlist>
767                 </listitem>
768             </varlistentry>
769             <varlistentry>
770                 <term>gsub</term>
771                 <listitem>
772                     <para>
773                         an <link linkend="external">external</link> used to evaluate
774                         <inlinemediaobject>
775                             <imageobject>
776                                 <imagedata>
777                                     <mml:math>
778                                         <mml:semantics>
779                                             <mml:mrow>
780                                                 <mml:msub>
781                                                     <mml:mi>g</mml:mi><mml:mi>i</mml:mi>
782                                                 </mml:msub>
783                                                 <mml:mrow>
784                                                     <mml:mo mml:stretchy="false">(</mml:mo>
785                                                     <mml:mrow>
786                                                         <mml:msub>
787                                                             <mml:mo mml:stretchy="false">ζ</mml:mo><mml:mi>i</mml:mi>
788                                                         </mml:msub>
789                                                         <mml:mi>,</mml:mi><mml:mi>z</mml:mi>
790                                                         <mml:mrow>
791                                                             <mml:mo mml:stretchy="false">(</mml:mo>
792                                                             <mml:mrow>
793                                                                 <mml:mi>u</mml:mi>
794                                                                 <mml:mrow>
795                                                                     <mml:mo mml:stretchy="false">(</mml:mo>
796                                                                     <mml:msub>
797                                                                         <mml:mo mml:stretchy="false">ζ</mml:mo><mml:mi>i</mml:mi>
798                                                                     </mml:msub>
799                                                                     <mml:mo mml:stretchy="false">)</mml:mo>
800                                                                 </mml:mrow>
801                                                             </mml:mrow>
802                                                             <mml:mo mml:stretchy="false">)</mml:mo>
803                                                         </mml:mrow>
804                                                     </mml:mrow>
805                                                     <mml:mo mml:stretchy="false">)</mml:mo>
806                                                 </mml:mrow>
807                                             </mml:mrow>
808                                             <mml:annotation mml:encoding="StarMath 5.0">g_i(%zeta_i,z(u(%zeta_i)))</mml:annotation>
809                                         </mml:semantics>
810                                     </mml:math>
811                                 </imagedata>
812                             </imageobject>
813                         </inlinemediaobject>
814                         given z=
815                         <inlinemediaobject>
816                             <imageobject>
817                                 <imagedata>
818                                     <mml:math>
819                                         <mml:semantics>
820                                             <mml:mrow>
821                                                 <mml:mi>z</mml:mi>
822                                                 <mml:mrow>
823                                                     <mml:mo mml:stretchy="false">(</mml:mo>
824                                                     <mml:mrow>
825                                                         <mml:mi>u</mml:mi>
826                                                         <mml:mrow>
827                                                             <mml:mo mml:stretchy="false">(</mml:mo>
828                                                             <mml:msub>
829                                                                 <mml:mo mml:stretchy="false">ζ</mml:mo><mml:mi>i</mml:mi>
830                                                             </mml:msub>
831                                                             <mml:mo mml:stretchy="false">)</mml:mo>
832                                                         </mml:mrow>
833                                                     </mml:mrow>
834                                                     <mml:mo mml:stretchy="false">)</mml:mo>
835                                                 </mml:mrow>
836                                             </mml:mrow>
837                                             <mml:annotation mml:encoding="StarMath 5.0">z(u(%zeta_i))</mml:annotation>
838                                         </mml:semantics>
839                                     </mml:math>
840                                 </imagedata>
841                             </imageobject>
842                         </inlinemediaobject>
843                         <literal>z = zeta(i)</literal> for
844                         <literal>1&lt;=i&lt;=M.</literal>
845                     </para>
846                     <para>The external must have the headings:</para>
847                     <itemizedlist>
848                         <listitem>
849                             <para>In Fortran the calling sequence must be:</para>
850                             <screen><![CDATA[
851 subroutine gsub(i,zu,g)
852 double precision zu(*), g(*)
853 integer i
854 ]]></screen>
855                         </listitem>
856                         <listitem>
857                             <para>In C the function prototype must be:</para>
858                             <screen><![CDATA[
859 void gsub(int *i, double *zu, double *g)
860 ]]></screen>
861                         </listitem>
862                         <listitem>
863                             <para>And in Scilab:</para>
864                             <screen><![CDATA[
865 function g = gsub(i,zu,parameters)
866 ]]></screen>
867                             <para>
868                                 Note that in contrast to <literal>f</literal> in <literal>fsub</literal>, here only one value per call is returned in <literal>g</literal>.
869                             </para>
870                         </listitem>
871                     </itemizedlist>
872                 </listitem>
873             </varlistentry>
874             <varlistentry>
875                 <term>dgsub</term>
876                 <listitem>
877                     <para>
878                         an <link linkend="external">external</link> used to evaluate
879                         the <literal>i</literal>-th row of the Jacobian of <literal>g(x,u(x))</literal>. Where
880                         <literal>z(u)</literal> is as for <literal>fsub</literal>, <literal>i</literal> as for
881                         <literal>gsub</literal> and the <literal>M</literal>-vector <literal>dg</literal> should
882                         be filled with the partial derivatives of <literal>g</literal>, viz, for a particular call one
883                         calculates
884                     </para>
885                     <informalequation>
886                         <mediaobject>
887                             <imageobject>
888                                 <imagedata align="center">
889                                     <mml:math>
890                                         <mml:semantics>
891                                             <mml:mrow>
892                                                 <mml:mi mml:fontstyle="italic">dg</mml:mi>
893                                                 <mml:mrow>
894                                                     <mml:mrow>
895                                                         <mml:mo mml:stretchy="false">(</mml:mo>
896                                                         <mml:mrow>
897                                                             <mml:mi>i</mml:mi>
898                                                             <mml:mi>,</mml:mi>
899                                                             <mml:mi>j</mml:mi>
900                                                         </mml:mrow>
901                                                         <mml:mo mml:stretchy="false">)</mml:mo>
902                                                     </mml:mrow>
903                                                     <mml:mo mml:stretchy="false">=</mml:mo>
904                                                     <mml:mfrac>
905                                                         <mml:mrow>
906                                                             <mml:mo mml:stretchy="false">∂</mml:mo>
907                                                             <mml:msub>
908                                                                 <mml:mi>g</mml:mi>
909                                                                 <mml:mi>i</mml:mi>
910                                                             </mml:msub>
911                                                         </mml:mrow>
912                                                         <mml:mrow>
913                                                             <mml:mo mml:stretchy="false">∂</mml:mo>
914                                                             <mml:msub>
915                                                                 <mml:mi>z</mml:mi>
916                                                                 <mml:mi>j</mml:mi>
917                                                             </mml:msub>
918                                                         </mml:mrow>
919                                                     </mml:mfrac>
920                                                 </mml:mrow>
921                                                 <mml:mtext> for
922                                                 </mml:mtext>
923                                                 <mml:mrow>
924                                                     <mml:mo mml:stretchy="true">{</mml:mo>
925                                                     <mml:mtable>
926                                                         <mml:mtr>
927                                                             <mml:mrow>
928                                                                 <mml:mrow>
929                                                                     <mml:mi>i</mml:mi>
930                                                                     <mml:mo mml:stretchy="false">=</mml:mo>
931                                                                     <mml:mn>1</mml:mn>
932                                                                 </mml:mrow>
933                                                                 <mml:mi mml:fontstyle="normal">:</mml:mi>
934                                                                 <mml:mi mml:fontstyle="italic">M</mml:mi>
935                                                             </mml:mrow>
936                                                         </mml:mtr>
937                                                         <mml:mtr>
938                                                             <mml:mrow>
939                                                                 <mml:mrow>
940                                                                     <mml:mi>j</mml:mi>
941                                                                     <mml:mo mml:stretchy="false">=</mml:mo>
942                                                                     <mml:mn>1</mml:mn>
943                                                                 </mml:mrow>
944                                                                 <mml:mi mml:fontstyle="normal">:</mml:mi>
945                                                                 <mml:mi mml:fontstyle="italic">M</mml:mi>
946                                                             </mml:mrow>
947                                                         </mml:mtr>
948                                                     </mml:mtable>
949                                                 </mml:mrow>
950                                             </mml:mrow>
951                                             <mml:annotation mml:encoding="StarMath 5.0">dg(i,j)= {partial{g_i}} over
952                                                 {partial{z_j}} ~ for ~ left lbrace binom{i=1:M}{j=1:M} right
953                                                 none
954                                             </mml:annotation>
955                                         </mml:semantics>
956                                     </mml:math>
957                                 </imagedata>
958                             </imageobject>
959                         </mediaobject>
960                     </informalequation>
961                     <para>The external must have the headings:</para>
962                     <itemizedlist>
963                         <listitem>
964                             <para>In Fortran the calling sequence must be:</para>
965                             <screen><![CDATA[
966 subroutine dgsub(i,zu,dg)
967 double precision zu(*), dg(*)
968 ]]></screen>
969                         </listitem>
970                         <listitem>
971                             <para>In C the function prototype must be</para>
972                             <screen><![CDATA[
973 void dgsub(int *i, double *zu, double *dg)
974 ]]></screen>
975                         </listitem>
976                         <listitem>
977                             <para>And in Scilab </para>
978                             <screen><![CDATA[
979 function dg = dgsub(i,zu,parameters)
980 ]]></screen>
981                         </listitem>
982                     </itemizedlist>
983                 </listitem>
984             </varlistentry>
985             <varlistentry>
986                 <term>guess</term>
987                 <listitem>
988                     <para>
989                         An <link linkend="external">external</link> used to evaluate
990                         the initial approximation for <literal>z(u(x))</literal> and
991                         <literal>dmval(u(x))</literal> the vector of the <literal>mj</literal>-th derivatives
992                         of <literal>u(x)</literal>. Note that this subroutine is used only
993                         if <literal>ipar(9) = 1</literal>, and then all <literal>M</literal>
994                         components of  <literal>zu</literal> and <literal>N</literal> components of <literal>dmval</literal> should be computed for
995                         any <literal>x</literal> such as <literal>x_low</literal> &lt;= <literal>x</literal> &lt;= <literal>x_up</literal>.
996                     </para>
997                     <para>The external must have the headings:</para>
998                     <itemizedlist>
999                         <listitem>
1000                             <para>In Fortran the calling sequence must be:</para>
1001                             <screen><![CDATA[
1002 subroutine guess(x,zu,dmval)
1003 double precision x,z(*), dmval(*)
1004 ]]></screen>
1005                         </listitem>
1006                         <listitem>
1007                             <para>In C the function prototype must be</para>
1008                             <screen><![CDATA[
1009 void fsub(double *x, double *zu, double *dmval)
1010 ]]></screen>
1011                         </listitem>
1012                         <listitem>
1013                             <para>And in Scilab </para>
1014                             <screen><![CDATA[
1015 function [dmval,zu] = fsub(x,parameters)
1016 ]]></screen>
1017                         </listitem>
1018                     </itemizedlist>
1019                 </listitem>
1020             </varlistentry>
1021             <varlistentry>
1022                 <term>&lt;optional_args&gt;</term>
1023                 <listitem>
1024                     <para>It should be either:</para>
1025                     <itemizedlist>
1026                         <listitem>
1027                             <para>any left part of the ordered sequence of values:
1028                                 <literal>guess, dfsub, dgsub, fixpnt, ndimf, ndimi, ltol, tol,
1029                                     ntol,nonlin, collpnt, subint, iprint, ireg, ifail
1030                                 </literal>
1031                             </para>
1032                         </listitem>
1033                         <listitem>
1034                             <para>
1035                                 or any sequence of <literal>arg_name=argvalue</literal>
1036                                 with <literal>arg_name</literal> in: <literal>guess</literal>,
1037                                 <literal>dfsub</literal>, <literal>dgsub</literal>,
1038                                 <literal>fixpnt</literal>, <literal>ndimf</literal>,
1039                                 <literal>ndimi</literal>, <literal>ltol</literal>,
1040                                 <literal>tol</literal>, <literal>ntol</literal>,
1041                                 <literal>nonlin</literal>, <literal>collpnt</literal>,
1042                                 <literal>subint</literal>, <literal>iprint</literal>,
1043                                 <literal>ireg</literal>, <literal>ifail</literal>
1044                             </para>
1045                         </listitem>
1046                     </itemizedlist>
1047                     <para>
1048                         where all these arguments excepted <literal>ifail</literal> are
1049                         described above. <literal>ifail</literal> can be used to display the
1050                         bvode call corresponding to the selected optional arguments. If
1051                         <literal>guess</literal> is given <literal>iguess</literal> is set to
1052                         1
1053                     </para>
1054                 </listitem>
1055             </varlistentry>
1056         </variablelist>
1057     </refsection>
1058     <refsection>
1059         <title>Description</title>
1060         <para>These functions solve a multi-point boundary value problem for a
1061             mixed order system of ode-s given by
1062         </para>
1063         <informalequation>
1064             <mediaobject>
1065                 <imageobject>
1066                     <imagedata align="left">
1067                         <mml:math>
1068                             <mml:semantics>
1069                                 <mml:mrow>
1070                                     <mml:mo mml:stretchy="true">{</mml:mo>
1071                                     <mml:mtable>
1072                                         <mml:mtr>
1073                                             <mml:mrow>
1074                                                 <mml:mrow>
1075                                                     <mml:msubsup>
1076                                                         <mml:mi>u</mml:mi>
1077                                                         <mml:mi>i</mml:mi>
1078                                                         <mml:mrow>
1079                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1080                                                             <mml:msub>
1081                                                                 <mml:mi>m</mml:mi>
1082                                                                 <mml:mi>i</mml:mi>
1083                                                             </mml:msub>
1084                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1085                                                         </mml:mrow>
1086                                                     </mml:msubsup>
1087                                                     <mml:mo mml:stretchy="false">=</mml:mo>
1088                                                     <mml:msub>
1089                                                         <mml:mi>f</mml:mi>
1090                                                         <mml:mi>i</mml:mi>
1091                                                     </mml:msub>
1092                                                 </mml:mrow>
1093                                                 <mml:mrow>
1094                                                     <mml:mo mml:stretchy="false">(</mml:mo>
1095                                                     <mml:mrow>
1096                                                         <mml:mi>x</mml:mi>
1097                                                         <mml:mi>,</mml:mi>
1098                                                         <mml:mi>z</mml:mi>
1099                                                         <mml:mrow>
1100                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1101                                                             <mml:mrow>
1102                                                                 <mml:mi>u</mml:mi>
1103                                                                 <mml:mrow>
1104                                                                     <mml:mo mml:stretchy="false">(</mml:mo>
1105                                                                     <mml:mi>x</mml:mi>
1106                                                                     <mml:mo mml:stretchy="false">)</mml:mo>
1107                                                                 </mml:mrow>
1108                                                             </mml:mrow>
1109                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1110                                                         </mml:mrow>
1111                                                     </mml:mrow>
1112                                                     <mml:mo mml:stretchy="false">)</mml:mo>
1113                                                 </mml:mrow>
1114                                                 <mml:mi/>
1115                                                 <mml:mrow>
1116                                                     <mml:mo mml:stretchy="true">{</mml:mo>
1117                                                     <mml:mtable>
1118                                                         <mml:mtr>
1119                                                             <mml:mrow>
1120                                                                 <mml:mrow>
1121                                                                     <mml:mi>i</mml:mi>
1122                                                                     <mml:mo mml:stretchy="false">=</mml:mo>
1123                                                                     <mml:mn>1</mml:mn>
1124                                                                 </mml:mrow>
1125                                                                 <mml:mi mml:fontstyle="normal">:</mml:mi>
1126                                                                 <mml:mi>N</mml:mi>
1127                                                             </mml:mrow>
1128                                                         </mml:mtr>
1129                                                         <mml:mtr>
1130                                                             <mml:mrow>
1131                                                                 <mml:mi>x</mml:mi>
1132                                                                 <mml:mo mml:stretchy="false">∈</mml:mo>
1133                                                                 <mml:mfenced mml:close="[" mml:open="]">
1134                                                                     <mml:mrow>
1135                                                                         <mml:msub>
1136                                                                             <mml:mi>x</mml:mi>
1137                                                                             <mml:mi>l</mml:mi>
1138                                                                         </mml:msub>
1139                                                                         <mml:mi>,</mml:mi>
1140                                                                         <mml:msub>
1141                                                                             <mml:mi>x</mml:mi>
1142                                                                             <mml:mi>u</mml:mi>
1143                                                                         </mml:msub>
1144                                                                     </mml:mrow>
1145                                                                 </mml:mfenced>
1146                                                             </mml:mrow>
1147                                                         </mml:mtr>
1148                                                     </mml:mtable>
1149                                                 </mml:mrow>
1150                                             </mml:mrow>
1151                                         </mml:mtr>
1152                                         <mml:mtr>
1153                                             <mml:mi/>
1154                                         </mml:mtr>
1155                                         <mml:mtr>
1156                                             <mml:mrow>
1157                                                 <mml:msub>
1158                                                     <mml:mi>g</mml:mi>
1159                                                     <mml:mi>j</mml:mi>
1160                                                 </mml:msub>
1161                                                 <mml:mrow>
1162                                                     <mml:mrow>
1163                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1164                                                         <mml:mrow>
1165                                                             <mml:msub>
1166                                                                 <mml:mo mml:stretchy="false">ζ</mml:mo>
1167                                                                 <mml:mi>j</mml:mi>
1168                                                             </mml:msub>
1169                                                             <mml:mi>,</mml:mi>
1170                                                             <mml:mi>z</mml:mi>
1171                                                             <mml:mrow>
1172                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1173                                                                 <mml:mrow>
1174                                                                     <mml:mi>u</mml:mi>
1175                                                                     <mml:mrow>
1176                                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1177                                                                         <mml:msub>
1178                                                                             <mml:mo mml:stretchy="false">ζ</mml:mo>
1179                                                                             <mml:mi>j</mml:mi>
1180                                                                         </mml:msub>
1181                                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1182                                                                     </mml:mrow>
1183                                                                 </mml:mrow>
1184                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1185                                                             </mml:mrow>
1186                                                         </mml:mrow>
1187                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1188                                                     </mml:mrow>
1189                                                     <mml:mo mml:stretchy="false">=</mml:mo>
1190                                                     <mml:mn>0</mml:mn>
1191                                                 </mml:mrow>
1192                                                 <mml:mi/>
1193                                                 <mml:mrow>
1194                                                     <mml:mtext>,</mml:mtext>
1195                                                     <mml:mi>j</mml:mi>
1196                                                     <mml:mo mml:stretchy="false">=</mml:mo>
1197                                                     <mml:mn>1</mml:mn>
1198                                                 </mml:mrow>
1199                                                 <mml:mi mml:fontstyle="normal">:</mml:mi>
1200                                                 <mml:mi>M</mml:mi>
1201                                             </mml:mrow>
1202                                         </mml:mtr>
1203                                     </mml:mtable>
1204                                 </mml:mrow>
1205                                 <mml:annotation mml:encoding="StarMath 5.0">left lbrace
1206                                     stack{u_i^(m_i)=f_i(x,z(u(x))) ~~left lbrace { binom{i=1:N}{x
1207                                     in left ] a_l, a_u right [} } right none# `#
1208                                     g_j(%zeta_j,z(u(%zeta_j))) = 0~~j=1:M} right
1209                                     none
1210                                 </mml:annotation>
1211                             </mml:semantics>
1212                         </mml:math>
1213                     </imagedata>
1214                 </imageobject>
1215             </mediaobject>
1216         </informalequation>
1217         <para>where</para>
1218         <mediaobject>
1219             <imageobject>
1220                 <imagedata align="left">
1221                     <mml:math>
1222                         <mml:semantics>
1223                             <mml:mrow>
1224                                 <mml:mo mml:stretchy="true">{</mml:mo>
1225                                 <mml:mtable>
1226                                     <mml:mtr>
1227                                         <mml:mrow>
1228                                             <mml:mi>M</mml:mi>
1229                                             <mml:mo mml:stretchy="false">=</mml:mo>
1230                                             <mml:mrow>
1231                                                 <mml:munderover>
1232                                                     <mml:mo mml:stretchy="false">∑</mml:mo>
1233                                                     <mml:mrow>
1234                                                         <mml:mi>i</mml:mi>
1235                                                         <mml:mo mml:stretchy="false">=</mml:mo>
1236                                                         <mml:mn>1</mml:mn>
1237                                                     </mml:mrow>
1238                                                     <mml:mi>N</mml:mi>
1239                                                 </mml:munderover>
1240                                                 <mml:msub>
1241                                                     <mml:mi>m</mml:mi>
1242                                                     <mml:mi>i</mml:mi>
1243                                                 </mml:msub>
1244                                             </mml:mrow>
1245                                         </mml:mrow>
1246                                     </mml:mtr>
1247                                     <mml:mtr>
1248                                         <mml:mi/>
1249                                     </mml:mtr>
1250                                     <mml:mtr>
1251                                         <mml:mrow>
1252                                             <mml:mi>z</mml:mi>
1253                                             <mml:mrow>
1254                                                 <mml:mrow>
1255                                                     <mml:mo mml:stretchy="false">(</mml:mo>
1256                                                     <mml:mrow>
1257                                                         <mml:mi>u</mml:mi>
1258                                                         <mml:mrow>
1259                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1260                                                             <mml:mi>x</mml:mi>
1261                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1262                                                         </mml:mrow>
1263                                                     </mml:mrow>
1264                                                     <mml:mo mml:stretchy="false">)</mml:mo>
1265                                                 </mml:mrow>
1266                                                 <mml:mo mml:stretchy="false">=</mml:mo>
1267                                                 <mml:mrow>
1268                                                     <mml:mo mml:stretchy="false">[</mml:mo>
1269                                                     <mml:mrow>
1270                                                         <mml:msub>
1271                                                             <mml:mi>u</mml:mi>
1272                                                             <mml:mn>1</mml:mn>
1273                                                         </mml:msub>
1274                                                         <mml:mrow>
1275                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1276                                                             <mml:mi>x</mml:mi>
1277                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1278                                                         </mml:mrow>
1279                                                         <mml:mi>;</mml:mi>
1280                                                         <mml:msubsup>
1281                                                             <mml:mi>u</mml:mi>
1282                                                             <mml:mn>1</mml:mn>
1283                                                             <mml:mn>1</mml:mn>
1284                                                         </mml:msubsup>
1285                                                         <mml:mrow>
1286                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1287                                                             <mml:mi>x</mml:mi>
1288                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1289                                                         </mml:mrow>
1290                                                         <mml:mi>;</mml:mi>
1291                                                         <mml:mo mml:stretchy="false">⋯</mml:mo>
1292                                                         <mml:msubsup>
1293                                                             <mml:mi>u</mml:mi>
1294                                                             <mml:mn>1</mml:mn>
1295                                                             <mml:mrow>
1296                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1297                                                                 <mml:mrow>
1298                                                                     <mml:msub>
1299                                                                         <mml:mi>m</mml:mi>
1300                                                                         <mml:mn>1</mml:mn>
1301                                                                     </mml:msub>
1302                                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1303                                                                     <mml:mn>1</mml:mn>
1304                                                                 </mml:mrow>
1305                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1306                                                             </mml:mrow>
1307                                                         </mml:msubsup>
1308                                                         <mml:mrow>
1309                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1310                                                             <mml:mi>x</mml:mi>
1311                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1312                                                         </mml:mrow>
1313                                                         <mml:mi>;</mml:mi>
1314                                                         <mml:mi/>
1315                                                         <mml:mo mml:stretchy="false">⋯</mml:mo>
1316                                                         <mml:mi>;</mml:mi>
1317                                                         <mml:mi/>
1318                                                         <mml:msub>
1319                                                             <mml:mi>u</mml:mi>
1320                                                             <mml:mi>N</mml:mi>
1321                                                         </mml:msub>
1322                                                         <mml:mrow>
1323                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1324                                                             <mml:mi>x</mml:mi>
1325                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1326                                                         </mml:mrow>
1327                                                         <mml:mi>;</mml:mi>
1328                                                         <mml:msubsup>
1329                                                             <mml:mi>u</mml:mi>
1330                                                             <mml:mi>N</mml:mi>
1331                                                             <mml:mn>1</mml:mn>
1332                                                         </mml:msubsup>
1333                                                         <mml:mrow>
1334                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1335                                                             <mml:mi>x</mml:mi>
1336                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1337                                                         </mml:mrow>
1338                                                         <mml:mi>;</mml:mi>
1339                                                         <mml:mo mml:stretchy="false">⋯</mml:mo>
1340                                                         <mml:mi>;</mml:mi>
1341                                                         <mml:msubsup>
1342                                                             <mml:mi>u</mml:mi>
1343                                                             <mml:mi>N</mml:mi>
1344                                                             <mml:mrow>
1345                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1346                                                                 <mml:mrow>
1347                                                                     <mml:msub>
1348                                                                         <mml:mi>m</mml:mi>
1349                                                                         <mml:mi>N</mml:mi>
1350                                                                     </mml:msub>
1351                                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1352                                                                     <mml:mn>1</mml:mn>
1353                                                                 </mml:mrow>
1354                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1355                                                             </mml:mrow>
1356                                                         </mml:msubsup>
1357                                                         <mml:mrow>
1358                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1359                                                             <mml:mi>x</mml:mi>
1360                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1361                                                         </mml:mrow>
1362                                                     </mml:mrow>
1363                                                     <mml:mo mml:stretchy="false">]</mml:mo>
1364                                                 </mml:mrow>
1365                                             </mml:mrow>
1366                                         </mml:mrow>
1367                                     </mml:mtr>
1368                                     <mml:mtr>
1369                                         <mml:mi/>
1370                                     </mml:mtr>
1371                                     <mml:mtr>
1372                                         <mml:mrow>
1373                                             <mml:mrow>
1374                                                 <mml:mrow>
1375                                                     <mml:mrow>
1376                                                         <mml:msub>
1377                                                             <mml:mi>x</mml:mi>
1378                                                             <mml:mi>l</mml:mi>
1379                                                         </mml:msub>
1380                                                         <mml:mo mml:stretchy="false">≤</mml:mo>
1381                                                         <mml:msub>
1382                                                             <mml:mo mml:stretchy="false">ζ</mml:mo>
1383                                                             <mml:mn>1</mml:mn>
1384                                                         </mml:msub>
1385                                                     </mml:mrow>
1386                                                     <mml:mo mml:stretchy="false">≤</mml:mo>
1387                                                     <mml:mo mml:stretchy="false">⋯</mml:mo>
1388                                                 </mml:mrow>
1389                                                 <mml:mo mml:stretchy="false">≤</mml:mo>
1390                                                 <mml:msub>
1391                                                     <mml:mo mml:stretchy="false">ζ</mml:mo>
1392                                                     <mml:mi>M</mml:mi>
1393                                                 </mml:msub>
1394                                             </mml:mrow>
1395                                             <mml:mo mml:stretchy="false">≤</mml:mo>
1396                                             <mml:msub>
1397                                                 <mml:mi>x</mml:mi>
1398                                                 <mml:mi>u</mml:mi>
1399                                             </mml:msub>
1400                                         </mml:mrow>
1401                                     </mml:mtr>
1402                                 </mml:mtable>
1403                             </mml:mrow>
1404                             <mml:annotation mml:encoding="StarMath 5.0">left lbrace stack
1405                                 { M= sum from {i=1} to {N} m_i # ~# z(u(x)) =
1406                                 [u_1(x);u_1^{1}(x);dotsaxis u_1^(m_1-1)(x);~ dotsaxis;
1407                                 ~u_N(x);u_N^{1}(x);dotsaxis; u_N^(m_N-1)(x)]# ~# x_l &lt;=
1408                                 %zeta_1 &lt;= dotsaxis &lt;= %zeta_M &lt;=x_u}right
1409                                 none
1410                             </mml:annotation>
1411                         </mml:semantics>
1412                     </mml:math>
1413                 </imagedata>
1414             </imageobject>
1415         </mediaobject>
1416         <para>
1417             The argument <literal>zu</literal> used by the external functions
1418             and returned by <literal>bvode</literal> is the column vector formed by
1419             the components of <literal>z(u(x))</literal> for a given <literal>x</literal>.
1420         </para>
1421         <para>
1422             The method used to approximate the solution <literal>u</literal> is collocation at
1423             gaussian points, requiring <literal>m(i)-1</literal> continuous derivatives in the <literal>i</literal>-th
1424             component, <literal>i = 1:N</literal>. here, <literal>k</literal> is the number of collocation points (stages)
1425             per subinterval and is chosen such that <emphasis>k ≥ max(m(i))</emphasis>.
1426             A runge-kutta-monomial solution representation is utilized.
1427         </para>
1428     </refsection>
1429     <refsection>
1430         <title>Examples</title>
1431         <para>The first two problems below are taken from the paper [1] of the
1432             Bibliography.
1433         </para>
1434         <itemizedlist>
1435             <listitem>
1436                 <para>
1437                     <emphasis role="bold">The problem 1</emphasis> describes a
1438                     uniformly loaded beam of variable stiffness, simply supported at both
1439                     end.
1440                 </para>
1441                 <para>It may be defined as follow :</para>
1442                 <para>Solve the fourth order differential equation:</para>
1443                 <mediaobject>
1444                     <imageobject>
1445                         <imagedata align="left">
1446                             <mml:math>
1447                                 <mml:semantics>
1448                                     <mml:mrow>
1449                                         <mml:mfrac>
1450                                             <mml:msup>
1451                                                 <mml:mi>d</mml:mi>
1452                                                 <mml:mn>4</mml:mn>
1453                                             </mml:msup>
1454                                             <mml:mrow>
1455                                                 <mml:mi>d</mml:mi>
1456                                                 <mml:msup>
1457                                                     <mml:mi>x</mml:mi>
1458                                                     <mml:mn>4</mml:mn>
1459                                                 </mml:msup>
1460                                             </mml:mrow>
1461                                         </mml:mfrac>
1462                                         <mml:mi>u</mml:mi>
1463                                         <mml:mrow>
1464                                             <mml:mrow>
1465                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1466                                                 <mml:mi>x</mml:mi>
1467                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1468                                             </mml:mrow>
1469                                             <mml:mo mml:stretchy="false">=</mml:mo>
1470                                             <mml:mfrac>
1471                                                 <mml:mrow>
1472                                                     <mml:mrow>
1473                                                         <mml:mn>1</mml:mn>
1474                                                         <mml:mo mml:stretchy="false">−</mml:mo>
1475                                                         <mml:mrow>
1476                                                             <mml:mrow>
1477                                                                 <mml:mn>6</mml:mn>
1478                                                                 <mml:mo mml:stretchy="false">.</mml:mo>
1479                                                                 <mml:msup>
1480                                                                     <mml:mi>x</mml:mi>
1481                                                                     <mml:mn>2</mml:mn>
1482                                                                 </mml:msup>
1483                                                             </mml:mrow>
1484                                                             <mml:mo mml:stretchy="false">.</mml:mo>
1485                                                             <mml:mfrac>
1486                                                                 <mml:msup>
1487                                                                     <mml:mi>d</mml:mi>
1488                                                                     <mml:mn>3</mml:mn>
1489                                                                 </mml:msup>
1490                                                                 <mml:mrow>
1491                                                                     <mml:mi>d</mml:mi>
1492                                                                     <mml:msup>
1493                                                                         <mml:mi>x</mml:mi>
1494                                                                         <mml:mn>3</mml:mn>
1495                                                                     </mml:msup>
1496                                                                 </mml:mrow>
1497                                                             </mml:mfrac>
1498                                                         </mml:mrow>
1499                                                     </mml:mrow>
1500                                                     <mml:mi>u</mml:mi>
1501                                                     <mml:mrow>
1502                                                         <mml:mrow>
1503                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1504                                                             <mml:mi>x</mml:mi>
1505                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1506                                                         </mml:mrow>
1507                                                         <mml:mo mml:stretchy="false">−</mml:mo>
1508                                                         <mml:mrow>
1509                                                             <mml:mrow>
1510                                                                 <mml:mn>6</mml:mn>
1511                                                                 <mml:mo mml:stretchy="false">.</mml:mo>
1512                                                                 <mml:mi>x</mml:mi>
1513                                                             </mml:mrow>
1514                                                             <mml:mo mml:stretchy="false">.</mml:mo>
1515                                                             <mml:mfrac>
1516                                                                 <mml:msup>
1517                                                                     <mml:mi>d</mml:mi>
1518                                                                     <mml:mn>2</mml:mn>
1519                                                                 </mml:msup>
1520                                                                 <mml:mrow>
1521                                                                     <mml:mi>d</mml:mi>
1522                                                                     <mml:msup>
1523                                                                         <mml:mi>x</mml:mi>
1524                                                                         <mml:mn>2</mml:mn>
1525                                                                     </mml:msup>
1526                                                                 </mml:mrow>
1527                                                             </mml:mfrac>
1528                                                         </mml:mrow>
1529                                                     </mml:mrow>
1530                                                     <mml:mi>u</mml:mi>
1531                                                     <mml:mrow>
1532                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1533                                                         <mml:mi>x</mml:mi>
1534                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1535                                                     </mml:mrow>
1536                                                 </mml:mrow>
1537                                                 <mml:msup>
1538                                                     <mml:mi>x</mml:mi>
1539                                                     <mml:mn>3</mml:mn>
1540                                                 </mml:msup>
1541                                             </mml:mfrac>
1542                                         </mml:mrow>
1543                                     </mml:mrow>
1544                                     <mml:annotation mml:encoding="StarMath 5.0">d^4 over {d
1545                                         x^4} u(x)={1 -6*x^2*{{d^3} over {d x^3}} u(x)-6*x*{{d^2}
1546                                         over {d x^2}} u(x)} over x^3
1547                                     </mml:annotation>
1548                                 </mml:semantics>
1549                             </mml:math>
1550                         </imagedata>
1551                     </imageobject>
1552                 </mediaobject>
1553                 <para>Subjected to the boundary conditions:</para>
1554                 <mediaobject>
1555                     <imageobject>
1556                         <imagedata align="left">
1557                             <mml:math>
1558                                 <mml:semantics>
1559                                     <mml:mrow>
1560                                         <mml:mo mml:stretchy="true">{</mml:mo>
1561                                         <mml:mtable>
1562                                             <mml:mtr>
1563                                                 <mml:mrow>
1564                                                     <mml:mi>u</mml:mi>
1565                                                     <mml:mrow>
1566                                                         <mml:mrow>
1567                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1568                                                             <mml:mn>1</mml:mn>
1569                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1570                                                         </mml:mrow>
1571                                                         <mml:mo mml:stretchy="false">=</mml:mo>
1572                                                         <mml:mn>0</mml:mn>
1573                                                     </mml:mrow>
1574                                                 </mml:mrow>
1575                                             </mml:mtr>
1576                                             <mml:mtr>
1577                                                 <mml:mrow>
1578                                                     <mml:mfrac>
1579                                                         <mml:msup>
1580                                                             <mml:mi>d</mml:mi>
1581                                                             <mml:mn>2</mml:mn>
1582                                                         </mml:msup>
1583                                                         <mml:mrow>
1584                                                             <mml:mi>d</mml:mi>
1585                                                             <mml:msup>
1586                                                                 <mml:mi>x</mml:mi>
1587                                                                 <mml:mn>2</mml:mn>
1588                                                             </mml:msup>
1589                                                         </mml:mrow>
1590                                                     </mml:mfrac>
1591                                                     <mml:mi>u</mml:mi>
1592                                                     <mml:mrow>
1593                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1594                                                         <mml:mi>x</mml:mi>
1595                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1596                                                     </mml:mrow>
1597                                                     <mml:mrow>
1598                                                         <mml:mrow>
1599                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1600                                                             <mml:mn>1</mml:mn>
1601                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1602                                                         </mml:mrow>
1603                                                         <mml:mo mml:stretchy="false">=</mml:mo>
1604                                                         <mml:mn>0</mml:mn>
1605                                                     </mml:mrow>
1606                                                 </mml:mrow>
1607                                             </mml:mtr>
1608                                             <mml:mtr>
1609                                                 <mml:mrow>
1610                                                     <mml:mi>u</mml:mi>
1611                                                     <mml:mrow>
1612                                                         <mml:mrow>
1613                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1614                                                             <mml:mn>2</mml:mn>
1615                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1616                                                         </mml:mrow>
1617                                                         <mml:mo mml:stretchy="false">=</mml:mo>
1618                                                         <mml:mn>0</mml:mn>
1619                                                     </mml:mrow>
1620                                                 </mml:mrow>
1621                                             </mml:mtr>
1622                                             <mml:mtr>
1623                                                 <mml:mrow>
1624                                                     <mml:mfrac>
1625                                                         <mml:msup>
1626                                                             <mml:mi>d</mml:mi>
1627                                                             <mml:mn>2</mml:mn>
1628                                                         </mml:msup>
1629                                                         <mml:mrow>
1630                                                             <mml:mi>d</mml:mi>
1631                                                             <mml:msup>
1632                                                                 <mml:mi>x</mml:mi>
1633                                                                 <mml:mn>2</mml:mn>
1634                                                             </mml:msup>
1635                                                         </mml:mrow>
1636                                                     </mml:mfrac>
1637                                                     <mml:mi>u</mml:mi>
1638                                                     <mml:mrow>
1639                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1640                                                         <mml:mi>x</mml:mi>
1641                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1642                                                     </mml:mrow>
1643                                                     <mml:mrow>
1644                                                         <mml:mrow>
1645                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1646                                                             <mml:mn>2</mml:mn>
1647                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1648                                                         </mml:mrow>
1649                                                         <mml:mo mml:stretchy="false">=</mml:mo>
1650                                                         <mml:mn>0</mml:mn>
1651                                                     </mml:mrow>
1652                                                 </mml:mrow>
1653                                             </mml:mtr>
1654                                         </mml:mtable>
1655                                     </mml:mrow>
1656                                     <mml:annotation mml:encoding="StarMath 5.0">left lbrace
1657                                         stack{ u(1)=0# {{d^2} over {d x^2}} u(x)(1)=0# u(2)=0#
1658                                         {{d^2} over {d x^2}} u(x)(2)=0} right
1659                                         none
1660                                     </mml:annotation>
1661                                 </mml:semantics>
1662                             </mml:math>
1663                         </imagedata>
1664                     </imageobject>
1665                 </mediaobject>
1666                 <para>The exact solution of this problem is known to be:</para>
1667                 <mediaobject>
1668                     <imageobject>
1669                         <imagedata align="left">
1670                             <mml:math>
1671                                 <mml:semantics>
1672                                     <mml:mrow>
1673                                         <mml:mi>u</mml:mi>
1674                                         <mml:mrow>
1675                                             <mml:mrow>
1676                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1677                                                 <mml:mi>x</mml:mi>
1678                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1679                                             </mml:mrow>
1680                                             <mml:mo mml:stretchy="false">=</mml:mo>
1681                                             <mml:mfrac>
1682                                                 <mml:mn>1</mml:mn>
1683                                                 <mml:mn>4</mml:mn>
1684                                             </mml:mfrac>
1685                                         </mml:mrow>
1686                                         <mml:mrow>
1687                                             <mml:mo mml:stretchy="false">(</mml:mo>
1688                                             <mml:mrow>
1689                                                 <mml:mn>10</mml:mn>
1690                                                 <mml:mi/>
1691                                                 <mml:mi>log</mml:mi>
1692                                                 <mml:mrow>
1693                                                     <mml:mrow>
1694                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1695                                                         <mml:mn>2</mml:mn>
1696                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1697                                                     </mml:mrow>
1698                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1699                                                     <mml:mn>3</mml:mn>
1700                                                 </mml:mrow>
1701                                             </mml:mrow>
1702                                             <mml:mo mml:stretchy="false">)</mml:mo>
1703                                         </mml:mrow>
1704                                         <mml:mi/>
1705                                         <mml:mrow>
1706                                             <mml:mrow>
1707                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1708                                                 <mml:mrow>
1709                                                     <mml:mn>1</mml:mn>
1710                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1711                                                     <mml:mi>x</mml:mi>
1712                                                 </mml:mrow>
1713                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1714                                             </mml:mrow>
1715                                             <mml:mo mml:stretchy="false">+</mml:mo>
1716                                             <mml:mfrac>
1717                                                 <mml:mn>1</mml:mn>
1718                                                 <mml:mn>2</mml:mn>
1719                                             </mml:mfrac>
1720                                         </mml:mrow>
1721                                         <mml:mrow>
1722                                             <mml:mo mml:stretchy="false">[</mml:mo>
1723                                             <mml:mrow>
1724                                                 <mml:mfrac>
1725                                                     <mml:mn>1</mml:mn>
1726                                                     <mml:mi>x</mml:mi>
1727                                                 </mml:mfrac>
1728                                                 <mml:mo mml:stretchy="false">+</mml:mo>
1729                                                 <mml:mrow>
1730                                                     <mml:mrow>
1731                                                         <mml:mo mml:stretchy="false">(</mml:mo>
1732                                                         <mml:mrow>
1733                                                             <mml:mn>3</mml:mn>
1734                                                             <mml:mo mml:stretchy="false">+</mml:mo>
1735                                                             <mml:mi>x</mml:mi>
1736                                                         </mml:mrow>
1737                                                         <mml:mo mml:stretchy="false">)</mml:mo>
1738                                                     </mml:mrow>
1739                                                     <mml:mi/>
1740                                                     <mml:mi>log</mml:mi>
1741                                                     <mml:mrow>
1742                                                         <mml:mrow>
1743                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1744                                                             <mml:mi>x</mml:mi>
1745                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1746                                                         </mml:mrow>
1747                                                         <mml:mo mml:stretchy="false">−</mml:mo>
1748                                                         <mml:mi>x</mml:mi>
1749                                                     </mml:mrow>
1750                                                 </mml:mrow>
1751                                             </mml:mrow>
1752                                             <mml:mo mml:stretchy="false">]</mml:mo>
1753                                         </mml:mrow>
1754                                     </mml:mrow>
1755                                     <mml:annotation mml:encoding="StarMath 5.0">u(x)=1 over 4
1756                                         (10`log(2)-3)`(1-x)+ {1 over 2} [ {1 over x} + {(3+x) `
1757                                         log(x)-x}]
1758                                     </mml:annotation>
1759                                 </mml:semantics>
1760                             </mml:math>
1761                         </imagedata>
1762                     </imageobject>
1763                 </mediaobject>
1764                 <programlisting role="example"><![CDATA[
1765 N = 1; // just one differential equation
1766 m = 4; // a fourth order  differential equation
1767 M = sum(m);
1768
1769 x_low = 1;
1770 x_up = 2; // the x limits
1771 zeta = [x_low,x_low,x_up,x_up]; // two constraints (on the value of u and its second derivative) on each bound.
1772
1773 // The external functions
1774 // These functions are called by the solver with zu=[u(x);u'(x);u''(x);u'''(x)]
1775
1776 // - The function which computes the right hand side of the differential equation
1777 function f = fsub(x,zu)
1778     f = (1-6*x^2*zu(4)-6*x*zu(3))/x^3
1779 endfunction
1780
1781 // - The function which computes the derivative of fsub with respect to zu
1782 function df = dfsub(x,zu)
1783     df = [0,0,-6/x^2,-6/x]
1784 endfunction
1785
1786 // - The function which computes the ith constraint for a given i
1787 function g = gsub(i,zu),
1788   select i
1789   case 1 then  // x = zeta(1) = 1
1790     g = zu(1)  // u(1) = 0
1791   case 2 then  // x = zeta(2) = 1
1792     g = zu(3)  // u''(1) = 0
1793   case 3 then  // x = zeta(3) = 2
1794     g = zu(1)  // u(2) = 0
1795   case 4 then  // x = zeta(4) = 2
1796     g = zu(3)  // u''(2) = 0
1797   end
1798 endfunction
1799
1800 // - The function which computes the derivative of gsub with respect to z
1801 function dg = dgsub(i,z)
1802   select i
1803   case 1 then  // x = zeta(1) = 1
1804     dg = [1,0,0,0]
1805   case 2 then  // x = zeta(2) = 1
1806     dg = [0,0,1,0]
1807   case 3 then  // x = zeta(3) = 2
1808     dg = [1,0,0,0]
1809   case 4 then  // x = zeta(4) = 2
1810     dg = [0,0,1,0]
1811   end
1812 endfunction
1813
1814 // - The function which computes the initial guess, unused here
1815 function [zu,mpar] = guess(x)
1816     zu = 0;
1817     mpar = 0;
1818 endfunction
1819
1820 // define the function which computes the exact value of u for a given x ( for testing purposes)
1821 function zu = trusol(x)
1822   zu = 0*ones(4,1)
1823   zu(1) =  0.25*(10*log(2)-3)*(1-x) + 0.5 *( 1/x   + (3+x)*log(x) - x)
1824   zu(2) = -0.25*(10*log(2)-3)       + 0.5 *(-1/x^2 + (3+x)/x      + log(x) - 1)
1825   zu(3) = 0.5*( 2/x^3 + 1/x   - 3/x^2)
1826   zu(4) = 0.5*(-6/x^4 - 1/x/x + 6/x^3)
1827 endfunction
1828
1829 fixpnt = []; // All boundary conditions are located at x_low and x_up
1830
1831 //      nonlin  collpnt n ntol ndimf  ndimi iprint iread iguess rstart nfxpnt
1832 ipar = [0       0       1 2    2000   200   1      0     0      0      0   ]
1833
1834 ltol = [1,3];          // set tolerance control on zu(1) and zu(3)
1835 tol = [1.e-11,1.e-11]; // set tolerance values for these two controls
1836 xpoints = x_low:0.01:x_up;
1837
1838 zu = bvode(xpoints,N,m,x_low,x_up,zeta,ipar,ltol,tol,fixpnt,...
1839            fsub,dfsub,gsub,dgsub,guess)
1840 // check the constraints
1841 zu([1,3],[1 $]) // should be zero
1842 plot(xpoints,zu(1,:)) // the evolution of the solution u
1843 zu1 = [];
1844 for x = xpoints
1845     zu1 = [zu1,trusol(x)];
1846 end
1847 norm(zu-zu1)
1848              ]]></programlisting>
1849             </listitem>
1850             <listitem>
1851                 <para>
1852                     Same problem using <literal>bvodeS</literal> and an initial guess.
1853                 </para>
1854                 <programlisting role="no-scilab-exec"><![CDATA[
1855 function [z,lhS] = zstart(x)
1856     z = zeros(5,1); z(5) = 1;
1857     lhS = [0;1];
1858 endfunction
1859 zu = bvode(xpoints, N, m, x_low,x_up, zeta, ltol=ltol,tol=tol, guess=zstart)
1860  ]]></programlisting>
1861             </listitem>
1862             <listitem>
1863                 <para>
1864                     <emphasis role="bold">The problem 2</emphasis> describes the
1865                     small finite deformation of a thin shallow spherical cap of constant
1866                     thickness subject to a quadratically varying axisymmetric external pressure
1867                     distribution. Here <emphasis>φ</emphasis> is the meridian angle change of the
1868                     deformed shell and <emphasis>ψ</emphasis> is a stress function.
1869                     For <emphasis>ε = μ = 10<superscript>-3</superscript></emphasis>, two
1870                     different solutions may found depending on the starting point
1871                 </para>
1872                 <mediaobject>
1873                     <imageobject>
1874                         <imagedata align="left">
1875                             <mml:math>
1876                                 <mml:semantics>
1877                                     <mml:mrow>
1878                                         <mml:mo mml:stretchy="true">{</mml:mo>
1879                                         <mml:mtable>
1880                                             <mml:mtr>
1881                                                 <mml:mrow>
1882                                                     <mml:mfrac>
1883                                                         <mml:msup>
1884                                                             <mml:mo mml:stretchy="false">ε</mml:mo>
1885                                                             <mml:mn>4</mml:mn>
1886                                                         </mml:msup>
1887                                                         <mml:mo mml:stretchy="false">μ</mml:mo>
1888                                                     </mml:mfrac>
1889                                                     <mml:mrow>
1890                                                         <mml:mrow>
1891                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1892                                                             <mml:mrow>
1893                                                                 <mml:mo mml:stretchy="false">φ</mml:mo>
1894                                                                 <mml:mi>'</mml:mi>
1895                                                                 <mml:mrow>
1896                                                                     <mml:mrow>
1897                                                                         <mml:mi>'</mml:mi>
1898                                                                         <mml:mo mml:stretchy="false">+</mml:mo>
1899                                                                         <mml:mfrac>
1900                                                                             <mml:mrow>
1901                                                                                 <mml:mo mml:stretchy="false">φ</mml:mo>
1902                                                                                 <mml:mi>'</mml:mi>
1903                                                                             </mml:mrow>
1904                                                                             <mml:mi>x</mml:mi>
1905                                                                         </mml:mfrac>
1906                                                                     </mml:mrow>
1907                                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1908                                                                     <mml:mfrac>
1909                                                                         <mml:mo mml:stretchy="false">φ</mml:mo>
1910                                                                         <mml:msup>
1911                                                                             <mml:mi>x</mml:mi>
1912                                                                             <mml:mn>2</mml:mn>
1913                                                                         </mml:msup>
1914                                                                     </mml:mfrac>
1915                                                                 </mml:mrow>
1916                                                             </mml:mrow>
1917                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1918                                                         </mml:mrow>
1919                                                         <mml:mo mml:stretchy="false">+</mml:mo>
1920                                                         <mml:mo mml:stretchy="false">ψ</mml:mo>
1921                                                     </mml:mrow>
1922                                                     <mml:mrow>
1923                                                         <mml:mrow>
1924                                                             <mml:mrow>
1925                                                                 <mml:mo mml:stretchy="false">(</mml:mo>
1926                                                                 <mml:mrow>
1927                                                                     <mml:mn>1</mml:mn>
1928                                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1929                                                                     <mml:mfrac>
1930                                                                         <mml:mo mml:stretchy="false">φ</mml:mo>
1931                                                                         <mml:mi>x</mml:mi>
1932                                                                     </mml:mfrac>
1933                                                                 </mml:mrow>
1934                                                                 <mml:mo mml:stretchy="false">)</mml:mo>
1935                                                             </mml:mrow>
1936                                                             <mml:mo mml:stretchy="false">−</mml:mo>
1937                                                             <mml:mo mml:stretchy="false">φ</mml:mo>
1938                                                         </mml:mrow>
1939                                                         <mml:mo mml:stretchy="false">+</mml:mo>
1940                                                         <mml:mo mml:stretchy="false">γ</mml:mo>
1941                                                     </mml:mrow>
1942                                                     <mml:mi>x</mml:mi>
1943                                                     <mml:mrow>
1944                                                         <mml:mrow>
1945                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1946                                                             <mml:mrow>
1947                                                                 <mml:mn>1</mml:mn>
1948                                                                 <mml:mo mml:stretchy="false">−</mml:mo>
1949                                                                 <mml:mfrac>
1950                                                                     <mml:msup>
1951                                                                         <mml:mi>x</mml:mi>
1952                                                                         <mml:mn>2</mml:mn>
1953                                                                     </mml:msup>
1954                                                                     <mml:mn>2</mml:mn>
1955                                                                 </mml:mfrac>
1956                                                             </mml:mrow>
1957                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1958                                                         </mml:mrow>
1959                                                         <mml:mo mml:stretchy="false">=</mml:mo>
1960                                                         <mml:mn>0</mml:mn>
1961                                                     </mml:mrow>
1962                                                 </mml:mrow>
1963                                             </mml:mtr>
1964                                             <mml:mtr>
1965                                                 <mml:mrow>
1966                                                     <mml:mo mml:stretchy="false">μ</mml:mo>
1967                                                     <mml:mrow>
1968                                                         <mml:mrow>
1969                                                             <mml:mo mml:stretchy="false">(</mml:mo>
1970                                                             <mml:mrow>
1971                                                                 <mml:mo mml:stretchy="false">ψ</mml:mo>
1972                                                                 <mml:mi>'</mml:mi>
1973                                                                 <mml:mrow>
1974                                                                     <mml:mrow>
1975                                                                         <mml:mi>'</mml:mi>
1976                                                                         <mml:mo mml:stretchy="false">+</mml:mo>
1977                                                                         <mml:mfrac>
1978                                                                             <mml:mrow>
1979                                                                                 <mml:mo mml:stretchy="false">ψ</mml:mo>
1980                                                                                 <mml:mi>'</mml:mi>
1981                                                                             </mml:mrow>
1982                                                                             <mml:mi>x</mml:mi>
1983                                                                         </mml:mfrac>
1984                                                                     </mml:mrow>
1985                                                                     <mml:mo mml:stretchy="false">−</mml:mo>
1986                                                                     <mml:mfrac>
1987                                                                         <mml:mo mml:stretchy="false">ψ</mml:mo>
1988                                                                         <mml:msup>
1989                                                                             <mml:mi>x</mml:mi>
1990                                                                             <mml:mn>2</mml:mn>
1991                                                                         </mml:msup>
1992                                                                     </mml:mfrac>
1993                                                                 </mml:mrow>
1994                                                             </mml:mrow>
1995                                                             <mml:mo mml:stretchy="false">)</mml:mo>
1996                                                         </mml:mrow>
1997                                                         <mml:mo mml:stretchy="false">−</mml:mo>
1998                                                         <mml:mo mml:stretchy="false">φ</mml:mo>
1999                                                     </mml:mrow>
2000                                                     <mml:mrow>
2001                                                         <mml:mrow>
2002                                                             <mml:mo mml:stretchy="false">(</mml:mo>
2003                                                             <mml:mrow>
2004                                                                 <mml:mn>1</mml:mn>
2005                                                                 <mml:mo mml:stretchy="false">−</mml:mo>
2006                                                                 <mml:mfrac>
2007                                                                     <mml:mo mml:stretchy="false">φ</mml:mo>
2008                                                                     <mml:mn>2x</mml:mn>
2009                                                                 </mml:mfrac>
2010                                                             </mml:mrow>
2011                                                             <mml:mo mml:stretchy="false">)</mml:mo>
2012                                                         </mml:mrow>
2013                                                         <mml:mo mml:stretchy="false">=</mml:mo>
2014                                                         <mml:mn>0</mml:mn>
2015                                                     </mml:mrow>
2016                                                 </mml:mrow>
2017                                             </mml:mtr>
2018                                             <mml:mtr>
2019                                                 <mml:mrow>
2020                                                     <mml:mrow>
2021                                                         <mml:mn>0</mml:mn>
2022                                                         <mml:mo mml:stretchy="false">&lt;</mml:mo>
2023                                                         <mml:mi>x</mml:mi>
2024                                                     </mml:mrow>
2025                                                     <mml:mo mml:stretchy="false">&lt;</mml:mo>
2026                                                     <mml:mn>1</mml:mn>
2027                                                 </mml:mrow>
2028                                             </mml:mtr>
2029                                         </mml:mtable>
2030                                     </mml:mrow>
2031                                     <mml:annotation mml:encoding="StarMath 5.0">left lbrace
2032                                         stack{{%epsilon^4} over %mu (%phi''+ {%phi'} over x
2033                                         -{%phi} over {x^2} ) +%psi (1- %phi over x ) -%phi+%gamma
2034                                         x(1-{x^2} over 2)=0# %mu(%psi''+{%psi'} over x-%psi over
2035                                         {x^2})-%phi(1-%phi over{2x})=0 # 0&lt;x&lt;1} right
2036                                         none
2037                                     </mml:annotation>
2038                                 </mml:semantics>
2039                             </mml:math>
2040                         </imagedata>
2041                     </imageobject>
2042                 </mediaobject>
2043                 <para>Subject to the boundary conditions</para>
2044                 <mediaobject>
2045                     <imageobject>
2046                         <imagedata align="left">
2047                             <mml:math>
2048                                 <mml:semantics>
2049                                     <mml:mrow>
2050                                         <mml:mo mml:stretchy="true">{</mml:mo>
2051                                         <mml:mtable>
2052                                             <mml:mtr>
2053                                                 <mml:mrow>
2054                                                     <mml:mo mml:stretchy="false">φ</mml:mo>
2055                                                     <mml:mo mml:stretchy="false">=</mml:mo>
2056                                                     <mml:mn>0</mml:mn>
2057                                                 </mml:mrow>
2058                                             </mml:mtr>
2059                                             <mml:mtr>
2060                                                 <mml:mrow>
2061                                                     <mml:mi>x</mml:mi>
2062                                                     <mml:mi/>
2063                                                     <mml:mo mml:stretchy="false">ψ</mml:mo>
2064                                                     <mml:mrow>
2065                                                         <mml:mi>'</mml:mi>
2066                                                         <mml:mo mml:stretchy="false">−</mml:mo>
2067                                                         <mml:mn>0.3</mml:mn>
2068                                                     </mml:mrow>
2069                                                     <mml:mrow>
2070                                                         <mml:mrow>
2071                                                             <mml:mo mml:stretchy="false">ψ</mml:mo>
2072                                                             <mml:mo mml:stretchy="false">+</mml:mo>
2073                                                             <mml:mn>0.7x</mml:mn>
2074                                                         </mml:mrow>
2075                                                         <mml:mo mml:stretchy="false">=</mml:mo>
2076                                                         <mml:mn>0</mml:mn>
2077                                                     </mml:mrow>
2078                                                 </mml:mrow>
2079                                             </mml:mtr>
2080                                         </mml:mtable>
2081                                     </mml:mrow>
2082                                     <mml:annotation mml:encoding="StarMath 5.0">left lbrace
2083                                         stack{ %phi=0# x`%psi'-0.3%psi+0.7x=0} right
2084                                         none
2085                                     </mml:annotation>
2086                                 </mml:semantics>
2087                             </mml:math>
2088                         </imagedata>
2089                     </imageobject>
2090                 </mediaobject>
2091                 <para>
2092                     for <literal>x=0</literal> and <literal>x=1</literal>
2093                 </para>
2094                 <programlisting role="example"><![CDATA[
2095 N = 2;     // two differential equations
2096 m = [2 2]; // each differential equation is of second  order
2097 M = sum(m);
2098
2099 x_low = 0;x_up=1; // the x limits
2100 zeta = [x_low,x_low, x_up x_up]; // two  constraints on each bound.
2101
2102 // The external functions
2103 // These functions are called by the solver with zu=[u1(x);u1'(x);u2(x);u2'(x)]
2104
2105 // - The function which computes the right hand side of the differential equation
2106 function f = fsub2(x,zu,eps,dmu,eps4mu,gam,xt),
2107    f = [zu(1)/x^2-zu(2)/x+(zu(1)-zu(3)*(1-zu(1)/x)-gam*x*(1-x^2/2))/eps4mu //phi''
2108         zu(3)/x^2-zu(4)/x+zu(1)*(1-zu(1)/(2*x))/dmu];//psi''
2109 endfunction
2110
2111 // - The function which computes the derivative of fsub with respect to zu
2112 function df = dfsub2(x,zu,eps,dmu,eps4mu,gam,xt),
2113     df = [1/x^2+(1+zu(3)/x)/eps4mu, -1/x, -(1-zu(1)/x)/eps4mu, 0
2114          (1-zu(1)/x)/dmu             0    1/x^2              -1/x];
2115 endfunction
2116
2117 // - The function which computes the ith constraint for a given i
2118 function g = gsub2(i,zu),
2119   select i
2120   case 1 then  // x = zeta(1) = 0
2121     g = zu(1)  // u(0) = 0
2122   case 2 then  // x = zeta(2) = 0
2123     g = -0.3*zu(3) // x*psi'-0.3*psi+0.7x = 0
2124   case 3 then  // x = zeta(3) = 1
2125     g = zu(1)  // u(1) = 0
2126   case 4 then  // x = zeta(4) = 1
2127     g = 1*zu(4)-0.3*zu(3)+0.7*1 // x*psi'-0.3*psi+0.7x = 0
2128   end
2129 endfunction
2130
2131 // - The function which computes the derivative of gsub with respect to z
2132 function dg = dgsub2(i,z)
2133   select i
2134   case 1 then  // x = zeta(1) = 1
2135     dg = [1,0,0,0]
2136   case 2 then  // x = zeta(2) = 1
2137     dg = [0,0,-0.3,0]
2138   case 3 then  // x = zeta(3) = 2
2139     dg = [1,0,0,0]
2140   case 4 then  // x = zeta(4) = 2
2141     dg = [0,0,-0.3,1]
2142   end
2143 endfunction
2144
2145 [gam, eps, dmu] = (1.1, 1d-3, 1d-3);
2146 eps4mu = eps^4/dmu
2147 xt = sqrt(2*(gam-1)/gam)
2148
2149 fixpnt = []; // All boundary conditions are located at x_low and x_up
2150 collpnt = 4;
2151 nsizef = 4 + 3*M + (5+collpnt*N)*(collpnt*N+M)+(2*M-2)*2*M ;
2152 nsizei = 3 + collpnt*N+M;
2153 nmax = 200;
2154 //      nonlin  collpnt n  ntol  ndimf        ndimi       iprint iread iguess rstart nfxpnt
2155 ipar = [1       collpnt 10  4   nmax*nsizef  nmax*nsizei   -1      0     0      0      0   ];
2156
2157 ltol = 1:4; // set tolerance control on zu(1), zu(2), zu(3) and zu(4)
2158 tol = [1.e-5,1.e-5,1.e-5,1.e-5]; // set tolreance values for these four controls
2159 xpoints = x_low:0.01:x_up;
2160
2161 // - The function which computes the initial guess, unused here
2162 function [zu,dmval] = guess2(x,gam),
2163    cons = gam*x*(1-x^2/2)
2164    dcons = gam*(1-3*x^2/2)
2165    d2cons = -3*gam*x
2166    dmval = zeros(2,1)
2167    if x>xt then
2168      zu = [0 0 -cons -dcons]
2169      dmval(2) = -d2cons
2170    else
2171      zu = [2*x;2; -2*x+cons; -2*dcons]
2172      dmval(2) = d2cons
2173    end
2174 endfunction
2175
2176 zu = bvode(xpoints,N,m,x_low,x_up,zeta,ipar,ltol,tol,fixpnt,...
2177            fsub2,dfsub2,gsub2,dgsub2,guess2);
2178 scf(1); clf(); plot(xpoints,zu([1 3],:)) // the evolution of the solution phi and psi
2179
2180 // using an initial guess
2181 ipar(9) = 1; // iguess
2182
2183 zu2 = bvode(xpoints,N,m,x_low,x_up,zeta,ipar,ltol,tol,fixpnt,...
2184             fsub2,dfsub2,gsub2,dgsub2,guess2);
2185 scf(2); clf(); plot(xpoints,zu2([1 3],:)) // the evolution of the solution phi and psi
2186              ]]></programlisting>
2187             </listitem>
2188             <listitem>
2189                 <para>
2190                     <emphasis role="bold">An eigenvalue problem:</emphasis>
2191                 </para>
2192                 <programlisting role="example"><![CDATA[
2193 // y''(x)=-la*y(x)
2194 // BV: y(0)=y'(0); y(1)=0
2195 // Eigenfunctions and eigenvalues are y(x,n)=sin(s(n)*(1-x)), la(n)=s(n)^2,
2196 // where s(n) are the zeros of f(s,n)=s+atan(s)-(n+1)*pi, n=0,1,2,...
2197 // To get a third boundary condition, we choose y(0)=1
2198 // (With y(x) also c*y(x) is a solution for each constant c.)
2199 // We solve the following ode system:
2200 // y''=-la*y
2201 // la'=0
2202 // BV: y(0)=y'(0), y(0)=1; y(1)=0
2203 // z=[y(x) ; y'(x) ; la]
2204
2205 function rhs = fsub(x,z)
2206   rhs = [-z(3)*z(1);0]
2207 endfunction
2208
2209 function g = gsub(i,z)
2210   g = [z(1)-z(2) z(1)-1 z(1)]
2211   g = g(i)
2212 endfunction
2213
2214 // The following start function is good for the first 8 eigenfunctions.
2215 function [z,lhs] = ystart(x,z,la0)
2216   z = [1;0;la0]
2217   lhs = [0;0]
2218 endfunction
2219
2220 [a, b, m, n] =(0, 1, [2;1], 2);
2221 zeta = [a a b];
2222 N = 101;
2223 x = linspace(a,b,N)';
2224
2225 // We have s(n)-(n+1/2)*pi -> 0 for n to infinity.
2226 la0 = evstr(x_dialog('n-th eigenvalue: n= ?','10'));
2227 la0 = (%pi/2+la0*%pi)^2;
2228
2229 z = bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,la0));
2230 // The same call without any display
2231 z = bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,la0),iprint=1);
2232 // The same with a lot of display
2233 z = bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,la0),iprint=-1);
2234
2235 clf()
2236 plot(x,[z(1,:)' z(2,:)'])
2237 xtitle(['Startvalue =  '+string(la0);'Eigenvalue = '+string(z(3,1))],'x',' ')
2238 legend(['y(x)';'y''(x)']);
2239              ]]></programlisting>
2240                 <scilab:image localized="true">
2241                     function rhs=fsub(x,z)
2242                     rhs=[-z(3)*z(1);0]
2243                     endfunction
2244
2245                     function g=gsub(i,z)
2246                     g=[z(1)-z(2) z(1)-1 z(1)]
2247                     g=g(i)
2248                     endfunction
2249
2250                     function [z,lhs]=ystart(x,z,la0)
2251                     z=[1;0;la0]
2252                     lhs=[0;0]
2253                     endfunction
2254
2255                     a=0;b=1;
2256                     m=[2;1];
2257                     n=2;
2258                     zeta=[a a b];
2259                     N=101;
2260                     x=linspace(a,b,N)';
2261
2262                     la0=10;
2263                     la0=(%pi/2+la0*%pi)^2;
2264
2265                     z=bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,la0),iprint=1);
2266
2267                     plot(x,[z(1,:)' z(2,:)']);
2268                     xtitle(['Startvalue =  '+string(la0);'Eigenvalue = '+string(z(3,1))],'x',' ');
2269                     legend(['y(x)';'y''(x)']);
2270                 </scilab:image>
2271
2272             </listitem>
2273             <listitem>
2274                 <para>
2275                     <emphasis role="bold">A boundary value problem with more than one solution.</emphasis>
2276                 </para>
2277                 <programlisting role="example"><![CDATA[
2278 // DE: y''(x) = -exp(y(x))
2279 // BV: y(0)=0; y(1)=0
2280 // This boundary value problem has more than one solution.
2281 // It is demonstrated how to find two of them with the help of
2282 // some preinformation of the solutions y(x) to build the function ystart.
2283 // z = [y(x);y'(x)]
2284
2285 [a, b, m, n] = (0, 1, 2, 1);
2286 zeta = [a b];
2287 N = 101;
2288 tol = 1e-8*[1 1];
2289 x = linspace(a,b,N);
2290
2291 function rhs = fsub(x,z)
2292   rhs = -exp(z(1))
2293 endfunction
2294
2295 function g = gsub(i,z)
2296   g = [z(1) z(1)]
2297   g = g(i)
2298 endfunction
2299
2300 function [z,lhs] = ystart(x,z,M)
2301   // z = [4*x*(1-x)*M ; 4*(1-2*x)*M]
2302   z = [M;0]
2303   //lhs = [-exp(4*x*(1-x)*M)]
2304   lhs = 0
2305 endfunction
2306
2307 for M = [1 4]
2308    if M==1
2309       z = bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,M),tol=tol);
2310    else
2311       z1 = bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,M),tol=tol);
2312    end
2313 end
2314
2315 // Integrating the ode yield e.g. the two solutions yex and yex1.
2316
2317 function y = f(c)
2318   y = c.*(1-tanh(sqrt(c)/4).^2)-2;
2319 endfunction
2320 c = fsolve(2,f);
2321
2322 function y = yex(x,c)
2323   y = log(c/2*(1-tanh(sqrt(c)*(1/4-x/2)).^2))
2324 endfunction
2325
2326 function y = f1(c1), y=2*c1^2+tanh(1/4/c1)^2-1; endfunction
2327 c1 = fsolve(0.1,f1);
2328
2329 function y = yex1(x,c1)
2330   y = log((1-tanh((2*x-1)/4/c1).^2)/2/c1/c1)
2331 endfunction
2332
2333 disp('norm(yex(x)-z(1,:))= ', norm(z(1,:)-yex(x)))
2334 disp('norm(yex1(x)-z1(1,:))= ', norm(z1(1,:)-yex1(x)))
2335 clf();
2336 subplot(2,1,1)
2337 plot2d(x,z(1,:),style=[5])
2338 xtitle('Two different solutions','x',' ')
2339 subplot(2,1,2)
2340 plot2d(x,z1(1,:),style=[5])
2341 xtitle(' ','x',' ')
2342              ]]></programlisting>
2343                 <scilab:image localized="true">
2344                     a=0;
2345                     b=1;
2346                     m=2;
2347                     n=1;
2348                     zeta=[a b];
2349                     N=101;
2350                     tol=1e-8*[1 1];
2351                     x=linspace(a,b,N);
2352
2353                     function rhs=fsub(x,z)
2354                     rhs=-exp(z(1));
2355                     endfunction
2356
2357                     function g=gsub(i,z)
2358                     g=[z(1) z(1)]
2359                     g=g(i)
2360                     endfunction
2361
2362                     function [z,lhs]=ystart(x,z,M)
2363                     //z=[4*x*(1-x)*M ; 4*(1-2*x)*M]
2364                     z=[M;0]
2365                     //lhs=[-exp(4*x*(1-x)*M)]
2366                     lhs=0
2367                     endfunction
2368
2369                     for M=[1 4]
2370                     if M==1
2371                     z=bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,M),tol=tol,iprint=1);
2372                     else
2373                     z1=bvodeS(x,m,n,a,b,fsub,gsub,zeta,ystart=list(ystart,M),tol=tol,iprint=1);
2374                     end
2375                     end
2376
2377                     // Integrating the ode yield e.g. the two solutions yex and yex1.
2378
2379                     function y=f(c)
2380                     y=c.*(1-tanh(sqrt(c)/4).^2)-2;
2381                     endfunction
2382                     c=fsolve(2,f);
2383
2384                     function y=yex(x,c)
2385                     y=log(c/2*(1-tanh(sqrt(c)*(1/4-x/2)).^2))
2386                     endfunction
2387
2388                     function y=f1(c1), y=2*c1^2+tanh(1/4/c1)^2-1;endfunction
2389                     c1=fsolve(0.1,f1);
2390
2391                     function y=yex1(x,c1)
2392                     y=log((1-tanh((2*x-1)/4/c1).^2)/2/c1/c1)
2393                     endfunction
2394
2395                     subplot(2,1,1)
2396                     plot2d(x,z(1,:),style=[5])
2397                     xtitle('Two different solutions','x',' ')
2398                     subplot(2,1,2)
2399                     plot2d(x,z1(1,:),style=[5])
2400                     xtitle(' ','x',' ')
2401                 </scilab:image>
2402             </listitem>
2403             <listitem>
2404                 <para>
2405                     <emphasis role="bold">A multi-point boundary value problem.</emphasis>
2406                 </para>
2407                 <programlisting role="example"><![CDATA[
2408 // DE y'''(x)=1
2409 // z = [y(x);y'(x);y''(x)]
2410 // BV: y(-1)=2 y(1)=2
2411 // Side condition: y(0)=1
2412
2413 a = -1; b = 1; c = 0;
2414 // The side condition point c must be included in the array fixpnt.
2415 n = 1;
2416 m = 3;
2417
2418 function rhs = fsub(x,z)
2419   rhs = 1
2420 endfunction
2421
2422 function g = gsub(i,z)
2423   g = [z(1)-2 z(1)-1 z(1)-2]
2424   g = g(i)
2425 endfunction
2426
2427 N = 10;
2428 zeta = [a c b];
2429 x = linspace(a,b,N);
2430
2431 z = bvodeS(x,m,n,a,b,fsub,gsub,zeta,fixpnt=c);
2432
2433 function y = yex(x)
2434     y = x.^3/6 + x.^2 - x/6 + 1
2435 endfunction
2436
2437 disp(norm(yex(x)-z(1,:)),'norm(yex(x)-z(1,:))= ')
2438              ]]></programlisting>
2439             </listitem>
2440             <listitem>
2441                 <para>
2442                     <emphasis role="bold">
2443                         Quantum Neumann equation, with 2 "eigenvalues" (c_1 and c2). Continuation being used.
2444                     </emphasis>
2445                 </para>
2446                 <programlisting role="example"><![CDATA[
2447 // Quantum Neumann equation, with 2 "eigenvalues" c_1 and c_2
2448 // (c_1=v-c_2-c_3, v is a parameter, used in continuation)
2449 //
2450 // diff(f,x,2) + (1/2)*(1/x + 1/(x-1) + 1/(x-y))*diff(f,x)
2451 //      - (c_1/x + c_2/(x-1) + c_3/(x-y))* f(x) = 0
2452 // diff(c_2,x)=0,  diff(c_3,x) = 0
2453 //
2454 // and 4 "boundary" conditions: diff(f,x)(a_k)=2*c_k*f(a_k) for
2455 // k=1,2,3, a_k=(0, 1 , y)  and normalization f(1) = 1
2456 //
2457 // The z-vector is z_1=f, z_2=diff(f,x), z_3=c_2 and z_4=c_3
2458 // The guess is chosen to have one node in [0,1],  f(x)=2*x-1
2459 // such that f(1)=1, c_2 and c_3 are chosen to cancel poles in
2460 // the differential equation at 1.0 and y, z_3=1, z_4=1/(2*y-1)
2461 // Ref: http://arxiv.org/pdf/hep-th/0407005
2462
2463 y = 1.9d0;
2464 eigens = zeros(3,40); // To store the results
2465
2466 // General setup for bvode
2467
2468 // Number of differential equations
2469 ncomp = 3;
2470
2471 // Orders of equations
2472 m = [2, 1, 1];
2473
2474 // Non-linear problem
2475 ipar(1) = 1;
2476
2477 // Number of collocation points
2478 ipar(2) = 3;
2479
2480 // Initial uniform mesh of 4 subintervals
2481 ipar(3) = 4;
2482 ipar(8) = 0;
2483
2484 // Size of fspace, ispace, see colnew.f to choose size
2485 ipar(5) =  30000;
2486 ipar(6) =  2000;
2487
2488 // Medium output
2489 ipar(7) = 0;
2490
2491 // Initial approx is provided
2492 ipar(9) = 1;
2493
2494 // fixpnt is an array containing all fixed points in the mesh, in
2495 // particular "boundary" points, except aleft and aright, ipar[11] its
2496 // size, here only one interior "boundary point"
2497 ipar(11) = 1;
2498 fixpnt = [1.0d0];
2499
2500 // Tolerances on all components z_1, z_2, z_3, z_4
2501 ipar(4) = 4;
2502
2503 // Tolerance check on f and diff(f,x) and on c_2 and c_3
2504 ltol = [1, 2, 3, 4];
2505 tol = [1d-5, 1d-5, 1d-5, 1d-5];
2506
2507 // Define the differential equations
2508
2509 function [f]=fsub(x,z)
2510     f = [ -.5*(1/x+1/(x-1)+1/(x-y))*z(2) +...
2511      z(1) * ((v-z(3)-z(4))/x + z(3)/(x-1) + z(4)/(x-y)),...
2512     0,0];
2513 endfunction
2514 function [df] = dfsub(x,z)
2515     df = [(v-z(3)-z(4))/x + z(3)/(x-1) + z(4)/(x-y),...
2516     -.5*(1/x+1/(x-1)+1/(x-y)),z(1)/(x*(x-1)),z(1)*y/(x*(x-y));...
2517     0,0,0,0;0,0,0,0];
2518 endfunction
2519
2520 // Boundary conditions
2521
2522 function [g]=gsub(i,z)
2523     select i
2524     case 1, g = z(2) - 2*z(1)*(v-z(3)-z(4))
2525     case 2, g = z(2) - 2*z(1)*z(3)
2526     case 3, g = z(1)-1.
2527     case 4, g = z(2) - 2*z(1)*z(4)
2528     end
2529 endfunction
2530 function [dg]=dgsub(i,z)
2531         select i
2532         case 1, dg = [-2*(v-z(3)-z(4)),1.,2*z(1),2*z(1)]
2533         case 2, dg = [-2*z(3),1.,-2*z(1),0]
2534         case 3, dg = [1,0,0,0]
2535         case 4, dg = [-2*z(4),1.,0,-2*z(1)]
2536         end
2537 endfunction
2538
2539 // Start computation
2540
2541 // Locations of side conditions, sorted
2542 zeta = [0.0d0, 1.0d0, 1.0d0, y];
2543 // Interval ends
2544 aleft = 0.0d0;
2545 aright = y;
2546
2547 // Array of 40 values of v explored by continuation, and array of 202
2548 // points where to evaluate function f.
2549 valv = [linspace(0,.9,10) logspace(0,2,30)];
2550 res = [linspace(0,.99,100) linspace(1,y,101)];
2551
2552 // eigenstates are characterized by number of nodes in [0,1] and in
2553 // [1,y], here guess selects one node (zero) in [0,1] with linear
2554 // f(x)=2*x-1 and constant c_2, c_3, so dmval=0. Notice that the z-vector
2555 // has mstar = 4 components, while dmval has ncomp = 3 components.
2556
2557 function [z,dmval] = guess(x)
2558      z = [2*x-1, 2., 1., 1/(2*y-1)]
2559      dmval = [0,0,0]
2560 endfunction
2561
2562 // First execution has ipar(9)=1 and uses the guess
2563 // Subsequent executions have ipar(9)=3 and use continuation. This is
2564 // run in tight closed loop to not disturb the stack
2565
2566 for i = 1:40
2567     v = valv(i);
2568     sol = bvode(res,ncomp,m,aleft,aright,zeta,ipar,ltol,tol,fixpnt,...
2569                 fsub,dfsub,gsub,dgsub,guess);
2570     eigens(:,i) = [v;sol(3,101);sol(4,101)];  // c_2 and c_3 are constant!
2571     ipar(9) = 3;
2572 end
2573
2574 // To see the evolution of the eigenvalues with v, disp(eigens)
2575 // Note they evolve smoothly.
2576 // To see the solution f for v=40, disp(sol(1,:)). Note that it vanishes
2577 // exactly once in [0,1] at x close to 0.98, and becomes very small
2578 // when x -> 0 and very large when x -> y.
2579 // This is markedly different from the case  at small v.
2580 // The continuation procedure allows to explore these exponential behaviours
2581 // without skipping to other eigenstates.
2582              ]]></programlisting>
2583             </listitem>
2584         </itemizedlist>
2585     </refsection>
2586     <refsection>
2587         <title>Used Functions</title>
2588         <para>This function is based on the Fortran routine
2589             <literal>colnew</literal> developed by
2590         </para>
2591         <para>U. Ascher, Department of Computer Science, University of British
2592             Columbia, Vancouver, B.C. V6T 1W5, Canada
2593         </para>
2594         <para>G. Bader, institut f. Angewandte mathematik university of
2595             Heidelberg; im Neuenheimer feld 294d-6900 Heidelberg 1
2596         </para>
2597     </refsection>
2598     <refsection>
2599         <title>Bibliography</title>
2600         <orderedlist>
2601             <listitem>
2602                 <para>U. Ascher, J. Christiansen and R.D. Russell, collocation
2603                     software for boundary-value ODEs, acm trans. math software 7 (1981),
2604                     209-222. this paper contains EXAMPLES where use of the code is
2605                     demonstrated.
2606                 </para>
2607             </listitem>
2608             <listitem>
2609                 <para>G. Bader and U. Ascher, a new basis implementation for a mixed
2610                     order boundary value ode solver, siam j. scient. stat. comput.
2611                     (1987).
2612                 </para>
2613             </listitem>
2614             <listitem>
2615                 <para>U. Ascher, J. Christiansen and R.D. Russell, a collocation
2616                     solver for mixed order systems of boundary value problems, math. comp.
2617                     33 (1979), 659-679.
2618                 </para>
2619             </listitem>
2620             <listitem>
2621                 <para>U. Ascher, J. Christiansen and R.D. russell, colsys - a
2622                     collocation code for boundary value problems, lecture notes comp.sc.
2623                     76, springer verlag, b. children et. al. (eds.) (1979), 164-185.
2624                 </para>
2625             </listitem>
2626             <listitem>
2627                 <para>C. Deboor and R. Weiss, solveblok: a package for solving almost
2628                     block diagonal linear systems, acm trans. math. software 6 (1980),
2629                     80-87.
2630                 </para>
2631             </listitem>
2632         </orderedlist>
2633     </refsection>
2634     <refsection role="see also">
2635         <title>See also</title>
2636         <simplelist type="inline">
2637             <member>
2638                 <link linkend="link">link</link>
2639             </member>
2640             <member>
2641                 <link linkend="external">external</link>
2642             </member>
2643             <member>
2644                 <link linkend="ode">ode</link>
2645             </member>
2646             <member>
2647                 <link linkend="dassl">dassl</link>
2648             </member>
2649         </simplelist>
2650     </refsection>
2651 </refentry>