MAT-VET-F 20002 Examensarbete 15 hp June 2020

Investigating strains on the using photogrammetry and finite element modeling

Andreas Eriksson Erik Thermaenius Abstract Investigating strains on the Oseberg ship using photogrammetry and finite element modeling Andreas Eriksson, Erik Thermaenius

Teknisk- naturvetenskaplig fakultet UTH-enheten The Oseberg ship is known as one of the finest surviving artifacts from the age, with origins dated back to the 800s. The ship has been displayed in the Viking ship Besöksadress: museum in since 1926. The nearly 100 years on museum display along with the Ångströmlaboratoriet Lägerhyddsvägen 1 over 1000 years it was buried has weakened the structure of the ship. To slow down Hus 4, Plan 0 the deterioration, several research projects has been initiated, among them the project ''Saving Oseberg''. A part of ''Saving Oseberg'' is contributing to the planning Postadress: of a new museum for the ship. As a basis for the planning, the ship has been Box 536 751 21 Uppsala monitored with photogrammetry. This is intended as a way to visualise the deformation and displacements of the ship due to seasonal changes in indoor Telefon: temperature and humidity. 018 – 471 30 03

Telefax: In this thesis the photogrammetry data from the hull of the ship was used to make a 018 – 471 30 00 finite element model, and through this model calculate the average strain on each element. The method was based on a previous research project conducted on the Hemsida: Swedish warship by a research group at the Division of Applied Mechanics at http://www.teknat.uu.se/student . The measurements of the ship was formed into a hull by Delaunay triangulation. The strain was approximated as a Green strain and evaluated using isoparametric mapping of the elements. Through the nodal displacements, the strain was evaluated by approximating the elements as tetrahedrons and calculating the average strain from these elements between the measurements. The showed an oscillating behavior of the displacements, proving the proposal of seasonal depending displacements. The measured principal strains also matched to the corresponding relative humidity fluctuation during the year. The strain magnitude was relatively even throughout the ship, mostly varying between ±0.4% but certain areas were more subjected than others. A few elements on the starboard side showed very large strains through most of the measurements, this seemed very unusual and was probably the result of inaccuracies or errors in the data. Though the ship is subjected to relative small strains and permanent displacements after annual cycles, the mechano-sorptive strains may lead to accumulated deformation and eventually failure in the weak parts of the wood or at the high stress concentraion parts. In addition, the cyclic strain even in elastic range may cause fatigue failure in any material which could pose a large threat for the future conservation of the ship.

Handledare: Kristofer Gamstedt, Reza Afshar Ämnesgranskare: Johan Gising Examinator: Martin Sjödin ISSN: 1401-5757, MAT-VET-F 20002 Tryckt av: Uppsala Populärvetenskaplig sammanfattning

Osebergsskeppet är känd som en av de bäst bevarade och mest åtråvärda artefakterna som överlevt från Vikingatiden. Det stora långskeppet med en omkrets på över 40 meter hittades i en gravplats utanför staden Tønsberg i Norge år 1904 och grävdes upp följande år av arkeologerna och . Till en början förvarades skeppet i en av Oslo Universitets lokaler till dess att Vikingaskeppsmuséet slog upp sina dörrar år 1926, där det befunnit sig sedan dess. Trots att skeppet inte brytits ned under de 1000 år det varit begravet har denna process nu ökat takten. Ett flertal forskningsprojekt har initierats för att sakta ned nedbrytningen och möjliggöra skeppets förefintlighet, bland annat det pågående ”Saving Oseberg”. Då museet som huserar Osbergsskeppet är en gammal byggnad som saknar en modern klimatanläg- gning vilken kan reglerar inomhustemperatur och luftfuktighet till ideala förhållanden så ingår det i ”Saving Oseberg” att bidra med projekteringen till det nya muséet. En forskare har som underlag till projekteringen för den nya muséebyggnaden gjort punktmätningar över skrovet på skeppet med jämna mellanrum. Målet med dessa mätningar är att se hur de uppmätta punkterna förflyttas mellan mättillfällena vilket ger möjlighet att analysera deformationen av skeppet. Detta var syftet med det presenterade kandidatarbetet, som innebar att skapa en modell av skeppet från all mätdata och utifrån förflyttningarna i mätdatan översätta det till töjningar i skrovet på skeppet i %. Mätdatan på skeppet analyserades med programvaran Matlab, där det sammanfogades och tri- angulerades till ett tvådimensionellt skal av skrovet. Utifrån förflyttningarna av mätpunkterna, beräknades den genomsnittliga töjningen på varje triangel (även kallat element) som bygger upp skrovet för varje mätning. Töjning visualiserades med hjälp av en färgskala, där negativ och positiv töjning färgade elementen blå respektive röda. Detta gjorde det enkelt att överblicka skeppet och identifiera s.k. ”hotspots” som utsätts för större töjningar än övriga delar på skeppet. Dessutom visualiserades medelvärdet av mätpunkternas förflyttningar vid varje mättillfälle för de två sidorna på skeppet i en graf. Resultatet visade att det fanns delar på skeppet som var mer utsatta än andra, särskilt utsatt var relingen runt båten och delar av kölen. Detta förklarades enklast av att relingen saknar samma stöd som resten av skrovet och eftersom ungefär halva tyngden av skeppet vilar på kölen medför detta en högre belastning och därmed större töjningar. Halva tyngden eftersom den andra halvan är fördelat på stöttor runt sidorna av skeppet. När medelvärdet av förflyttningarna studerades uppmärksammades ett cykliskt beteende av förflyttningarna på babordsidan vilket troligen beror på årstidsvariationer i temperatur och luftfuktighet, då förflyttningar återfanns på ungefär samma positioner ett år senare. Styrbordsidan var dock mycket mer utsatt och hade ett delvis cyklisk beteende men att utslagen var betydligt högre. För alla skeppets delar syntes även flera element vars töjning var flera storleksordningar högre än elementen runt om. Detta var väldigt orimligt, och vad det berodde på blev inte klarlagt. Troligen något fel i den ursprungliga mätdatan. Slutsatsen blev att skeppet utsätts för töjningar, att dessa skiljde sig på olika delar av skeppet och att förflyttningarna varierade cykliskt under året. Med viss osäkerhet inkluderat så var resultatet relativt väntat och rimligt.

i Acknowledgements

We, the authors of this thesis, would first of all like to express our gratitude towards our supervi- sors, professor Kristofer Gamstedt and researcher Reza Afshar from the Division of Applied Mechanics at Uppsala University. Both for introducing the project to us and for their guidance and valuable input throughout the project. Along with their previous work on a similar project which has been a helpful inspiration for the general structure of this thesis. Secondly, we want to thank doctoral research fellow David Hauer from the Department of Col- lection Management at Oslo University who is the researcher from ”Saving Oseberg” behind this project. His help with supplying us with the data and answering all our question regarding the data and ”Saving Osberg”-project in general was much appreciated. We would also like to thank our project mentor, researcher Johan Gising from the Division of Drug Design and Discovery and the Division of Nanotechnology and Functional Materials at Uppsala University. His effort in managing the stage-gates, and his positive feedback and support when the project was falling behind the planned time schedule was a great help in keeping us on track. Finally, we would like to acknowledge our dear classmates who kept us company during the whole time span of the project. From the lunches in the sun, to the activities on the nights and weekends was truly delightful highlights which kept our moral high considering the unexpected pandemic which fully broke out just days prior to the start of the project. Without their contributions, this thesis would not had been made possible.

Andreas Eriksson Erik Thermaenius Uppsala, May 2020

ii Contents

1Introduction 1 1.1 Background ...... 1 1.2 Objective ...... 2 1.3 Aims ...... 2

2Theory 3 2.1 Strainanddeformation...... 3 2.2 Finiteelements ...... 7 2.3 Isoparametricmapping...... 10 2.4 Delaunaytriangulation...... 13 2.5 Mapping between vector spaces ...... 14

3Method 17 3.1 Calculatingthestrain ...... 17 3.2 Verifyingthestraincalculation ...... 18 3.3 Measurementsoftheship ...... 20 3.4 Utilisingthemeasurementdata ...... 22

4Results 25

5Discussion 38

6 Conclusions 39

Appendix A Strain analysis A.1 A.1 strain.m ...... A.1 A.2 elementInOnePlane.m ...... A.2 A.3 colourFromStrain.m ...... A.2 A.4 assemble.m ...... A.4 A.5 centerDataInSphere.m ...... A.7

iii Glossary aft The direction towards the stern, or rear of a ship. 26, 28, 38 bow The direction towards the stem, or front of a ship. 26, 28, 38 engineering strain Describes strain during a deformation as the ratio between the change of length from the initial dimension and the original length. 3, 6 functional A mathematical construction that maps a vector space into a field of scalars. 7, 8 gunwale The top edge of the hull of a ship. 38, 39 port The left facing side of a ship relative the direction the ship is heading. 20, 21, 25–27, 30, 32, 34, 35, 38 shear strain Describes the strain as the change of angles between two points on an element during a deformation. 6 starboard The right facing side of a ship relative the direction the ship is heading. 20, 25, 28–30, 32, 36–38 stem The forward-facing part of a ship. 1, 20, 25, 32, 33, 38 stern The back part of a ship. 1, 20, 21, 25, 30, 31, 38 strake A strip of planking running alongside the bottom and sides of a ship, making up its’ hull. 18, 22

Stem

Stern

Gunwale -

6 Port Starboard Strake

An illustration of the nautical terms described in the glossaries. Note that the gunwale is marked in blue and a strake is marked in red.[1]

iv 1 Introduction

