source: stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Physics/AircraftLift.cs @ 17097

Last change on this file since 17097 was 17097, checked in by mkommend, 2 months ago

#2520: Merged 16565 - 16579 into stable.

File size: 4.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2019 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
22using System;
23using System.Collections.Generic;
24using System.Linq;
25using HeuristicLab.Random;
26
27namespace HeuristicLab.Problems.Instances.DataAnalysis {
28  public class AircraftLift : ArtificialRegressionDataDescriptor {
29    public override string Name { get { return "Aircraft Lift Coefficient C_L = C_La (a - a0) + C_Ld_e d_e S_HT / S_ref"; } }
30
31    public override string Description {
32      get {
33        return "A full description of this problem instance is given in: " + Environment.NewLine +
34          "Chen Chen, Changtong Luo, Zonglin Jiang, \"A multilevel block building algorithm for fast " +
35          "modeling generalized separable systems\", Expert Systems with Applications, Volume 109, 2018, " +
36          "Pages 25-34 https://doi.org/10.1016/j.eswa.2018.05.021. " + Environment.NewLine +
37          "Function: C_L = C_La (a - a0) + C_Ld_e d_e S_HT / S_ref" + Environment.NewLine +
38          "with C_La ∈ [0.4, 0.8]," + Environment.NewLine +
39          "a ∈ [5°, 10°]," + Environment.NewLine +
40          "C_Ld_e ∈ [0.4, 0.8]," + Environment.NewLine +
41          "d_e ∈ [5°, 10°]," + Environment.NewLine +
42          "S_HT ∈ [1m², 1.5m²]," + Environment.NewLine +
43          "S_ref ∈ [5m², 7m²]," + Environment.NewLine +
44          "a0 is set to -2°";
45      }
46    }
47
48    protected override string TargetVariable { get { return "C_L"; } }
49    protected override string[] VariableNames { get { return new string[] { "C_La", "a", "a0", "C_Ld_e", "d_e", "S_HT", "C_L" }; } }
50    protected override string[] AllowedInputVariables { get { return new string[] { "C_La", "a", "a0", "C_Ld_e", "d_e", "S_HT" }; } }
51    protected override int TrainingPartitionStart { get { return 0; } }
52    protected override int TrainingPartitionEnd { get { return 100; } }
53    protected override int TestPartitionStart { get { return 100; } }
54    protected override int TestPartitionEnd { get { return 200; } }
55
56    public int Seed { get; private set; }
57
58    public AircraftLift() : this((int)System.DateTime.Now.Ticks) { }
59
60    public AircraftLift(int seed) {
61      Seed = seed;
62    }
63
64    protected override List<List<double>> GenerateValues() {
65      var rand = new MersenneTwister((uint)Seed);
66
67      List<List<double>> data = new List<List<double>>();
68      var C_La = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.4, 0.8).ToList();
69      var a = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 10.0).ToList();
70      var C_Ld_e = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.4, 0.8).ToList();
71      var d_e = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 10.0).ToList();
72      var S_HT = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList();
73      var S_ref = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 7.0).ToList();
74
75      List<double> C_L = new List<double>();
76      data.Add(C_La);
77      data.Add(a);
78      data.Add(C_Ld_e);
79      data.Add(d_e);
80      data.Add(S_HT);
81      data.Add(S_ref);
82      data.Add(C_L);
83
84      double a0 = -2.0;
85
86      for (int i = 0; i < C_La.Count; i++) {
87        double C_Li = C_La[i] * (a[i] - a0) + C_Ld_e[i] * d_e[i] * S_HT[i] / S_ref[i];
88        C_L.Add(C_Li);
89      }
90
91      return data;
92    }
93  }
94}
Note: See TracBrowser for help on using the repository browser.