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