Skip to content
Snippets Groups Projects
Commit bf9aeafb authored by Антон Кудряшов's avatar Антон Кудряшов
Browse files

- added special lines checking

parent 9164bf6a
No related branches found
No related tags found
No related merge requests found
......@@ -204,7 +204,7 @@ namespace MES_Wind
WindStressPRM.Powerline dummyline = new WindStressPRM.Powerline();
DataRow featureData = feature.DataRow;
dummyline.Identifier = feature.Fid;
dummyline.Year = 1990;//int.Parse(featureData["Year"].ToString());
dummyline.Year = int.Parse(featureData["Year"].ToString());
dummyline.Height = double.Parse(featureData["HeightOffs"].ToString());
dummyline.Voltage = int.Parse(featureData["Voltage"].ToString());
dummyline.PointFromID = int.Parse(featureData["PointFrom"].ToString());
......
......@@ -15,13 +15,11 @@ namespace WindStressPRM
/// массив прогностического ветра
/// </summary>
public Matrix<PrognosticCell> PrognosticCells { get; set; }
/// <summary>
/// climate raster array
/// массив климатических полей скорости ветра заданной повторяемости
/// </summary>
public Matrix<ClimateCell> ClimateCells { get; set; }
/// <summary>
/// lines list
/// список ЛЭП
......@@ -29,19 +27,25 @@ namespace WindStressPRM
public List<Powerline> PowerLines { get; set; }
/// <summary>
/// stations/poles list
/// список точечных объектов - трансформаторных подстанций/столбов/понижающих(конечных) подстанций
/// список точечных объектов - трансформаторных подстанций/столбов/понижающих(конечных) подстанций
/// </summary>
public List<PowerStation> PowerStations { get; set; }
/// <summary>
/// step for interpolation in CheckSpecificLines()
/// шаг для интерполяции в CheckSpecificLines()
/// </summary>
public double Distance35kVCheck { get; set; }
/// <summary>
/// maximum distance for line segment, meters
/// максимальное расстояние между точками ЛЭП, для которых проверяется сломаются/несломаются под действием ветра
/// </summary>
public double DistThreshold
{
get
{
return 500;
}
public double DistThreshold { get; set; }
/// <summary>
/// default constructor
/// </summary>
public Input() {
DistThreshold = 500;
Distance35kVCheck = 1000;
}
}
}
......@@ -20,5 +20,10 @@ namespace WindStressPRM
/// Список прогнозируемых сломанных ЛЭП в результате ветрового воздействия
/// </summary>
public List<Powerline> DisabledLines { get; set; }
/// <summary>
/// specific coordinates in which probable break of 35 kV powerlines may occure, checked on regular grid
/// список точек с возможной поломкой ЛЭП меньше 35кВ с регулярной сетки
/// </summary>
public List<Coordinate> SpectificCoordinates { get; set; }
}
}
......@@ -36,6 +36,7 @@ namespace WindStressPRM
Output output = new Output();
output.DisabledStations = new List<PowerStation>();
output.DisabledLines = prmBrokenLines;
output.SpectificCoordinates = CheckSpecificLines();
foreach (PowerStation powerStation in input.PowerStations)
{
//stations of type pole can be disabled if the line is broken
......@@ -208,7 +209,7 @@ namespace WindStressPRM
{
return cell.Wind25;
}
else if (power > 5 && power < 330)
else if (power > 5 && power <= 330)
{
return cell.Wind10;
}
......@@ -273,6 +274,37 @@ namespace WindStressPRM
return result;
}
private List<Coordinate> CheckSpecificLines()
{
List<Coordinate> list = new List<Coordinate>();
Coordinate firstCoordinate = Input.ClimateCells.Origin;
Index lastIndex = new Index( Input.ClimateCells.RowsCount() - 1, Input.ClimateCells.ColumnCount() - 1);
Coordinate lastCoordinate = Input.ClimateCells.CellToProjection(lastIndex);
for (double x = firstCoordinate.X; x <= lastCoordinate.X;
x += Math.Sign(lastCoordinate.X - firstCoordinate.X)*Input.Distance35kVCheck)
{
for (double y = firstCoordinate.Y; y <= lastCoordinate.Y;
y += Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * Input.Distance35kVCheck)
{
Coordinate current = new Coordinate(x, y);
double wind = interpol<ClimateCell>(current, Input.ClimateCells, delegate(ClimateCell cell) { return cell.Wind10; });
double u = interpol<PrognosticCell>(current, Input.PrognosticCells, delegate(PrognosticCell cell) { return cell.VelocityX; });
double v = interpol<PrognosticCell>(current, Input.PrognosticCells, delegate(PrognosticCell cell) { return cell.VelocityY; });
if (Double.IsNaN(u) || Double.IsNaN(v) || Double.IsNaN(wind))
{
// interpolation fail. we can't say everything about here
// discussion: also we can save these points for detail analysis
continue;
}
Console.WriteLine((Math.Sqrt(u * u + v * v) - wind).ToString());
if (Math.Sqrt(u*u + v*v) > wind) {
list.Add(current);
}
}
}
return list;
}
private double interpol<T>(Coordinate coords, Matrix<T> matrix, Func<T, double> valueGetter)
{
// select directions for projections
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment