aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/LODO2.ht
blob: e5021a48d099d0c76266066eaa2897b8dc06c2b4 (plain)
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
187
188
189
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\LinearOrdinaryDifferentialOperatorTwoXmpTitle}{LinearOrdinaryDifferentialOperator2}
\newcommand{\LinearOrdinaryDifferentialOperatorTwoXmpNumber}{9.46}
%
% =====================================================================
\begin{page}{LinearOrdinaryDifferentialOperatorTwoXmpPage}{9.46 LinearOrdinaryDifferentialOperator2}
% =====================================================================
\beginscroll

\spadtype{LinearOrdinaryDifferentialOperator2(A, M)} is the domain of linear
%-% \HDindex{operator!linear ordinary differential}{LinearOrdinaryDifferentialOperatorTwoXmpPage}{9.46}{LinearOrdinaryDifferentialOperator2}
ordinary differential operators with coefficients in the differential ring
\spad{A} and operating on \spad{M}, an \spad{A}-module.
This includes the cases of operators which are polynomials in \spad{D}
acting upon scalar or vector expressions of a single variable.
The coefficients of the operator polynomials can be integers, rational
functions, matrices or elements of other domains.
\showBlurb{LinearOrdinaryDifferentialOperator2}

\beginmenu
    \menudownlink{{9.46.1. Differential Operators with Constant Coefficients}}{ugxLinearOrdinaryDifferentialOperatorTwoConstPage}
    \menudownlink{{9.46.2. Differential Operators with Matrix Coefficients Operating on Vectors}}{ugxLinearOrdinaryDifferentialOperatorTwoMatrixPage}
\endmenu
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugxLinearOrdinaryDifferentialOperatorTwoConstTitle}{Differential Operators with Constant Coefficients}
\newcommand{\ugxLinearOrdinaryDifferentialOperatorTwoConstNumber}{9.46.1.}
%
% =====================================================================
\begin{page}{ugxLinearOrdinaryDifferentialOperatorTwoConstPage}{9.46.1. Differential Operators with Constant Coefficients}
% =====================================================================
\beginscroll

This example shows differential operators with rational
number coefficients operating on univariate polynomials.

\labelSpace{3pc}
\xtc{
We begin by making type assignments so we can conveniently refer
to univariate polynomials in \spad{x} over the rationals.
}{
\spadpaste{Q  := Fraction Integer \bound{Q}}
}
\xtc{
}{
\spadpaste{PQ := UnivariatePolynomial('x, Q) \free{Q}\bound{PQ0}}
}
\xtc{
}{
\spadpaste{x: PQ := 'x \free{PQ0}\bound{x}}
}
\xtc{
Now we assign \spad{Dx} to be the differential operator
\spadfunFrom{D}{LinearOrdinaryDifferentialOperator2}
corresponding to \spad{d/dx}.
}{
\spadpaste{Dx: LODO2(Q, PQ) := D() \free{Q PQ0}\bound{Dx}}
}
\xtc{
New operators are created as polynomials in \spad{D()}.
}{
\spadpaste{a := Dx  + 1 \bound{a}\free{Dx}}
}
\xtc{
}{
\spadpaste{b := a + 1/2*Dx**2 - 1/2 \bound{b}\free{Dx}}
}
\xtc{
To apply the operator \spad{a} to the value \spad{p} the usual function
call syntax is used.
}{
\spadpaste{p := 4*x**2 + 2/3 \free{x}\bound{p}}
}
\xtc{
}{
\spadpaste{a p \free{a p}}
}
\xtc{
Operator multiplication is defined by the identity \spad{(a*b) p = a(b(p))}
}{
\spadpaste{(a * b) p = a b p \free{a b p}}
}
\xtc{
Exponentiation follows from multiplication.
}{
\spadpaste{c := (1/9)*b*(a + b)**2 \free{a b}\bound{c}}
}
\xtc{
Finally, note that operator expressions may be applied directly.
}{
\spadpaste{(a**2 - 3/4*b + c) (p + 1) \free{a b c p}}
}

\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugxLinearOrdinaryDifferentialOperatorTwoMatrixTitle}{Differential Operators with Matrix Coefficients Operating on Vectors}
\newcommand{\ugxLinearOrdinaryDifferentialOperatorTwoMatrixNumber}{9.46.2.}
%
% =====================================================================
\begin{page}{ugxLinearOrdinaryDifferentialOperatorTwoMatrixPage}{9.46.2. Differential Operators with Matrix Coefficients Operating on Vectors}
% =====================================================================
\beginscroll

This is another example of linear ordinary differential
operators with non-commutative multiplication.
Unlike the rational function case, the differential ring of
square matrices (of a given dimension) with univariate
polynomial entries does not form a field.
Thus the number of operations available is more limited.

\labelSpace{1pc}
\xtc{
In this section, the operators have three by three
matrix coefficients with polynomial entries.
}{
\spadpaste{PZ   := UnivariatePolynomial(x,Integer)\bound{PZ0}}
}
\xtc{
}{
\spadpaste{x:PZ := 'x \free{PZ0}\bound{PZ}}
}
\xtc{
}{
\spadpaste{Mat  := SquareMatrix(3,PZ)\free{PZ}\bound{Mat}}
}
\xtc{
The operators act on the vectors considered as a \spad{Mat}-module.
}{
\spadpaste{Vect := DPMM(3, PZ, Mat, PZ);\free{PZ,Mat}\bound{Vect}}
}
\xtc{
}{
\spadpaste{Modo := LODO2(Mat, Vect);\free{Mat Vect}\bound{Modo}}
}
\xtc{
The matrix \spad{m} is used as a coefficient and the vectors \spad{p}
and \spad{q} are operated upon.
}{
\spadpaste{m:Mat := matrix [[x**2,1,0],[1,x**4,0],[0,0,4*x**2]]\free{Mat}\bound{m}}
}
\xtc{
}{
\spadpaste{p:Vect := directProduct [3*x**2+1,2*x,7*x**3+2*x]\free{Vect}\bound{p}}
}
\xtc{
}{
\spadpaste{q: Vect := m * p\free{m p Vect}\bound{q}}
}
\xtc{
Now form a few operators.
}{
\spadpaste{Dx : Modo := D()\bound{Dx}\free{Modo}}
}
\xtc{
}{
\spadpaste{a : Modo := Dx  + m\bound{a}\free{m Dx}}
}
\xtc{
}{
\spadpaste{b : Modo := m*Dx  + 1\bound{b}\free{m Dx}}
}
\xtc{
}{
\spadpaste{c := a*b \bound{c}\free{a b}}
}
\xtc{
These operators can be applied to vector values.
}{
\spadpaste{a p \free{p a}}
}
\xtc{
}{
\spadpaste{b p \free{p b}}
}
\xtc{
}{
\spadpaste{(a + b + c) (p + q) \free{a b c p q}}
}
\endscroll
\autobuttons
\end{page}
%