1.1 Background The Oseberg Ship is known to be one of the finest and most well-preserved artefacts from the Viking Era. The over 20 meters long and 5 meters broad ship of the type Karve was found in 1903 at a large burial mound near the Norwegian town of Tønsberg and excavated the following years 1904-1905 by the Norwegian archaeologist Haakon Shetelig and Swedish archaeologist Gabriel Gustafson, see Figure 1.1a. The age of the ship has not been determined exactly, researchers have seen that timber found in the grave with the ship is from the year 834 AD but the ship is thought to be older.[2] Since the excavation, the most deteriorated artefacts of the find were treated with alum as a conser- vation process. However, the oak built ship was in better condition and could be slowly air dried, it was only surface treated with a mixture of creosote and linseed oil. [3] Completely destroyed parts were reconstructed with new wood, among them were the posts on the stem and stern. The ship was then stored at the temporally until the first halls of the Viking Ship Museum in Oslo were finished in 1926 and the ship was moved where it has been ever since, see Figure 1.1b.[2][4] Being displayed in the museum hall in over 90 years, the ship has slowly been degrading and shown signs of deformation and fracture formations, it was not until the 2000s that the extent of the degradation became apparent.[4]

(a) (b)

Figure 1.1: (a) The Oseberg Ship being excavated outside Tønsberg.[5] (b) The ship displayed in the Viking Ship Museum in Oslo.[6]

In 2014 a research project was launched called ”Saving Oseberg” with the aim of preventing and if possible stop the deterioration of the ship.[4] One part of the ”Saving Oseberg”-project is contributing to the planning of a new museum and the future move of the ships to the new building. The group has been monitoring the ship through photogrammetric surveillance, making point-wise position measuring of the ship on a regular basis. The researchers have observed that the measured positions of the ship are not consistent throughout the year, but instead are displaced from the original position due to seasonal changes in the indoor climate. The Viking Ship Museum housing the ship is an old building, and have not been modified with a modern air conditioning system making the indoor humidity and temperature of the museum irregular. The changes in humidity makes the wood of the ship swell and shrink, possibly causing the displacements of the measured positions.

1 1.2 Objective The deformation of the ship can pose a potential threat for the future conservation of it, depending on the magnitude and character of the deformations. Elastic deformations are completely reversible, meaning that the displaced points of the ship will return to their original position after a time cycle. But even if the deformations are elastic, cyclic deformation as fatigue in elastic range may cause failure in any material. Plastic deformations are irreversible, slowly deforming the ship until inevitable fracture. Concerned with the displacements over time, the research team monitoring the ship wants to determine if the ship is subjected to irreversible deformations or if the displacements are strictly composed of elastic deformations as well as if there are ”hot spots” where the strain is larger than in other places. A research group at the Division of Applied Mechanics at Uppsala University have conducted a similar study on the Swedish warship Vasa. Using geodetic measurements of the ship over a 12- year period, they computed the average strain of different sections on the hull of the ship through the measured position data from the original measurement to the final measurement. The building housing the ship have an advanced air conditioning system installed monitoring, among other things, the humidity in the museum which is kept constant. Their result was that the Vasa ship was slowly deformed during the monitored time and subjected to a constant stress called creep deformation. The displacements varied in different regions and directions on the hull.[7] The objective of this thesis is to conduct a similar study as the one conducted on the Vasa Ship. Using the same technique as the Vasa Ship project, this project aims to visualise the displacements of the Oseberg ships hull during the measured time. The data will in this project instead be measured using photogrammetry. Furthermore, using the same technique as the Vasa Ship project, calculate the average strain of the hull, determine the strain in percentages with respect to the reference position along the different directions on the hull and the different sections of the ship.

1.3 Aims We the authors of this thesis aim to produce a finite element model of the ship using the gathered position data with Matlab and its triangulation functions to visualise the hull. This model will be easy to implement on general position data for later use on similar projects. If the ship is further studied and more position data is added it should be possible to implement the code on this data as well. The model will calculate the average strain on finite elements composed from the data. The result will then be plotted with colourised triangular elements where the colour is decided from the scale of the strain. The plots for each time point will then be used in an animation to give a better view of the deformation over time. From the result it can be discussed where the strains are most tangible and possibly determine the cause of these strains.

2 2 Theory

2.1 Strain and deformation Consider a point in an arbitrary body B in R3, P :(x, y, z). Then look at the same point in 3 the deformed body B⇤ in R , P ⇤ :(x⇤,y⇤,z⇤). Assuming the coordinate functions (x⇤,y⇤,z⇤) are continuous and differentiable in the (x, y, z) variables. This implies that

x = x(x⇤,y⇤,z⇤), 8y = y(x⇤,y⇤,z⇤), <>z = z(x⇤,y⇤,z⇤).

Note that (x⇤,y⇤,z⇤) is considered as independent:> variables. It can be shown that when dealing with small displacements it is not necessary to distinguish between the two points (x, y, z) and (x⇤,y⇤,z⇤). Now lets add the point Q :(x +dx, y +dy, z +dz) to B to make a line element ds = PQ. This is deformed in the body B⇤ into ds⇤ by adding the point Q⇤ :(x⇤ +dx⇤,y⇤ +dy⇤,z⇤ +dz⇤). See Figure 2.1.

z z⇤

B⇤ Q⇤ :(x⇤ +dx⇤,y⇤ +dy⇤,z⇤ +dz⇤) • ds⇤ B

• (u, v, w) P ⇤ :(x⇤,y⇤,z⇤)

y⇤ x Q :(x +dx, y +dy, z +dz) • ds x⇤ •P :(x, y, z) y

Figure 2.1: The line segments ds between the points P , Q in the undeformed body B and ds⇤ between the points P ⇤, Q⇤ in the deformed body B⇤.Notethe distance between the points P and P ⇤ is (u, v, w).

The deformation of ds can be described by the engineering strain "E

ds⇤ ds " = . (2.1) E ds

3 Since there are two different bodies, B and B⇤ which do not necessarily have the same coordinate axes, each line element variable can be expressed as

@x⇤ @x⇤ @x⇤ dx⇤ = dx + dy + dz. (2.2) @x @y @z

The same follows for dy⇤ and dz⇤. Noting from Figure 2.1 the displacement of the point P to P ⇤ as (u, v, w), the relation between the spaces is described as

x⇤ = x + u, 8y⇤ = y + v, (2.3) <>z⇤ = z + w.

The length of the line element ds can be described:> as

ds 2 =dx2 +dy2 +dz2, | | 2 2 2 2 ds⇤ =dx⇤ +dy⇤ +dz⇤ . | | There are several ways to calculate strain, among them are Greens strain which is used to calculate finite strains. The expression for Greens strain "G is

1 ds 2 ds2 " = ⇤ . G 2 ds2 This can also be written as the magnification factor M which is just another expression for Greens strain, see [8] for the full derivation of M.

1 ds 2 M = ⇤ 1 2 ds ✓ ◆ ⇣ 1 ⌘ = " + "2 E 2 E (2.4) 2 2 2 = l "xx + lm"xy + ln"xz + ml"yx + m "yy + mn"yz + nl"zx + nm"zy + n "zz 2 2 2 = l "xx + m "yy + n "zz +2lm"xy +2ln"xz +2mn"yz where the parameters l, m and n are defined as dx dy dz l = ,m= ,n= (2.5) ds ds ds

4 and the strain terms as

@u 1 @u 2 @v 2 @w 2 " = + + + , xx @x 2 @x @x @x ✓ ◆ ✓ ◆ ✓ ◆ ! @v 1 @u 2 @v 2 @w 2 " = + + + , yy @y 2 @y @y @y ✓ ◆ ✓ ◆ ✓ ◆ ! @w 1 @u 2 @v 2 @w 2 " = + + + , zz @z 2 @z @z @z ✓ ◆ ✓ ◆ ✓ ◆ ! (2.6) 1 @v @u @u @u @v @v @w @w " = " = + + + + , xy yx 2 @x @y @x @y @x @y @x @y ✓ ◆ 1 @w @u @u @u @v @v @w @w " = " = + + + + , xz zx 2 @x @z @x @z @x @z @x @z ✓ ◆ 1 @w @v @u @u @v @v @w @w " = " = + + + + . yz zy 2 @y @z @y @z @y @z @y @z ✓ ◆

Note that when the line element ds is along for example the x-axis (ds =dsx) then equation 2.5 will output l =1and m = n =0. In turn equation 2.4 will output

M = Mx = "xx.

Similar to equation 2.5, the deformed forms can be written as

dx⇤ dx⇤ ds dy⇤ dy⇤ ds dz⇤ dz⇤ ds l⇤ = = ,m⇤ = = ,n⇤ = = . ds⇤ ds ds⇤ ds⇤ ds ds⇤ ds⇤ ds ds⇤ Combining equation 2.2 and 2.3, it is known that dx @u @u @u ⇤ = 1+ l + m + n, ds @x @y @z dy ⇣@v ⌘ @v @v ⇤ = l + 1+ m + n, ds @x @y @z dz @w ⇣@w ⌘ @w ⇤ = l + m + 1+ n. ds @x @y @z ⇣ ⌘ Rewriting equation 2.1, it is possible to express ds 1 = . ds⇤ 1+"E From the equations above, the expressions for the deformed line elements is given as @u @u @u (1 + " )l⇤ = 1+ l + m + n, E @x @y @z ⇣@v ⌘ @v @v (1 + " )m⇤ = l + 1+ m + n, E @x @y @z @w ⇣@w ⌘ @w (1 + " )n⇤ = l + m + 1+ n. E @x @y @z ⇣ ⌘ 5 This will be useful in the following. The goal is to explain how a shear strain can be expressed. Considering two line elements ds1 and ds2, the product of these vectors can be expressed as

