law:cubic
List of: Scheme Extensions
Subjects: Laws, Mathematics
Contents: Kernel

Action: Creates a cubic law given {a,b,f(a),f(b),f'(a),f'(b)}.

Filename: kern/kern_scm/law_scm.cxx

APIs: api_make_cubic

Syntax: (law:cubic a b f-a f-b df-a df-b)

Arg Types: a real

b real

f-a real

f-b real

df-a real

df-b real

Returns: boolean

Description: Produces a cubic a polynomial with given boundary conditions for both it and its first derivative.


a and b specifies the boundary values.


f-a and f-b are the desired output of the law at a and b.


df-a and df-b are the desired output of the first derivative at a and b.

Example: ; law:cubic

; Create a law.

(define law1 (law:cubic 0 1 2 3 4 5))

;; law1

; According to the definition, if a 0 is input,

; the output should be 2 and its first derivative

; at 0 is 4.

(law:eval law1 0)

;; 2

(law:eval law1 1)

;; 3

(define deriv (law:derivative law1))

;; deriv

(law:eval deriv 0)

;; 4

(law:eval deriv 1)

;; 5
PDF/KERN/14SCI.PDF
HTM/DATA/KERN/KERN/14SCI/0006.HTM