File: fsolve.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (107 lines) | stat: -rw-r--r-- 2,486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.TH fsolve G "August 1993" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
fsolve - find a zero of a system of n nonlinear functions
.SH CALLING SEQUENCE
.nf
[x [,v [,info]]]=fsolve(x0,fct [,fjac] [,tol])
.fi
.SH PARAMETERS
.TP 10
x0 
: real vector (initial value of function argument).
.TP
fct
: external (i.e function or list or string).
.TP
fjac
: external (i.e function or list or string).
.TP
tol
: real scalar. precision tolerance: termination occurs
when the algorithm estimates that the relative error
between x and the solution is at most tol.
(\fVtol=1.d-10\fR is the default value).
.TP
x : 
real vector (final value of function argument, estimated zero).
.TP
v : 
real vector (value of function at x).
.TP
info
:  termination indicator
.RS
.TP
0
: improper input parameters.
.TP
1
: algorithm estimates that the relative error between x and the solution
 is at most tol.
.TP
2 
: number of calls to fcn reached
.TP
3  
: tol is too small. No further improvement in the approximate solution 
x is possible.
.TP
4  
: iteration is not making good progress.
.RE
.SH DESCRIPTION
find a zero of a system of
n nonlinear functions in n variables by a modification
of the powell hybrid method. Jacobian may be provided.
.nf
0 = fct(x) w.r.t x.
.fi
\fVfct\fR is an "external".
This external returns \fVv=fct(x)\fR given \fVx\fR.
.LP
The simplest calling sequence for \fVfct\fR is:
.nf
[v]=fct(x).
.fi
If \fVfct\fR is a character string, it refers to a C or Fortran routine
which must be linked to Scilab. Fortran calling sequence must be  
.nf
fct(n,x,v,iflag)
integer n,iflag
double precision x(n),v(n)
.fi
and C Calling sequence must be 
.nf
fct(int *n, double x[],double v[],int *iflag)
.fi

Incremental  link is possible (help \fVlink\fR).
.LP
.fi
\fVjac\fR is an "external".
This external returns \fVv=d(fct)/dx (x)\fR given \fVx\fR.
.LP
The simplest calling sequence for \fVjac\fR is:
.nf
[v]=jac(x).
.fi
If \fVjac\fR is a character string, it refers to a to a C or Fortran routine
which must be linked to Scilab calling sequences are the same as those
for fct. Note however that v must be a nxn array.
.SH EXAMPLES
.nf
// A simple example with fsolve 
a=[1,7;2,8];b=[10;11];
deff('[y]=fsol1(x)','y=a*x+b');
deff('[y]=fsolj1(x)','y=a');
[xres]=fsolve([100;100],fsol1);
a*xres+b
[xres]=fsolve([100;100],fsol1,fsolj1);
a*xres+b
// See routines/default/Ex-fsolve.f
[xres]=fsolve([100;100],'fsol1','fsolj1',1.e-7);
a*xres+b
.fi
.SH SEE ALSO
external, quapro, linpro, optim