ds ds = cos (✓), ds⇤ ds⇤ = cos (✓⇤). 1 · 2 1 · 2 From this the shear strain between the two deformed line elements can be written as

12 =(1+"E1)(1 + "E2) cos (✓⇤)

=2l1l2"xx +2m1m2"yy +2n1n2"zz

+ 2(l1m2 + l2m1)"xy + 2(m1n2 + m2n1)"yz + 2(l1n2 + l2n1)"xz.

If ds1 is oriented along the x-axis and ds2 along the y-axis, then l1 = m2 =1and m1 = n1 = l2 = n2 =0. This yields 12 = xy =2"xy which also implies that xy =2"xy,yz =2"yz,xz =2"xz.

Assuming small displacements, the quadratic terms in equation 2.6 can be discarded. This yields the following simplification M " , ⇡ E @u @v @w " ," ," , (2.7) xx ⇡ @x yy ⇡ @y zz ⇡ @z 1 @v @u 1 @w @u 1 @w @v " + ," + ," + . xy ⇡ 2 @x @y xz ⇡ 2 @x @z yz ⇡ 2 @y @z ⇣ ⌘ ⇣ ⌘ ⇣ ⌘ Since the engineering strain " and shear strain is of interest, this is related to the magnification factor M by equation 2.4. When calculating the strain in practice, the following strain tensor is obtained [9] "xx "xy "xz "xx xy/2 xz/2 " = 2 "yx "yy "yz 3 = 2 yz/2 "yy yz/2 3 . (2.8) " " " /2 /2 " 6 zx zy zz 7 6 zx zy zz 7 4 5 4 5 It should also be mentioned that one can calculate the principle strains from this tensor. The principle strains can be explained by imagining a volume in the 3D space which is deformed into a new volume. The deformation can be in any directions defined by a global coordinate system. If a local coordinate system of the body is set so the deformation is along the coordinate axes, the strain tensor " will be a diagonal matrix. Doing this it will eliminate any shear strains and only be made up of three directional strains. An easy way to implement this is by calculating the eigenvalues of the strain tensor " as

