• No results found

Solar Storms and Topology

N/A
N/A
Protected

Academic year: 2021

Share "Solar Storms and Topology"

Copied!
81
0
0

Loading.... (view fulltext now)

Full text

(1)

MASTER'S THESIS

Solar Storms and Topology

Viktor Andersson

2013

(2)

GAIS

Solar Storms and Topology

Viktor Andersson

(3)
(4)

Abstract

The purpose of this report is to investigate if topology can be used to simulate solar storms. This is performed by constructing and testing two topological models, the stretch-twist-fold model and the torus model based on the smile attractor. The assumption is made that a solar storm is a reduction in complexity, represented by a simpler set of model parameters. The stretch-twist-fold model was discarded after poor simulation results while the torus model was converted into magnetograms and compared to current magnetograms of solar active regions as measured by SDO. The torus model was also used to simulate the 1921 Karlstad super solar storm and the simulation results indicate that the active region produced two special parameter changes. The first one, a separation of interconnected torus’s, caused a major solar flare on the 12 May 1921 and the second one, a change in the active area orientation, caused a series of fast CME on the 14 May that burnt down a telegraph station in Karlstad on the following day. A side effect of the simulation is that the temporal resolution of the active region is increased.

The conclusion is that topology can be used to simulate solar active regions and solar storms. The torus model performed well when it came to describing the general evolution of the active region, but had issues regarding the weaker parts and the details. The fractured nature of the active region can likely be better described by using a higher number of iterations of the smile attractor.

To simplify the modeling of the 1921 Karlstad super solar storm, the hand drawn magnetograms from the Mount Wilson Observatory were con-verted into color scale, the same color scale as used in the torus model simulations. This method is recommended to be used for studies of other older magnetograms.

The torus model offer many opportunities for future work, in the short term by allowing for a more general parameter set to be used and to perform more simulations on recent active regions. The relative color scale also has to be made absolute.

In the medium term the interpretation of the model needs to be altered to simulate the three dimensional vector magnetic field, possibly by using the parts of a torus in between two cutouts. It is also possible that further moderations should be performed on the smile attractor formula.

(5)

In the longer term the goal is to use a topological model, together with a neural network, to automatically detect, simulate and predict super solar storms.

(6)

Summary

Chapter 1 represents an introduction to solar storms, including impacts and predictions. It also contains the goal of the thesis, which is to study the connections between solar storms and topology, states that the software used is Mathematica and provides a description of the limited previous work performed in the area of linking solar storms and topology.

Chapter 2 represents an introduction to the solar measurements that we can and do perform, such as taking images of the sun in different wavelengths to study the Sun’s different regions, blocking out the Sun to get an image of the outer solar atmosphere to study CME and measuring the strength and polarity of the Sun’s magnetic field. It states Hale’s Polarity Law governing the polarity of an active region.

Chapter 3 represents an introduction to solar storms and in particular super solar storms. A solar storm is a large scale release of energy from the sun, either as a CME or as a solar flare. In this report it is assumed that a solar storm is a reduction of complexity. A super solar storm is an extremely strong solar storm. The chapter also contains a study of the latest Earth directed super solar storm from 1921 where old magnetograms are converted into modern color scales for use in chapter 7.

Chapter 4 represents an introduction to the relevant topology used, such as the writhe, twist and linking number of a torus. Visual representation is provided.

(7)

Chapter 5 contains a description of the two solar dynamo models used, the stretch-twist-fold model which performed unsatisfactory and the self constructed torus model using the smile attractor. The connection between the parameters of the smile attractor and the topology presented in chapter 4 is illustrated. The interpretation of turning the torus model cutouts into magnetograms is also included. It is assumed that a solar storm is a change in the torus model parameters.

Chapter 6 provides some comparisons with actual current SDO magne-tograms and a modeling of the 1921 Karlstad super solar storm. The pa-rameter sets used for this modeling is provided in tables.

Chapter 7 contains the results and the analysis of the torus models behavior. The modeled magnetograms are compared with the actual magnetograms of the 1921 Karlstad super solar storm. An analysis is performed to study what changes occurred in the model and how they are linked to the actual super storm. Two significant changes occurred, during the 12 and 14 May, the first one likely causing a major solar flare and the second one causing a rapid series of CME’s that hit the Earth on the 15 May.

Chapter 8 contain the conclusions drawn from the project as well as a discus-sion on future work to be performed on the torus model. The concludiscus-sion is that topology can be used to simulate solar active regions and solar storms. Based on the simulation of the 1921 Karlstad super solar storm the super solar storm on the 14 May was caused by a change in the active area orienta-tion. A second rare parameter change, the separation of connected torus’s, happened on the 12 May and may have caused a major solar flare.

The torus model offer many opportunities for future work, including exploring more parameter sets, conducting simulations on recent active

(8)

re-Acknowledgements

I would like to thank my supervisor, Associate Professor Henrik Lundstedt for his constant support and feedback throughout this Master thesis project. I would like to thank Tomas Persson, PhD at the Centre for Mathematical Sciences at Lund University for his mathematical guidance. I would also like to extend a general thanks to IRF Lund for inviting me and providing me with an office space and relevant office materials.

Last but not least, I would like to thank everyone at Lule˚a University of Technology, both students and teachers, for five great years.

(9)
(10)

Contents

Abstract i

Summary iii

Acknowledgements v

Table of Contents vii

1 Introduction 1 1.1 Goal Statement . . . 2 1.2 Previous work. . . 2 1.3 Software used . . . 2 2 Solar measurements 3 3 Solar Storms 7

3.1 Super Solar Storms . . . 8

3.2 The 1921 Karlstad super solar storm . . . 9

4 Topology 11

5 Dynamo models 13

5.1 The stretch-twist-fold dynamo. . . 13

5.2 The torus model . . . 16

5.3 Interpretation of the torus model . . . 19

6 Compare with real data 23

6.1 Modeling the 1921 Karlstad super solar storm . . . 24

(11)

8 Conclusions 33

8.1 Future work . . . 34

A Mathematica Code 37

A.1 The stretch-twist-fold model . . . 37

A.2 The torus model . . . 43

B Abreviations 63

List of Figures 65

List of Tables 67

(12)

Chapter 1

Introduction

The study of solar storms is not only motivated by scientific curiosity but more and more by infrastructure safety. As our society becomes more re-liant on power grids, radio communication, pipe lines and satellite system, it also becomes more vulnerable to solar storms. A major solar storm can for instance disable GPS-satellites and cause ionospheric disturbances that increase the error of the remaining signals. This could be a disaster scenario in the near future with plans to make both cars and airplanes run automat-ically using GPS or Galileo satellite positioning systems. The more current danger was illustrated in October 2003 when a solar storm caused a power blackout in Malm¨o.

Steps can be taken to limit the effect of a solar storm, but only if an early warning is received. We have fortunately been spared in recent history from Earth-directed super solar storms, but studies show us that super solar storms may occur once every solar cycle (11 years).

Whatever the frequency of super solar storms is, it is not a question if but when the next one will hit the Earth. And when that happens we need as much early warning as possible.

The origin of all space weather can be traced back to the Sun, where coronal holes and solar storms drive the solar wind. Despite much effort, solar storms remain difficult to predict and only statistical methods exist to make automatic predictions. This warrants the use of a new approach to study solar storms based on topology. Using topology will hopefully give new insight to solar storms and what makes a solar storm into a super solar storm.

(13)

1.1

Goal Statement

The goal of this project is to investigate if topology can be used to model solar storms. The secondary goal is to create a topological model to model the 1921 Karlstad super solar storm and to analyze it.

1.2

Previous work

The possible connection between solar storms and topology has been studied before, including by Lundstedt et al 2012[1].

The stretch-twist-fold model is a topological model often used as the basis for more advanced solar dynamos. The behavior of the stretch-twist-fold model was studied by Vainshtein et al 1996[2].

Berger et al 2006[3] studies twist and writhe and suggests connecting them to magnetic flux tubes in the solar atmosphere.

The smile attractor[4] and topology[5] is described in several mathemat-ics books, but no known previous work connect them to the solar dynamo and solar storms.

Regarding the 1921 Karlstad super solar storm, no previous work is known to have been performed on using topology to simulated it, to convert the magnetograms into color scale or to enhance the temporal resolution of the magnetograms.

1.3

Software used

The software used to create and run the topological model was Wolfram Mathematica version 8. The software code provided cannot be guaranteed to be compatible with other versions of Mathematica.

(14)

Chapter 2

Solar measurements

