Skip to content

Commit 0319089

Browse files
committed
docu
1 parent ba0d941 commit 0319089

File tree

8 files changed

+171
-64
lines changed

8 files changed

+171
-64
lines changed

pages/documentation_matlab/AxesAlignment.html

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<head>
1111
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
1212
<!--
13-
This HTML was auto-generated from MATLAB code.
14-
To make changes, update the MATLAB code and republish this document.
13+
This HTML was auto-generated from MATLAB code.
14+
To make changes, update the MATLAB code and republish this document.
1515
-->
1616
<title>On Screen Coordinate System Alignment</title>
1717
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
@@ -40,7 +40,11 @@
4040
{% endhighlight %}
4141

4242
{% highlight plaintext %}
43-
43+
ans = plottingConvention
44+
45+
outOfScreen: (0,0,1)
46+
north : (0,1,0)
47+
east : (1,0,0)
4448
{% endhighlight %}
4549
<p>The property <code class="language-plaintext highlighter-rouge">how2plot</code> is a handle class of type @plottingConvention and tells MTEX how to align the corresponding coordinate system on screen.</p>
4650
{% highlight matlab %}
@@ -58,7 +62,9 @@
5862
{% endhighlight %}
5963

6064
{% highlight plaintext %}
61-
65+
v1 = vector3d
66+
x y z
67+
1 1 1
6268
{% endhighlight %}
6369
<center>
6470
{% include inline_image.html file="AxesAlignment_02.png" %}
@@ -73,7 +79,11 @@
7379
{% endhighlight %}
7480

7581
{% highlight plaintext %}
76-
82+
ans = plottingConvention
83+
84+
outOfScreen: (0,1,0)
85+
north : (0,0,-1)
86+
east : (1,0,0)
7787
{% endhighlight %}
7888
<center>
7989
{% include inline_image.html file="AxesAlignment_03.png" %}
@@ -95,7 +105,11 @@
95105
{% endhighlight %}
96106

97107
{% highlight plaintext %}
98-
108+
pC2 = plottingConvention
109+
110+
outOfScreen: (0,0,1)
111+
north : (0,1,0)
112+
east : (1,0,0)
99113
{% endhighlight %}
100114
<center>
101115
{% include inline_image.html file="AxesAlignment_04.png" %}
@@ -118,7 +132,22 @@
118132
{% endhighlight %}
119133

120134
{% highlight plaintext %}
121-
135+
pf = PoleFigure (xyz)
136+
crystal symmetry : Quartz (321, X||a*, Y||b, Z||c*)
137+
138+
h = (02-21), r = 72 x 19 points
139+
h = (10-10), r = 72 x 19 points
140+
h = (10-11)(01-11), r = 72 x 19 points
141+
h = (10-12), r = 72 x 19 points
142+
h = (11-20), r = 72 x 19 points
143+
h = (11-21), r = 72 x 19 points
144+
h = (11-22), r = 72 x 19 points
145+
146+
ans = plottingConvention
147+
148+
outOfScreen: (0,0,1)
149+
north : (0,1,0)
150+
east : (1,0,0)
122151
{% endhighlight %}
123152
<center>
124153
{% include inline_image.html file="AxesAlignment_06.png" %}
@@ -139,7 +168,11 @@
139168
{% endhighlight %}
140169

141170
{% highlight plaintext %}
142-
171+
ans = plottingConvention
172+
173+
outOfScreen: (0,0,1)
174+
north : (0,1,0)
175+
east : (1,0,0)
143176
{% endhighlight %}
144177
</div>
145178
</body>

pages/documentation_matlab/OptimalKernel.html

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<head>
1111
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
1212
<!--
13-
This HTML was auto-generated from MATLAB code.
14-
To make changes, update the MATLAB code and republish this document.
13+
This HTML was auto-generated from MATLAB code.
14+
To make changes, update the MATLAB code and republish this document.
1515
-->
1616
<title>Optimal Kernel Selection</title>
1717
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
@@ -32,16 +32,13 @@
3232

3333
% build a density function by combining a uniform texture with two
3434
% predefined texture components
35-
odf = 0.25*uniformODF(cs) + 0.25*unimodalODF(orientation.brass(cs)) + ...
36-
0.5*fibreODF(fibre.alpha(cs),'halfwidth',10*degree);
35+
odf = 0.25*uniformODF(cs) + ...
36+
0.25 * unimodalODF(orientation.byEuler([35,45,0]*degree,cs)) + ...
37+
0.5 * fibreODF(Miller(7,-1,10,cs),vector3d(7,-5,11),'halfwidth',10*degree);
3738

3839
% plot the density function as six sigma sections
3940
plot(odf,'sections',6,'silent','sigma')
4041
mtexColorbar
41-
{% endhighlight %}
42-
43-
{% highlight plaintext %}
44-
4542
{% endhighlight %}
4643
<center>
4744
{% include inline_image.html file="OptimalKernel_01.png" %}
@@ -53,15 +50,18 @@
5350
{% endhighlight %}
5451