" " " xx 1 xy xz "yx "yy 2 "yz =det(" I)=0 (2.9) " " " zx zy zz 3 where I is the identity matrix and the eigenvalues as a row vector. The magnitude of the strains will then be known, but the direction of the strains unknown.[8]

6 2.2 Finite elements When solving equations and computational problems numerically, the equation and computational domain needs to be discretised. Once a computational domain is discretised, it is called a mesh. There are several different methods for discretising computational domains, most common are as point wise differences or as finite elements. These types of discretisations originates from methods for solving partial differential equations numerically, the above mentioned comes from the finite difference method and finite element method.[10] The reason for meshing a domain is because it allows easy constructions of polynomial function spaces that is otherwise difficult. Discretisation using finite elements can utilise several different types of polygons to shape the mesh, most common are lines, triangles, tetrahedrons and bricks depending on the dimension and type of the computation domain. In this thesis the finite elements are composed of tetrahedral geometries K, these are defined by a polynomial function space P . The polynomial space is defined by a set of linear functionals L ( ) defining the degrees of freedom, j · where i =1, 2,...,n and n =dim(P ). The function space P is spanned by a basis N n and { i}i=1 since they form the geometry of the finite element they will be referred to as the shape functions. The functionals L ( ) is used to uniquely define the shape functions by requiring them to satisfy the j · relation [10] n 1,i= j, Lj(Ni)=ij = (2.10) (0,i= j. i,jX=1 6 Combining this with the theory of strain mentioned in Section 2.1, a numerical method for computing strain over an arbitrarily body is achieved. Assuming the body B, containing the point P in Figure 2.1 is discretised with 3D polygons and is then displaced into the body B⇤ and the point P into P ⇤. The polygon element containing P is called K with the nodes ni, see Figure 2.2.[9]

n4 •

z

K • B n3

P x •

n•2 y • n1•

Figure 2.2: The element K on the body B containing the point P .

The displacement components of the element (u, v, w) are continuous functions of the spatial coordi- nates (x, y, z), where each node ni of the polygon have separate displacement components (ui,vi,wi), see Figure 2.3.[9]

7 v4 4 u4 • w4 v3

u3 • w3 3 K v P u • v2 v1 w 2 u2 1 • • u1 w2 z w1

x y

Figure 2.3: The tetrahedron element K, showing the nodal displacements and the displacement of the point P .

For the implementation done in this thesis it suffices to use continuous functionals L ( ) with dis- i · continuous derivatives at the element boundaries. This type of functionals are called Lagrange functionals and are defined as

(i) (i) (i) Lj(v)=v(Ni),Ni = f(x ,y ,z ) where (x(i),y(i),z(i)) are selected nodal points. For a tetrahedral element with linear shape functions where the polynomial space P is the space P 1(K). The simplest basis for this space will be the canonical basis 1,x,y,z such that any of the shape functions can be expressed as { }

N1 = a1 + a2x + a3y + a4z where a 4 are coefficients unique to each shape function. For a reference element with nodal { k}k=1 points at (0, 0, 0), (1, 0, 0), (0, 1, 0) and (0, 0, 1), see Figure 2.4, the coefficients can easily be calcu- lated.

8 z

(0, 0, 1) •

K

(1, 0, 0) x (0, 0, 0)• •

(0, 1, 0) • y

Figure 2.4: A uniform reference tetrahedron.

From the criteria of equation 2.10 the following system is obtained

1 L1(1) L1(x) L1(y) L1(z) a1 1000 a1 2 0 3 2 L2(1) L2(x) L2(y) L2(z) 3 2 a2 3 2 11003 2 a2 3 e = = = = V a 1 · 6 0 7 6 L3(1) L3(x) L3(y) L3(z) 7 6 a3 7 6 10107 6 a3 7 6 7 6 7 6 7 6 7 6 7 6 0 7 6 L4(1) L4(x) L4(y) L4(z) 7 6 a4 7 6 10017 6 a4 7 6 7 6 7 6 7 6 7 6 7 4 5 4 5 4 5 4 5 4 5 where the matrix V is called the Vandermonde matrix. The coefficients a can be calculated as 1 | a = V e1 which in this case gives a = 1 1 1 1 . It implies that N1 =1 x y z. Similar calculations for N2,N3 and N4 willh give the followingi N =1 x y z, 1 N2 = x,

N3 = y,

N4 = z.

This is only true for the element presented in Figure 2.4 because of its specific geometry. For other geometries the shape functions would be different. Although for easy calculations it is preferred that all elements is of this geometry, and it can actually be accomplished using an isoparametric mapping which will be discussed in the following section.[10]

9 The shape functions are related to the displacement functions as

4 u(x, y, z)= Ni(x, y, z)ui, Xi=1 4 v(x, y, z)= Ni(x, y, z)vi, (2.11) Xi=1 4 w(x, y, z)= Ni(x, y, z)wi. Xi=1 Note that the shape functions sum up to one.[9]

2.3 Isoparametric mapping When dealing with curved geometries and non-uniform finite elements, the computations become advanced and cumbersome when calculating the element shape functions. This can be solved using an isoparametric mapping of the coordinates which builds up each element. This will make the shape functions equal for all elements even if their geometries may vary, making it possible to reuse the calculated shape functions for all elements. This makes the calculations a lot less complicated especially if a higher order shape function is used, for example a quadratic shape function. The higher order shape functions is very common for curved geometries and since these have more terms that need calculation, isoparametric mapping is almost essential when dealing with these.[10] The following set up is used. Consider a finite element K called the physical element, this will usually not be uniform and is described in the global coordinate system. The element uesd for easy calculations is on the other hand K¯ called the reference element or the natural element, where the nodes are given in the local coordinate system. If the element have i =1, 2,...,n nodal points, each coordinate can be descried in the physical nodal points from the reference nodal points as[9][10]

n (i) x(r, s, t)= x Ni(r, s, t), i=1 Xn (i) y(r, s, t)= y Ni(r, s, t), (2.12) i=1 Xn (i) z(r, s, t)= z Ni(r, s, t). Xi=1

Ni is the shape function of each coordinate-axis and (r, s, t) is the local coordinates which maps (x(i),y(i),z(i)) of K¯ to the global coordinates of K. Therefore a description of the mapping from the reference coordinates to the physical coordinates is obtained, see Figure 2.5.[10]

10 z t • K 1 •

• • x r 1• •1

1•

y s

(a) (b)

Figure 2.5: (a) The non-uniform element K. (b) The isoparametric mapping K¯ .

This can also be written in vector notation as

P (r, s, t)=N P¯ · ¯ | where P = x1 y1 z1 x2 y2 z2 ... is the vector for the nodal points and N is the matrix of the shapeh functions which is written as i

N1 00N2 00N3 00N4 00 N = 2 0 N1 0 0 N2 0 0 N3 0 0 N4 0 3 00N 00N 00N 00N 6 1 2 3 4 7 4 5 for finite elements with four nodal points.[9] In the same way a function v of the finite element K can also be described as equation 2.12

n v(r, s, t)= viNi(r, s, t). (2.13) Xi=1 Since equation 2.7 have partial derivatives of first order, the chain rule is used to derive an expression

11 like equation 2.13 @v @v @r @v @s @v @t = + + , @x @r @x @s @x @t @x @v @v @r @v @s @v @t = + + , @y @r @y @s @y @t @y @v @v @r @v @s @v @t = + + . @z @r @z @s @z @t @z This can in vector form be written as

@v/@x @r/@x@s/@x@t/@x @v/@r @v/@r 2 3 2 3 2 3 2 3 1 @v/@y = @r/@y@s/@y@t/@y @v/@s = J @v/@s 6 7 6 7 · 6 7 · 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 @v/@z 7 6 @r/@z@s/@z@t/@z 7 6 @v/@t 7 6 @v/@t 7 6 7 6 7 6 7 6 7 4 5 4 5 4 5 4 5 where J is the Jacobian matrix[10]

@x/@r@y/@r@z/@r 2 3 J = @x/@s@y/@s@z/@s . 6 7 6 7 6 7 6 7 6 @x/@t@y/@t@z/@t 7 6 7 4 5 The Jacobian can also be used to describe the differential terms ds from equation 2.2 as @x @x @x dx = dr + ds + dt, @r @s @t @y @y @y dy = dr + ds + dt, @r @s @t @z @z @z dz = dr + ds + dt, @r @s @t

| = ds = J| dr ds dt . ) · h i The shape functions of the two coordinate systems is also related like this [9]

@Ni/@x @Ni/@r 2 3 2 3 1 @N /@y = J @N /@s . (2.14) 6 i 7 · 6 i 7 6 7 6 7 6 7 6 7 6 7 6 7 6 @N /@z 7 6 @N /@t 7 6 i 7 6 i 7 4 5 4 5

12 For equation 2.13 the Jacobian will be decomposed as follows @x @N @y @N @z @N J = = i x(i),J= = i y(i),J= = i z(i), 11 @r @r 12 @r @r 13 @r @r Xi Xi Xi @x @N @y @N @z @N J = = i x(i),J= = i y(i),J= = i z(i), 21 @s @s 22 @s @s 23 @s @s (2.15) Xi Xi Xi @x @N @y @N @z @N J = = i x(i),J= = i y(i),J= = i z(i). 31 @t @t 32 @t @t 33 @t @t Xi Xi Xi

Following the properties of the elements, polynomial spaces can be constructed on each element. Combined with the isoparametric mapping of a element, the construction of the nodal shape func- tions becomes fairly easy as described in the previous section.

2.4 Delaunay triangulation Mesh generation is an essential tool within many branches of mathematics and computer science, examples ranges from image analysis, computer graphics and numerical analysis. When discretising a domain with triangular polygons for finite element analysis the meshes should be suitable for interpolation. The aim is to find a set of triangles that covers the domain and satisfy certain constrains such as the angles in the triangles should not be to small or to large, and the size of triangles should not be smaller nor larger than necessary. Delaunay triangulation and refinement is a mathematical algorithm that guarantees these constraints are met when discretising domains.[10][11] Such a mesh generator that triangulates 2D surfaces attempts to satisfy three conditions: Firstly, the union of the triangles is the triangulation domain, meaning that the triangles shall cover the whole discretisation domain. Secondly, the triangles should have a sufficient shape, bounding how large and small the angles of the triangles can be. A lower bound for an angle implicitly bounds the largest angle, meaning if no angle is smaller than ✓ then no angle is larger than 180 2✓. Hence, mesh generators typically approach to bound the smallest angle. Thirdly, the generator should offer as much control as possible over the size of the triangles. This makes it possible to trade offaccuracy against speed when dealing with finite element analysis. Large, sparse triangles offers fast computations but often have low accuracy and small, densely packed triangles offers great accuracy but are computationally expensive. Given this option, the user can make this trade offdepending on the given problem. A coarse mesh with few triangles should be able to be refined with more triangles, and the opposite. This is made possible with the Delaunay refinement algorithm.[11] Both Delaunay triangulation and refinement is built in as functions in Matlab, and therefore a sufficient meshing method for finite element problems is made possible. This function makes it possible to both triangulate a given a geometry or a shape, and given a set of data points which can be formed into a surface, see Figure 2.6 and 2.7.[10]

13 (a) (b)

Figure 2.6: (a) A random elliptical body. (b) The Delaunay triangulation of that body.

(a) (b)

Figure 2.7: (a) A set of 30 random data points. (b) The Delaunay triangulation of those points.

2.5 Mapping between vector spaces A point vector in the Cartesian space can be represented by P = aˆı + b|ˆ+ ckˆ. Where ˆı, |ˆ, kˆ are unit vectors along the coordinate axes, in this case x, y, z. This can also be written as x a = x/w 2 y 3 P = , b = y/w 6 z 7 6 7 c = z/w 6 w 7 6 7 4 5 where the term w represent a scaling factor. By doing this a point vector can be written in many ways yet still represent the same point vector. In case of the unit vector for the x-direction it can

14 | | be written as 1001 or 2002 and similarly for the other unit vectors. h i h i In this thesis it is important to look at translation and rotation of vector spaces in case the mea- surements of the data have different origins and coordinate axes. It will be needed to transform all vector spaces into one global space. Lets look at transformation of the space H with a 4 4 matrix ⇥ M. This matrix will be able to represent translation, rotation, scaling and shearing of the space. Given a point P0 represented in two different spaces, the same point will be written as P1 in the second space. The transformation will then be written as

P = M P . 1 · 0 If the matrix only need to deal with translation it will look like

100a 2 010b 3 M = Trans(a, b, c)= . 6 001c 7 6 7 6 00017 6 7 4 5 In turn the points will be translated as

100a x x + aw x/w + a 010b y y + bw y/w + b P = 2 3 2 3 = 2 3 = 2 3 . 1 · 6 001c 7 6 z 7 6 z + cw 7 6 z/w + c 7 6 7 6 7 6 7 6 7 6 00017 6 1 7 6 w 7 6 1 7 6 7 6 7 6 7 6 7 4 5 4 5 4 5 4 5 If the matrix instead deal with rotation only it will look like the following for rotations about the x, y and z axes by an angle ✓

10 0 0 2 0 cos (✓) sin (✓)03 M = Rot(x, ✓)= , 6 0sin(✓) cos (✓)07 6 7 6 00 0 17 6 7 4 5 cos (✓)0sin(✓)0 2 01003 M = Rot(y, ✓)= , 6 sin (✓) 0 cos (✓)07 6 7 6 00017 6 7 4 5 cos (✓) sin (✓)00 2 sin (✓) cos (✓)003 M = Rot(z,✓)= . 6 00107 6 7 6 00017 6 7 Scaling and shearing are represented by exchanging4 the diagonal elements5 by the axis scale factor. By combining these different operations the matrix M will be able to transform one vector space

15 into another.[12] The transformation matrix can therefore be described by a set of variables as

↵11 ↵12 ↵13 a 2 ↵21 ↵22 ↵23 b 3 M = . 6 ↵31 ↵32 ↵33 c 7 6 7 6 00017 6 7 4 5

16 3 Method

3.1 Calculating the strain The data obtained for calculating the displacement and strain of the ship is made up of a number of measurement points. These points are given as coordinates in a 3D Cartesian domain at a certain time. The measurements has been done at several time points. This data will be analysed to obtain the movement of the data points over time. The theory presented in Section 2.2 gives us a way of joining the data points to form finite elements making up the hull of the ship and determine the strain using the nodal points. The finite element discretisation is done with Matlab using its built-in Delaunay triangulation function. We use the theory presented in Section 2.1 to describe the strain in each finite element as a strain tensor " given by equation 2.8. Along with equation 2.7 we get an expression for the tensor we want to calculate as

@u/@x + @u/@x@v/@x + @u/@y@w/@x + @u/@z

1 2 3 1 " = @v/@x + @u/@y@v/@y + @v/@y@w/@y + @v/@z = (A + A|) 2 6 7 2 6 7 6 7 6 7 6 @w/@x + @u/@z@w/@y + @v/@z@w/@z + @w/@z 7 6 7 4 5 where A is given by

@u/@x@u/@y@u/@z @/@x 2 3 2 3 A = @v/@x@v/@y@v/@z = uvw @/@y . 6 7 · 6 7 6 7 6 7 6 7 h i 6 7 6 7 6 7 6 @w/@x@w/@y@w/@z 7 6 @/@z 7 6 7 6 7 4 5 4 5 Using this we find that the partial derivatives of the displacement functions (u, v, w) can be calcu- lated by equation 2.11. For an easier calculation we use an isoparametric mapping as described in Section 2.3, then the partial derivatives of the shape functions can be rewritten as equation 2.14 using the Jacobian presented. The Jacobians elements is given by equation 2.15. By these equations along with the displacement vector of the finite element and its original positions we can easily com- pute the strain tensor, see Algorithm 1. This is implemented in a simple Matlab routine presented in Appendix A.1. The algorithm takes three points in the Cartesian 3D coordinate system and adds a fourth node in the normal from the plane between the nodes making a tetrahedral as the finite element, see Figure 3.1. From this it calculates the strain tensor in the element. In practice, strain is a 3D phenomenon, but in this thesis the measuring data only gives information for a 2D surface. This means that the in-and-out strain of the hull cannot be interpreted correctly with this information and is therefore neglected in the analysis. By doing this procedure and adding an additional node to the finite elements, creating 3D finite elements on a 2D hull essentially makes the calculated strain in-and-out of the hull equal to zero. The actual strain can be non-zero as explained in [7]. We will therefore only analyse the strain along and across the hull. Because of this

17 we have also made it possible to calculate the strain along the strakes of the ship by rotating each element to the same 2D plane during calculation.

Algorithm 1 Calculate the average strain of triangular finite element

Input: Vectors with nodal points of initial and deformed triangular element X0 & X1 Output: Strain tensor of the initial element " ((Xi(2) Xi(1)) (Xi(3) Xi(1))) 1: Compute normal vectors to elements ni = X⇥ , i =0, 1 k ik 2: Find centre points of triangular elements ci = E(Xi), i =0, 1 3: Place normal vectors on element centre points to form tetrahedrons Xi(4) = ci + ni, i =0, 1 4: Calculate the displacement between the tetrahedrons u = X X 1 0 5: Find the matrix for the derivative of the shape functions with respect to the isoparametric mapping of the elements @Nrst 6: Compute the Jacobian of transformation from isoparametric to Cartesian coordinates J = @N X rst · 0 7: Compute the matrix for the derivative of the shape functions with respect to the reference coordinates of the elements @N = J 1 @N xyz · rst 8: Compute the derivative of the displacement with respect to the reference coordinates @u = @Nxyz u · 1 9: Compute the strain for the initial element " = (@u + @u|) 2 ·

• • • •

• • • • (a) • • (b) (c)

Figure 3.1: (a) Initial triangle element. (b) Adding normal vector. (c) Obtained tetrahedron element.

3.2 Verifying the strain calculation The implementation of the method is done via Matlab using the function in Appendix A.1. To verify it we construct a square made up of two elements. The magnitude of the strain from the ship will be around 0.1%, therefore the square spans an area of 1000 1000 to show how movement of ⇥ 1 unit will affect the result. If one side of the square is moved by 1 unit out from the square the expected output is 0.1%. If a shear is applied, moving one side to either direction parallel to the side by 2 units the expected output should also be 0.1%. This is tested and shown in the following figures where both input and output is presented.

18 z z-strain 0.1% 0.2 P40 :(0,0,1001) P30 :(0,1000,1001)

P4 :(0,0,1000) P3 :(0,1000,1000) 1,000 0.1 -axis z 500 0

0.1 P :(0,0,0) 0 1 y 1 P :(0,1000,1000) 0 2 1,000 0.2 1 0 500 x-axis Strain [%] x y-axis (a) (b)

Figure 3.2: (a) The elements sent into the analysis script exposed to a strain in the z-direction. (b) The output of the script.

z y-strain 0.1% 0.2

P3 :(0,1000,1000) P4 :(0,0,1000) 1,000 P30 :(0,1001,1000) 0.1 -axis z 500 0

0.1 P20 :(0,1001,0) P1 :(0,0,0) 0 y 1 P2 :(0,1000,0) 0 1,000 0.2 1 0 500 x x-axis Strain [%] y-axis (a) (b)

Figure 3.3: (a) The elements sent into the analysis script exposed to a strain in the y-direction. (b) The output of the script.

19 z y-shear 0.1% 0.2

P40:(0,2,1000) P3 :(0,1000,1000) 1,000 P4:(0,0,1000) P30 :(0,1000,1002) 0.1 -axis z 500 0

0.1 P1 :(0,0,0) 0 y 1 P2 :(0,1000,1000) 0 1,000 0.2 1 0 500 x x-axis Strain [%] y-axis (a) (b)

Figure 3.4: (a) The elements sent into the analysis script exposed to a shear in the zy-direction. (b) The output of the script.

The output is one of the elements of the strain tensor ".InFigure3.2itis"zz which is plotted as a colour. For Figure 3.3 it is "yy and for Figure 3.4 it is the "yz element. In these cases the other elements are zero when these specified deformations are applied. This is not shown in this thesis but can easily be seen when applying the function in Appendix A.1. These results corresponds as expected and the method is therefore correct.

3.3 Measurements of the ship The measurements of the ship are done using photogrammetry. The measuring was divided into four sections of the ship, and all sections had fixed points on the museum floor as reference for the coordinate systems. All points on the ship and surrounding environment are fixed year around and are not removed after each measurement, guaranteeing reliable comparison between each measure- ment, see Figure 3.5b. The individual measurement sections of the ship are the stem, the stern, the starboard and port sides. A total of 15 different measurements have been conducted at the time of this thesis between August 2018 and December 2019, see Table 3.1. As mentioned in the introduction, the museum building does not have the ability to control the humidity sufficiently causing the variations in temperature and humidity between the measurements. The measurements for each section was saved as ATOS files for the software GOM Inspect, and each section was divided into further components. GOM Inspect held information on how many points each component of every section was composed of, and gave warnings if any point was not found on later measurements, see Figure 3.5a. A threshold residual around each point could be set to help the program identify points which had been lost. A maximum residual of 10 mm was set so no point would intervene with another point, as there were no points closer than 10 mm to another point. This meant that if a component was missing points, we would know that it needed reconstruction. See Table 3.2 for each section components and number of measuring points.

20 Table 3.1: The dates for the measurements along with the temperature and relative humidity inside the museum at the time of the measurements.

Measurement date Temperature [C] Relative humidity [%] 24 August 2018 21.0 60.5 19 September 2018 19.2 66.1 17 October 2018 16.5 68.9 15 November 2018 17.0 61.6 12 December 2018 15.5 49.4 10 January 2019 15.1 48.3 6February2019 14.6 45.6 7March2019 15.6 48.2 3April2019 16.5 42.4 29 April 2019 19.3 51.5 30 May 2019 18.3 56.8 27 June 2019 22.2 66.1 22 July 2019 22.9 69.2 21 August 2019 22.0 62.1 16 December 2019 15.5 54.7

(b) (a)

Figure 3.5: (a) Example of how the measurement points looks in the GOM software, in this case the stern of the ship. All measurement points are taken from a set of images which can also be seen in the program. (b) One of the images which the measurement points are calculated from, in this case the port side of the stern.

21 Table 3.2: The measurement sections with components and number of measure- ment points from the initial measurement in August 2018. Stem Stern

Component Measurement points Component Measurement points Stem keel 10 Stern keel 9 Stem keel beam 13 Stern keel beam 13 Stem outer section 17 Stern outer section 13 Stem strake 7 10 Stern strake 7 10 Stem strake 10 8 Stern strake 10 9 Stem strake 12 20 Stern strake 12 15 Stem supports 9 Stern supports 9

Starboard Port

Component Measurement points Component Measurement points Starboard keel 10 Port keel 12 Starboard keel beam 5 Port keel beam 6 Starboard strake 7 10 Port strake 7 10 Starboard strake 10 6 Port strake 10 10 Starboard strake 12 20 Port strake 12 16 Starboard supports 9 Port supports 10

As there were points missing after the residual was set to 10 mm for some of the measurements, we reconstructed those missing points as the mean value of the measurement before and after. Reconstructed points was highlighted as black dots in the results.

3.4 Utilising the measurement data Each data file can be analysed as earlier described. This could be of interest if a certain part of the ship is more exposed, although it would be of greater interest to look at the whole ship all at once. Since the measurements have been done in separate parts for the ship it will have to be merged into one data file for each time point. This is done by transforming the coordinate systems into one common system. If we are given two sets of data which should be joined by common points, we can utilise the theory in Section 2.5. Both data sets need to contain three common points for the following to be used. The first data set described in the space U have the points u0, u1, u2. The data set V also have points v0, v1, v2 which are equal to those of U but described by different coordinates. We want to rotate and translate the set V so that the common points are matched with set U. The first step is to define a common origin as one of these points and setting it in 000. We call this origin for the two sets u0 and v0. To translate the set V a vector r =h abci = u v is added to all points in V. Then all points in both sets are moved to the vu 0 0 h i 22 new origin 000by adding r = 000 u to all points in both U and V.Therotation u 0 of V can nowh be performed,i but first theh rotationi matrix R have to be identified. Since the origin in both sets are u0 = v0 = 000, a base for these two spaces can be described by three vectors pointing out from the origin.h The firsti two basis vectors are u1, u2 and v1, v2 translated as earlier described, the third is given by the cross product of these forming an orthogonal vector to these two. Now three basis vectors are given in set U as u , u , u = u u and set V as v , v , 1 2 3 1 ⇥ 2 1 2 v = v v . The rotation matrix is then given by forming two matrices with the basis vectors as 3 1 ⇥ 2 rows and calculating R from the inverse 1 u1 v1 v1 u1 ↵11 ↵12 ↵13 u = R v = R = v u = ↵ ↵ ↵ . 2 2 3 · 2 2 3 ) 2 2 3 · 2 2 3 2 21 22 23 3 u v v u ↵ ↵ ↵ 6 2 7 6 3 7 6 3 7 6 3 7 6 31 32 33 7 4 5 4 5 4 5 4 5 4 5 To move the original set V to match the common points in the original U all points in V must be translated to the new origin, rotated and then translated again to match U as

