Документация API

Этот раздел содержит примеры запросов и ответов для API расчета нагрева проводов.

Пример JSON-ответа

Ниже представлен пример JSON-ответа от сервера:

Пример JSON-ответа API
  1{
  2    "apiVersion": "1.0",
  3    "title": "Wire Heating Calculation Service",
  4    "description": "API for calculating the heating of electrical wires based on various parameters.",
  5    "endpoints": [
  6      {
  7        "name": "Calculate Wire Heating",
  8        "url": "/calculate-heating",
  9        "method": "POST",
 10        "requestBody": {
 11          "type": "object",
 12          "properties": {
 13            "wireModel": {
 14              "type": "string",
 15              "description": "The model or mark of the wire (e.g., 'МФ-85', 'МФ-100'). Must match a value from the TWires.dat file."
 16            },
 17            "windSpeed": {
 18              "type": "number",
 19              "description": "Wind speed in meters per second (m/s). Default: 1.0."
 20            },
 21            "ambientTemperature": {
 22              "type": "number",
 23              "description": "Ambient temperature in degrees Celsius (°C). Default: 40.0."
 24            },
 25            "maxTime": {
 26              "type": "integer",
 27              "description": "Maximum simulation time in minutes. Default: 60."
 28            },
 29            "timeStep": {
 30              "type": "integer",
 31              "description": "Time step for the simulation in minutes. Default: 1."
 32            },
 33            "tmpProgram": {
 34              "type": "boolean",
 35              "description": "Whether to use a temporary program for calculations. Default: false."
 36            },
 37            "calculationMethod": {
 38              "type": "string",
 39              "description": "The method used for the calculation (e.g., 'Ми77', 'Ми61'). Must match one of the available methods."
 40            }
 41          },
 42          "required": ["wireModel", "calculationMethod"]
 43        },
 44        "responseBody": {
 45          "type": "object",
 46          "properties": {
 47            "status": {
 48              "type": "string",
 49              "description": "Status of the calculation ('success' or 'error')."
 50            },
 51            "message": {
 52              "type": "string",
 53              "description": "Additional message or error description."
 54            },
 55            "results": {
 56              "type": "object",
 57              "properties": {
 58                "currentOverTime": {
 59                  "type": "array",
 60                  "items": {
 61                    "type": "number",
 62                    "description": "Current values over time in Amperes (A)."
 63                  },
 64                  "description": "Array of current values over time."
 65                },
 66                "temperatureOverTime": {
 67                  "type": "array",
 68                  "items": {
 69                    "type": "number",
 70                    "description": "Temperature values over time in degrees Celsius (°C)."
 71                  },
 72                  "description": "Array of temperature values over time."
 73                },
 74                "permissibleTemperature": {
 75                  "type": "number",
 76                  "description": "Permissible temperature limit in degrees Celsius (°C)."
 77                },
 78                "tapr": {
 79                  "type": "number",
 80                  "description": "Tapr parameter specific to the selected wire model."
 81                },
 82                "additionalStats": {
 83                  "type": "object",
 84                  "properties": {
 85                    "averageCurrent": {
 86                      "type": "number",
 87                      "description": "Average current over the simulation period in Amperes (A)."
 88                    },
 89                    "peakTemperature": {
 90                      "type": "number",
 91                      "description": "Peak temperature reached during the simulation in degrees Celsius (°C)."
 92                    }
 93                  }
 94                }
 95              }
 96            }
 97          }
 98        }
 99      },
100      {
101        "name": "Get Available Wire Models",
102        "url": "/available-wires",
103        "method": "GET",
104        "responseBody": {
105          "type": "object",
106          "properties": {
107            "status": {
108              "type": "string",
109              "description": "Status of the request ('success' or 'error')."
110            },
111            "message": {
112              "type": "string",
113              "description": "Additional message or error description."
114            },
115            "wires": {
116              "type": "array",
117              "items": {
118                "type": "object",
119                "properties": {
120                  "mark": {
121                    "type": "string",
122                    "description": "The model or mark of the wire (e.g., 'МФ-85')."
123                  },
124                  "diameter": {
125                    "type": "number",
126                    "description": "Diameter of the wire in millimeters (mm)."
127                  },
128                  "resistance": {
129                    "type": "number",
130                    "description": "Resistance of the wire in Ohms per kilometer (Ω/km)."
131                  },
132                  "thermalCapacity": {
133                    "type": "number",
134                    "description": "Thermal capacity of the wire in Joules per Kelvin (J/K)."
135                  },
136                  "ratedCurrent": {
137                    "type": "number",
138                    "description": "Rated current of the wire in Amperes (A)."
139                  },
140                  "durabilityTemperature": {
141                    "type": "number",
142                    "description": "Durability temperature of the wire in degrees Celsius (°C)."
143                  },
144                  "tapr": {
145                    "type": "number",
146                    "description": "Tapr parameter specific to the wire model."
147                  }
148                }
149              },
150              "description": "List of available wire models with their properties."
151            }
152          }
153        }
154      },
155      {
156        "name": "Get Available Calculation Methods",
157        "url": "/available-methods",
158        "method": "GET",
159        "responseBody": {
160          "type": "object",
161          "properties": {
162            "status": {
163              "type": "string",
164              "description": "Status of the request ('success' or 'error')."
165            },
166            "message": {
167              "type": "string",
168              "description": "Additional message or error description."
169            },
170            "methods": {
171              "type": "array",
172              "items": {
173                "type": "object",
174                "properties": {
175                  "shortName": {
176                    "type": "string",
177                    "description": "Short name of the calculation method (e.g., 'Ми77')."
178                  },
179                  "fullName": {
180                    "type": "string",
181                    "description": "Full name or description of the calculation method (e.g., 'Михеев, 1977, гладкий')."
182                  }
183                }
184              },
185              "description": "List of available calculation methods."
186            }
187          }
188        }
189      }
190    ]
191  }