While the Sun has fascinated us since the dawn of time, we have until recently been very limited in our ability to study it. The only distinct characteristics visible were solar spots, areas on the solar surface, also called the photosphere, that are slightly colder than the surroundings. Solar spots can grow large enough to be visible with the naked eye and series of solar spot measurements are available for long time periods. This has yielded much research studying solar spots, including the 11 year solar cycle and long term climate variations. The Sun however has much more information to give us.

(a) Photosphere (b) Chromosphere (c) Corona (d) Magnetic Field

Figure 2.1: Four images of the Sun at 23:43:44 on the 3 April 2013 in different wavelengths[6]. The wavelengths are (from the left) 450 nm, 30.4 nm, 19.3 nm, 17.1 nm. To illustrate the resolution provided by SDO, the zoomed image of the chromosphere is displayed in figure2.2.

Today we can study the Sun’s light in different wavelengths, allowing us to get clear images of different regions of the Sun (see figure 2.1). This is made possible thanks to the temperature differences of the regions, causing them to glow differently in different wavelengths. An improvement in these images is achieved by using satellites instead of ground based observatories to capture the images. Satellites are not affected by the atmospheric

(15)

distor-tions and provide an almost continuous data series unaffected by clouds or nighttime. Solar observing satellites are located both in the L1 point (the gravitational midpoint between Earth and the Sun) to get a closer view of the Sun as well as behind the Sun to show us what happens on the other side. The currently best data is provided by SDO which is a satellite located in a geosynchronous orbit to allow for a larger data transfer.

Figure 2.2: An images of the Sun at 23:43:44 on the 3 April 2013 at 30.4 nm wavelength[6].

The other solar measurement available in historic time was the study of the solar corona. During a complete solar eclipse the outer solar atmosphere becomes visible and show us a much more complex image of the Sun. This method is used today by deliberately blocking out the Sun and it gives us a great way to study CME’s (see figure 2.3).

(16)

Figure 2.3: An image of the outer solar atmosphere during a CME the 2 December 2003 taken from SOHO[7]. Includes a cut in image of the Sun’s chromosphere in the middle.

There are also a few other measurements available to us and most no-tably for this report is the ability to measure the Sun’s magnetic field.

Figure 2.4: A magnetogram of the Sun at the 25 April 2013 at 12:00:00[8].

The magnetic field is measured as a three dimensional vector, which is available as measurements, but is simplified to include only the longitude part of the magnetic field (”north” or ”south”). This trans-forms the measurements into a picture, comparable to the ones in figure2.1, called a magnetogram (see figure 2.4). The brightest areas of a magnetogram corre-sponds to the location of sun spots, but using a magnetogram we can also see the polarity and get a better scale. Bright ar-eas in a magnetogram are referred to as active regions. Of primary interest to us is the complexity of these active regions combined with its size and strength.

The polarity of these active areas generally follows Hale’s polarity law, which states that the polarity of active regions is the same in a given hemi-sphere with respect to the east-west direction and reversed on the other hemisphere. The hemispherical dirtribution reverses every solar cyce. Fig-ure2.4shows the current polarity with +/- (green/yellow) on the northern hemisphere and -/+ (yellow/green) on the southern hemisphere.

The Regional Warning Center Sweden, operated by IRF Lund, provides a simple and daily updated webpage for the current space weather and predictions[9].

(17)
(18)

Chapter 3

Solar Storms

The primary interest behind studying the solar activity is to understand and be able to predict solar storms. A solar storm is a large release of energy from the Sun into the solar system, either by a solar flare or by a CME.

A solar flare is a strong heating of plasma generally located in the mag-netic field lines within an active region of the Sun. This strong heating causes a strong spike in the X-ray radiation coming from the Sun and if lo-cated on the Earth-facing side of the Sun severely raises the radiation levels in near-Earth space. This creates radiation hazards for astronauts and any-one aboard a high latitude airplane as well as disturbs radio communications through the ionosphere.

A CME is the release of parts of the Sun’s corona into space. This causes billions of tons of protons and electrons to be thrown out into the solar system. Although a CME can spread over a quite large area it is more localized than a solar flare. Only CME emerging from an area in the middle of the Sun will hit the Earth and their effects can be hindered by the ambient solar wind, slowing down and redirecting it. Powerful CME are dangerous to unprotected electronic systems and are responsible for many satellite failures through increased single event upsets. They also cause geomagnetically induced currents, which is a direct consequence of Faraday’s law of induction. The CME arrives as a fast moving cloud of protons causing a temporal change in the Earth’s magnetic field. This is accompanied by an electric field causing currents to flow in the Earth’s atmosphere. Some of these currents flow inside man-made conductors, like power lines, pipelines, telecommunication cables, and railroads, causing damage to them depending on the systems robustness and the strength of the geomagnetically induced current. A CME also pose the same radiation risks as a solar flare.

(19)

During a solar storm it is not uncommon for solar flares and CME to occur together. In this project the term solar storm is used instead of solar flares and CME, since it is assumed that they are simply two variations of the same thing. The assumption is that a solar storm is a reduction in the complexity of the Sun’s local magnetic field.

3.1

Super Solar Storms

A super solar storm is a term used to describe an extreme solar storm that, if Earth-directed, can be very dangerous. There is no clear criteria for what makes a solar storm into a super solar storm, in fact it is a key question asked by IRF Lund and a very important one. Are they only a strong variant of a solar storm, are they created by motions in the chromosphere or are they created deeper down in the Sun’s dynamo predestined to cause a super solar storm? These questions are important, for while a large solar storm certainly can cause damage, it is the super solar storms that we must learn to predict and prepare for.

The strongest super solar storm measured, in 1859, disabled telegraph systems worldwide and caused auroras to be visible as close to the equator as Samoa[10]. The damage was limited however by the fact that the society was not as electrified as our current society. Since then there have only been a few solar storms that can be classified as super solar storms[11].

The frequency of super solar storms, as well as their maximum potential, has long been a matter of scientific debate. Studies of our own Sun is limited by the number of measurement, we have been able to detect solar storm during less than 20 solar cycles. We can however study the super solar storms on other stars of the same type as our Sun’s to get a better statistical groundwork.

A paper by Maehara et al 2012[12] analyzes these studies based on 365 observed super solar storms from 83 000 stars. They suggest that a super solar storm 100 times more powerful than the 1859 event occur once every 800 years. More frightening, it also finds that even stronger super solar storms are possible, up to at least 1000 times stronger than the 1859 event. Recent discoveries have also been made regarding the super solar storms that are not Earth-directed and findings shows that we had one as recently

(20)

3.2

The 1921 Karlstad super solar storm

Assuming that a solar storm is a reduction in the complexity of the magnetic field, magnetograms are required to study them. Unfortunately there are no magnetograms available from the 1859 event, but they are available from the second strongest recorded super solar storm. This super solar storm happened in May 1921 and is famous for burning down a telegraph station in Karlstad[14]. This spike in the geomagnetically induced currents was caused by a series of four rapid CME hitting the Earth on the 15th May. Assuming that they took about one day to reach the Earth the CME would have been created on the 14th May. Some even argue that this storm was stronger than the 1859 event.

During the time of the 1921 Karlstad super solar storm, astronomers at the Mount Wilson Observatory in the US created daily magnetograms of the Sun. The magnetograms for the period 12 - 16 May is displayed in figure 3.1. Magnetograms are available for more days, but when the active region is close to the edges of the Sun a projection error is included and the resolution is degraded. Furthermore no observation are available from Mount Wilson for the 17 May due to clouds.

The first observation one should make is that the magnetogram of the 14th may shows the active regions almost at the center of the Sun (from the Earth’s perspective), validating the assumption that the super solar storm occurred on the 14th May. One also sees that the most drastic change does not take place on the 14th May, but on the 12th May, breaking up the active region into two regions. These regions then rotated in separate directions.

(a) 12th May (b) 13th may (c) 14th May (d) 15th May (e) 16th May

Figure 3.1: Magnetograms from 12 - 16 May 1921 as measured by the Mount Wilson Observatory[15].

To be able to compare the magnetograms with any model simulation it is desirable to convert them into a color scale similar to the one used in current magnetograms. The actual details of the color scale is not too important if the same color scale is used both when converting the magnetograms and in the model.

(21)

The conversion into color scale was made by drawing a grid pattern above the original magnetograms and make the best possible approxima-tion of the value for each box. This was done manually and afterward an interpolation was used to increase the resolution between pixels by a factor of 4 in each dimension. This increased the pixel resolution by 16 and thus reduced the time required by a factor 16. The converted magnetograms are displayed in figure 7.1 and considered to be in good agreement with the original magnetograms in figure3.1.