5552
{% highlight plaintext %}
56-
53+
ori = orientation (321 → xyz)
54+
size: 10000 x 1
5755
{% endhighlight %}
5856
<p>Next we estimate the optimal <a href="ODFShapes.html">kernel function</a> using the command <code class="language-plaintext highlighter-rouge"><a href="orientation.calcKernel.html">calcKernel</a></code> with the default settings.</p>
5957
{% highlight matlab %}
6058
psi = calcKernel(ori)
6159
{% endhighlight %}
6260

6361
{% highlight plaintext %}
64-
62+
psi = SO3DeLaValleePoussinKernel
63+
bandwidth: 43
64+
halfwidth: 5.7°
6565
{% endhighlight %}
6666
<p>This kernel can now be used to reconstruct the original ODF from the sampled points using the command <a href="DensityEsimation.html">density estimation</a>
6767
</p>
@@ -74,7 +74,9 @@
7474
{% endhighlight %}
7575

7676
{% highlight plaintext %}
77-
77+
odf_rec = SO3FunHarmonic (321 → xyz)
78+
bandwidth: 43
79+
weight: 1
7880
{% endhighlight %}
7981
<center>
8082
{% include inline_image.html file="OptimalKernel_02.png" %}
@@ -111,20 +113,24 @@ <h2 id="5">Exploration of the relationship between estimation error and number o
111113
]);
112114

113115
end
114-
{% endhighlight %}
115116

116-
{% highlight plaintext %}
117-
118-
{% endhighlight %}
119-
<p>Plot the error to the number of single orientations sampled from the original ODF.</p>
120-
{% highlight matlab %}
117+
% Plot the error to the number of single orientations sampled from the original ODF.
121118
close all;
122119
loglog(10.^(1:length(e)),e,'LineWidth',2)
123120
legend('Default','RuleOfThumb','magicRule')
124121
xlabel('Number of orientations (log scale)')
125122
ylabel('Estimation Error in degrees')
126123
title('Error between original ODF model and the reconstructed ODF','FontWeight','bold')
127124
{% endhighlight %}
125+
126+
{% highlight plaintext %}
127+
RuleOfThumb: 75° KLCV: 24° magicRule: 31°
128+
RuleOfThumb: 30° KLCV: 12° magicRule: 22°
129+
RuleOfThumb: 18° KLCV: 8° magicRule: 16°
130+
RuleOfThumb: 10° KLCV: 6° magicRule: 11°
131+
RuleOfThumb: 9° KLCV: 5° magicRule: 8°
132+
RuleOfThumb: 7° KLCV: 4° magicRule: 6°
133+
{% endhighlight %}
128134
<center>
129135
{% include inline_image.html file="OptimalKernel_03.png" %}
130136
</center>

pages/documentation_matlab/RBFApproximationTheory.html

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<head>
1111
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
1212
<!--
13-
This HTML was auto-generated from MATLAB code.
14-
To make changes, update the MATLAB code and republish this document.
13+
This HTML was auto-generated from MATLAB code.
14+
To make changes, update the MATLAB code and republish this document.
1515
-->
1616
<title>RBF-Kernel Approximation from Discrete Data</title>
1717
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
@@ -57,7 +57,12 @@
5757
{% endhighlight %}
5858

5959
{% highlight plaintext %}
60-
60+
SO3F = SO3FunRBF (1 → xyz)
61+
62+
multimodal components
63+
kernel: de la Vallee Poussin, halfwidth 5°
64+
center: 72018 orientations, resolution: 5°
65+
weight: 1
6166
{% endhighlight %}
6267
<center>
6368
{% include inline_image.html file="RBFApproximationTheory_02.png" %}
@@ -69,15 +74,19 @@
6974
{% endhighlight %}
7075

7176
{% highlight plaintext %}
72-
77+
minValue =
78+
1.1635e-06
79+
meanValue =
80+
1.0000
7381
{% endhighlight %}
7482
<p>One has to keep in mind that we can not expect the error in the data nodes to be zero, because we compute a smooth function from the noisy input data.</p>
7583
{% highlight matlab %}
7684
norm(SO3F.eval(ori) - val) / norm(val)
7785
{% endhighlight %}
7886

7987
{% highlight plaintext %}
80-
88+
ans =
89+
0.1639
8190
{% endhighlight %}
8291
<p>In contrast, if we do not tell MTEX, that we try to approximate a density function, the solver has less information and the result is not denoised.</p>
8392
{% highlight matlab %}
@@ -87,7 +96,12 @@
8796
{% endhighlight %}
8897

8998
{% highlight plaintext %}
90-
99+
SO3F = SO3FunRBF (1 → xyz)
100+
101+
multimodal components
102+
kernel: de la Vallee Poussin, halfwidth 5°
103+
center: 119088 orientations, resolution: 5°
104+
weight: 0.95
91105
{% endhighlight %}
92106
<center>
93107
{% include inline_image.html file="RBFApproximationTheory_03.png" %}
@@ -100,7 +114,12 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
100114
{% endhighlight %}
101115