u =(v + rv)R + ru. ⇤ ⇤ This can also be implemented as in the 4 4 matrices in Section 2.5. The different systems will ⇥ have parallel axes and will only be mirrored or translated between each other, therefore it will not be needed to do any scaling and only translation and rotation in the transformation matrix. In practice this is done with the Matlab routine in Appendix A.4. Once all the parts are merged into one file for the ship, the data is triangulated using the built-in Delaunay triangulation function in Matlab. The triangulated model is saved as a matrix where each row contains the three indices from the initial data defining each triangular element. The triangulation is done with respect to two of the axes, as we are interested in a 2D hull and not a 3D body. The ship forms an oval shape and to translate this into a plane for the triangulation it was first projected onto the underside of a large sphere. This was achieved through Algorithm 2 and was implemented as a Matlab routine in Appendix A.5. The triangulation could then be done on the x and y coordinates.

Algorithm 2 Project a given data set on the boundary of a sphere Input: A data set X with rows for each data point and four columns as (index, x, y, z), the coordinates of the origin of the data set C0, the coordinates for the new origin of the data set C1 Output: The data set centred around the new origin XC , the data set projected on the surface of a sphere XS 1: Find the radius of the sphere r = C C 1 0 2: Add the radius to all the coordinates of the initial data set XC = X + r 3: Define the boundaries of the sphere in all directions as the maximum and minimum values of XC and save it as a vector R XC R 4: Project the new data set XC on the boundary of the sphere XS = X · k C k

