/// <summary> /// This method obtains up to 360 points of the selected satellite trajectory /// </summary> /// <param name="orbitModel"></param> private void GetOrbitPainted(PlotModel orbitModel) { double a = tle_dataset._TLE_Sat_Selected.Sat_SemiAxis; double ecc = tle_dataset._TLE_Sat_Selected.Sat_Eccentricity; double r_pos = (a * (1 - Math.Pow(ecc, 2))); OxyPlot.Series.ScatterSeries orbit = new OxyPlot.Series.ScatterSeries(); orbit.MarkerSize = 1; orbit.MarkerStroke = OxyColor.FromRgb(255, 0, 0); orbit.MarkerStrokeThickness = 1; orbitModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, MaximumPadding = 0.1, MinimumPadding = 0.1, AxislineColor = OxyColor.FromRgb(255, 255, 255), AxislineStyle = LineStyle.Solid, MajorGridlineColor = OxyColors.White }); orbitModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left, MaximumPadding = 0.1, MinimumPadding = 0.1, AxislineColor = OxyColor.FromRgb(255, 255, 255), AxislineStyle = LineStyle.Solid }); for (int j = 0; j < 360; j++) { double rad = (double)j * (double)2 * Math.PI / (double)360; double r_true = r_pos / (1 + ecc * Math.Cos(j)); double x = r_true * Math.Cos(j); double y = r_true * Math.Sin(j); OxyPlot.Series.ScatterPoint point = new OxyPlot.Series.ScatterPoint(x, y); orbit.Points.Add(point); } orbitModel.Series.Add(orbit); }
// #7 1D oteration periodic Map // 1Diteration -> x plot against n (period) private void drawIterationMap() { // Clear old data this.scatterSeries7.Points.Clear(); this.plotView7.Model.Series.Clear(); // Initialize data double x = DEFAULT_X; double y = DEFAULT_Y; double alpha = this.alpha7; double beta = this.beta7; // Iteration for (int i = 0; i < PURE_ITERATIONS; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Add point to plot double size = POINT_SIZE > 2.0 ? POINT_SIZE : 2.0; double colorValue = 100.0; OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(i, x, size, colorValue, y); this.scatterSeries7.Points.Add(pt); } // Add series to plot this.plotView7.Model.Series.Add(this.scatterSeries7); this.plotView7.Refresh(); }
public void GetOrbit() { double a = _tle_dataset._TLE_Sat_Selected.Sat_SemiAxis; double ecc = _tle_dataset._TLE_Sat_Selected.Sat_Eccentricity; double b = a * Math.Pow(1 - Math.Pow(ecc, 2), 0.5); // Get focus distance to center (negative) double c = -Math.Sqrt(Math.Pow(a, 2) - Math.Pow(b, 2)); double r_pos = (a * (1 - Math.Pow(ecc, 2))); OxyPlot.Series.ScatterSeries orbit = new OxyPlot.Series.ScatterSeries(); orbit.MarkerSize = 1; orbit.MarkerStroke = OxyColor.FromRgb(255, 0, 0); orbit.MarkerStrokeThickness = 1; orbitModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, MaximumPadding = 0.1, MinimumPadding = 0.1 }); orbitModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left, MaximumPadding = 0.1, MinimumPadding = 0.1 }); for (int j = 0; j < 360; j++) { double rad = (double)j * (double)2 * Math.PI / (double)360; double r_true = r_pos / (1 + ecc * Math.Cos(j)); double x = r_true * Math.Cos(j); double y = r_true * Math.Sin(j); OxyPlot.Series.ScatterPoint point = new OxyPlot.Series.ScatterPoint(x, y); orbit.Points.Add(point); } orbitModel.Series.Add(orbit); }
// #5 beta plot Map // betaPlot -> X and beta in axis = Bifurcation diagram for beta (Color with ARGB) private void drawBetaPlot() { // Clear old data this.scatterSeries5.Points.Clear(); this.plotView5.Model.Series.Clear(); // Outer iteration multiple beta for (double beta = -5.0; beta < 5.0; beta += STEP_BIFURCATION) { // Initialize data double alpha = this.alpha5; double x = DEFAULT_X; double y = DEFAULT_Y; // Fixed Points if (this.showFixedPoints) { double size = POINT_SIZE; double colorValue = 3.0; Point pt = this.UnstableFixedPoint(alpha, beta); this.scatterSeries5.Points.Add(new OxyPlot.Series.ScatterPoint(beta, pt.X, size, colorValue, "Fixed Point")); pt = this.StableFixedPoint(alpha, beta); this.scatterSeries5.Points.Add(new OxyPlot.Series.ScatterPoint(beta, pt.X, size, colorValue, "Fixed Point")); x = pt.X + DEFAULT_DISTANCE_FIXPOINT; y = pt.Y + DEFAULT_DISTANCE_FIXPOINT; } // Iteration for (int i = 0; i < NUM_ITERATIONS_BIFURCATION; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Add point to plot double size = POINT_SIZE; double colorValue = 1.0; if (i > NUM_ITERATIONS_BIFURCATION - LAST_DISPLAY_BIFURCATION && !(x > 10 || x < -10)) { OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(beta, x, size, colorValue, i); this.scatterSeries5.Points.Add(pt); } } } // Add series to plot this.plotView5.Model.Series.Add(this.scatterSeries5); this.plotView5.Refresh(); }
// #6 double plot Map // doublePlot -> X-param and Y-param plots side-by-side for bifurcation diagram of alpha (Color with ARGB) private void drawDouble() { // Clear old data this.scatterSeries6x.Points.Clear(); this.scatterSeries6y.Points.Clear(); this.plotView6x.Model.Series.Clear(); this.plotView6y.Model.Series.Clear(); // Outer iteration multiple beta for (double alpha = -5.0; alpha < 5.0; alpha += STEP_BIFURCATION) { // Initialize data double beta = this.beta6; double x = DEFAULT_X; double y = DEFAULT_Y; // Iteration for (int i = 0; i < NUM_ITERATIONS_BIFURCATION; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Add point to plot double size = POINT_SIZE; double colorValue = 1.0; if (i > NUM_ITERATIONS_BIFURCATION - LAST_DISPLAY_BIFURCATION) { if (!(x > 10 || x < -10)) { OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(alpha, x, size, colorValue, i); this.scatterSeries6x.Points.Add(pt); } if (!(y > 10 || y < -10)) { OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(alpha, y, size, colorValue, i); this.scatterSeries6y.Points.Add(pt); } } } } // Add series to plot this.plotView6x.Model.Series.Add(this.scatterSeries6x); this.plotView6y.Model.Series.Add(this.scatterSeries6y); this.plotView6x.Refresh(); this.plotView6y.Refresh(); }
// #1 default Map // defaultMap -> Standardplot with default parameters (adjustable) private void drawDefaultMap() { // Clear old data this.scatterSeries1.Points.Clear(); this.plotView1.Model.Series.Clear(); // Initialize data double x = DEFAULT_X; double y = DEFAULT_Y; double alpha = this.alpha1; double beta = this.beta1; // Fixed Points if (this.showFixedPoints) { double size = POINT_SIZE > 3.0 ? POINT_SIZE : 3.0; double colorValue = 3.0; Point pt = this.UnstableFixedPoint(alpha, beta); this.scatterSeries1.Points.Add(new OxyPlot.Series.ScatterPoint(pt.X, pt.Y, size, colorValue, "Fixed Point")); pt = this.StableFixedPoint(alpha, beta); this.scatterSeries1.Points.Add(new OxyPlot.Series.ScatterPoint(pt.X, pt.Y, size, colorValue, "Fixed Point")); x = pt.X + DEFAULT_DISTANCE_FIXPOINT; y = pt.Y + DEFAULT_DISTANCE_FIXPOINT; } // Iteration for (int i = 0; i < NUM_ITERATIONS; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Add point to plot double size = POINT_SIZE; double colorValue = 1.0; if (i > NUM_ITERATIONS - LAST_DISPLAY) { OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(x, y, size, colorValue, i); this.scatterSeries1.Points.Add(pt); } } // Add series to plot this.plotView1.Model.Series.Add(this.scatterSeries1); this.plotView1.Refresh(); }
// #2 multiple beta Map // fixedAlpha -> X-Y Diagram with colored beta graphs (alpha adjustable) private void drawFixedAlpha() { // Clear old data this.scatterSeries2.Points.Clear(); this.plotView2.Model.Series.Clear(); // Outer iteration multiple beta if (this.steps2 <= 0.0) { this.steps2 = 0.01; } for (double beta = -1.0; beta < 1.0; beta += this.steps2) { // Initialize data double alpha = this.alpha2; double x = DEFAULT_X; double y = DEFAULT_Y; // Iteration for (int i = 0; i < NUM_ITERATIONS; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Add point to plot double size = POINT_SIZE; if (i > NUM_ITERATIONS - LAST_DISPLAY && !(x > 10 || x < -10)) { OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(x, y, size, beta, i); this.scatterSeries2.Points.Add(pt); } } } // Add series to plot this.plotView2.Model.Series.Add(this.scatterSeries2); this.plotView2.Model.Axes[0].Reset(); this.plotView2.Refresh(); }
// #9 x-y Starting Point Heatmap Map // startingMap -> plot the period for given alpha and beta value for all possible starting points private void drawStartingMap() { // Clear old data this.scatterSeries9.Points.Clear(); this.plotView9.Model.Series.Clear(); // Fixed Points if (this.showFixedPoints) { double size = POINT_SIZE > 3.0 ? POINT_SIZE : 3.0; double colorValue = -10.0; Point pt = this.UnstableFixedPoint(this.alpha9, this.beta9); this.scatterSeries9.Points.Add(new OxyPlot.Series.ScatterPoint(pt.X, pt.Y, size, colorValue, "Fixed Point")); pt = this.StableFixedPoint(this.alpha9, this.beta9); this.scatterSeries9.Points.Add(new OxyPlot.Series.ScatterPoint(pt.X, pt.Y, size, colorValue, "Fixed Point")); } // X-Y double iteration for (double y_s = -5.0; y_s <= 5.0; y_s += this.steps9) { for (double x_s = -5.0; x_s <= 5.0; x_s += this.steps9) { // Initialize data double x = x_s; double y = y_s; double alpha = this.alpha9; double beta = this.beta9; Point[] pt_list = new Point[LAST_DISPLAY_BIFURCATION]; // Iteration for (int i = 0; i < NUM_ITERATIONS_BIFURCATION; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Save points for period analysis if (i >= NUM_ITERATIONS_BIFURCATION - LAST_DISPLAY_BIFURCATION) { Point p = new Point { X = x, Y = y }; pt_list[i - NUM_ITERATIONS_BIFURCATION + LAST_DISPLAY_BIFURCATION] = p; } // Shortcut for escaped points if (x > 10 || x < -10) { break; } } // Shortcut for escaped points if (x > 10 || x < -10) { continue; } // Find period (100 = no period found) int period = 1; try { for (; period < MAX_PERIOD; ++period) { bool found = true; for (int j = 0; j < period; ++j) { for (int i = 0; i < 5; ++i) { if (!pt_list[LAST_DISPLAY_BIFURCATION - i * period - j - 1].Compare(pt_list[LAST_DISPLAY_BIFURCATION - (i + 1) * period - j - 1])) { found = false; i = MAX_PERIOD; } } if (!found) { j = period; } } if (found) { break; } } } catch { period = MAX_PERIOD; } // Add point to plot (if not escaped) double size = POINT_SIZE; OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(x_s, y_s, size, period, period); this.scatterSeries9.Points.Add(pt); } } // Add series to plot this.plotView9.Model.Series.Add(this.scatterSeries9); this.plotView9.Refresh(); }
// #8 Alpha-Beta Heatmap Map // heatMap -> plot the period as a color for all alpha & beta parameter values private void drawHeatMap() { // Clear old data this.scatterSeries8.Points.Clear(); this.plotView8.Model.Series.Clear(); // Alpha-Beta double iteration for (double alpha = -5.0; alpha <= 5.0; alpha += this.steps8) { for (double beta = -5.0; beta <= 5.0; beta += this.steps8) { // Initialize data double x = DEFAULT_X; double y = DEFAULT_Y; Point[] pt_list = new Point[LAST_DISPLAY_BIFURCATION]; // Fixed Points if (this.showFixedPoints) { Point point = this.StableFixedPoint(alpha, beta); x = point.X + DEFAULT_DISTANCE_FIXPOINT; y = point.Y + DEFAULT_DISTANCE_FIXPOINT; } else { x = DEFAULT_X; y = DEFAULT_Y; } // Iteration for (int i = 0; i < NUM_ITERATIONS_BIFURCATION; ++i) { // Henon function double x_new = 1.0 - alpha * x * x + y; y = beta * x; x = x_new; // Save points for period analysis if (i >= NUM_ITERATIONS_BIFURCATION - LAST_DISPLAY_BIFURCATION) { Point p = new Point { X = x, Y = y }; pt_list[i - NUM_ITERATIONS_BIFURCATION + LAST_DISPLAY_BIFURCATION] = p; } // Shortcut for escaped points if (x > 10 || x < -10) { break; } } // Shortcut for escaped points if (x > 10 || x < -10) { continue; } // Find period (100 = no period found) int period = 1; try { for (; period < MAX_PERIOD; ++period) { bool found = true; for (int j = 0; j < period; ++j) { for (int i = 0; i < 5; ++i) { if (!pt_list[LAST_DISPLAY_BIFURCATION - i * period - j - 1].Compare(pt_list[LAST_DISPLAY_BIFURCATION - (i + 1) * period - j - 1])) { found = false; i = MAX_PERIOD; } } if (!found) { j = period; } } if (found) { break; } } } catch { period = MAX_PERIOD; } // Add point to plot (if not escaped) double size = POINT_SIZE; OxyPlot.Series.ScatterPoint pt = new OxyPlot.Series.ScatterPoint(alpha, beta, size, period, period); this.scatterSeries8.Points.Add(pt); } } // Add series to plot this.plotView8.Model.Series.Add(this.scatterSeries8); this.plotView8.Refresh(); }