-
Notifications
You must be signed in to change notification settings - Fork 0
/
dist_tests.mac
201 lines (147 loc) · 3.04 KB
/
dist_tests.mac
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
190
191
192
193
194
195
196
197
198
199
200
201
(kill(all),0)
0$
%test heaviside
heaviside(-1);
0$
heaviside(1);
1$
heaviside(0);
1$
heaviside(3*x);
heaviside(x)$
%test delta
delta(-1);
0$
delta(1);
0$
delta(3*x);
delta(x)/3$
0*delta(x);
0$
delta(-3*x);
delta(x)/3$
delta(0): error
delta(0*x): error
%test doublet
doublet(-1);
0$
doublet(1);
0$
0*doublet(x);
0$
doublet(3*x);
doublet(x)/9$
doublet(-3*x);
-doublet(x)/9$
doublet(0): error
doublet(0*x): error
%note: make a few tests involving assumptions, such as doublet(a*x) with a
%assumed to be a real number
%derivative tests
diff(delta(t),t);
doublet(t)$
diff(delta(-3*t+2),t);
-3*doublet(-3*t+2)$
diff(heaviside(t),t);
delta(t)$
diff(heaviside(-3*t+2),t);
-3*delta(-3*t+2)$
diff(t^2*delta(2*t),t);
2*t*delta(2*t) + 2*t^2*doublet(2*t)$
diff(t^2*heaviside(2*t),t);
2*t*heaviside(2*t) + 2*t^2*delta(2*t)$
%indefinite integral tests
integrate(doublet(x),x);
delta(x)$
integrate(delta(x),x);
heaviside(x)$
integrate(heaviside(x),x);
x*heaviside(x)$
%definite integral tests
integrate(heaviside(x-2)*f(x),x,1,3);
integrate(f(x),x,2,3)$
integrate(heaviside(-x+4)*x^2,x,0,5);
64/3$
integrate(heaviside(x+2)*x,x,1,3);
0$
%note: make a few tests involving assumptions, such as int(h(t-c),t,a,b) with
%various assumptions on a,b,c
integrate(delta(x)*f(x),x,-1,1);
f(0)$
integrate(delta(x)*exp(2*x),x,-2,3);
1$
integrate(delta(x)*f(x),x,-2,-1);
0$
integrate(delta(x)*f(x),x,1,2);
0$
integrate(delta(2*x)*cos(x),x,-4,4);
1/2$
integrate(delta(2*x-2)*(x^2),x,-4,4);
1/2$
integrate(delta(2*x-2)*x^2,x,-3,1/2);
0$
integrate(delta(2*x-2)*x^2,x,0,1)
%see above note. Also, here we will have to add a fifth argument to the
%integrate command to indicate a closed or open interval, and we have to
%decide which is the default.
integrate(doublet(x)*f(x),x,-1,1);
f'(0)$
integrate(doublet(x)*exp(2*x),x,-2,3);
2$
integrate(doublet(x)*f(x),x,-2,-1);
0$
integrate(doublet(x)*f(x),x,1,2);
0$
integrate(doublet(2*x)*cos(x),x,-4,4):
integrate(doublet(2*x-2)*(x^2),x,-4-4):
integrate(doublet(2*x-2)*x^2,x,-3,1/2);
0$
integrate(doublet(2*x-2)*x^2,x,0,1)
%see notes about assumptions and open/closed interval
%Verify abstract linearity
laplace(f(t)+g(t),t,s) : laplace(f(t),t,s) + laplace(g(t),t,s)
laplace(a*f(t),t,s): a*laplace(f(t),t,s)
laplace(a*f(t)+b*g(t),t,s): a*laplace(f(t),t,s) + b*laplace(g(t),t,s)
%Verify "naked" functions laplace transforms
sin(5*t)
sin(a*t)
sin(5*t+1)
sin(a*t+b)
sinh(5*t)
sinh(a*t)
sinh(5*t+1)
sinh(a*t+b)
cos(6*t)
cos(a*t)
cos(5*t+1)
cos(a*t+b)
cosh(5*t)
cosh(a*t)
cosh(5*t+1)
cosh(a*t+b)
exp(-2*t)
exp(a*t)
log(3*t)
log(a*t)
erf(2*t)
erf(a*t)
erf(2*t+3) (question: do we want a*t+b, or just a*t?)
erf(a*t+b)
bessel_j(3,4*t)
bessel_j(n,a*t)
heaviside(3*t)
heaviside(2*t+4)
heaviside(-2*t+4)
heaviside(a*t+b) %for various assumptions
delta(3*t)
delta(2*t+4)
delta(-2*t+4)
delta(a*t+b) %for various assumptions
doublet(3*t)
doublet(2*t+4)
doublet(-2*t+4)
doublet(a*t+b) %for various assumptions
%think up more laplace tests involving products, exponentials, derivatives,
%integrals and invlaps
%inverse laplace tests needed
%desolve tests needed