Skip to content

Commit

Permalink
Merge branch 'brstu:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gleb7499 authored Oct 5, 2024
2 parents 19ef051 + ce87b96 commit a92e83d
Show file tree
Hide file tree
Showing 39 changed files with 2,558 additions and 7 deletions.
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
|| ФИО | Directory name | #0 | #1 | #2 | #3 | #4 | #5 | #6 | Рейтинг | Доклад |
|----|--------------------------------|------------------------------|----|-----|----|-----|----|----|----|---------|--------|
|1| Абдулвали Сундус|||||||||||
|2|Ващук Анатолий|||||||||||
|2|Ващук Анатолий|[as0006302](./trunk/as0006302/)|:white_check_mark:|:white_check_mark:||||||||
|3|Выржемковский Даниил||||||||| ||
|4|Грицук Дмитрий|||||||||||
|5|Грицук Павел|||||||||||
|6|Казаренко Павел|||||||||||
|7|Карпеш Никита|||||||||||
|7|Карпеш Никита|[as0006309](./trunk/as0006309/)|:white_check_mark:|:white_check_mark:||||||||
|8|Козлович Антон|||||||||||
|9|Козловская Анна|||||||||||
|10|Колодич Максим|||||||||||
|11|Крагель Алина|||||||||||
|11|Крагель Алина|[as0006311](./trunk/as0006311/)|:white_check_mark:|:white_check_mark:||||||||
|12|Куликович Иван|||||||||||
|13|Кульбеда Кирилл|||||||||||
|14|Кухарчук Илья|[as0006314](trunk/as0006314)||||||||||
|15|Логинов Глеб|||||||||||
|15|Логинов Глеб|[as0006315](./trunk/as0006315/)|:white_check_mark:|:white_check_mark:|:white_check_mark:|||||||
|16|Мороз Евгений|||||||||||
|17|Никифоров Александр|||||||||||
|18|Поплавский Владислав|||||||||||
Expand All @@ -43,7 +43,7 @@
|21|Стельмашук Иван|||||||||||
|22|Тунчик Антон|||||||||||
|23|Филипчук Дмитрий|||||||||||
|24|Ярмола Александр|[as0006325](./trunk/as0006325/)|:white_check_mark:|:white_check_mark:||||||||
|24|Ярмола Александр|[as0006325](./trunk/as0006325/)|:white_check_mark:|:white_check_mark:|:white_check_mark|||||||
|25|Ярмолович Александр|||||||||||

## Группа АС-64
Expand All @@ -55,10 +55,10 @@
|3|Будник Анна Андреевна|||||||||||
|4|Булавский Андрей Сергеевич|||||||||||
|5|Бурак Илья Эдуардович|||||||||||
|6|Горкавчук Никита Михайлович|[as64-220038](./trunk/as64-220038/)|:white_check_mark:|||||||||
|6|Горкавчук Никита Михайлович|[as64220038](./trunk/as64220038/)|:white_check_mark:|:white_check_mark:||||||||
|7|Евкович Андрей Викторович|||||||||||
|8|Ежгунович Глеб Михайлович|||||||||||
|9|Иванюк Иван Александрович|||||||||||
|9|Иванюк Иван Александрович|[as0006409](./trunk/as0006409/)|:white_check_mark:|:white_check_mark:|||||||||
|10|Игнаткевич Кирилл Сергеевич|||||||||||
|11|Кашпир Дмитрий Русланович|||||||||||
|12|Котковец Кирилл Викторович|||||||||||
Expand Down
74 changes: 74 additions & 0 deletions trunk/as0006302/task_01/doc/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

<p align="center"> Министерство образования Республики Беларусь</p>
<p align="center">Учреждение образования</p>
<p align="center">“Брестский Государственный Технический университет”</p>
<p align="center">Кафедра ИИТ</p>
<br><br><br><br><br><br><br>
<p align="center">Лабораторная работа №1</p>
<p align="center">По дисциплине “Теория и методы автоматического управления”</p>
<p align="center">Тема: “Моделирования температуры объекта”</p>
<br><br><br><br><br>
<p align="right">Выполнил:</p>
<p align="right">Студент 3 курса</p>
<p align="right">Группы АС-63</p>
<p align="right">Ващук А. В.</p>
<p align="right">Проверила:</p>
<p align="right">Ситковец Я. С.</p>
<br><br><br><br><br>
<p align="center">Брест 2024</p>

---

**Задание**:

The rate of change of temperature with respect to time depends on the input heat, the room temperature, and certain constants that characterize the system's behavior. After some transformations, we obtain both linear and nonlinear models:

