2023 Certification Cup Little America International Competition Question A Sunspot Prediction Python Code

1. Restatement of the problem

Question A of the 2023 Certification Cup Little America International Competition is restated as follows: Sunspots are phenomena on the solar photosphere. They are temporary spots that are darker than the surrounding area. They are areas of reduced surface temperature caused by magnetic flux concentrations that inhibit convection. Sunspots occur within active regions, usually as pairs of opposite magnetic polarities. Their numbers vary according to the approximately 11-year solar cycle.

A single sunspot or group of sunspots may persist anywhere from a few days to a few months, but will eventually decay. Sunspots expand and contract as they move across the Sun's surface, ranging from 16 kilometers (10 miles) [1] to 160,000 kilometers (100,000 miles) in diameter. Without a telescope [2], some larger sunspots can be seen from the Earth. When they first appear, they may move at relative speeds of a few hundred meters per second or with normal motion.

The solar cycle usually lasts about 11 years, ranging from less than 10 to 12 years. The highest activity point of sunspots in a cycle is called solar maximum, and the lowest activity point is called solar minimum. This cycle is also observed in most other solar events and is associated with changes in the Sun's magnetic field, which changes polarity with this cycle.

The number of sunspot viruses also changes over long periods of time. For example, during the period known as the Modern Maximum from 1900 to 1958, the solar maximum trend in sunspot numbers was upward; over the next 60 years, the trend was mainly downward [3]. Overall, the Sun is as active as it was 8,000 years ago.

Because sunspots are related to other types of solar activity, sunspots can be used to help predict space weather, the state of the ionosphere, and conditions related to shortwave radio propagation or satellite communications. Many models based on time series analysis, spectral analysis and neural networks have been used to predict sunspot activity, but the results are often poor. This may be related to the fact that most predictive models are phenomenological at the data level. Although we generally know the length of the solar activity cycle, this cycle is not completely stable, the maximum intensity of activity varies over time, and the timing of the peak and the duration of the peak are difficult to predict accurately.

We need to predict sunspots and usually we need to take the average results by month. You and your team have been asked to develop sound mathematical models that make sunspot predictions as credible as possible. Relevant observational data are publicly available at many observatories and space science research organizations, including observations of the historical number of sunspots, the area of ​​sunspots, and other possibly related indicators.

Task:

Please predict the beginning and end of the current and next solar cycle;

Please predict the start time and duration of solar maximum for the next solar cycle;

Predict the number and area of ​​sunspots during the current and next solar cycle and explain the reliability of your model in your paper.

2. Problem analysis

The analysis of Question A of the 2023 Certification Cup Little America International Competition is as follows:

2.1 Analysis of Question 1

Please predict the beginning and end of the current and next solar cycle;

Time Series Analysis: Time series analysis using historical sunspot data. This includes looking at the number of sunspots, their activity levels, and their periodic changes. Trend analysis and cyclical analysis can be used to estimate possible trends in future activity.

Spectral Analysis: The spectrum of sunspot activity is analyzed to look for any specific frequencies or patterns. This could reveal specific periodicities that occur in sunspot activity.

Neural Networks: Use neural network models to learn complex relationships between sunspot activity and other factors. Neural networks can process large amounts of data and try to capture non-linear relationships between different variables.

Machine learning models: Use machine learning algorithms, such as decision trees, random forests, or support vector machines, to build predictive models. This requires a large amount of training data, including observations of sunspot numbers, sunspot areas, and other potentially relevant indicators.

Physical model: Based on an in-depth understanding of solar physics, a physical model is constructed to simulate changes in sunspot activity. This may require consideration of multiple factors such as the solar magnetic field and convection.

Follow these steps:

Data collection: Collect historical data on sunspots, including quantity, activity level, periodicity and other information. You have provided some data sources, use these or find other reliable data sets.

Data cleaning and preparation: Clean and prepare the collected data to ensure that the data is complete, accurate, and can be used for model training.

Feature selection: Select features related to sunspot activity, which may include the number of sunspots, the area of ​​sunspots, the solar magnetic field, etc.

Model training: Train the data using selected methods (time series analysis, spectral analysis, neural networks, machine learning models, etc.). During training, historical data is used to learn model parameters.

Model evaluation: Use a portion of the data for model evaluation to verify the accuracy and generalization ability of the model. This can be done by using a validation set or cross-validation.

Forecast: Use the trained model to predict sunspot activity for the current and next solar cycle.

Interpretation of results: Explain the model's predicted results, including possible uncertainties and limitations. Discussions with experts in the field of heliophysics to verify the credibility of the model

2.2 Analysis of Question 2

