aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/Lagrange-maximum-degree/2d.maple
blob: a5b197c92bfab4e728c0a382a29782b26e69ce58 (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
# 2d.maple -- compute Lagrange interpolation coefficients in 2-D
# $Header$

################################################################################

#
# 2d, cube, order=1, smoothing=0 (size=2)
#

# interpolating polynomial
interp_2d_cube_order1_smooth0
	:= Lagrange_polynomial_interpolant(fn_2d_order1, coeffs_list_2d_order1,
					   coords_list_2d, posn_list_2d_size2);

# I
coeffs_as_lc_of_data(%, posn_list_2d_size2);
print_coeffs__lc_of_data(%, "coeffs_I->coeff_", "fp",
			 "2d.coeffs/2d.cube.order1.smooth0/coeffs-I.compute.c");

# d/dx
simplify( diff(interp_2d_cube_order1_smooth0,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size2);
print_coeffs__lc_of_data(%, "coeffs_dx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order1.smooth0/coeffs-dx.compute.c");

# d/dy
simplify( diff(interp_2d_cube_order1_smooth0,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size2);
print_coeffs__lc_of_data(%, "coeffs_dy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order1.smooth0/coeffs-dy.compute.c");

################################################################################

#
# 2d, cube, order=2, smoothing=0 (size=3)
#

# interpolating polynomial
interp_2d_cube_order2_smooth0
	:= Lagrange_polynomial_interpolant(fn_2d_order2, coeffs_list_2d_order2,
					   coords_list_2d, posn_list_2d_size3);

# I
coeffs_as_lc_of_data(%, posn_list_2d_size3);
print_coeffs__lc_of_data(%, "coeffs_I->coeff_", "fp",
			 "2d.coeffs/2d.cube.order2.smooth0/coeffs-I.compute.c");

# d/dx
simplify( diff(interp_2d_cube_order2_smooth0,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size3);
print_coeffs__lc_of_data(%, "coeffs_dx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order2.smooth0/coeffs-dx.compute.c");

# d/dy
simplify( diff(interp_2d_cube_order2_smooth0,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size3);
print_coeffs__lc_of_data(%, "coeffs_dy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order2.smooth0/coeffs-dy.compute.c");

# d^2/dx^2
simplify( diff(interp_2d_cube_order2_smooth0,x,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size3);
print_coeffs__lc_of_data(%, "coeffs_dxx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order2.smooth0/coeffs-dxx.compute.c");

# d^2/dxdy
simplify( diff(interp_2d_cube_order2_smooth0,x,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size3);
print_coeffs__lc_of_data(%, "coeffs_dxy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order2.smooth0/coeffs-dxy.compute.c");

# d^2/dy^2
simplify( diff(interp_2d_cube_order2_smooth0,y,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size3);
print_coeffs__lc_of_data(%, "coeffs_dyy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order2.smooth0/coeffs-dyy.compute.c");

################################################################################

#
# 2d, cube, order=3, smoothing=0 (size=4)
#

# interpolating polynomial
interp_2d_cube_order3_smooth0
	:= Lagrange_polynomial_interpolant(fn_2d_order3, coeffs_list_2d_order3,
					   coords_list_2d, posn_list_2d_size4);

# I
coeffs_as_lc_of_data(%, posn_list_2d_size4);
print_coeffs__lc_of_data(%, "coeffs_I->coeff_", "fp",
			 "2d.coeffs/2d.cube.order3.smooth0/coeffs-I.compute.c");

# d/dx
simplify( diff(interp_2d_cube_order3_smooth0,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size4);
print_coeffs__lc_of_data(%, "coeffs_dx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order3.smooth0/coeffs-dx.compute.c");

# d/dy
simplify( diff(interp_2d_cube_order3_smooth0,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size4);
print_coeffs__lc_of_data(%, "coeffs_dy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order3.smooth0/coeffs-dy.compute.c");

# d^2/dx^2
simplify( diff(interp_2d_cube_order3_smooth0,x,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size4);
print_coeffs__lc_of_data(%, "coeffs_dxx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order3.smooth0/coeffs-dxx.compute.c");

# d^2/dxdy
simplify( diff(interp_2d_cube_order3_smooth0,x,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size4);
print_coeffs__lc_of_data(%, "coeffs_dxy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order3.smooth0/coeffs-dxy.compute.c");

# d^2/dy^2
simplify( diff(interp_2d_cube_order3_smooth0,y,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size4);
print_coeffs__lc_of_data(%, "coeffs_dyy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order3.smooth0/coeffs-dyy.compute.c");

################################################################################

#
# 2d, cube, order=4, smoothing=0 (size=5)
#

# interpolating polynomial
interp_2d_cube_order4_smooth0
	:= Lagrange_polynomial_interpolant(fn_2d_order4, coeffs_list_2d_order4,
					   coords_list_2d, posn_list_2d_size5);

# I
coeffs_as_lc_of_data(%, posn_list_2d_size5);
print_coeffs__lc_of_data(%, "coeffs_I->coeff_", "fp",
			 "2d.coeffs/2d.cube.order4.smooth0/coeffs-I.compute.c");

# d/dx
simplify( diff(interp_2d_cube_order4_smooth0,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size5);
print_coeffs__lc_of_data(%, "coeffs_dx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order4.smooth0/coeffs-dx.compute.c");

# d/dy
simplify( diff(interp_2d_cube_order4_smooth0,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size5);
print_coeffs__lc_of_data(%, "coeffs_dy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order4.smooth0/coeffs-dy.compute.c");

# d^2/dx^2
simplify( diff(interp_2d_cube_order4_smooth0,x,x) );
coeffs_as_lc_of_data(%, posn_list_2d_size5);
print_coeffs__lc_of_data(%, "coeffs_dxx->coeff_", "fp",
			 "2d.coeffs/2d.cube.order4.smooth0/coeffs-dxx.compute.c");

# d^2/dxdy
simplify( diff(interp_2d_cube_order4_smooth0,x,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size5);
print_coeffs__lc_of_data(%, "coeffs_dxy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order4.smooth0/coeffs-dxy.compute.c");

# d^2/dy^2
simplify( diff(interp_2d_cube_order4_smooth0,y,y) );
coeffs_as_lc_of_data(%, posn_list_2d_size5);
print_coeffs__lc_of_data(%, "coeffs_dyy->coeff_", "fp",
			 "2d.coeffs/2d.cube.order4.smooth0/coeffs-dyy.compute.c");

################################################################################