Once the triangulation is obtained, the strain in each element is calculated using Algorithm 1 and the strain is then translated as a corresponding RGB colour in a chosen colourmap. This is implemented

23 in Algorithm 3 which inputs two sets of data, the initial set and the deformed, the triangulation of one of the sets, the chosen axis for the strain calculation and spectrum of the strain in %. This was implemented as a Matlab routine presented in Appendix A.3.

Algorithm 3 Map the colour of finite elements depending on the strain of the element

Input: Row vectors of the initial and deformed data set X0 & X1, triangulation for one of the sets T, chosen axis for strain calculation (x, y, z), vector s with spectrum of the strain in % Output: Matrix with RGB coordinates for each element from T from a chosen colourmap depend- ing on the strain 1: Create zero matrix for allocation of colour coordinates for all elements C = zeros(size(T)) 2: Calculate the strain " in each element using Algorithm 1, and save the strain for the chosen axis in a vector Ei = "i(axis, axis) 3: Choose a colourmap and save the RGB coordinates of the map in a separate vector M 4: Find indices of the colourmap limited by the specified spectrum and corresponds to the strain size(M) s(1) I = E 100·|size(M| ) s+ · · s j m 5: AllocateP eachP element in the matrix C by the indices of the colourmap by the values of I, Ci = M(Ii),ifIi > Mmax then Ii = Mmax of if Ii < 1 then Ii =1

We only choose to focus on five of the measurements during the analysis, the measurements from January, April 3rd, June, August and December 2019 with the January measurement as reference. The reasoning was that this gives a good idea over the seasonal dependence of the strain, as only one specific year was analysed and the measurements are somewhat even distributed and includes the different seasons and where the different peaks in temperature and humidity was located, see Figure 3.6.

80

70

60

50 Relative humidity [%] 40

Feb 2019 Apr 2019 July 2019 Oct 2019 Dec 2019

Figure 3.6: The relative humidity measured inside the museum during 2019 along with the humidity for the chosen measurements. The highlighted markers shows the chosen measurements.

The spectrum of the strain in the plots was set between 0.4% through initial observations of the ± strain plots. Elements which exceeded 1% was plotted as completely black as strains exceeding ± those magnitudes seemed non-physical.

24 4 Results

The normal and principal strains was visualised on the two main sides, the starboard and port along with the stern and stem ends. As mentioned in the Method section, the analysis only focused on the normal strain along and across the hull. As a strain tensor was calculated for each element, this corresponded to plot one of the diagonal elements "ii of the tensor ". This is shown through Figure 4.2 to 4.9. The principal strain was calculated from each tensor as the tensor eigenvalues, as demonstrated in equation 2.9. Each tensor had three eigenvalues, and both the maximum and minimum values was visualised in the analysis shown in Figure 4.10 to 4.13. The chosen colourmap, a diverging map ranging from red to blue shows the direction of the strain i.e. if it’s negative or positive. Blue elements shows negative strain, compression and red elements shows positive strain, elongation. Elements with strain larger than 1% was coloured black. Recreated ± data points was enclosed in a black dot. Apart from the strain, the average value of the displacements on the two sides relative to the January measurement was calculated. It was calculated for the three spatial directions, even though the strain in-and-out of the hull was ignored for the strain calculations, see Figure 4.1.

0.4 port-starboard aft-bow 0.2 vertical

0

0.2 Mean displacement [mm]

0.4 Feb 2019 Apr 2019 July 2019 Oct 2019 Dec 2019 (a) 30 port-starboard aft-bow 20 vertical

10

0

10 Mean displacement [mm]

20 Feb 2019 Apr 2019 July 2019 Oct 2019 Dec 2019 (b)

Figure 4.1: The mean displacements of all measurement points on the ships two sides, (a) the port side (b) the starboard side.

25 Normal strains on the port side, aft-bow direction

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.2: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

26 Normal strains on the port side, vertical direction

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.3: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

27 Normal strains on the starboard side, aft-bow direction

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.4: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

28 Normal strains on the starboard side, vertical direction

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.5: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

29 Normal strains on the stern side, port-starboard direction

(a) 2019-04-03 (b) 2019-06-27

(c) 2019-08-21 (d) 2019-12-16

Figure 4.6: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

30 Normal strains on the stern side, vertical direction

(a) 2019-04-03 (b) 2019-06-27

(c) 2019-08-21 (d) 2019-12-16

Figure 4.7: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

31 Normal strains on the stem side, port-starboard direction

(a) 2019-04-03 (b) 2019-06-27

(c) 2019-08-21 (d) 2019-12-16

Figure 4.8: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

32 Normal strains on the stem side, vertical direction

(a) 2019-04-03 (b) 2019-06-27

(c) 2019-08-21 (d) 2019-12-16

Figure 4.9: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

33 Maximum principal strains on the port side

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.10: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

34 Minimum principal strains on the port side

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.11: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

35 Maximum principal strains on the starboard side

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.12: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

36 Minimum principal strains on the starboard side

(a) 2019-04-03

(b) 2019-06-27

(c) 2019-08-21

(d) 2019-12-16

Figure 4.13: Comparisons to the measurement from 2019-01-10. Black dots marks reconstructed data points which was originally missing, and constructed as the mean value of the past and future measurement. Elements with strain exceeding 1% are plotted completely black. ±

37 5 Discussion

The result shows several areas where strain occurs. It unfortunately shows a few elements which tends to get very large deformations as mentioned in the method section. This seems to be because of inaccurate data, for some elements the strain is well over 1% which is unlikely to be true, ± these have therefore been coloured black. When analysing without black elements for large strains one could also see that these elements lie beside other elements with large strains in the opposite direction. This is because of one common point in the two elements which has moved more than the points around it. Because this seems unlikely we will overlook this and focus on larger areas of the hull. When observing the results over the chosen measurements, the strains appears to vary seasonally as expected. For most of the April measurements in the different directions, the hull is mostly subjected to negative strain i.e. contractions. For the summer measurements in June and August there are mostly positive elongation strains. This observation is also verified by looking at the principal strains, where the largest maximum strains occur over the summer measurements and the largest minimum strain occur over the winter. This is explained by Figure 3.6 which shows that the humidity in the museum is lower in April compared to January, meaning that the wood is dryer and have shrunk compared to the previous measurement. In June and August the humidity is higher than in January, meaning the wood have absorbed water and begun to swell. The principal strain plots also shows that the areas where the port/starboard sides connect to the stern/stem of the ship have larger strains. This implies we have more movement here and that the stern/stem are moving away from the rest of the hull. Especially when observing the gunwale area on the port side nearest the stem, Figure 4.3 and Figure 4.10, the strain is especially potent. This is one of many suspected hot spots from the researchers in Oslo, where they have observed larger deterioration’s in the last 50 to 60 years. From Figure 4.1, the displacements of the ships measurement points over the total measurement time follows an almost sinusoidal behaviour. From the measurements on the port side, the displacements from the initial measurement in January 2019 compared to one year later in December 2019 only have displacements of magnitude of approximately 0.05 % in the aft-bow and port-starboard direction and 0.15 % in the vertical direction. The displacements are small and is another remark that the strain seem to vary periodically due to seasonal changes in temperature and humidity. The starboard side is subjected to larger displacements than the port side unfortunately. The displacement are of magnitude 1-3 % for most of the measurement series with outliers reaching magnitudes up to 20+ %. These outliers have unexpectedly large magnitudes which we believe are untrue due to the scale of the remaining measurements and is possibly the result of inaccurate data which we discussed earlier. Possibly one or two elements on the starboard side which could have potentially distorted all of the mean displacement measurements on that side. From Figures 4.6 and 4.8, the stern and stem post are subjected to larger strains in the port- starboard direction than vertically, and compared to the rest of the section of the ship. This might be due to that these posts are not made of the original over 1000 year old wood that the rest of the ship is made of, but are instead reconstructions made of over 100 year old wood from when the ship was excavated. This difference in age of wood affect its ability to absorb moisture which could explain the posts larger horizontal movements, combined with that the posts have less support than the other sections. This was also one of the researchers suspected hot spots on the ship.

38 6 Conclusions

Both the strain and the displacement of the ship vary seasonally due to differences in temperature and relative humidity in the museum. Sections that are reconstructions and not made of the original wood of the ship, like the stem and stern posts are more affected by these differences. These newer woods have tendencies to absorb more moisture than the rest of the ship and therefore it has more movement. This results in larger strains and possibly tensions in the ship where the new wood connects to the old wood. Sections where there is less support from the rest of the ship is also more affected, such as the gunwale and where the stern and stem connects to the sides of the ship. The deformations are small when viewing on a year basis but when comparing between the seasons there are much larger strain and deformation. The changes between January and December are very small since the indoor climate is similar at these time points. Although the ship returns to its original shape after a year, large movements happens during this period. This cyclic movement can be destructive over time. Wood that is subjected to stresses and changes in the moisture content may lead to accumulated deformation and eventually failure in the weak parts of the wood or at the high stress concentration parts. In addition, the cyclic strain even in elastic range may cause fatigue failure in any material. It would be beneficial to control the climate of the ships surrounding environment and keep the humidity and temperature constant between each season. A constant climate would keep the cyclic strains small over the year, possibly counteracting the occurrence of unnecessarily large strains. The cause of the inaccuracies of the measurement data is yet unknown. One of the possible sugges- tions was inaccuracies and residual errors in the initial measurement data from August 2018, but when the test was conducted on the measurement from January 2019 as reference, the same type of non-physical strains occurred. Other explanations was that some type of systematic error occurred on some of the elements on the starboard side from a specific date, and this error displaced the further measurement results on these elements. This, however, is not verified.

