Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/29/19 15:57:35 (5 years ago)
Author:
mkommend
Message:

#2521: Merged trunk changes into problem refactoring branch.

Location:
branches/2521_ProblemRefactoring
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring

  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis

  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Physics/FluidDynamics.cs

    r16565 r17226  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Random;
    2627
    2728namespace HeuristicLab.Problems.Instances.DataAnalysis {
    2829  public class FluidDynamics : ArtificialRegressionDataDescriptor {
    29     public override string Name { get { return "Flow Psi = V_inf r sin(th) (1 - R²/r²) + G/(2 π) ln(r/R)"; } }
     30    public override string Name { get { return "Spinning cylinder flow Ψ = V_∞ r sin(θ) (1 - R²/r²) + Γ/(2 π) ln(r/R)"; } }
    3031
    3132    public override string Description {
     
    3536          "modeling generalized separable systems\", Expert Systems with Applications, Volume 109, 2018, " +
    3637          "Pages 25-34 https://doi.org/10.1016/j.eswa.2018.05.021. " + Environment.NewLine +
    37           "Function: Psi = V_inf r sin(th) (1 - R²/r²) + G/(2 π) ln(r/R)" + Environment.NewLine +
    38           "with V_inf ∈ [60 m/s, 65 m/s]," + Environment.NewLine +
    39           "th ∈ [30°, 40°]," + Environment.NewLine +
    40           "r ∈ [0.2m, 0.5m]," + Environment.NewLine +
    41           "R ∈ [0.5m, 0.8m]," + Environment.NewLine +
    42           "G ∈ [5 m²/s, 10 m²/s]";
     38          "Function: Ψ = V_∞ r sin(θ) (1 - R²/r²) + Γ/(2 π) ln(r/R)" + Environment.NewLine +
     39          "with uniform stream velocity V_∞ ∈ [60 m/s, 65 m/s]," + Environment.NewLine +
     40          "angle for polar coordinate vector field θ ∈ [30°, 40°]," + Environment.NewLine +
     41          "radius for polar coordinate vector field r ∈ [0.5m, 0.8m]," + Environment.NewLine +
     42          "radius of cylinder R ∈ [0.2m, 0.5m]," + Environment.NewLine +
     43          "vortex strength (induced by spinning) Γ ∈ [5 m²/s, 10 m²/s]" + Environment.NewLine +
     44          "Note: the definition deviates from the definition used in the source above because here we have r > R meaning we want to calculate the flow _outside_ of the cylinder.";
    4345      }
    4446    }
    4547
    46     protected override string TargetVariable { get { return "Psi"; } }
    47     protected override string[] VariableNames { get { return new string[] { "V_inf", "th", "r", "R", "G", "Psi" }; } }
    48     protected override string[] AllowedInputVariables { get { return new string[] { "V_inf", "th", "r", "R", "G" }; } }
     48    protected override string TargetVariable { get { return "Ψ"; } }
     49    protected override string[] VariableNames { get { return new string[] { "V_∞", "θ", "r", "R", "Γ", "Ψ", "Ψ_noise" }; } }
     50    protected override string[] AllowedInputVariables { get { return new string[] { "V_∞", "θ", "r", "R", "Γ" }; } }
    4951    protected override int TrainingPartitionStart { get { return 0; } }
    5052    protected override int TrainingPartitionEnd { get { return 100; } }
     
    6668      var V_inf = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 60.0, 65.0).ToList();
    6769      var th = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 30.0, 40.0).ToList();
    68       var r = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.2, 0.5).ToList();
    69       var R = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.5, 0.8).ToList();
     70      var r = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.5, 0.8).ToList();
     71      var R = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.2, 0.5).ToList();
    7072      var G = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 5, 10).ToList();
    7173
    72       List<double> Psi = new List<double>();
     74      var Psi = new List<double>();
     75      var Psi_noise = new List<double>();
     76
    7377      data.Add(V_inf);
    7478      data.Add(th);
     
    7781      data.Add(G);
    7882      data.Add(Psi);
     83      data.Add(Psi_noise);
    7984
    8085      for (int i = 0; i < V_inf.Count; i++) {
     
    8590      }
    8691
     92      var sigma_noise = 0.05 * Psi.StandardDeviationPop();
     93      Psi_noise.AddRange(Psi.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     94
    8795      return data;
    8896    }
Note: See TracChangeset for help on using the changeset viewer.