(a) 12th May (b) 13th may (c) 14th May (d) 15th May (e) 16th May

Figure 3.2: The same magnetograms as in figure 3.1 converted into color scale. Zoomed x2.

The magnetograms, while providing some important data, has a few flaws. They only display peak values of certain areas and omit gradients between areas. They also have a cut-off value and does not display weaker parts of the active regions. These flaws make them harder to compare with any model data since the model will not have these flaws, but the magnetograms should be able to give the general evolution of the strongest parts of the active regions.

It should be noted that the converted images are in no way perfect either. They are however the best representation derived that can be compared to the measured magnetograms.

The time used in the magnetograms as well as the later simulated mag-netograms is local Mount Wilson time (California).

(22)

Chapter 4

Topology

This chapter aims to give an introduction to the topology used in later chapters. Topology is closely tied to geometry and the basic geometric figure used here is a torus. This torus is then subjected to transformations in order to alter it.

A twist is given to the torus by moving a secondary curve, located at the surface of the primary curve, with respect to the primary curve. Somewhat simplified this means that the primary curve of the torus is kept constant, but it is rotated about its own axis causing the surface to become twisted.

The writhe of a torus is the dispositioning of its primary curve with respect to itself, deviating from the smooth original torus. Simplified this means that the curve itself is bent. An illustration of the twist and writhe of a torus is seen in figure 4.1.

(a) Original Torus (b) Twisted Torus (c) Writhed Torus

(23)

The linking number is another topological parameter available to us. The linking number, always an integer and it represents the number of times that two curves winds about each other (counting both negative and positive passages). In the torus case the linking number represents the linking of the curve with itself. An illustration of the torus linking number is seen in figure4.2.

(a) 1 - Linked (b) 3 - Linked

Figure 4.2: An illustrationg of different linking numbers. The linking num-ber is the numnum-ber of times two curves wind about each other or, in this case, them selves.

Combined, the twist, writhe and linking number can transform a torus into a complex image. Using the linking number is not the ultimate goal, but instead the more general term winding number that counts the number of times a closed curve travels around a given point (preferably in the middle). This was however decided to become a part of future works rather than a part of this report.

(24)

Chapter 5

Dynamo models

We want to create a topological model using the topological quantities writhe, twist and linking number described in chapter 4. Another desir-able property is for the model to be a dynamical system with a stdesir-able torus attractor. This means that even after a large number of repetitions, the model shall still, roughly, resemble a torus. The properties of two mod-els, the stretch-twist-fold model and the torus model, is investigated in this chapter.

5.1

The stretch-twist-fold dynamo

The stretch-twist-fold model is the basic model for many solar dynamos, with a process easily illustrated by a rubber band. The aim is to double the number of magnetic flux tubes (and thus the magnetic strength) in any given cutout of the torus. This is performed by the five steps illustrated in figure 5.1. First off, the torus is stretched. Then the torus is twisted into an eight figure and twisted again out of the XY-plane. The fourth step is to fold the two parts of the eight together and finally the doubled torus is turned back into the XY-plane. These steps will convert the kinetic energy of plasma motion from deep inside of the Sun into magnetic energy.

A desirable effect of this dynamo, as compared to other solar dynamos, is that it is a fast dynamo. This means that the number of magnetic flux tubes will continue to double after every cycle, as opposed to a slow dynamo that will have a slower growth rate. This doubling is independent of the cycle number.

(25)

(a) Original Torus (b) Stretch (c) 8-twist

(d) X-axis twist (e) Folding (f) Turning back

Figure 5.1: The five steps of an ideal stretch-twist-fold dynamo.

To mathematically describe the five steps of the stretch-twist-fold dy-namo the five transformations suggested by Vainshtein et al 1996[2] is used.

u1 = a1e− x 2+y2+z2/R2 1x − 2xz2/R2 1, y − 2yz2/R21, −2z + 2 x2+ y2z/R21 (5.1) u2 = a2e−x 2/R2 2− y2+z2  /r2 r0, −y + 2yz2/r2 2, z − 2zy2/r22} (5.2) u3 = a3e− x 2+y2+z2/R2 30, xz − xz y2+ z2/R2 3, −xy + xy y2+ z2/R23} (5.3) u4 = a4e−y 2/R2 4− x2+z2  /r42 − x + 2 xy2+ cx3y/R2 4, y + 3cx2− 2 x2y + cx4/r24, 0} (5.4) u5 = a5e− x 2+y2+z2/R2 5 − x + z, r 0 1 + a1e−r 2 0/R21, −z + x} (5.5)

A Mathematica program is created to set up the original torus and to apply equations 5.1 - 5.5 for a chosen set of parameters. The program can run for a chosen amount of cycles and displays the resulting torus at chosen times (such as each cycle, after a certain step has been performed or after a chosen amount of cycles). The Mathematica code used is shown in appendix A.

(26)

The equations 5.1 - 5.5 are rather straight forward, for each cycle you go through every point inputting its current coordinates and receiving its new coordinates. What makes them difficult to handle is the 12 unknown parameters used in them.

Several thousands of parameter combinations were tried with disappoint-ing results. The parameters must be relatively fine tuned to produce an agreeable result even after the first cycle and the results grow worse for each cycle. This is illustrated in figure5.2were the parameters that most closely match the original torus is displayed through 25 cycles.

(a) 1 cycle (b) 5 cycles (c) 10 cycles (d) 25 cycles

Figure 5.2: The behavior of equations 5.1 - 5.5 illustrated by different stretch-twist-fold model cycles.

There is indeed a stable torus attractor in equations 5.1 - 5.5 but it is located in the wrong plane (see figure 5.2) and does not correspond to a stretch-twist-fold cycle. It turned out that most parameter choices after 25 cycles approached this torus attractor and the ones that did not reached a more drawn out torus in the y-direction. None displayed any signs of a XY-plane torus attractor after the first cycles.

It is also hard to find a direct link between the 12 parameters and the de-sired topology. Some topological situations are not possible, such as chang-ing the linkchang-ing number for a torus after given amount of cycles. The growth rate of the number of magnetic flux tubes per torus cutout is also fixed as 2n and thus excludes many possible combinations.

These reasons make the stretch-twist-fold model undesirable for the project purposes and another model is needed.

(27)

5.2

The torus model

In the search for a new model it was decided to find a more controllable and simpler mathematical expression to get the same result as intended in the stretch-twist-fold model. Some help from the Centre for Mathematical Sciences at Lund University produced the smile attractor. The smile attrac-tor is a transformation that maps a attrac-torus onto itself, with the capability of producing the sought double torus to increase the number of magnetic flux tubes per torus cutout[4]. The smile attractor uses an angular argument t together with a complex number z to describe the torus. The equation, much simpler than the stretch-twist-fold equations, is

f (t, z) = (at, bz + cedit). (5.6) The task is now to tie the parameters a, b, c and d in equation 5.6 to the desired topology. The result of varying the parameter a is shown in figure 5.3. It directly decides the growth of the number of magnetic flux tubes per torus cutout or, simpler put, the number of times the torus winds about the center.

(a) a = 1 (b) a = 2 (c) a = 3

Figure 5.3: The parameter a determine how many times the curve winds about the center. The other parameters are fixed at b = 0.5, c = 1 and d = 1.

The parameter b is tied to the old z -value as a scalar product, varying it changes the radius of the torus directly decided by the change in the parameter b. This is shown in figure5.4.

(28)

(a) b = 1 (b) b = 0.5

Figure 5.4: The parameter b determine the radius of the torus. The other parameters are fixed at a = 1, c = 0 and d = 0.

The parameter c is linked to the size of the effect of the angular param-eter t. The angular paramparam-eter t causes the two parts of the torus windings to not intersect. Figure5.5shows that the parameter c govern the distance between the two parts of the torus winding.

(a) c = 1 (b) c = 0.5

Figure 5.5: The parameter c determine the separation of the torus parts in the same plane. The other parameters are fixed at a = 2, b = 0.5 and d = 1.

The parameter d is also linked to the angular parameter t and decides the period of the separating part of the smile attractor. The direct effect of this translates into the linking number, as shown in figure5.6. The parameter d also causes the curve to writhe, showing a connection between the linking number and the writhe.

(a) d = 1 (b) d = 3 (c) d = 5 (d) d = 7

Figure 5.6: The parameter d determine the linking number of the torus. The other parameters are fixed at a = 2, b = 0.5 and c = 1.

