File: rational_funcs.man

package info (click to toggle)
tcllib 1.20%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 68,064 kB
  • sloc: tcl: 216,842; ansic: 14,250; sh: 2,846; xml: 1,766; yacc: 1,145; pascal: 881; makefile: 107; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (186 lines) | stat: -rw-r--r-- 4,675 bytes parent folder | download | duplicates (2)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin math::rationalfunctions n 1.0.1]
[keywords math]
[keywords {rational functions}]
[copyright {2005 Arjen Markus <arjenmarkus@users.sourceforge.net>}]
[moddesc   {Math}]
[titledesc {Polynomial functions}]
[category  Mathematics]
[require Tcl [opt 8.4]]
[require math::rationalfunctions [opt 1.0.1]]

[description]
[para]
This package deals with rational functions of one variable:

[list_begin itemized]
[item]
the basic arithmetic operations are extended to rational functions
[item]
computing the derivatives of these functions
[item]
evaluation through a general procedure or via specific procedures)
[list_end]

[section "PROCEDURES"]

The package defines the following public procedures:

[list_begin definitions]

[call [cmd ::math::rationalfunctions::rationalFunction] [arg num] [arg den]]

Return an (encoded) list that defines the rational function. A
rational function
[example {
             1 + x^3
   f(x) = ------------
          1 + 2x + x^2
}]
can be defined via:
[example {
   set f [::math::rationalfunctions::rationalFunction [list 1 0 0 1] \
             [list 1 2 1]]
}]

[list_begin arguments]
[arg_def list num] Coefficients of the numerator of the rational
function (in ascending order)
[para]
[arg_def list den] Coefficients of the denominator of the rational
function (in ascending order)
[list_end]

[para]

[call [cmd ::math::rationalfunctions::ratioCmd] [arg num] [arg den]]

Create a new procedure that evaluates the rational function. The name of the
function is automatically generated. Useful if you need to evaluate
the function many times, as the procedure consists of a single
[lb]expr[rb] command.

[list_begin arguments]
[arg_def list num] Coefficients of the numerator of the rational
function (in ascending order)
[para]
[arg_def list den] Coefficients of the denominator of the rational
function (in ascending order)
[list_end]

[para]

[call [cmd ::math::rationalfunctions::evalRatio] [arg rational] [arg x]]

Evaluate the rational function at x.

[list_begin arguments]
[arg_def list rational] The rational function's definition (as returned
by the rationalFunction command).
order)

[arg_def float x] The coordinate at which to evaluate the function

[list_end]

[para]

[call [cmd ::math::rationalfunctions::addRatio] [arg ratio1] [arg ratio2]]

Return a new rational function which is the sum of the two others.

[list_begin arguments]
[arg_def list ratio1] The first rational function operand

[arg_def list ratio2] The second rational function operand

[list_end]

[para]

[call [cmd ::math::rationalfunctions::subRatio] [arg ratio1] [arg ratio2]]

Return a new rational function which is the difference of the two
others.

[list_begin arguments]
[arg_def list ratio1] The first rational function operand

[arg_def list ratio2] The second rational function operand

[list_end]

[para]

[call [cmd ::math::rationalfunctions::multRatio] [arg ratio1] [arg ratio2]]

Return a new rational function which is the product of the two others.
If one of the arguments is a scalar value, the other rational function is
simply scaled.

[list_begin arguments]
[arg_def list ratio1] The first rational function operand or a scalar

[arg_def list ratio2] The second rational function operand or a scalar

[list_end]

[para]

[call [cmd ::math::rationalfunctions::divRatio] [arg ratio1] [arg ratio2]]

Divide the first rational function by the second rational function and
return the result. The remainder is dropped

[list_begin arguments]
[arg_def list ratio1] The first rational function operand

[arg_def list ratio2] The second rational function operand

[list_end]

[para]

[call [cmd ::math::rationalfunctions::derivPolyn] [arg ratio]]

Differentiate the rational function and return the result.

[list_begin arguments]
[arg_def list ratio] The rational function to be differentiated

[list_end]

[para]

[call [cmd ::math::rationalfunctions::coeffsNumerator] [arg ratio]]

Return the coefficients of the numerator of the rational function.

[list_begin arguments]
[arg_def list ratio] The rational function to be examined
[list_end]

[para]

[call [cmd ::math::rationalfunctions::coeffsDenominator] [arg ratio]]

Return the coefficients of the denominator of the rational
function.

[list_begin arguments]
[arg_def list ratio] The rational function to be examined
[list_end]

[para]

[list_end]

[section "REMARKS ON THE IMPLEMENTATION"]

The implementation of the rational functions relies on the
math::polynomials package. For further remarks see the documentation on
that package.

[vset CATEGORY {math :: rationalfunctions}]
[include ../common-text/feedback.inc]
[manpage_end]