Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2965_CancelablePersistence/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Physics/AircraftMaximumLift.cs @ 16321

Last change on this file since 16321 was 16264, checked in by gkronber, 6 years ago

#2957: initial import of physics problems implemented by lkammere

File size: 6.4 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2018 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  class AircraftMaximumLift : ArtificialRegressionDataDescriptor {
29    public override string Name { get { return "Aircraft Maximum Lift Coefficient"; } }
30
31    public override string Description {
32      get {
33        return "A full description of this problem instance is given in the paper: A multilevel block building algorithm for fast modeling generalized separable systems. " + Environment.NewLine +
34               "Authors: Chen Chen, Changtong Luo, Zonglin Jiang" + Environment.NewLine +
35               "Function: f(X) = x1 - 0.25 x4 x5 x6 (4 + 0.1 x2/x3 - x2²/x3²) + x13 x14/x15 x18 x7 - x13 x14/x15 x8 + x13 x14/x15 x9 + x16 x17/x15 x18 x10 - x16 x17/x15 x11 + x16 x17/x15 x12" + Environment.NewLine +
36               "with x1 in [0.4, 0.8], " +
37               "x2 in [3, 4], " +
38               "x3 in [20, 30], " +
39               "x4, x13, x16 in [2, 5]," +
40               "x14, x17 in [1, 1.5], " +
41               "x15 in [5, 7]," +
42               "x18 in [10, 20]," +
43               "x8, x11 in [1, 1.5]," +
44               "x9, x12 in [1, 2]," +
45               "x7, x10 in [0.5, 1.5]";
46      }
47    }
48
49    protected override string TargetVariable { get { return "f(X)"; } }
50    protected override string[] VariableNames { get { return new string[] { "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "f(X)" }; } }
51    protected override string[] AllowedInputVariables { get { return VariableNames.Except(new string[] { TargetVariable }).ToArray(); } }
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 AircraftMaximumLift() : this((int)System.DateTime.Now.Ticks) { }
60
61    public AircraftMaximumLift(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 x1 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.4, 0.8).ToList();
70
71      var x2 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 3.0, 4.0).ToList();
72
73      var x3 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 20.0, 30.0).ToList();
74
75      var x4 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 2.0, 5.0).ToList();
76      var x13 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 2.0, 5.0).ToList();
77      var x16 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 2.0, 5.0).ToList();
78
79
80      var x5 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList(); // TODO: range for X5 is not specified in the paper
81      var x6 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 7.0).ToList(); // TODO: range for X6 is not specified in the paper
82
83      var x7 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.5, 1.5).ToList();
84      var x10 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.5, 1.5).ToList();
85
86      var x8 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList();
87      var x11 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList();
88
89      var x9 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 2.0).ToList();
90      var x12 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 2.0).ToList();
91
92      var x14 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList();
93      var x17 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1.0, 1.5).ToList();
94
95      var x15 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5.0, 7.0).ToList();
96
97      var x18 = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 10.0, 20.0).ToList();
98
99      List<double> fx = new List<double>();
100      data.Add(x1);
101      data.Add(x2);
102      data.Add(x3);
103      data.Add(x4);
104      data.Add(x5);
105      data.Add(x6);
106      data.Add(x7);
107      data.Add(x8);
108      data.Add(x9);
109      data.Add(x10);
110      data.Add(x11);
111      data.Add(x12);
112      data.Add(x13);
113      data.Add(x14);
114      data.Add(x15);
115      data.Add(x16);
116      data.Add(x17);
117      data.Add(x18);
118      data.Add(fx);
119
120      for (int i = 0; i < x1.Count; i++) {
121        double fxi = x1[i];
122        fxi = fxi - 0.25 * x4[i] * x5[i] * x6[i] * (4 + 0.1 * (x2[i] / x3[i]) - (x2[i] / x3[i]) * (x2[i] / x3[i]));
123        fxi = fxi + x13[i] * (x14[i] / x15[i]) * x18[i] * x7[i];
124        fxi = fxi - x13[i] * (x14[i] / x15[i]) * x8[i];
125        fxi = fxi + x13[i] * (x14[i] / x15[i]) * x9[i];
126        fxi = fxi + x16[i] * (x17[i] / x15[i]) * x18[i] * x10[i];
127        fxi = fxi - x16[i] * (x17[i] / x15[i]) * x11[i];
128        fxi = fxi + x16[i] * (x17[i] / x15[i]) * x12[i];
129
130        fx.Add(fxi);
131      }
132
133      return data;
134    }
135  }
136}
Note: See TracBrowser for help on using the repository browser.