(29)

The parameters of the smile attractor show direct and clear connections to the behavior of the modeled torus, but it does not include the twist. A modified version of equation 5.6 can perform this though by introducing a fifth parameter e.

f (t, z) = (at, bzeeit+ cedit) (5.7) The parameter e determines the twist of the torus as shown in figure5.7. With it, the five parameters a, b, c, d and e now provide a simple and directly controllable, yet very potent torus model.

(a) e = 0 (b) e = 1

Figure 5.7: The parameter e now determine the twist of the torus. The other parameters are fixed at a = 1, b = 1, c = 0 and d = 0.

(30)

5.3

Interpretation of the torus model

To interpret the torus’s produced by equation 5.7 the cutout at an angle t is used. The torus is cut into two equal semicircles (treated as positive and negative poles) and a grid of values is calculated based on their inversed distance squared to the semicircles. An illustration of how this works is shown in figure5.8.

Figure 5.8: A few examples of simple cutouts created by the torus model. All examples use the interpretation that the torus cutout forms an attractor that declines by the square of the distance.

The connection to solar storms, based on the assumption that a solar storm is a reduction in complexity, is that a solar storm is a change in the torus model parameters.

There is a problem using the inverse distance squared when the distance is close to zero. To avoid this one could either fix the value within a close distance to the center of the semicircle or add a term to the distance to keep it from becoming zero. Both solutions will avoid the division with zero and approximate as the inverse distance over a larger scale. The second solution was chosen and the semiminor axis of the semicircle, 4r, was chosen as the term to add to the distance.

A possible solution was found during the later stages of the project and thus not implemented into the project. This is to calculate the average distance to all points in the semicircle, a value that will never become zero for a semicircle of size greater than zero, and use this averaged distance to simulate the magnetograms. The effects should only be noticeable on the shorter scales.

(31)

Another problem is related to the color scale used to produce the sim-ulated magnetograms. Although Mathematica allows for the creation of customized color scales, all color scales becomes relative rather than abso-lute. This sometimes causes the a shift in the colors of the simulated mag-netograms (and of the converted magmag-netograms from chapter 3.2) which is problematic for comparison purposes. Since the relative color scale is sen-sitive even to very small values, who’s number can change much between simulations, a low-cutout is made setting values close to zero to zero. This keeps the color scale more constant without affecting the main areas.

A few assumptions are made regarding the allowed parameter choices. These assumptions represents assumptions made to make the torus behave more logical.

The parameter a is assumed to be an integer. Non-integer values are mathematically possible, but will create a broken torus where the edges are not connected, e.g. if a = 0.5 then the torus will wind 1.5 laps around the center before making a jump back to the start.

The parameter b is assumed to be √1

a to preserve the volume of the

torus. This allows for a higher level of details if equation 5.7 is applied several times.

The parameter d is assumed to be an integer. Non-integer values are mathematically possible, but will create a broken torus at the limit between t = 0 and t = 360 because the winding separation will be discontinuous.

The parameter e is assumed to be an integer. Non-integer values are mathematically possible, but will create a torus with a discontinuous twist at the limit between t = 0 and t = 360.

It is also assumed that if equation 5.7 is used more than once it is used using the same parameters. This is to limit the space of possible parameter choices as a project limitation. Other choices are likely valid, but will be a part of future work.

The simulated magnetograms produced by the torus model may seem too simple at first, lacking the fractal structure seen in actual magnetograms. But an investigation into the iterative use of equation 5.7, shown in fig-ure 5.9, shows that the magnetograms become fractal when subjected to

(32)

(a) n = 1 (b) n = 2 (c) n = 3 (d) n = 4

Figure 5.9: The fractal behavior of the torus model for different iterations. The same parameters are used for each iteration.

The torus model can produce many types of magnetograms (see fig-ure5.10), including magnetograms with a different sizes of the poles, differ-ent number of positive and negative areas and some parameter configurations even produce magnetogram that mostly resemble flowers. The last ones are probably not realistic, but they are included to show what the torus model can produce.

(a) Different sizes (b) Different areas (c) A flower!?

Figure 5.10: A selection of possible magnetograms produced by the torus model interpretation.

Using equation 5.7 and the cutout interpretation into magnetograms we now have a topological model of a solar storm!

The Mathematica code used for both the torus model and the magne-togram simulation is shown in appendix A.

(33)
(34)

Chapter 6

Compare with real data

The torus model will now be checked by comparing it to recent SDO mag-netograms of active regions and to use it to model the 1921 Karlstad super solar storm based on the magnetograms converted into color scale.

Figure 6.1 shows five examples of recent active regions and there torus model parameter equivalents. Some of the magnetogram are a bit bent due to the curvature of the Sun, something not included in the simulated magnetograms. Note that more complicated active regions may in fact be a combination of two or more torus’s.

(a) 20121210 (b) 20130313 (c) 20130329 (d) 20130418 (e) 20130421

Figure 6.1: A few examples of the comparisons between magnetograms ob-served by SDO[6] and simulated magnetograms.

Many active regions on the Sun are not as clear as the ones presented in figure 6.1, but rather split up and fractured. This is especially true for the simplest torus configuration shown in figure 6.1a. This is explained by

(35)

that the simplest parameter configuration should also be the ”weakest” one, since it cannot change into a simpler parameter configuration. The torus is considered to be the driving force creating an active region, but with a weak torus the effects of the ambient plasma takes over and breaks up the active region. These fractured active regions never produce any larger solar storms, further strengthening the assumptions that they are now practically no longer an active region. The fractured remains of an active region can however lend strengthen to a new active region if one is formed in the same position shortly afterwards.

6.1

Modeling the 1921 Karlstad super solar storm

The method used to model the 1921 Karlstad super solar storm is to find a torus model that resembles the converted magnetograms for the first image (the 12 May) and then increase the angular argument t to produce the models evolution. If the evolution does not satisfactory follow the converted magnetograms (see figure 7.1) then a change in parameters is assumed to have occurred indicating a solar storm.

To simplify the parameter search, only the main structure and behavior of the converted magnetograms are attempted to be simulated. More than one torus is required to resemble the converted magnetograms, but this is logical given that the active region simulated created a super solar storm. The simulated magnetograms are shown as results in chapter 7.

The parameters used to simulated the converted magnetograms are pre-sented in tables, including its relative position, the parameters used, the direction of the alignment, the angular argument, the speed of the angular argument change. The change in the angular argument t is always positive. The relative strength of the different areas is decided by the parameter strength. Apart from this strength-parameter, the strength of a torus cutout is also determined by the number of iterations used together with the pa-rameter a. For example, a torus cutout using a = 2 and n = 1 will be twice as strong as one only using a = 1 or n = 0. This effect is normalized so that is does not need to be included in the relative strength.

An example of the program used to create the combined simulated mag-netograms is in appendix A. This is the program used to create the simulated

(36)

Table 6.1: The parameter sets used for the simulated magnetogram on the 12 May 09:00. Parameter Centre a 2 2 3 1 b 1/√2 1/√2 1/√3 1 c 0.4 0.1 0.5 0 d 1 1 -3 0 e 0 3 -3 1 n 2 1 1 1

Direction Up Right Right Right t 284 360 294 150 ∆t/day 16 170 16 0 strength 5 2 2 1

Sometime after the 12 May measured magnetogram at 08:30, the two main parts of the active region separates from each other. The right area also begin to turn in the clockwise directions given by Hale’s polarity law, a motion that may already have been there on the first magnetogram. The left active area turns somewhat in the opposite direction and there is a tail created between the areas that rapidly shifts polarity. To describe the tail another two parameter sets are used, although this could perhaps have been neglected (the tail only has a low intensity). The parameter sets used is displayed in table6.2.

Table 6.2: The parameter sets used for the simulated magnetogram on the 13 (and 14 except for the t -value) May 09:00.

Parameter Left Centre Right

a 2 1 2 2 3 2 b 1/√2 1 1/√2 1/√2 1/√3 1/√2 c 0.4 0 0.1 0.1 0.5 0.5 d 1 1 1 1 -3 -1 e 0 1 3 3 -3 -4 n 2 1 1 1 1 1

Direction Up Left Left Right Right Right t 300 350 20 170 310 80 ∆t/day 80 0 180 180 20 60 strength 7.5 0.75 4 1.125 3.25 0.5

(37)