102116
{% highlight plaintext %}
103-
117+
SO3F = SO3FunRBF (1 → xyz)
118+
119+
multimodal components
120+
kernel: de la Vallee Poussin, halfwidth 2°
121+
center: 1852941 orientations, resolution: 2°
122+
weight: 1
104123
{% endhighlight %}
105124
<center>
106125
{% include inline_image.html file="RBFApproximationTheory_04.png" %}
@@ -113,7 +132,12 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
113132
{% endhighlight %}
114133

115134
{% highlight plaintext %}
116-
135+
SO3F = SO3FunRBF (1 → xyz)
136+
137+
multimodal components
138+
kernel: de la Vallee Poussin, halfwidth 10°
139+
center: 70038 orientations, resolution: 5°
140+
weight: 1
117141
{% endhighlight %}
118142
<center>
119143
{% include inline_image.html file="RBFApproximationTheory_05.png" %}
@@ -126,7 +150,17 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
126150
{% endhighlight %}
127151

128152
{% highlight plaintext %}
129-
153+
S3G = SO3Grid (1 → xyz)
154+
grid: 119088 orientations, resolution: 5°
155+
Warning: Maximum number of iterations reached,
156+
result may not have converged to the optimum yet.
157+
158+
SO3F = SO3FunRBF (1 → xyz)
159+
160+
multimodal components
161+
kernel: de la Vallee Poussin, halfwidth 5°
162+
center: 72018 orientations, resolution: 5°
163+
weight: 1
130164
{% endhighlight %}
131165
<center>
132166
{% include inline_image.html file="RBFApproximationTheory_06.png" %}
@@ -147,9 +181,6 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
147181
ylabel('relative error')
148182
{% endhighlight %}
149183

150-
{% highlight plaintext %}
151-
152-
{% endhighlight %}
153184
<center>
154185
{% include inline_image.html file="RBFApproximationTheory_07.png" %}
155186
</center>
@@ -160,7 +191,12 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
160191
{% endhighlight %}
161192

162193
{% highlight plaintext %}
163-
194+
SO3F = SO3FunRBF (1 → xyz)
195+
196+
multimodal components
197+
kernel: de la Vallee Poussin, halfwidth 7.5°
198+
center: 24649 orientations, resolution: 7.5°
199+
weight: 1
164200
{% endhighlight %}
165201
<center>
166202
{% include inline_image.html file="RBFApproximationTheory_08.png" %}
@@ -173,7 +209,16 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
173209
{% endhighlight %}
174210

175211
{% highlight plaintext %}
176-
212+
psi = SO3AbelPoissonKernel
213+
bandwidth: 48
214+
halfwidth: 5°
215+
216+
SO3F = SO3FunRBF (1 → xyz)
217+
218+
multimodal components
219+
kernel: Abel Poisson, halfwidth 5°
220+
center: 3989 orientations, resolution: 5°
221+
weight: 1
177222
{% endhighlight %}
178223
<center>
179224
{% include inline_image.html file="RBFApproximationTheory_09.png" %}
@@ -189,7 +234,7 @@ <h2 id="15">Exact Interpolation</h2>
189234
{% endhighlight %}
190235

191236
{% highlight plaintext %}
192-
237+
Elapsed time is 65.813998 seconds.
193238
{% endhighlight %}
194239
<center>
195240
{% include inline_image.html file="RBFApproximationTheory_10.png" %}
@@ -201,15 +246,17 @@ <h2 id="15">Exact Interpolation</h2>
201246
{% endhighlight %}
202247

203248
{% highlight plaintext %}
204-
249+
ans =
250+
9.0528e-04
205251
{% endhighlight %}
206252
<p>Also, interpolation might not guarantee non-negativity of the function</p>
207253
{% highlight matlab %}
208254
minValue = min(SO3F)
209255
{% endhighlight %}
210256

211257
{% highlight plaintext %}
212-
258+
minValue =
259+
-7.6067
213260
{% endhighlight %}
214261
<h2 id="18">LSQR-Parameters</h2>
215262
<p>The <code class="language-plaintext highlighter-rouge">lsqr</code> solver and the <code class="language-plaintext highlighter-rouge">mlsq</code> solver, which are used to minimize the least squares problem from above has some predefined termination conditions. We can specify the method tolerance with the option <code class="language-plaintext highlighter-rouge">'tol'</code> (default 1e-3) and the maximum number of iterations by the option <code class="language-plaintext highlighter-rouge">'maxit'</code> (default 30/100).</p>
@@ -231,7 +278,13 @@ <h2 id="18">LSQR-Parameters</h2>
231278
{% endhighlight %}
232279

233280
{% highlight plaintext %}
281+
Elapsed time is 1.065290 seconds.
282+
Number of iterations = 8
283+
Value of energy functional = 0.43171
234284

285+
Elapsed time is 1.607980 seconds.
286+
Number of iterations = 41
287+
Value of energy functional = 0.0015935
235288
{% endhighlight %}
236289
</div>
237290
</body>

0 commit comments

Comments
 (0)