Вы можете скачать этот файл: example_api_response.json.

Описание полей

Общая информация

  • apiVersion: Версия API.

  • title: Название сервиса.

  • description: Краткое описание API.

Эндпоинты

1. Calculate Wire Heating

  • URL: /calculate-heating

  • Method: POST

RequestBody:

  • wireModel: Модель или марка провода (например, 'МФ-85', 'МФ-100'). Должна соответствовать значению из файла TWires.dat.

  • windSpeed: Скорость ветра в метрах в секунду (м/с). По умолчанию: 1.0.

  • ambientTemperature: Температура окружающей среды в градусах Цельсия (°C). По умолчанию: 40.0.

  • maxTime: Максимальное время симуляции в минутах. По умолчанию: 60.

  • timeStep: Шаг времени для симуляции в минутах. По умолчанию: 1.

  • tmpProgram: Использовать ли временную программу для расчетов. По умолчанию: false.

  • calculationMethod: Метод расчета (например, 'Ми77', 'Ми61'). Должен соответствовать одному из доступных методов.

ResponseBody:

  • status: Статус расчета ('success' или 'error').

  • message: Дополнительное сообщение или описание ошибки.

  • results:

    • currentOverTime: Массив значений тока во времени (в амперах).

    • temperatureOverTime: Массив значений температуры во времени (в градусах Цельсия).

    • permissibleTemperature: Допустимый предел температуры (в градусах Цельсия).

    • tapr: Параметр TAPR, специфичный для выбранной модели провода.

    • additionalStats:

      • averageCurrent: Средний ток за период симуляции (в амперах).

      • peakTemperature: Пиковая температура, достигнутая во время симуляции (в градусах Цельсия).

1. Get Available Wire Models

  • URL: /available-wires

  • Method: GET

ResponseBody:

  • status: Статус запроса ('success' или 'error').

  • message: Дополнительное сообщение или описание ошибки.

  • wires: Список доступных моделей проводов со свойствами:

    • mark: Модель или марка провода (например, 'МФ-85').

    • diameter: Диаметр провода (в миллиметрах).

    • resistance: Сопротивление провода (в омах на километр).

    • thermalCapacity: Теплоемкость провода (в джоулях на кельвин).

    • ratedCurrent: Номинальный ток провода (в амперах).

    • durabilityTemperature: Температура прочности провода (в градусах Цельсия).

    • tapr: Параметр TAPR, специфичный для модели провода.

1. Get Available Calculation Methods

  • URL: /available-methods

  • Method: GET

ResponseBody:

  • status: Статус запроса ('success' или 'error').

  • message: Дополнительное сообщение или описание ошибки.

  • methods: Список доступных методов расчета:

    • shortName: Короткое название метода (например, 'Ми77').

    • fullName: Полное название или описание метода (например, 'Михеев, 1977, гладкий').