On the 13 and 14 May the two active areas keep on behaving the same, but later on the 14 May the parameters for both areas change. Now the left area begins to rotate anticlockwise (the right direction according to Hale’s polarity law for the northern hemisphere) and a part of it moves in between the two active areas. The change in parameters for the left area is not large, but instead the bigger change is the change in direction. From being oriented upwards, it now become oriented leftwards. It is also worth noting that the active region is almost perfectly Earth-centered on the 14 May. The centre torus’s are now removed. The parameter sets used is displayed in table6.3. Table 6.3: The parameter sets used for the simulated magnetogram on the 15 May 09:00.

Parameter Left Right

a 2 1 3 2 b 1/√2 1 1/√3 1/√2 c 0.4 0 0.5 0.5 d 1 1 -3 -1 e 4 1 -3 -4 n 2 1 1 1

dir Left Left Right Right t 100 350 350 200 ∆t/day 10 0 20 60 strength 3 1.5 0.75 1.5

After this the left area parameters remain the same while continuing the anticlockwise rotation. The right area has a change in parameters on the 15 May causing it to stop the clockwise rotation and to rotate slightly anticlockwise. This last parameter change could probably have been done better to instead become a single parameter change on the 14 May. The parameter sets used is displayed in table6.4.

(38)

Table 6.4: The parameter sets used for the simulated magnetogram on the 16 May 09:00.

Parameter Left Right

a 2 1 3 2 b 1/√2 1 1/√3 1/√2 c 0.4 0 0.5 0.5 d 1 1 3 1 e 4 1 3 4 n 2 1 1 1

dir Left Left Right Right t 110 350 10 200 ∆t/day 10 0 20 60 strength 3 1.5 0.75 0.5625

A major reason behind the changes in the strength-parameter is to sta-bilize the colors, again there are difficulties with using the relative color scale.

(39)
(40)

Chapter 7

Results and Analysis

The results from using the values presented in tables 6.1 - 6.4 form com-bined simulated magnetograms that can be compared with the converted magnetograms from chapter 3. This comparison is shown in figure7.1using the simulated magnetogram closest in time to the converted magnetogram. Note again that the time used is not universal time, but the local time of the Mount Wilson Observatory (California).

(a) 12th May (b) 13th May (c) 14th May (d) 15th May (e) 16th May

Figure 7.1: A comparison between the measured magnetograms and the simulated magnetograms for the 12 - 16 May 1921.

The simulated magnetograms are able to simulate the general temporal behavior of the active region. The positions and relative proportions of the different poles in the active region are captured to a certain degree, though they could arguably be better.

(41)

The simulated magnetogram have some issues with the weaker areas of the active region, however it should be noted that the measured magne-tograms have a cut-off value so they do not show the weaker parts.

The converted magnetograms show larger gradients that are harder to replicate with the simulated magnetograms. They also show a higher level of details and, based on recent magnetograms, they likely show less details then there actually are. It is possible that higher numbers of iterations used in the simulations could produce simulated magnetograms that better resemble these features (in chapter 5 the fractal nature of the torus model is illustrated). It is also possible that these details require the use of other parameter sets not included.

Based on the proposed assumption that a solar storm is a change in the torus model parameters it is now interesting to study the parameter changes made in order to simulate the 1921 Karlstad super solar storm. There are two changes that are particularly interesting.

Regarding the solar storm that effected the Earth on the 15 May and that is believed to have happened on the Sun on the 14 May, the parameters do change sometime on the 14 May (see tables 6.2 and 6.3) causing the area to accelerate its anticlockwise rotation. The main change however is the change in the direction of the left active area that shifts from being oriented upwards to being oriented leftwards as directed by Hale’s Polarity Law. Could it be that this shift to adhere to Hale’s Polarity Law caused the 1921 Karlstad super solar storm? This would definitely to a rare parameter change, clearly distinct from other parameter changes that is assumed to ”only” cause a solar storm.

The second change, already noted in chapter 3, occurs on the 12 May with the break-up of the active region into two areas. One could think of it as two torus’s being connected and then becoming disconnected. This would also be a rare and possibly dangerous parameter change. But there is no data indicating a strong CME hit the Earth on the 12 or 13 May. Looking closer at copies of the hand drawn original magnetograms may offer a clue. In the marginal of the magnetogram from the 12 May there are two lines written saying ”K2 bright” and ”Hα bright”. This is an indication that

(42)

may have been significant enough to be considered a super solar storm.

A positive side effect of the torus model is that it can not only simulate the magnetogram at the time of the measured magnetograms, but at any chosen time in between. This allows for the simulation of the magnetograms shown in figure7.2.

(a) 12th 09:00 (b) 12th 15:00 (c) 12th 21:00 (d) 13th 03:00 (e) 13th 09:00

(f) 13th 15:00 (g) 13th 21:00 (h) 14th 03:00 (i) 14th 09:00 (j) 14th 15:00

(k) 14th 21:00 (l) 15th 03:00 (m) 15th 09:00 (n) 15th 15:00 (o) 15th 21:00

(p) 16th 03:00 (q) 16th 09:00

Figure 7.2: The simulated magnetograms every 6th hour between the 12 -16 May 1921.

This temporal resolution suffers from the same flaws as the magne-tograms shown in figure 7.1 and also requires assumptions about when parameter changes occur. They do however provide a better idea of the evolution of the active region.

(43)
(44)

Chapter 8

Conclusions

The main conclusion to draw from this project is that it is possible to use a topological model to simulate solar storms and even super solar storms.

This project concludes that the stretch-twist-fold model is not suitable as a topological model, at least not using the equations suggested by Vainshtein et al 1996[2]. The model lacks a stable torus attractor in the XY-plane and is also too complicated in the sense that there are no clear connections between its 12 parameters and the desired topological quantities. Not even using extreme fine tuning did the model produce the desired results after even a few iterations.

The torus model based on the smile attractor is concluded to warrant further study since it succeeds in both replicating current solar active re-gions and in simulating the 1921 Karlstad super solar storm. It represents both a simple and a clear way to topologically transform a torus. Other in-terpretations of it may be more suitable to use when attempting to simulate the three dimensional vector magnetic field.

The torus model is in no way perfect, with errors primarily in the weaker areas of an active region and on the smaller scales. These are believed to be improved by using a higher number of iterations and by allowing for more general parameter sets. It also cannot represent the fractured remains of an active region attributed to the ambient plasma motion or the connection between active regions where an event can cause near simultaneous solar storms in more than one active region.

Based on the torus model simulation of the 1921 Karlstad super solar storm, assuming that the torus model provided is the correct representation of the active region, it is concluded that there were two major parameter changes. On the 12 May there was a disconnection between the torus’s

(45)

causing a major solar flare and on the 14 May there was a shift in the orientation reverting to the direction given by hale’s Polarity Law causing a series of strong CME that affected the Earth.

For the study of the 1921 Karlstad super solar storm, measured magne-togram were converted into color scale magnemagne-tograms. This method allowed for an easier comparison and is recommended to be used more frequently in attempts to simulate older magnetograms.

Using the torus model it is possible to increase the temporal resolution of magnetograms, although some care should be taken with assumptions on the time of intermediate parameter changes. The simulated magnetograms provided in this report slide into one another continuously and it is possible that a parameter change can only occur if the old and new magnetograms are close enough. If this is proven to be true then it becomes possible to find the time of historic solar storms based on low temporal resolution magnetograms. Furthermore this would make it possible to predict the time and size of solar storms!

8.1

Future work

The torus model offer many opportunities for future work.

In the short term by allowing for a more general parameter set to be used than the parameters used in this report. Particularly the result of several iterations of different parameter sets are interesting as well as the study of the models fractured behavior after several repeated iterations using the same parameters. More simulations also needs to be compared and performed on recent SDO measured magnetograms. Also the issue regarding the relative color scale has to be resolved to simplify comparisons. Better source code organization and structuring is always possible.

In the medium term the interpretation of the torus model needs to be altered in order to simulate the three dimensional vector magnetic field. This vector magnetic field is also given by SDO measurements and represent a more complete image of an active region. A possible suggestion for a new interpretation is to use a part of the torus produced by the torus model in between several cutouts. This could simulate the sigmoids that may believe are related to solar storms by the torus’s writhe. Further modifications to

(46)

In the longer term the goal is to use a topological model to automatically predict solar storms. This could be done by training a neural network to identify the topology of an active region and compare it to a topological model.

(47)
(48)

Appendix A

Mathematica Code

A.1

The stretch-twist-fold model

This is the mathematica code used to simulate the stretch-twist-fold model. The parameters used are the parameters used in figure 5.2.

Initialization

(*Initializes the parameters used in the model. The first 11 parameters are the same as used by Vainshtein et al 1996. Change these to test the STF-model.*)

