~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/nonlinear/fsolve.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
fsolve            Scilab Group            Scilab Function            fsolve
2
 
NAME
3
 
   fsolve - find a zero of a system of n nonlinear functions
4
 
  
5
 
CALLING SEQUENCE
6
 
 [x [,v [,info]]]=fsolve(x0,fct [,fjac] [,tol])
7
 
PARAMETERS
8
 
 x0         : real vector (initial value of function argument).
9
 
            
10
 
 fct        : external (i.e function or list or string).
11
 
            
12
 
 fjac       : external (i.e function or list or string).
13
 
            
14
 
 tol        : real scalar. precision tolerance: termination occurs when
15
 
            the algorithm estimates that the relative error between x and
16
 
            the solution is at most tol. (tol=1.d-10 is the default value).
17
 
            
18
 
 x :        real vector (final value of function argument, estimated
19
 
            zero).
20
 
            
21
 
 v :        real vector (value of function at x).
22
 
            
23
 
 info       :  termination indicator
24
 
            
25
 
           0    : improper input parameters.
26
 
                
27
 
           1    : algorithm estimates that the relative error between x
28
 
                and the solution  is at most tol.
29
 
                
30
 
           2    : number of calls to fcn reached
31
 
                
32
 
           3    : tol is too small. No further improvement in the
33
 
                approximate solution  x is possible.
34
 
                
35
 
           4    : iteration is not making good progress.
36
 
                
37
 
DESCRIPTION
38
 
   find a zero of a system of n nonlinear functions in n variables by a
39
 
  modification of the powell hybrid method. Jacobian may be provided.
40
 
  
41
 
 0 = fct(x) w.r.t x.
42
 
   fct is an "external". This external returns v=fct(x) given x.
43
 
  
44
 
   The simplest calling sequence for fct is:
45
 
  
46
 
 [v]=fct(x).
47
 
   If fct is a character string, it refers to a C or Fortran routine which
48
 
  must be linked to Scilab. Fortran calling sequence must be  
49
 
  
50
 
 fct(n,x,v,iflag)
51
 
 integer n,iflag
52
 
 double precision x(n),v(n)
53
 
   and C Calling sequence must be 
54
 
  
55
 
 fct(int *n, double x[],double v[],int *iflag)
56
 
    Incremental  link is possible (help link).
57
 
  
58
 
   jac is an "external". This external returns v=d(fct)/dx (x) given x.
59
 
  
60
 
   The simplest calling sequence for jac is:
61
 
  
62
 
 [v]=jac(x).
63
 
   If jac is a character string, it refers to a to a C or Fortran routine
64
 
  which must be linked to Scilab calling sequences are the same as those
65
 
  for fct. Note however that v must be a nxn array.
66
 
  
67
 
EXAMPLES
68
 
 // A simple example with fsolve 
69
 
 a=[1,7;2,8];b=[10;11];
70
 
 deff('[y]=fsol1(x)','y=a*x+b');
71
 
 deff('[y]=fsolj1(x)','y=a');
72
 
 [xres]=fsolve([100;100],fsol1);
73
 
 a*xres+b
74
 
 [xres]=fsolve([100;100],fsol1,fsolj1);
75
 
 a*xres+b
76
 
 // See routines/default/Ex-fsolve.f
77
 
 [xres]=fsolve([100;100],'fsol1','fsolj1',1.e-7);
78
 
 a*xres+b
79
 
SEE ALSO
80
 
   external, quapro, linpro, optim
81