The linear model expresses the next temperature value as a function of the current temperature and input heat, along with system constants.
The nonlinear model adds complexity by including terms that account for more intricate dependencies on the previous temperature and input heat, incorporating non-linearities like squared terms and trigonometric functions.
The goal is to use these models to control the temperature over discrete time intervals.

Пример вывода программы:

``` bash
Enter the constant a for the model: 0.08
Enter the constant b for the linear model: 0.02
Enter the constant c for the nonlinear model: 0.01
Enter the constant d for the nonlinear model: 0.05
Enter the initial temperature (y0): 20
Enter the number of discrete time moments: 10
Enter the heat values (u) for each time moment:
u[1]: 10
u[2]: 15
u[3]: 20
u[4]: 25
u[5]: 30
u[6]: 35
u[7]: 40
u[8]: 45
u[9]: 50
u[10]: 55

Linear Model Simulation:
Time 1: Temperature = 20
Time 2: Temperature = 1.8
Time 3: Temperature = 0.444
Time 4: Temperature = 0.43552
Time 5: Temperature = 0.534842
Time 6: Temperature = 0.642787
Time 7: Temperature = 0.751423
Time 8: Temperature = 0.860114
Time 9: Temperature = 0.968809
Time 10: Temperature = 1.0775

Non-linear Model Simulation:
Time 1: Temperature = 20
Time 2: Temperature = -6.3272
Time 3: Temperature = -1.12433
Time 4: Temperature = 0.130418
Time 5: Temperature = 0.253476
Time 6: Temperature = 0.269591
Time 7: Temperature = 0.348705
Time 8: Temperature = 0.46272
Time 9: Temperature = 0.525281
Time 10: Temperature = 0.523385
```
11 changes: 11 additions & 0 deletions trunk/as0006302/task_01/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Игнорировать все в папке .vscode
.vscode/

# Игнорировать папку build
build/

# Игнорировать папку out
out/

# Игнорировать json файл
CMakePresets.json
5 changes: 5 additions & 0 deletions trunk/as0006302/task_01/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.5.0)
project(TempControlSystem VERSION 0.1.0 LANGUAGES C CXX)

add_executable(TempControlSystem TempControlSystem.cpp)

80 changes: 80 additions & 0 deletions trunk/as0006302/task_01/src/TempControlSystem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

// Function to simulate the linear model
vector<double> simulateLinearModel(double a, double b, double y0, const vector<double>& u, int n) {
vector<double> y(n);
y[0] = y0; // Initial temperature

// Loop through each time step to calculate the temperature
for (int t = 1; t < n; ++t) {
y[t] = a * y[t - 1] + b * u[t - 1]; // Update temperature based on the linear model
}

return y; // Return the vector of temperatures
}

// Function to simulate the nonlinear model
vector<double> simulateNonLinearModel(double a, double b, double c, double d, double y0, const vector<double>& u, int n) {
vector<double> y(n);
y[0] = y0; // Initial temperature

// Loop through each time step to calculate the temperature
for (int t = 1; t < n; ++t) {
double prev_y = y[t - 1];
double prev_u = u[t - 1];
y[t] = a * prev_y - b * pow(prev_y, 2) + c * prev_u + d * sin(prev_u); // Nonlinear model update
}

return y; // Return the vector of temperatures
}

int main() {
// Input constants from user
double a, b, c, d, y0;
cout << "Enter the constant a for the model: ";
cin >> a;
cout << "Enter the constant b for the linear model: ";
cin >> b;
cout << "Enter the constant c for the nonlinear model: ";
cin >> c;
cout << "Enter the constant d for the nonlinear model: ";
cin >> d;
cout << "Enter the initial temperature (y0): ";
cin >> y0;

// Input the number of time moments
int n;
cout << "Enter the number of discrete time moments: ";
cin >> n;

// Input the heat values
vector<double> u(n);
cout << "Enter the heat values (u) for each time moment:" << endl;
for (int i = 0; i < n; ++i) {
cout << "u[" << i + 1 << "]: ";
cin >> u[i]; // Read input for each heat value
}

// Simulate the linear model
vector<double> y_linear = simulateLinearModel(a, b, y0, u, n);

// Simulate the nonlinear model
vector<double> y_nonlinear = simulateNonLinearModel(a, b, c, d, y0, u, n);

// Output results
cout << "\nLinear Model Simulation:" << endl;
for (int t = 0; t < n; ++t) {
cout << "Time " << t + 1 << ": Temperature = " << y_linear[t] << endl;
}

cout << "\nNon-linear Model Simulation:" << endl;
for (int t = 0; t < n; ++t) {
cout << "Time " << t + 1 << ": Temperature = " << y_nonlinear[t] << endl;
}

return 0; // Indicate successful completion
}
1 change: 1 addition & 0 deletions trunk/as0006302/task_02/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

