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
|
fsolve(G) Scilab Function fsolve(G)
NAME
fsolve - find a zero of a system of n nonlinear functions
CALLING SEQUENCE
[x [,v [,info]]]=fsolve(x0,fct [,fjac] [,tol])
PARAMETERS
x0 : real vector (initial value of function argument).
fct : external (i.e function or list or string).
fjac : external (i.e function or list or string).
tol : real scalar. precision tolerance: termination occurs when the
algorithm estimates that the relative error between x and the
solution is at most tol. (tol=1.d-10 is the default value).
x : real vector (final value of function argument, estimated zero).
v : real vector (value of function at x).
info : termination indicator
0 : improper input parameters.
1 : algorithm estimates that the relative error between x and the
solution
is at most tol.
2 : number of calls to fcn reached
3 : tol is too small. No further improvement in the approximate
solution x is possible.
4 : iteration is not making good progress.
DESCRIPTION
find a zero of a system of n nonlinear functions in n variables by a modif-
ication of the powell hybrid method. Jacobian may be provided.
0 = fct(x) w.r.t x.
fct is an "external". This external returns v=fct(x) given x.
The simplest calling sequence for fct is:
[v]=fct(x).
If fct is a character string, it refers to a fortran routine which must be
linked to Scilab (see fsolvf.f for the calling sequence). Dynamic link is
possible (help link).
jac is an "external". This external returns v=d(fct)/dx (x) given x.
The simplest calling sequence for jac is:
[v]=jac(x).
If jac is a character string, it refers to a fortran routine which must be
linked to Scilab (see fsolvj.f for the calling sequence). Dynamic link is
possible (help link).
EXAMPLES
// 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
SEE ALSO
external, quapro, linpro, optim
|