1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Linq;
|
---|
25 | using HeuristicLab.Common;
|
---|
26 | using HeuristicLab.Random;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Problems.Instances.DataAnalysis {
|
---|
29 | public class AircraftLift : ArtificialRegressionDataDescriptor {
|
---|
30 | public override string Name { get { return "Aircraft Lift Coefficient C_L = C_Lα (α - α0) + C_Lδ_e δ_e S_HT / S_ref"; } }
|
---|
31 |
|
---|
32 | public override string Description {
|
---|
33 | get {
|
---|
34 | return "A full description of this problem instance is given in: " + Environment.NewLine +
|
---|
35 | "Chen Chen, Changtong Luo, Zonglin Jiang, \"A multilevel block building algorithm for fast " +
|
---|
36 | "modeling generalized separable systems\", Expert Systems with Applications, Volume 109, 2018, " +
|
---|
37 | "Pages 25-34 https://doi.org/10.1016/j.eswa.2018.05.021. " + Environment.NewLine +
|
---|
38 | "Function: C_L = C_Lα (α - α0) + C_Lδ_e δ_e S_HT / S_ref" + Environment.NewLine +
|
---|
39 | "the lift coefficient of the main airfoil C_Lα ∈ [0.4, 0.8]," + Environment.NewLine +
|
---|
40 | "tha angle of attack α ∈ [5°, 10°]," + Environment.NewLine +
|
---|
41 | "the lift coefficient of the horizontal tail C_Lδ_e ∈ [0.4, 0.8]," + Environment.NewLine +
|
---|
42 | "δ_e ∈ [5°, 10°]," + Environment.NewLine +
|
---|
43 | "S_HT ∈ [1m², 1.5m²]," + Environment.NewLine +
|
---|
44 | "S_ref ∈ [5m², 7m²]," + Environment.NewLine +
|
---|
45 | "the zero-lift angle of attack α0 is set to -2°";
|
---|
46 | }
|
---|
47 | }
|
---|
48 |
|
---|
49 | protected override string TargetVariable { get { return "C_L"; } }
|
---|
50 | protected override string[] VariableNames { get { return new string[] { "C_Lα", "α", "C_Lδ_e", "δ_e", "S_HT", "S_ref", "C_L", "C_L_noise" }; } }
|
---|
51 | protected override string[] AllowedInputVariables { get { return new string[] { "C_Lα", "α", "C_Lδ_e", "δ_e", "S_HT", "S_ref" }; } }
|
---|
52 | protected override int TrainingPartitionStart { get { return 0; } }
|
---|
53 | protected override int TrainingPartitionEnd { get { return 100; } }
|
---|
54 | protected override int TestPartitionStart { get { return 100; } }
|
---|
55 | protected override int TestPartitionEnd { get { return 200; } }
|
---|
56 |
|
---|
57 | public int Seed { get; private set; }
|
---|
58 |
|
---|
59 | public AircraftLift() : this((int)System.DateTime.Now.Ticks) { }
|
---|
60 |
|
---|
61 | public AircraftLift(int seed) {
|
---|
62 | Seed = seed;
|
---|
63 | }
|
---|
64 |
|
---|
65 | protected override List<List<double>> GenerateValues() {
|
---|
66 | var rand = new MersenneTwister((uint)Seed);
|
---|
67 |
|
---|
68 | List<List<double>> data = new List<List<double>>();
|
---|
69 | var C_La = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.4, 0.8).ToList();
|
---|
70 | var a = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 10.0).ToList();
|
---|
71 | var C_Ld_e = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.4, 0.8).ToList();
|
---|
72 | var d_e = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 10.0).ToList();
|
---|
73 | var S_HT = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList();
|
---|
74 | var S_ref = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 7.0).ToList();
|
---|
75 |
|
---|
76 | var C_L = new List<double>();
|
---|
77 | var C_L_noise = new List<double>();
|
---|
78 | data.Add(C_La);
|
---|
79 | data.Add(a);
|
---|
80 | data.Add(C_Ld_e);
|
---|
81 | data.Add(d_e);
|
---|
82 | data.Add(S_HT);
|
---|
83 | data.Add(S_ref);
|
---|
84 | data.Add(C_L);
|
---|
85 | data.Add(C_L_noise);
|
---|
86 |
|
---|
87 | double a0 = -2.0;
|
---|
88 |
|
---|
89 | for (int i = 0; i < C_La.Count; i++) {
|
---|
90 | double C_Li = C_La[i] * (a[i] - a0) + C_Ld_e[i] * d_e[i] * S_HT[i] / S_ref[i];
|
---|
91 | C_L.Add(C_Li);
|
---|
92 | }
|
---|
93 |
|
---|
94 |
|
---|
95 | var sigma_noise = 0.05 * C_L.StandardDeviationPop();
|
---|
96 | C_L_noise.AddRange(C_L.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
|
---|
97 |
|
---|
98 | return data;
|
---|
99 | }
|
---|
100 | }
|
---|
101 | }
|
---|