61 changes: 61 additions & 0 deletions trunk/as0006309/task_01/doc/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<p align="center"> Министерство образования Республики Беларусь</p>
<p align="center">Учреждение образования</p>
<p align="center">“Брестский Государственный технический университет”</p>
<p align="center">Кафедра ИИТ</p>
<br><br><br><br><br><br><br>
<p align="center">Лабораторная работа №1</p>
<p align="center">По дисциплине “Теория и методы автоматического управления”</p>
<p align="center">Тема: “Моделирования температуры объекта”</p>
<br><br><br><br><br>
<p align="right">Выполнил:</p>
<p align="right">Студент 3 курса</p>
<p align="right">Группы АС-63</p>
<p align="right">Карпеш Н.П.</p>
<p align="right">Проверила:</p>
<p align="right">Ситковец Я. С.</p>
<br><br><br><br><br>
<p align="center">Брест 2024</p>

---

**Задание**:

Let's get some object to be controlled. We want to control its temperature, which can be described by this differential equation:

$$\Large\frac{dy(\tau)}{d\tau}=\frac{u(\tau)}{C}+\frac{Y_0-y(\tau)}{RC} $$ (1)

where $\tau$ – time; $y(\tau)$ – input temperature; $u(\tau)$ – input warm; $Y_0$ – room temperature; $C,RC$ – some constants.

After transformation we get these linear (2) and nonlinear (3) models:

$$\Large y_{\tau+1}=ay_{\tau}+bu_{\tau}$$ (2)

$$\Large y_{\tau+1}=ay_{\tau}-by_{\tau-1}^2+cu_{\tau}+d\sin(u_{\tau-1})$$ (3)

where $\tau$ – time discrete moments ($1,2,3{\dots}n$); $a,b,c,d$ – some constants.

Task is to write program (**С++**), which simulates this object temperature.

Пример вывода программы:

``` bash
Введите константу a: 1
Введите константу b: 2
Введите константу c: 3
Введите константу d: 4
Введите подаваемое тепло: 10
Введите температуру: 5
Введите количество тактов работы модели: 5
---Линейна температурная модель---
y1 = 25
y2 = 45
y3 = 65
y4 = 85
y5 = 105
---Нелинейная температурная модель---
y1 = 35
y2 = 12.8239
y3 = -2409.35
y4 = -2710.43
y5 = -1.16126e+07
```
4 changes: 4 additions & 0 deletions trunk/as0006309/task_01/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.0.0)
project(Lab01)

add_executable(Lab01 main.cpp)
52 changes: 52 additions & 0 deletions trunk/as0006309/task_01/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <iostream>
#include <cmath>
using namespace std;

//линейная модель
void linear(double a, double b, double uT, double yT, int t) {
cout << "\t---Линейна температурная модель---" << endl;
for (int i = 1; i <= t; i++) {
double yT1 = a * yT + b * uT;
cout << "y" << i << " = " << yT1 << endl;
yT = yT1;
}
}

//НЕлинейная модель
void nonLinear(double a, double b, double c, double d, double uT, double yT, int t) {
double uT_1 = 0;
double yT_1 = 0;

cout << "\t---Нелинейная температурная модель---" << endl;
for (int i = 1; i <= t; i++) {
double yT1 = a * yT - b * pow(yT_1, 2) + c * uT + d * sin(uT_1);
cout << "y" << i << " = " << yT1 << endl;
uT_1 = uT;
yT_1 = yT;
yT = yT1;
}
}

int main() {

system("chcp 1251");
system("cls");

double a, b, c, d; //константы
double uT; //теплота
double yT; //температура
int t; // такты

cout << "Введите константу a: "; cin >> a;
cout << "Введите константу b: "; cin >> b;
cout << "Введите константу c: "; cin >> c;
cout << "Введите константу d: "; cin >> d;
cout << "Введите подаваемое тепло: "; cin >> uT;
cout << "Введите температуру: "; cin >> yT;
cout << "Введите количество тактов работы модели: "; cin >> t;

linear(a, b, uT, yT, t);
nonLinear(a, b, c, d, uT, yT, t);

return 0;
}
Loading

0 comments on commit a92e83d

Please sign in to comment.