Last modified by purisha@helsinki_fi on 2024/03/27 10:46

Show last authors
1 = Applications of matrix computations, fall 2015 =
2
3
4
5 {{panel}}
6 **Teacher:** [[Samuli Siltanen>>doc:mathstatHenkilokunta.Siltanen, Samuli]]
7
8 **Scope:** 5 cr
9
10 **Type:** Intermediate studies
11
12 **Topics: **Mathematical modelling using matrices and linear algebra. Many practical applications with a special focus on digital image processing.
13
14 **Prerequisites: **Basic linear algebra. Rudimentary knowledge of Matlab programming is helpful.
15 {{/panel}}
16
17
18
19 Mathematics is applied everywhere in modern life. Whenever you play an mp3 music file, a mathematical algorithm is transforming the zeros and ones in the file into music. Medical CT scans (Computed Tomography) are calculated using mathematical formulas. Washing machines, traffic light control centres, car transmissions and Internet search engines are following sets of mathematical instructions.
20
21 It is important to note that the connection between abstract mathematics and the real world is provided by **algorithms**. Useful mathematics cannot be made only on blackboard, what is needed in addition is **programming**.
22
23 (% style="color: rgb(255,0,0);" %)**The aim of this course is to train the students in mathematical modelling and problem-solving using algorithms.**
24
25 Here are some past topics of this course.
26
27 === Calculation of lighting for a virtual room using the radiosity method (images by Topi Talvitie): ===
28
29 === [[image:attach:radiosity_mesh.png||height="250"]][[image:attach:radiosity_room_small.png||height="250"]] ===
30
31 === Dividing a photo into its low-frequency and high-frequency components: ===
32
33 === [[image:attach:Bonsai_all2.jpg||height="250"]] ===
34
35 === Defusing a photobomb (removing an unwanted object from a photo): ===
36
37 [[image:attach:Photobomb.jpg||height="250"]] [[image:attach:Photobomb_inpainted.jpg||height="250"]]
38
39
40
41 ----
42
43 == Teaching schedule ==
44
45 Weeks 44-49, Wed 10-12 in hall CK112, Fri 12-14 in hall B123 of Exactum. Two hours of exercise classes per week. The course is lectured mainly in English, and the course material will all be available in English.
46
47 ==== Lecture on Wednesday, October 28, 2015 ====
48
49 Examples of application areas for matrix computations: X-ray tomography, radiosity lighting model, finite element method (FEM) calculations, focus stacking, Google PageRank algorithm.
50
51 Slides: [[General introduction (5.3MB)>>attach:CourseIntroduction.pdf]], discussion of [[matrices and X-ray tomography (42MB)>>url:http://www.siltanen-research.net/TomographyIntro_v5.pdf||shape="rect"]].
52
53 ==== Lecture on Friday, October 30, 2015 ====
54
55 Simple example of a system of two linear equations. For the Matlab file, see [[attach:FarmExample.m]]. Further: we considered an example with three equations for two variables that has no solution, and calculated a least squares solution for it. See the Matlab file [[attach:LeastSquaresExample1.m]]. We took a look at the definition of //least squares solution// and //minimum norm solution.// Here is some material explaining them: [[attach:LeastSquaresStuff_v1.pdf]].
56
57 ==== Lecture on Wednesday, November 4, 2015 ====
58
59 Discussion about least squares solutions. Derivation of the normal equations based on differentiation; here is a [[Matlab illustration file>>attach:Qminimum_v2.m]] and the functional [[attach:Qfunctional.m]] needed therein.
60
61 As a specific application we considered fitting a linear model to noisy data, see Chapter 3 in the revised note [[attach:LeastSquaresStuff_v2.pdf]]. Here is the Matlab demonstration routine: [[attach:DataFitExample1.m]]. Finally we did a measurement of noisy time-temperature evolution data using an electric kettle.
62
63 ==== Lecture on Friday, November 6, 2015 ====
64
65 Short discussion about how to organize and sort the electric kettle data from the previous lecture.
66
67 Markov chain modeling of simple market share information. See [[attach:TeleOperatorComputation.pdf]], [[attach:TeleOperatorComputation.m]].
68
69 Elementary introduction to Google's PageRank algorithm in a very simple case. [[attach:FivePageInternet.pdf]], [[attach:FivePageInternet.m]].
70
71 ==== Lecture on Wednesday, November 11, 2015 ====
72
73 Fourier series in dimension one: an introduction to the world of Fourier techniques. See [[attach:FourierSeries.pdf]] and the Matlab routine [[attach:FourierSerIntro.m]]. (In case you are interested in deeper understanding of Fourier transforms and harmonic analysis, the course [[Fourier Analysis>>url:https://wiki.helsinki.fi/display/mathstatKurssit/Fourier+analysis,+fall+2015||shape="rect"]] by Professor Kari Astala is highly recommended.)
74
75 For a sneak peak on two-dimensional Fast Fourier Transform (FFT) for images, try out the Matlab routine [[attach:FFTdemo2D.m]]. You will also need the image file [[attach:BigBen.jpg]].
76 [[image:attach:BigBen.jpg||thumbnail="true" height="150"]]
77
78 ==== (% style="color: rgb(0,0,0);" %)No lecture on Friday, November 13, 2015(%%) ====
79
80 (% style="color: rgb(0,0,0);" %)There is a PhD dissertation in the lecture hall, so the lecture is cancelled.
81
82 (% style="color: rgb(0,0,0);" %)However, there is homework! Please do the following before the lecture on Wednesday, November 18:
83
84 (% style="color: rgb(0,0,0);" %)(1) Read the Wikipedia entry about Fourier series: [[(% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)https:~~/~~/en.wikipedia.org/wiki/Fourier_series>>url:https://en.wikipedia.org/wiki/Fourier_series||shape="rect"]]
85
86 (% style="color: rgb(0,0,0);" %)(2) Take a photograph (with your smartphone or any other digital camera) where something in the picture is in focus and something is not at all in the focus. Here are instructions: [[(% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)PhotoInstruction.pdf>>attach:PhotoInstruction.pdf]]
87
88 (% style="color: rgb(0,0,0);" %)
89
90 ==== Lecture on Wednesday, November 18, 2015 ====
91
92 One-dimensional FFT analysis of the sounds of dialing numbers with a cell phone.
93 Matlab resources: [[attach:PhoneSoundAnalysis.m]]
94 Data file, recorded in my office and tapping the phone twice to the table between every number dialling sound: [[attach:phone1234567890.m4a]]
95
96 (% style="color: rgb(0,0,0);" %)Two-dimensional FFT analysis of an image showing lichen (Cladonia fimbriana). The aim is to divide the image into little patches and analyse the sharpness of each patch separately using FFT. 
97 Matlab resources: [[(% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)PrepareImage.m>>attach:PrepareImage.m]](%%), [[(% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)FocusDetect.m>>attach:FocusDetect.m]](%%), [[(% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)MyScaleIm.m>>attach:MyScaleIm.m]](%%)
98 Data file: [[attach:CladoniaFimbriana.jpg]]
99 [[image:attach:CladoniaFimbriana.jpg||height="250"]]
100
101 (% style="color: rgb(0,0,0);" %)
102
103
104 (% style="color: rgb(0,0,0);" %)
105
106 ==== Lecture on Friday, November 20, 2015 ====
107
108 Discussion of FFT-based detection of well-focused areas in a photo. Matlab file: [[attach:FocusDetect.m]]
109
110 Geometric morphometrics project regarding maple leaves. All students attending the lecture got a dried maple leaf, from which landmark data should be measured. The Matlab file for doing that is here: [[attach:CollectLandmarks.m]]. The landmarks were agreed to be the ones given in this image~: [[attach:MapleLeafLandmarks.png]]
111
112 [[image:attach:MapleLeafLandmarks.png||height="250"]]
113
114 I kindly ask every student who has a leaf to
115 (1) scan it,
116 (2) collect landmark data saved in a file called landmarks.mat, and
117 (3) send the file to the same email address where the exercises are sent.
118
119 Please send the data files at latest during Monday, November 23. Every student who sends such a file on Monday or sooner will get one exercise point.
120
121 If you were not in the lecture but would like to take part, you may still find a maple leaf either in a tree or on the ground.
122
123 (% style="color: rgb(0,0,0);" %)
124
125 ==== Lecture on Wednesday, November 20, 2015 ====
126
127 Procrustes analysis of shapes represented by landmark coordinates.
128
129 Here is an explanation how the Procrustes analysis is done in the case of two triangles: [[attach:Procrustes_triangles.pdf]].
130 The related Matlab routine is this: [[attach:Procrustes_twotriangles.m]].
131
132 This is how the first two of the maple leaf landmark sets look like before and after Procrustes analysis:
133
134 [[image:attach:leaf_orig.png||height="400"]][[image:attach:leaf_optimal.png||height="400"]]
135
136 The above images were produced by the Matlab routine [[attach:Procrustes_twoleaves.m]] when applied to the dataset [[attach:MapleLeafLandmarks.mat]] collected by the students.
137
138 (The 16th data of [[attach:MapleLeafLandmarks.mat]]was wrongly input. Exclude this in calculation.)
139
140 ==== Lecture on Friday, November 27, 2015. ====
141
142 Principal Component Analysis (PCA) as a method of analysing variability in data. We created a simulated dataset of triangles with extra variability in the y-coordinate of the top vertex.
143
144 Left image~: simulated data. Right: variability among the first principal component.
145
146 [[image:attach:tr_data.png||height="400"]][[image:attach:tr_firstvar.png||height="400"]]
147
148 Matlab files: [[attach:PCA2variant.m]], [[attach:triangledataset.m]], [[attach:triangledataset_PCA.m]]
149
150 ==== Lecture on Wednesday, December 2, 2015. ====
151
152 Finite difference solution method for the Poisson equation. See [[attach:Poisson_FD_v2.pdf]].
153
154 Matlab resources: [[attach:FD_Laplace.m]], [[attach:Poisson_FDsolve.m]].
155
156 ==== [[image:attach:Uuzi.gif]]Lecture on Friday, December 4, 2015. ====
157
158 [[image:attach:HippoR.png||height="250"]] [[image:attach:HippoR2.png||height="250"]]
159
160 Defusing a black-and-white photobomb, or in other words removing the unwanted hippo from the photograph.
161
162 Matlab file: [[attach:Photobomb_defuse.m]]
163
164 Image: [[attach:Photobomb.jpg]]
165
166 ----
167
168 == Exams ==
169
170 There is no exam, only weekly exercises.
171
172 == Course material ==
173
174 This course does not follow any specific material. All material needed will be available on this webpage.
175
176 (% class="p1" %)
177 If you are not familiar with Matlab, please check out Chapter 1 of [[http:~~/~~/www.imc.tue.nl/>>url:http://www.imc.tue.nl/||style="line-height: 1.42857;" shape="rect"]].
178
179 == [[Registration>>url:https://oodi-www.it.helsinki.fi/hy/opintjakstied.jsp?html=1&Tunniste=57079||shape="rect"]] ==
180
181
182 (% style="color: rgb(96,96,96);" %)Did you forget to register? (%%)[[What to do?>>url:https://wiki.helsinki.fi/display/mathstatOpiskelu/Kysymys4||style="text-decoration: underline;" shape="rect"]]
183
184 == Exercises ==
185
186 You gain credits from this course only by computing the exercises (there is no exam). There are four simple one-score exercises and two more challenging three-score exercises per week (tentative). To gain the exercise score send a **single pdf-file **(no other formats are accepted!) written with your favourite text-editing program and** containing your matlab codes (as text), results, images, comments and explanations** to the e-mail address [[application.matrixcomputation@gmail.com>>mailto:application.matrixcomputation@gmail.com||rel="nofollow" shape="rect" class="external-link"]] **by Monday 10 a.m**. **after the exercise week** (for ex. by 9th November 10 a.m. for Exercise 1). Please write the answers in **English**.
187
188 Please write in the text of your e-mail which tasks are included in your solution (for ex. //Hi! I am sending my solutions to tasks 1, 2, 3, and 5 in the 1st exercise round. Best wishes, Mary Math//). Max number of pages is limited to 15. The assistant will **not** reply the e-mails. 
189
190 The exercise groups are for getting advice from an assistant in solving the exercise problems. (Participating the exercise class is not obligatory)
191
192 The exercise assistant are [[Zenith Purisha>>url:https://wiki.helsinki.fi/display/mathstatHenkilokunta/Purisha,+Zenith||rel="nofollow" shape="rect"]] and Topias Rusanen.
193
194
195
196 === Exercise classes ===
197
198 |=(((
199 Group
200 )))|=(((
201 Day
202 )))|=(((
203 Time
204 )))|=(((
205 Room
206 )))|=(% colspan="1" %)(((
207 Instructor
208 )))
209 |(((
210 1.
211 )))|(((
212 Tuesdays
213 )))|(((
214 12 - 2 pm
215 )))|(((
216 C 128
217 )))|(% colspan="1" %)(((
218 Zenith Purisha
219 )))
220 |(((
221 2.
222 )))|(((
223 Thursdays
224 )))|(((
225 12 - 2 pm
226 )))|(((
227 C 128
228 )))|(% colspan="1" %)(((
229 Topias Rusanen
230 )))
231 |(((
232
233 )))|(((
234
235 )))|(((
236
237 )))|(((
238
239 )))|(% colspan="1" %)(((
240
241 )))
242 |(% colspan="1" %)(((
243
244 )))|(% colspan="1" %)(((
245
246 )))|(% colspan="1" %)(((
247
248 )))|(% colspan="1" %)(((
249
250 )))|(% colspan="1" %)(((
251
252 )))
253 |(% colspan="1" %)(((
254
255 )))|(% colspan="1" %)(((
256
257 )))|(% colspan="1" %)(((
258
259 )))|(% colspan="1" %)(((
260
261 )))|(% colspan="1" %)(((
262
263 )))
264 |(% colspan="1" %)(((
265
266 )))|(% colspan="1" %)(((
267
268 )))|(% colspan="1" %)(((
269
270 )))|(% colspan="1" %)(((
271
272 )))|(% colspan="1" %)(((
273
274 )))
275 |(% colspan="1" %)(((
276
277 )))|(% colspan="1" %)(((
278
279 )))|(% colspan="1" %)(((
280
281 )))|(% colspan="1" %)(((
282
283 )))|(% colspan="1" %)(((
284
285 )))
286
287 == Course feedback ==
288
289 Course feedback can be given at any point during the course. Click [[here>>url:https://elomake.helsinki.fi/lomakkeet/11954/lomake.html||style="line-height: 1.4285;" shape="rect"]].