Please predict the start time and duration of solar maximum for the next solar cycle;

Historical data analysis: First, by analyzing the data of historical solar cycles, find out the trend of the start time and duration of the solar maximum. By looking at previous cycles, it may be possible to observe a pattern or pattern.

Sunspot Activity Monitoring: Solar maximums are often associated with peak periods of sunspot activity. By monitoring the number, area, and distribution of sunspots, one can attempt to determine the approach to solar maximum.

Machine learning model: Use machine learning algorithms, such as regression analysis, to build a model that associates the onset and duration of solar maxima with relevant features. This may include the number of sunspots, the area of ​​the sun's dark spots, the sun's magnetic field, etc.

Physical model: Taking into account the knowledge of solar physics, build a physical model to simulate the evolution of the solar activity cycle. This requires consideration of factors such as the formation and disappearance mechanisms of sunspots and changes in the solar magnetic field.

Multi-model ensemble: Combine the prediction results of multiple methods and use ensemble learning methods, such as voting or weighted average, to improve accuracy. A synthesis of different methods may help to compensate for the limitations of various models.

When implementing these methods, there are a few things to note:

Data quality: Ensure the data used is accurate and complete to increase the credibility of the model.

Feature Selection: Select features that correlate with solar maxima so that the model can better capture changes in solar activity.

Model evaluation: Evaluate the prediction results of the model and use a validation set or cross-validation to verify the performance of the model.

Uncertainty estimation: Understand the uncertainty of the model and provide corresponding confidence intervals or uncertainty measures in the results.

2.3 Analysis of Question 3

Predict the number and area of ​​sunspots during the current and next solar cycle and explain the reliability of your model in your paper.

Data Collection and Preparation: Collect historical data on sunspot number and area, including observations of the current solar cycle. Ensure data is complete and accurate, and perform necessary cleaning and preprocessing.

Feature Selection: Select features related to sunspot number and area. This may include historical sunspot data, solar magnetic field observations, solar activity index, etc.

Model Selection: Choose an appropriate prediction model. Consider using machine learning algorithms, such as regression analysis, neural networks, or time series-based models, as well as physical models, such as mathematical models that consider heliophysical processes.

Model training and validation: Use historical data to train the model, and use a validation set or cross-validation to verify the model's accuracy and generalization ability.

Prediction: Use the trained model to predict the number and area of ​​sunspots for the current and next solar cycle.

Uncertainty estimates: In the paper, highlight the uncertainty of the model and provide confidence intervals or other uncertainty measures of the results. This can be achieved by using methods such as confidence intervals, sensitivity analysis, or Monte Carlo simulations.

Explain the reliability of the model: A detailed explanation in the paper of why the chosen model is considered reliable. Including the model training process, selected features, model evaluation indicators, and the model's fitting of historical data.

Discussions with domain experts: If possible, conduct discussions of model predictions with domain experts in heliophysics to verify the credibility of the model and gain additional insights into the model results.

Compare other methods: Compare your model's prediction results with other existing prediction methods or models to strengthen the reliability of your model.

Model establishment and solution

The model establishment and solution process for question A of the 2023 Certification Cup International Mathematical Modeling Competition (Little US Competition) is as follows:

For data processing, first import relevant libraries

import pandas 
import scipy.signal as scipy
from matplotlib import pyplot as plt
from datetime import datetime
from colorama import Fore
import seaborn as sns
import plotly.graph_objects as go
import numpy as np
from peakdetect import peakdetect
import statistics

Read in data and extract average results by month

data = pandas.read_csv("dane.csv", sep=";", header=None)
plt.figure(figsize=(19,9))
plt.ylabel("Frequency")
plt.title("Histogram for Monthly Mean Total Sunspot Number")
plt.xlabel("Monthly Mean Total Sunspot Number")
data[CSV_DATA_COLUMN].hist()

plt.figure(figsize=(21,9))
plt.ylabel("Monthly mean total sunspot number")
plt.xlabel("Month")
plt.plot(data[CSV_DATA_COLUMN], c="green")

Find peaks

time_series = data[CSV_DATA_COLUMN]

peaks = peakdetect(time_series, lookahead=40) 

higherPeaks = np.array(peaks[0])
plt.figure(figsize=(19,9))
plt.ylabel("Monthly Mean Total Sunspot Number")
plt.xlabel("Month")
plt.title("Peaks")
plt.plot(time_series)
plt.plot(higherPeaks[:,0], higherPeaks[:,1], 'ro')

Code download

Later, download the complete code: https://www.jdmm.cc/file/2709944/

Guess you like

Origin blog.csdn.net/qq_45857113/article/details/134732153