39 References

[1] Knut Paasche, Geir Røvik, Vibeke Bischoff, “Rekonstruksjon av Osebergskipets form,” tech. rep., Kulturhistorisk Museum, Stiftelsen Nytt Osebergskip, Vikingeskibsmuseet i Roskilde, Oslo, Roskilde, Tønsberg, December 2007. [2] Wikipedia, “Oseberg Ship.” https://en.wikipedia.org/wiki/Oseberg_Ship. Cited 2020- 03-30. [3] Brøgger, A. W., Hj. Falk, Haakon Schetelig, Osebergfundet. Den norske stat, Kristiania, 1917. [4] Museum of Cultural History, “Saving Oseberg.” https://www.khm.uio.no/english/ research/projects/saving-oseberg/, 2015. Updated 2020-03-25, cited 2020-03-30. [5] Unknown author, “Excavation of the Oseberg ship, 1904/5. [photography],” 1904 [cited 2020- 03-30]. Available from: https://en.wikipedia.org/wiki/Oseberg_Ship#/media/File: Excavation_Oseberg_ship_1.jpg.(PublicDomainMark1.0)https://creativecommons. org/publicdomain/mark/1.0/deed.en. [6] Petter Ulleland, “The Oseberg ship (Viking Ship Museum, ) [photography],” 2016 [cited 2020-03-30]. Available from: https://en.wikipedia.org/wiki/Oseberg_Ship# /media/File:Osebergskipet_2016.jpg. (CC BY-SA 4.0) https://creativecommons.org/ licenses/by-sa/4.0/. [7] Nico van Dijk, Ingela Djurhager, Kristofer Gamstedt, “Monitoring archaeological wooden structures: Non-contact measurement systems and interpretation as average strain fields,” Journal of Cultural Heritage,no.17,pp.102–113,2016. [8] Arthur P. Boresi, Ken P. Chong, James D. Lee, Elasticity In Engineering Mechanics.John Wiley & Sons, Inc., 2011. [9] Arthur P. Boresi, Richard J. Schmidt, Omar M. Sidebottom, Advanced Mechanics of Materi- als. John Wiley & Sons, Inc., 1993. [10] Mats G. Larson, Fredrik Bengzon, The Finite Element Method: Theory, Implementation, and Applications. Springer, 2013. [11] Jonathan Richard Shewchuk, “Delaunay refinement algorithms for triangular mesh genera- tion,” tech. rep., Department of Electrical Engineering and Computer Science, University of California at , Berkeley, CA 94720, May 2001. [12] Richard P. Paul, Robot Manipulators: Mathematics, Programming and Control. The Mas- sachusetts Institute of Technology, 1981.

40 Appendix A Strain analysis

The algorithms discussed in Section 3 was implemented in Matlab and used to analyse the strain on the hull. The Matlab routines consists of several function scripts and a main script to achieve the re- sults in the paper. The functions used are strain.m, colourFromStrain.m, elementInOnePlane.m, assemble.m and centerDataInSphere.m. strain.m calculates the strain of the finite elements that build up the hull of the ship and colourFro- mStrain.m translates the strain of the elements to a corresponding colour of a colourmap. The function colourFromStrain.m can also use the function elementInOnePlane.m to rotate all elements to the same plane, making it possible to see the strain along the hull instead of a global direction. The chosen colourmap redblue.m was a divergent colourmap ranging from red to blue.† The zero strain elements was plotted as white, and depending on the magnitude and direction of the strain it was plotted as red for positive strain and blue for negative strain. assemble.m assembles the four parts of the ship as one single model. Depending on what the user sends into the function it either assembles the data right away or lets the user define how to assemble it and then puts out the corresponding matrices to do it automatically the next time it is called. centerDataInSphere.m projects input position data on a sphere. This was used for the triangulation of the ship along with the built-in Delaunay triangulation once the whole modelled was assembled, as the original data was too oval shaped for the Delaunay triangulation function to give a good analysis model.

A.1 strain.m function e=strain(X0, X1) %STRAINcalculatesthestraintensorfortheelementnodesX0 %deformedintoX1. % %Input:X0=[P1,P2,P3],wherePisacolumncoordinatevector. %Output:eisthestraintensorofthefiniteelement. % %AndreasEriksson&ErikThermaenius,May2020

%Calculatethenormaltotheplanemadeupoftheinput-nodes. n0 = cross(X0(:,2)-X0(:,1),X0(:,3)-X0(:,1)); n0 = n0/norm(n0); n1 = cross(X1(:,2)-X1(:,1),X1(:,3)-X1(:,1)); n1 = n1/norm(n1);

%Buildthereferencetetrahedronbyaddinganodeinthereferencenormal %ofthecenteroftheplane c0=mean(X0,2); % Centerpoint of X0. c1=mean(X1,2); % Centerpoint of X1. cn0 =[c0,c0+n0]; % Reference normal from centerpoint of X0. cn1 =[c1,c1+n1]; % Reference normal from centerpoint of X1.

X0(:,4)=c0+n0; % Add the normal point to form tetrahedron X1(:,4)=c1+n1; % Add the normal point to form tetrahedron

%Thedisplacementofthetetrahedron

