From d6c01ae4a841e9538d2a4c661c009cec4afce14f Mon Sep 17 00:00:00 2001 From: Yarmola Aleksandr <85304472+alexsandro007@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:18:01 +0300 Subject: [PATCH] [task_01] Add solution (#20) * create trunk * Update main.cpp * edit readme * edit 2 readme --- readme.md | 2 +- trunk/as0006325/task_01/doc/readme.md | 63 ++++++++++++++++++++++ trunk/as0006325/task_01/src/CMakeLists.txt | 4 ++ trunk/as0006325/task_01/src/main.cpp | 57 ++++++++++++++++++++ 4 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 trunk/as0006325/task_01/doc/readme.md create mode 100644 trunk/as0006325/task_01/src/CMakeLists.txt create mode 100644 trunk/as0006325/task_01/src/main.cpp diff --git a/readme.md b/readme.md index b5f2158e..2b708dd3 100644 --- a/readme.md +++ b/readme.md @@ -43,7 +43,7 @@ |21|Стельмашук Иван||||||||||| |22|Тунчик Антон||||||||||| |23|Филипчук Дмитрий||||||||||| -|24|Ярмола Александр||||||||||| +|24|Ярмола Александр|[as0006325](./trunk/as0006325/)|:white_check_mark:|:white_check_mark:|||||||| |25|Ярмолович Александр||||||||||| ## Группа АС-64 diff --git a/trunk/as0006325/task_01/doc/readme.md b/trunk/as0006325/task_01/doc/readme.md new file mode 100644 index 00000000..1002a85c --- /dev/null +++ b/trunk/as0006325/task_01/doc/readme.md @@ -0,0 +1,63 @@ +
Министерство образования Республики Беларусь
+Учреждение образования
+“Брестский Государственный технический университет”
+Кафедра ИИТ
+Лабораторная работа №1
+По дисциплине “Теория и методы автоматического управления”
+Тема: “Моделирования температуры объекта”
+Выполнил:
+Студент 3 курса
+Группы АС-63
+Ярмола А. О.
+Проверила:
+Ситковец Я. С.
+Брест 2024
+ +--- + +**Задание**: + +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 +Enter the value for constant a: 1 +Enter the value for constant b: 2 +Enter the value for constant c: 3 +Enter the value for constant d: 4 +Enter the initial value for current temperature, y: 10 +Enter the initial control value, u: 5 +Enter the number of iterations, steps: 5 + +Linear model simulation: +Step 1: y = 20 +Step 2: y = 30 +Step 3: y = 40 +Step 4: y = 50 +Step 5: y = 60 + +Nonlinear model simulation: +Step 1: y = 25 +Step 2: y = -163.836 +Step 3: y = -1402.67 +Step 4: y = -55075.8 +Step 5: y = -3.99004e+06 +``` \ No newline at end of file diff --git a/trunk/as0006325/task_01/src/CMakeLists.txt b/trunk/as0006325/task_01/src/CMakeLists.txt new file mode 100644 index 00000000..f9d44bc0 --- /dev/null +++ b/trunk/as0006325/task_01/src/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.10) +project(Task01) + +add_executable(Task01 main.cpp) \ No newline at end of file diff --git a/trunk/as0006325/task_01/src/main.cpp b/trunk/as0006325/task_01/src/main.cpp new file mode 100644 index 00000000..da165283 --- /dev/null +++ b/trunk/as0006325/task_01/src/main.cpp @@ -0,0 +1,57 @@ +#include