ClearAll[a1, a2, a3, a4, r2, r4, R1, R2, R3, R4, R5, Rgen, c]; a1 = 0.2; a2 = 1.0; a3 = 30.0; a4 = 1.1; a5 = 1; r2 = 2.0; r4 = 1.9; R1 = 1.0; R2 = 1.3; R3 = 0.71; R4 = 1.2; R5 = 6.0; c = 0.9; Rgen = (Sqrt[R1^2 + R2^2 + R3^2 + R4^2] + R5)/2;

(49)

(*Next comes the parameters used to set up the initial condition for the magnetic field line. These are the radius (r), the height (z0) and the resolu-tion, the number of desired points (n or actually n+1). Note that a higher resolution as well as a large number of STF-cycles means a longer execution time.*) ClearAll[r0, z0, n, iter]; r0 = 0.51; z0 = 0; n = 2^14; iter = 25; range = 3;

(*Create the closed magnetic field loop according to the above set parame-ters and stores it in the variable data. The dimensions of the variable data is n*3, with n being set above.*)

ClearAll[data];

data = Flatten[Table[{r*Cos[x], r*Sin[x], 0}, {r, r0, r0}, {x, 0, 2*Pi, 2*Pi/n}], 1];

(*Plots the variable data to show the initial condition magnetic field. The plot show a smooth closed loop.*)

ClearAll[plot1];

plot1 = ListPointPlot3D[data,

PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1.5, 1.5}}, PlotLabel -> "Initial condition (at t=0)",

(50)

ClearAll[u1, u2, u3, u4, u5, x, y, z];

u1[x_, y_, z_] = a1*E^(-(x^2 + y^2 + z^2)/R1^2)* {x - 2*x*z^2/R1^2,

y - 2*y*z^2/R1^2,

-2 z + 2 (x^2 + y^2)*z/R1^2};

u2[x_, y_, z_] = a2*E^(-x^2/R2^2 - (y^2 + z^2)/r2^2)* {0,

-y + 2*y*z^2/r2^2, z - 2*z*y^2/r2^2};

u3[x_, y_, z_] = a3*E^(-(x^2 + y^2 + z^2)/R3^2)* {0,

x*z - x*z*(y^2 + z^2)/R3^2, -x*y + x*y*(y^2 + z^2)/R3^2};

u4[x_, y_, z_] = a4*E^(-y^2/R4^2 - (x^2 + z^2)/r4^2)* {-x + 2*(x*y^2 + c*x^3*y)/R4^2,

y + 3*c*x^2 - 2*(x^2*y + c*x^4)/r4^2, 0};

ytrans = r0*(1 + a1*E^(-r0^2/R1^2))/2;

u5[x_, y_, z_] = E^(-(x^2 + y^2 + z^2)/R5^2)*{-x + z, -ytrans,

-z - x};

Calculations

(*This chapter contains all steps required to perform a series of STF cycles. The behaviour of the STF-model is determined by the parameters defined in the Initializations chapter. A for-loop is used to apply all the five function one by one to the data. After all functions are done the realignment of th-eloop’s center with y=0 is performed. The first step is to perform the stretch using the function u1. The stretch will be calculated for and performed on each point individually so a for-loop is used to extract all points from the variable data. *)

ClearAll[i, data2, data3, data4, data5, data6, data7]; data2 = data; data3 = data; data4 = data; data5 = data; data6 = data; data7 = data;

(51)

For[i = 1, i <= n + 1, i++, ClearAll[x, y, z]; {x, y, z} = data[[i, All]]; {x, y, z} = {x, y, z} + u1[x, y, z]; data2[[i, All]] = {x, y, z}; {x, y, z} = {x, y, z} + u2[x, y, z]; data3[[i, All]] = {x, y, z}; {x, y, z} = {x, y, z} + u3[x, y, z]; data4[[i, All]] = {x, y, z}; {x, y, z} = {x, y, z} + u4[x, y, z]; data5[[i, All]] = {x, y, z}; {x, y, z} = {x, y, z} + u5[x, y, z]; data6[[i, All]] = {x, y, z}; ]; Show[plot1]

