File: derivative.cat

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 (34 lines) | stat: -rw-r--r-- 986 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
derivative         Scilab Group         Scilab Function          derivative
NAME
   derivative- approximate derivative
  
CALLING SEQUENCE
 J=derivative(f,x0,h)
 [J,J2]=derivative(f,x0,h)
PARAMETERS
 f          : Scilab function f: R^n --> R^p 
            
 x0         : real column vector (of dimension n)
            
 h          : (small) positive real number (default is 1.d-7)
            
 J          : real p x n Jacobian matrix 
            
 J2         : real p x (p*n)  matrix
            
DESCRIPTION
   Approximate derivatives of a function f: R^n --> R^p.
  
 f(x) = f(x0) + D1f(x0) *dx + 1/2* D2f(x0) *(dx.*.dx) +...
 J = D1f(x0) ; J2=D2f(x0)
   Derivatives are evaluated by finite difference:f_i(x+h)-f_i(x))/h.
  Caution: h should be carefully chosen...
  
EXAMPLE
 deff('y=f(x)','y=[sin(x(1))*cos(x(2));x(1)^2*x(2)^2;1+x(1)*x(2)^2]')
 x0=[1;2];eps=0.001;h=eps*[2;5];
 [J,J2]=derivative(f,x0);
 [f(x0+h)-f(x0)-J*h ,0.5*J2*(h.*.h)]
SEE ALSO
   mtlb_diff, derivat