†Adam Auton (2009). Red Blue Colormap (https://www.mathworks.com/matlabcentral/fileexchange/ 25536-red-blue-colormap), MATLAB Central File Exchange. Retrieved May 4, 2020.

A.1 u=X1-X0;

%Derivativesofshapefunctionswith %respecttotheisoparametriccoordinates(r,s,t) dNdrst = [-1 -1 -1; 1 0 0; 0 1 0; 0 0 1];

%Jacobianoftransformationfrom(r,s,t)to(x,y,z) J=X0*dNdrst;

%Derivativesofshapefunctionswithrespectto %referencecoordinates(x,y,z) dNdxyz = dNdrst/J;

%Derivativesofthedisplacementwithrespecttothe %referencecoordinates dudxyz = u*dNdxyz;

%Infinitesimalstrain e=(dudxyz+dudxyz’)./2; end

A.2 elementInOnePlane.m function element=elementInOnePlane(element,plane) %ELEMENTINONEPLANErotatesanelementtobeparallellwiththeadefined %planewithoutchangeingtheotherdirections % %Input:element;a3x3matrixwhereeachpointisgivenasarow,plane; %theplanetorotateelementtogivenas[x,y,z]ieyz-plane=[0,1,1]. % %Output:element;theinputelementrotatedandtranslatedtolieinthe %yzplane % %AndreasEriksson&ErikThermaenius,May2020 r=-element(1,:); u1=(element(2,:)+r).*plane; u1=u1/norm(u1); u2=(element(3,:)+r).*plane; u2=u2/norm(u2); u3=cross(u1,u2); u3=u3/norm(u3); v1=(element(2,:)+r)/norm((element(2,:)+r)); v2=(element(3,:)+r)/norm((element(3,:)+r)); v3=cross(v1,v2); v3=v3/norm(v3);

R=inv([v1;v2;v3])*[u1;u2;u3]; element=(element+[r;r;r])*R; end

A.3 colourFromStrain.m function colour=colourFromStrain(A,B,T,type,spectrum,limit,alongStrakes) %COLOURFROMSTRAINoutputsavectorwitheachelementscolourdefinedasaRGB %array[red,green,blue].Thefunctiondefinesthecolourfromacolour %spectrumdependingonthestraincalculatedfromthedata.Thestrain %directionmustalsobedefined. %

A.2 %Input: %A;firstdataset,asrowvectors, %B;seconddataset,asrowvectors, %T;Delaunaytriangulationforthedatasets, %type;calculateprincipleornormalstrain,ifprinciplethen %maxormin?enter’min’/’max’,ifnormalthenenteraxiswanted %togetcolourfor,axis=[1,1]givesx-axis,axis=[2,2]y-axis... %spectrum;thespectrumwantedtoviewthestraingivenasupperand %lowerlimitinpercent,e.i.[lower[%],upper[%]], %limit;setslimitin%whichstrainswillbeshown,ifoutsidethe %limitelementissetasblack, %alongStrakes;if %setto[1,1,1]thestrainiscalculatedingivenglobaldirection %otherwiseifsettoexample[0,1,1]thestrainiscalculatedalongthe %strakessetintheyzplane. % %Output:colour;matrixwhereeachrowistheRGBcolourofthe %correspondingelementfromT. % %AndreasEriksson&ErikThermaenius,May2020 colour=zeros(size(T,1),3); %Calculatethestrainforeachelement for(i=1:size(T,1)) X0=[A(T(i,1),:)’,A(T(i,2),:)’,A(T(i,3),:)’]; X1=[B(T(i,1),:)’,B(T(i,2),:)’,B(T(i,3),:)’]; if(sum(alongStrakes)==2) X0=elementInOnePlane(X0’,alongStrakes)’; X1=elementInOnePlane(X1’,alongStrakes)’; end e=strain(X0,X1); %Checkifprincipleornormalstrainiswanted if(ischar(type)) if(type==’max’) E(i)=max(eigs(e)); elseif(type==’min’) E(i)=min(eigs(e)); end else E(i)=e(type(1),type(2)); end end %Definethecolourmapping map=redblue; %Setthecolourfromthestrainaccordingtothemapping index=round(length(map)*abs(spectrum(1))/sum(abs(spectrum))... +E*100*length(map)/sum(abs(spectrum))); %Makesureindexdonotexceedlimitsbysettingittomaxormin,then %assignthecolour. for(i=1:length(index)) if(index(i)>200) index(i)=200; elseif(index(i)<1) index(i)=1; end colour(i,:)=map(index(i),:);

A.3 end %Checkforstrainsaboveorbelowlimits for(i=1:length(E)) if(E(i)*100>limit || E(i)*100<-limit) colour(i,:)=[0,0,0]; end end end

A.4 assemble.m function [data, R_b_to_a, r_a, r_b]=assemble( A, B, R_b_to_a, r_a, r_b, r_off) %ASSEMBLEassemblestwodatasetswithcommonpointswhicharechosen %manually.AfterfivetriesyougettheoptiontorotatedatasetBmanually %andtranslateittoacommonpointinsetA.Theoutputcanbeusedasit %isoronecanmoreeasygetasenseofwhichpointscorrespondinmanual %mode. % %Input:A;maindataset,B;datasettoassembletoA,R_b_to_a;Rotation %matrixforsetBtomatchA,r_a;translationvectorforA,r_b; %translationvectorforB. % %Output:data;assembleddataset,R_b_to_a;RotationmatrixforsetBto %matchA,r_a;translationvectorforA,r_b;translationvectorforB. % %AndreasEriksson&ErikThermaenius,May2020

A_backup=A; B_backup=B; a=A; a(:,1)=[]; % Store A as a without data indices b=B; b(:,1)=[]; % Store B as b without data indices %Checkifdatahasalreadybeenassembled if(sum(sum(R_b_to_a))==0 || sum(r_a)==0 || sum(r_b)==0) matched=false; else %Movealldatatoneworigin for(i=1:size(b,1)) b(i,:)=b(i,:)+r_b; end %RotatealldatainsetBtomatchsetA for(i=1:size(b,1)) b(i,:)=b(i,:)*R_b_to_a; end %MovealldatatoA:soriginalposition for(i=1:size(b,1)) b(i,:)=b(i,:)-r_a+r_off; end A(:,2)=a(:,1); A(:,3)=a(:,2); A(:,4)=a(:,3); B(:,2)=b(:,1); B(:,3)=b(:,2); B(:,4)=b(:,3); matched=true; end

%Ifdatahaven’tbeenassembledearlierthisisdoneinthefollowing count=0; manual=false; % After 5 attempts one can assemble manualy while(matched==false && manual==false) disp(’Assembling data for first time...’); %Plottheinputdatatogether

A.4 fig1=figure(1); for(i=1:size(A,1)) plot3(A(i,2),A(i,3),A(i,4),’r*’); hold on; text(A(i,2),A(i,3),A(i,4),num2str(i)); end for(i=1:size(B,1)) plot3(B(i,2),B(i,3),B(i,4)+3000,’k*’); hold on; text(B(i,2),B(i,3),B(i,4)+3000,num2str(i)); end xlabel(’x-axis’); ylabel(’y-axis’); zlabel(’z-axis’); disp(’Input the indices in the data which corresponds as a vector:’); A_indices=input(’Which indices in main data can be used?’); B_indices=input(’Which indices in assembly data can be used?’);

%Defineorigoandtranslationvectorforbothdatasets ao=a(A_indices(1),:); r_a=-ao; bo=b(B_indices(1),:); r_b=-bo; %Movealldatatoneworigin for(i=1:size(a,1)) a(i,:)=a(i,:)+r_a; end for(i=1:size(b,1)) b(i,:)=b(i,:)+r_b; end %Definetheaxiswhichshouldbeinparallelforthedata a1=a(A_indices(2),:); a2=a(A_indices(3),:); a3=cross(a1,a2); b1=b(B_indices(2),:); b2=b(B_indices(3),:); b3=cross(b1,b2); Ma(1,:)=a1/norm(a1); Ma(2,:)=a2/norm(a2); Ma(3,:)=a3/norm(a3); Mb(1,:)=b1/norm(b1); Mb(2,:)=b2/norm(b2); Mb(3,:)=b3/norm(b3); %Calculaterotationmatrix R_b_to_a=inv(Mb)*Ma; %RotatealldatainsetBtomatchsetA for(i=1:size(b,1)) b(i,:)=b(i,:)*R_b_to_a; end %MovealldatatoA:soriginalposition for(i=1:size(a,1)) a(i,:)=a(i,:)-r_a; end for(i=1:size(b,1)) b(i,:)=b(i,:)-r_a+r_off; end %Checktheresult A(:,2)=a(:,1); A(:,3)=a(:,2); A(:,4)=a(:,3); B(:,2)=b(:,1); B(:,3)=b(:,2); B(:,4)=b(:,3); fig2=figure(2); for(i=1:size(A,1)) plot3(A(i,2),A(i,3),A(i,4),’r*’); hold on; text(A(i,2),A(i,3),A(i,4),num2str(i)); end for(i=1:size(B,1)) plot3(B(i,2),B(i,3),B(i,4),’k*’); hold on; text(B(i,2),B(i,3),B(i,4),num2str(i)); end xlabel(’x-axis’); ylabel(’y-axis’); zlabel(’z-axis’);

A.5 matched=input(’Does the data set match? true/false ’); close all; if(matched==false) A=A_backup; a=A; a(:,1)=[]; B=B_backup; b=B; b(:,1)=[]; count=count+1; end if(count >4) manual=input(’You seem to be stuck, wanna try manual? true/false ’); end end %After5attemptsonecanchoosetoassemblemanuallybydefiningrotation %ofdataandcommonpoints. while(matched==false && manual==true) disp(’Assembling in manual mode...’); %Plotinputdatatogether fig1=figure(1); for(i=1:size(A,1)) plot3(A(i,2),A(i,3),A(i,4),’r*’); hold on; text(A(i,2),A(i,3),A(i,4),num2str(i)); end for(i=1:size(B,1)) plot3(B(i,2),B(i,3),B(i,4)+3000,’k*’); hold on; text(B(i,2),B(i,3),B(i,4)+3000,num2str(i)); end xlabel(’x-axis’); ylabel(’y-axis’); zlabel(’z-axis’);

disp(’Input rotation angles in degrees:’); theta_x=input(’Around x-axis?’); theta_x=theta_x/360*2*pi; Rx=[1,0,0; 0,cos(theta_x),-sin(theta_x); 0,sin(theta_x),cos(theta_x)]; theta_y=input(’Around y-axis?’); theta_y=theta_y/360*2*pi; Ry=[cos(theta_y),0,sin(theta_y); 0,1,0; -sin(theta_y),0,cos(theta_y)]; theta_z=input(’Around z-axis?’); theta_z=theta_z/360*2*pi; Rz=[cos(theta_z),-sin(theta_z),0; sin(theta_z),cos(theta_z),0; 0,0,1];

%Calculaterotationmatrix R_b_to_a=Rx*Ry*Rz;

%RotatealldatainsetB for(i=1:size(b,1)) b(i,:)=b(i,:)*R_b_to_a; end %Checktheresult A(:,2)=a(:,1); A(:,3)=a(:,2); A(:,4)=a(:,3); B(:,2)=b(:,1); B(:,3)=b(:,2); B(:,4)=b(:,3); fig2=figure(2); for(i=1:size(A,1)) plot3(A(i,2),A(i,3),A(i,4),’r*’); hold on; text(A(i,2),A(i,3),A(i,4),num2str(i)); end for(i=1:size(B,1)) plot3(B(i,2),B(i,3),B(i,4)+3000,’k*’); hold on; text(B(i,2),B(i,3),B(i,4)+3000,num2str(i)); end xlabel(’x-axis’); ylabel(’y-axis’); zlabel(’z-axis’);

A.6 %Definecommonpointsforbothdatasets index_a=input(’Which index in A should be used as common point?’); index_b=input(’Which index in B should be used as common point?’); r_b_to_a=a(index_a ,:)-b(index_b ,:); %Movealldatainbtoa for(i=1:size(b,1)) b(i,:)=b(i,:)+r_b_to_a+r_off; end %Checktheresult A(:,2)=a(:,1); A(:,3)=a(:,2); A(:,4)=a(:,3); B(:,2)=b(:,1); B(:,3)=b(:,2); B(:,4)=b(:,3); fig3=figure(3); for(i=1:size(A,1)) plot3(A(i,2),A(i,3),A(i,4),’r*’); hold on; text(A(i,2),A(i,3),A(i,4),num2str(i)); end for(i=1:size(B,1)) plot3(B(i,2),B(i,3),B(i,4),’k*’); hold on; text(B(i,2),B(i,3),B(i,4),num2str(i)); end xlabel(’x-axis’); ylabel(’y-axis’); zlabel(’z-axis’);

matched=input(’Are you satisfied? true/false ’); close all; if(matched==false) A=A_backup; a=A; a(:,1)=[]; B=B_backup; b=B; b(:,1)=[]; end end %Putassembleddatatogether. data=[A; B]; end

A.5 centerDataInSphere.m function [ cData, sData ]=centerDataInSphere( data, center, newCenter ) %CENTERDATAINSPHEREcentresdataandputsitontheborderofasphere. % %Input:data;thedataset,center;centerofthedataset,newCenter; %wantedcenterfordataset. %Output:cData;thedatasetcenteredarounditscenter,sData;thedata %setputontheborderofaspherecenteredaroundthedatascenter. % %AndreasEriksson&ErikThermaenius,May2020 r=newCenter-center; %Movedatasoitscenteredaroundtheorigin for(i=1:size(data ,1)) cData(i,1)=data(i,1); cData(i,2:4)=data(i,2:4)+r; end

%Definethesphere R=max([max(cData(:,2)),min(cData(:,2)),max(cData(:,3)),... min(cData(:,3)),max(cData(:,4)),min(cData(:,4))]); %Movealldatatotheboundaryofthesphere

A.7 for(i=1:size(data ,1)) sData(i,1)=cData(i,1); sData(i,2:4)=cData(i,2:4)*R/norm(cData(i,2:4)); end end

A.8