ClearAll[plot2, plot3, plot4, plot5, plot6]; plot2 = Graphics3D[Line[data2],

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel -> "Stretch (t=1)",

AxesLabel -> {"x-axis", "y-axis", "z-axis"}] plot3 = Graphics3D[Line[data3],

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel -> "8-twist (t=1)",

AxesLabel -> {"x-axis", "y-axis", "z-axis"}] plot4 = Graphics3D[Line[data4],

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel -> "Twist about the x-axis (t=1)",

AxesLabel -> {"x-axis", "y-axis", "z-axis"}] plot5 = Graphics3D[Line[data5],

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel -> "Folding in the y direction (t=1)",

AxesLabel -> {"x-axis", "y-axis", "z-axis"}] plot6 = Graphics3D[Line[data6],

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel ->

(52)

dist = {r0}; long = {0}; For[j = 2, j <= iter, j++, For[i = 1, i <= n + 1, i++, ClearAll[x, y, z]; {x, y, z} = data[[i, All]]; {x, y, z} = {x, y, z} + u1[x, y, z]; {x, y, z} = {x, y, z} + u2[x, y, z]; {x, y, z} = {x, y, z} + u3[x, y, z]; {x, y, z} = {x, y, z} + u4[x, y, z]; {x, y, z} = {x, y, z} + u5[x, y, z]; data[[i, All]] = {x, y, z}; ] ClearAll[tempdist]; tempdist = N[Mean[Sqrt[

data[[All, 1]]^2 + data[[All, 2]]^2 + data[[All, 3]]^2]]]; dist = Append[dist, tempdist];

ClearAll[templong]; templong = 0;

For[i = 1, i <= n + 1, i++, ClearAll[x, y, z];

{x, y, z} = data[[i, All]]; If[Sqrt[x^2 + y^2 + z^2] > Rgen,

templong++,] ]

long = Append[long, templong]; Print[ListPointPlot3D[data,

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel -> StringForm["After ‘‘ completed STF-cycle(s)", (j)], AxesLabel -> {"x-axis", "y-axis", "z-axis"}]]

]

Print[Graphics3D[Line[data],

PlotRange -> {{-range, range}, {-range, range}, {-range, range}}, PlotLabel -> "Stretch (t=1)",

(53)
(54)

A.2

The torus model

These are the functions defined in mathematica and used in the torus model simulations.

(*Create a choosen part of a complex Z-plane circle EX: pdataStart = createCircleSec[-Pi/2,Pi/2]; ndataStart = createCircleSec[Pi/2,Pi*3/2];*) ClearAll[createCircleSec]; createCircleSec[angleStart_, angleStop_] := ( ClearAll[data, rstep]; data = {0}; rstep = 0.2*rminor;

For[r = rstep, r <= rminor, r = r + rstep, ClearAll[tempdata, dphi];

dphi = Pi/(r*resolutionZ);

tempdata = Flatten[Table[{r*Exp[I*phi]}, {phi, angleStart, angleStop, dphi}], 1]; data = Flatten[Append[{data}, tempdata], 1]; ];

ClearAll[ rstep, tempdata, dphi]; Return[data];

);

(*Creates a solenoid based on a complex Z-plane circle section EX: pdata = createSolenoid[pdataStart];

ndata = createSolenoid[ndataStart];*)

ClearAll[createSolenoid];

createSolenoid[dataStart_] := ( Return[

Flatten[Table[{phi, dataStart[[i]]}, {phi, 1, resolutionT, 1 }, {i, Length[dataStart]}], 1]];

(55)

(*Coordinate transformation from XYZ into TZ*) ClearAll[xyzTotz ]; xyzTotz [x_, r_] := ( ClearAll[t , z, tz ]; t = Round[ArcTan[x[[1]], x[[2]]]*180/Pi]; If[t <= 0, t = t + 360;]; z = Sqrt[x[[1]]^2 + x[[2]]^2] - r + I*x[[3]]; tz = {t, z}; Return[tz]; );

(*Transform all given coordinates from XYZ into TZ EX: pdataTZ = transformationIntoTZ[pdataXYZ];*) ClearAll[transformIntoTZ];

transformIntoTZ[dataXYZ_] := ( ClearAll[dataTz];

dataTZ =

Table[{xyzTotz[dataXYZ[[i]], rmajor][[1]],

xyzTotz[dataXYZ[[i]], rmajor][[2]]}, {i, 1, Length[dataXYZ], 1}]; Return[dataTZ];

);

(*Coordinate transformation from TZ into XYZ EX: x = tzToxyz[t,z,rminor]*)

ClearAll[tzToxyz ];

tzToxyz = Compile[{{t, _Real}, {z, _Complex}, {r, _Real}}, ClearAll[x, x1, x2, x3];

(56)

Return[x] ];

(*Transforms all given coordinates from TZ into XYZ*)

ClearAll[transformIntoXYZ]; transformIntoXYZ[dataTZ_] := (

ClearAll[dataXYZ]; dataXYZ =

Table[tzToxyz[dataTZ[[i, 1]], dataTZ[[i, 2]], rmajor], {i, 1, Length[dataTZ], 1}];

Return[dataXYZ]; );

(*Create a 3D-plot of the solenoid

EX: create3DPlot[pdataXYZ,ndataXYZ,displayX,displayY,displayZ,b,n]*) ClearAll[create3DPlot];

create3DPlot[positiveData_, negativeData_, displayX_, displayY_, displayZ_, b_, n_] := (

ClearAll[tpplot, tnplot, pointsize]; pointsize = b^n/(50);

tpplot = ListPointPlot3D[positiveData,

PlotStyle -> {{Blue, PointSize[pointsize]}}, PlotRange -> {displayX*{-1, 1}, displayY*{-1, 1},

displayZ*{-1, 1}}];

tnplot = ListPointPlot3D[negativeData,

PlotStyle -> {{Red, PointSize[pointsize]}},

PlotRange -> {displayX*{-1, 1}, displayY*{-1, 1}, displayZ*{-1, 1}}];

Show[tpplot, tnplot] );

(*Apply the smile attractor

(57)

;*)

ClearAll[applySmileAttractor];

applySmileAttractor[positiveData_, negativeData_, a_, b_, c_, d_, e_] := (

ClearAll[newpData, newnData, newpDataXYZ, newnDataXYZ]; newpData =

Table[{a*positiveData[[i, 1]],

b*positiveData[[i, 2]]*Exp[e*I*positiveData[[i, 1]]*2*Pi/360] + c*Exp[d*I*positiveData[[i, 1]]*2*Pi/360]}, {i, 1,

Length[positiveData], 1}]; newnData =

Table[{a*negativeData[[i, 1]],

b*negativeData[[i, 2]]*Exp[e*I*negativeData[[i, 1]]*2*Pi/360] + c*Exp[d*I*negativeData[[i, 1]]*2*Pi/360]}, {i, 1,

Length[negativeData], 1}]; newpDataXYZ = transformIntoXYZ[newpData]; newnDataXYZ = transformIntoXYZ[newnData]; newpData = transformIntoTZ[newpDataXYZ]; newnData = transformIntoTZ[newnDataXYZ]; newpData = interpolation[newpData, a] ; newnData = interpolation[newnData, a] ; newpDataXYZ = transformIntoXYZ[newpData]; newnDataXYZ = transformIntoXYZ[newnData];

Return[{newpData, newnData, newpDataXYZ, newnDataXYZ}]; );

(*Note that the function needs points in the TZ domain!*) ClearAll[interpolation];

interpolation[points_, a_] := (

ClearAll[ppa, value, scale, newvalue, finalvalue]; ppa = Length[points]*a/360;

value = Table[0, {i, 360}, {j, ppa + 1}]; Table[ClearAll[angle, place];

(58)

, {i, Length[points]}];

value[[0]] = Table[0, {i, Length[value[[360]]]}]; scale = (Length[value[[0]]] - 1)/a;

(*value[[0,1;;scale]] = value[[360,scale+1;;a*scale]]; value[[0,scale+1;;a*scale]] = value[[360,1;;scale]];*) If[Length[value[[0]]] == 2 + 1, value[[0, 1]] = value[[360, 2]]; value[[0, 2]] = value[[360, 1]]; ]; If[Length[value[[0]]] == 3 + 1, value[[0, 1]] = value[[360, 3]]; value[[0, 2]] = value[[360, 1]]; value[[0, 3]] = value[[360, 2]]; ]; If[Length[value[[0]]] == 4 + 1, value[[0, 1]] = value[[360, 4]]; value[[0, 2]] = value[[360, 3]]; value[[0, 3]] = value[[360, 1]]; value[[0, 4]] = value[[360, 2]]; ]; If[Length[value[[0]]] == 6 + 1, value[[0, 1]] = value[[360, 6]]; value[[0, 2]] = value[[360, 5]]; value[[0, 3]] = value[[360, 1]]; value[[0, 4]] = value[[360, 2]]; value[[0, 5]] = value[[360, 3]]; value[[0, 6]] = value[[360, 4]]; ]; If[Length[value[[0]]] == 8 + 1, value[[0, 1]] = value[[360, 8]]; value[[0, 2]] = value[[360, 7]]; value[[0, 3]] = value[[360, 5]]; value[[0, 4]] = value[[360, 6]];

(59)

value[[0, 5]] = value[[360, 1]]; value[[0, 6]] = value[[360, 2]]; value[[0, 7]] = value[[360, 3]]; value[[0, 8]] = value[[360, 4]]; ]; If[Length[value[[0]]] == 9 + 1, value[[0, 1]] = value[[360, 9]]; value[[0, 2]] = value[[360, 7]]; value[[0, 3]] = value[[360, 8]]; value[[0, 4]] = value[[360, 1]]; value[[0, 5]] = value[[360, 2]]; value[[0, 6]] = value[[360, 3]]; value[[0, 7]] = value[[360, 4]]; value[[0, 8]] = value[[360, 5]]; value[[0, 9]] = value[[360, 6]]; ]; If[Length[value[[0]]] == 16 + 1, value[[0, 1]] = value[[360, 16]]; value[[0, 2]] = value[[360, 15]]; value[[0, 3]] = value[[360, 13]]; value[[0, 4]] = value[[360, 14]]; value[[0, 5]] = value[[360, 9]]; value[[0, 6]] = value[[360, 10]]; value[[0, 7]] = value[[360, 11]]; value[[0, 8]] = value[[360, 12]]; value[[0, 9]] = value[[360, 1]]; value[[0, 10]] = value[[360, 2]]; value[[0, 11]] = value[[360, 3]]; value[[0, 12]] = value[[360, 4]]; value[[0, 13]] = value[[360, 5]]; value[[0, 14]] = value[[360, 6]]; value[[0, 15]] = value[[360, 7]]; value[[0, 16]] = value[[360, 8]]; ];

(60)

value[[0, 3]] = value[[360, 29]]; value[[0, 4]] = value[[360, 30]]; value[[0, 5]] = value[[360, 25]]; value[[0, 6]] = value[[360, 26]]; value[[0, 7]] = value[[360, 27]]; value[[0, 8]] = value[[360, 28]]; value[[0, 9]] = value[[360, 17]]; value[[0, 10]] = value[[360, 18]]; value[[0, 11]] = value[[360, 19]]; value[[0, 12]] = value[[360, 20]]; value[[0, 13]] = value[[360, 21]]; value[[0, 14]] = value[[360, 22]]; value[[0, 15]] = value[[360, 23]]; value[[0, 16]] = value[[360, 24]]; value[[0, 17]] = value[[360, 1]]; value[[0, 18]] = value[[360, 2]]; value[[0, 19]] = value[[360, 3]]; value[[0, 20]] = value[[360, 4]]; value[[0, 21]] = value[[360, 5]]; value[[0, 22]] = value[[360, 6]]; value[[0, 23]] = value[[360, 7]]; value[[0, 24]] = value[[360, 8]]; value[[0, 25]] = value[[360, 9]]; value[[0, 26]] = value[[360, 10]]; value[[0, 27]] = value[[360, 11]]; value[[0, 28]] = value[[360, 12]]; value[[0, 29]] = value[[360, 13]]; value[[0, 30]] = value[[360, 14]]; value[[0, 31]] = value[[360, 15]]; value[[0, 32]] = value[[360, 16]]; ]; (* Table[value[[0,1+(a-i)*scale;;(a-i+1)*scale]] = value[[360,1+(i-1)* scale;;(i)*scale]] ,{i,a}];*) newvalue = Table[ ClearAll[tempC]; tempC = Mod[i, a]; If[tempC == 0,

(61)

value[[i]],

tempC/a*value[[i - tempC]] + (a - tempC)/a*value[[i - tempC + a]] ], {i, 360}];

finalvalue =

Flatten[Table[{angle, newvalue[[angle, i]]}, {angle, 360}, {i, Length[value[[1]]] - 1}], 1]; (*ClearAll[newpoints,specialpoints]; specialpoints = Table[,{i,Length[points]}] points[[0]] = {points[[360]]} newpoints = Table[Mod[i,a]/a*points[[i-Mod[i,a]]]+(a-Mod[i,a])/a* points[[i-Mod[i,a]]+a] ,{i,Length[points]}];*) Return[finalvalue]; );

(*Creates the color function used for the potential display EX: createColorfunction;*) ClearAll[createColorfunction ]; createColorfunction := ( ClearAll[colorFunction]; red = {255, 0, 0}; darkRed = red*0.7; white = {255, 255, 255}; yellow = {255, 255, 0}; orange = {255, 127, 0}; gray = white*0.85; green = {0, 255, 0}; darkGreen = green*0.5; blue = {0, 0, 255}; darkBlue = blue*0.7; With[{rgb =

(62)

(*Display the color function with a desired resolution EX: displayColorFunction[1000]*) ClearAll[colorResolution]; displayColorFunction[colorResolution_] := ( ArrayPlot[{Range@colorResolution}, ColorFunction -> colorFunction, AspectRatio -> 0.5, Mesh -> {0, 5}, MeshStyle -> Black, Frame -> True, Background -> Black] ); createColorfunction; displayColorFunction[1000] ClearAll[plotcutout]; plotcutout[pa_, pb_, range_] := (

ClearAll[thetas, pplot, nplot, border, cross]; thetas =

Table[N[ArcTan[(pb[[i, 2]] pa[[i, 2]]), (pb[[i, 1]] -pa[[i, 1]])]/Degree], {i, Length[pa]}];

Table[If[thetas[[i]] < 1, thetas[[i]] = thetas [[i]] + 360], {i, Length[thetas]}];

nplot =

Graphics[{Opacity[0.75], Red, Table[Disk[pa[[i]],

0.5, {-thetas[[i]]*Degree + Pi/2, -thetas[[i]]*Degree + 3*Pi/2}], {i, Length[pa]}]}];

pplot =

Graphics[{Opacity[0.75], Blue, Table[Disk[pa[[i]],

0.5, {-thetas[[i]]*Degree + 3*Pi/2, -thetas[[i]]*Degree + 5*Pi/2}], {i, Length[pa]}]}];

border =

(63)

Rectangle[{-range, -range}, {range, range}]}]; cross =

Graphics[{Thick, Line[{{0, range}, {0, -range}}], Line[{{range, 0}, {-range, 0}}]}];

Show[border, cross, pplot, nplot] );

(*Creates a plane cutout with XY-coordinates and an angle phi for \ desciding what plane to show from the TZ-coordinates

EX: pcutout = createPlaneCutout[pdata]; ncutout = createPlaneCutout[ndata];*)

ClearAll[createPlaneCutout]; createPlaneCutout[data_] := (

ClearAll[x];

x = Table[{}, {phi, 1, resolutionT , 1}]; For[i = 1, i <= Length[data], i++,

ClearAll[phi];

phi = Round[data[[i, 1]]];

AppendTo[x[[phi]], {Re[data[[i, 2]]], Im[data[[i, 2]]]}]; ];

Return[x]; );

(*Creates a cutout plot of the solenoid using both the positive and \ negative data

EX: createCutoutPlot[pcutout, ncutout,b,n,scale,angle] *) ClearAll[createCutoutPlot];

createCutoutPlot[positiveData_, negativeData_, b_, n_, scale_, angle_] := (

(64)

PlotStyle -> {Blue, PointSize[pointsize]}]; nplot = ListPlot[negativeData[[angle]],

AspectRatio -> 1,

PlotRange -> scale*{{-1, 1}, {-1, 1}},

PlotStyle -> {Red, PointSize[pointsize*0.8]}]; Show[pplot, nplot,

PlotLabel ->

Style[StringForm["Cutout at t = ‘1‘", angle], FontSize -> 20, FontWeight -> Bold, FontFamily -> "Helvetica"]]

);

(*Creates a manipulable cutout plot of the solenoid using both the \ positive and negative data

EX: createManipulateCutoutPlot[pcutout, ncutout,b,n,scale,angleStep] *) ClearAll[createManipulateCutoutPlot];

createManipulateCutoutPlot[positiveData_, negativeData_, a_, b_, n_, scale_, angleStep_] := (

ClearAll[pplot, nplot, pointsize]; pointsize = b^n/(10*scale);

Manipulate[

pplot = ListPlot[positiveData[[phi]], AspectRatio -> 1,

PlotRange -> scale*{{-1, 1}, {-1, 1}}, PlotStyle -> {Blue, PointSize[pointsize]}]; nplot = ListPlot[negativeData[[phi]],

AspectRatio -> 1,

PlotRange -> scale*{{-1, 1}, {-1, 1}},

PlotStyle -> {Red, PointSize[pointsize*0.8]}]; Show[pplot, nplot,

PlotLabel ->

Style[StringForm["Cutout at t = ‘1‘", phi], FontSize -> 20, FontWeight -> Bold, FontFamily -> "Helvetica"]]

, {phi, a, resolutionT, angleStep}] );

(65)

(*Creates a potential map based on both positive and negative values EX: potentialMap = \

createPotentialMap[pcutout,ncutout,scale,displaySize,angleStart,\ angleStop,angleStep];*)

ClearAll[createPotentialMap];

createPotentialMap[positiveData_, negativeData_, scale_, displaySize_, angleStart_, angleStop_, angleStep_] := (

ClearAll[tempData]; tempData = Table[Norm[ Mean[1/(1 + ((positiveData[[angle, ;; , 1]] i)^2 + (positiveData[[angle, ;; , 2]] j)^2))]] -Norm[Mean[ 1/(1 + ((negativeData[[angle, ;; , 1]] -i)^2 + (negativeData[[angle, ;; , 2]] - j)^2))]], {angle, angleStart, angleStop, angleStep},

{j, -displaySize, displaySize, 1/scale}, {i, -displaySize, displaySize, 1/scale}];

Return[tempData]; );

(*Displays a plot of a potential map

EX: displayPotentialMap[pcutout,ncutout,,displaySize,angle,scale]*)

ClearAll[displayPotentialMap];

displayPotentialMap[positiveData_, negativeData_, displaySize_, angle_, scale_] := (

ClearAll[tempData]; tempData =

Table[Norm[

(66)

-{j, -displaySize, displaySize, 1/scale}, {i, -displaySize, displaySize, 1/scale}]; MatrixPlot[tempData, ColorFunction -> colorFunction, Frame -> True, FrameTicks -> None,

Mesh -> {2*displaySize - 1, 2*displaySize - 1}, MeshStyle -> Black,

PlotLabel ->

Style[StringForm["Potential map of cutout at t = ‘1‘", angle], FontSize -> 20, FontWeight -> Bold, FontFamily -> "Helvetica"]] );

(*Displays a manipulable plot of a potential map

EX: displayManipulablePotentialMap[potentialMap,displaySize,angleStep]\ *) ClearAll[displayManipulablePotentialMap]; displayManipulablePotentialMap[potentialData_, displaySize_, angleStep_] := ( Manipulate[ MatrixPlot[potentialData[[angle]], ColorFunction -> colorFunction, Frame -> True, FrameTicks -> None,

Mesh -> {2*displaySize - 1, 2*displaySize - 1}, MeshStyle -> Black],

{angle, 1, resolutionT/angleStep, 1}] );

ClearAll[magnetogramValue];

magnetogramValue[mP_, pC_, nC_, rminor_, b_, n_] := ( ClearAll[pr, nr, r0, pvalue, nvalue, const];

pr = Table[N[EuclideanDistance[mP, pC[[i]]]], {i, Length[pC]}]; nr = Table[N[EuclideanDistance[mP, nC[[i]]]], {i, Length[nC]}]; r0 = rminor*b^n*(4/(3*Pi));

References

Related documents

Personally, I think that in order to fully address the issue of domestic violence, the knowledge and already existing information about the situation of women exposed

Based on previous research, three cases, the EU, USA and China, are selected and their policy strategies in terms of domestic solar energy development are analyzed in the

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Av tabellen framgår att det behövs utförlig information om de projekt som genomförs vid instituten. Då Tillväxtanalys ska föreslå en metod som kan visa hur institutens verksamhet

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Although other researchers have previously raised questions on how to identify children in the archaeological record (see discussion in Lillehammer, this issue), the publication

The electrons will normally stay in the n-region due to the electric field which makes the electron experience a force F = −eE in the opposite of the diffusion, and the same happens