Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

[task_01] Add problem solution #356

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d804b97
add
NecodevEnjoyer Nov 29, 2023
8fc1df4
Update readme.md
NecodevEnjoyer Nov 29, 2023
5372f8f
Update CMakeLists.txt
NecodevEnjoyer Nov 29, 2023
e4f3d0d
fix
NecodevEnjoyer Nov 29, 2023
1efecc2
Merge branch 'Task1' of https://github.com/MishanyPrivezentsev/OTIS-2…
NecodevEnjoyer Nov 29, 2023
354fb5f
Update CMakeLists.txt
NecodevEnjoyer Nov 29, 2023
3f75bad
Update 1OTIS.cpp
NecodevEnjoyer Nov 29, 2023
e9e1f16
Merge branch 'brstu:main' into Task1
NecodevEnjoyer Dec 12, 2023
8df9f37
Merge branch 'brstu:main' into Task1
NecodevEnjoyer Dec 14, 2023
098d9eb
Update readme.md
NecodevEnjoyer Dec 14, 2023
69cc636
Update readme.md
NecodevEnjoyer Dec 14, 2023
be8670d
Merge branch 'main' into Task1
NecodevEnjoyer Dec 14, 2023
57ca385
Merge branch 'main' into Task1
Ghokury Dec 15, 2023
3b9c3d7
Merge branch 'main' into Task1
NecodevEnjoyer Dec 17, 2023
bbb3a1b
Merge branch 'main' into Task1
NecodevEnjoyer Dec 18, 2023
e0fc8e4
Merge branch 'main' into Task1
NecodevEnjoyer Dec 19, 2023
9bc2f9e
Merge branch 'main' into Task1
LapinVladimir Dec 20, 2023
51efe43
Merge branch 'main' into Task1
NecodevEnjoyer Dec 21, 2023
ae0a0c5
Merge branch 'main' into Task1
NecodevEnjoyer Dec 22, 2023
983f4a5
Merge branch 'main' into Task1
Gomziakoff Dec 23, 2023
5364cb8
Merge branch 'main' into Task1
VolkogonNikita Dec 24, 2023
042ea0e
Merge branch 'main' into Task1
NecodevEnjoyer Dec 24, 2023
8f133cb
Merge branch 'main' into Task1
NecodevEnjoyer Dec 25, 2023
c8a4998
Merge branch 'main' into Task1
NecodevEnjoyer Dec 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
| 8 | [Копач Александр](https://github.com/AtticaQQ) |[ii02308](trunk/ii02308) | ✅ | ✅ | ❌ | ✅ | ✅ | | | | 6|
| 9 | Кунц Александр | | ❌ | ❌ | ❌ | ❌ | | | | | |
| 10 | [Лапин Владимир](https://github.com/LapinVladimir) |[ii02310](trunk/ii02310) | ✅ | ✅ | ✅ | ✅ | ✅ | | | | 8|
| 11 | [Привезенцев Михаил](https://github.com/MishanyPrivezentsev)| | ❌ | | ❌ | ❌ | | | | | |
| 11 | [Привезенцев Михаил](https://github.com/NecodevEnjoyer)|[ii02311](trunk/ii02311)| ✅ | | ❌ | ❌ | | | | | 6|
| 12 | [Ежевский Егор](https://github.com/pinkgrasss) |[ii02312](trunk/ii02312) | ✅ | ✅ | ✅ | ✅ | ✅ | | | | 8|
| 13 | Макаревич Кирилл | | ❌ | ❌ | ❌ | ❌ | | | | | |
| 14 | [Макаревич Никита](https://github.com/sosiska52) |[ii02314](trunk/ii02314) | ✅ | ✅ | ✅ | ✅ | ✅ | | | | 7|
Expand Down
Binary file added trunk/ii02311/task_01/doc/picture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions trunk/ii02311/task_01/doc/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
МИНЕСТЕРСТВО ОБРАЗОВАНИЯ РЕСПУБЛИКИ БЕЛАРУСЬ <br/>
УЧЕРЕЖДЕНИЕ ОБРАЗОВАНИЯ <br/>
«Брестский государственный технический университет» <br/>
Кафедра «Интеллектуальные информационные технологии» <br/>

Лабораторная работа №1 <br/>
По дисциплине «Общая теория интеллектуальных систем» <br/>
Тема: «Modeling controlled object» <br/>

Выполнил: <br/>
студент 2 курса <br/>
группы ИИ-23 <br/>
Привезенцев М.А. <br/>

Проверил: <br/>
Иванюк Д.С. <br/>

Брест 2023 <br/>

# Общее задание #
1. Написать отчет по выполненной лабораторной работе №1 в .md формате (readme.md) и с помощью запроса на внесение изменений (**pull request**) разместить его в следующем каталоге: **trunk\ii0xxyy\task_01\doc** (где **xx** - номер группы, **yy** - номер студента, например **ii02311**).
2. Исходный код написанной программы разместить в каталоге: **trunk\ii0xxyy\task_01\src**.

## Task 1. Modeling controlled object ##
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 (**Julia**), which simulates this object temperature.

## Код программы: ###
```С++
#include <iostream>
#include <cmath>

using namespace std;

double a = 0.5;
double b = 1;
double c = 0.15;
double d = 0.3;
double u = 1.2;

void liner(double& y1) {
y1 = a * y1 + b * u;
cout << y1 << endl;
}

void unliner(double& y2, double& y_prev, bool& second_iteration) {
if (second_iteration) {
y_prev = y2;
y2 = a * y2 + c * u + d * sin(u);
cout << y2 << endl;
second_iteration = false;
} else {
double temp;
temp = a * y2 - b * pow(y_prev, 2) + c * u + d * sin(u);
y_prev = y2;
y2 = temp;
cout << y2 << endl;
}
}

int main() {
double y1, y2, y_prev;
bool second_iteration = true;
cout << "Введите температуру: ";
cin >> y1;
y2 = y1;
int num_steps = 10;

cout << "Линейная модель\n" << y1 << endl;
for (int i = 0; i < num_steps; i++) {
liner(y1);
}

cout << "\nНелинейная модель\n" << y2 << endl;
for (int i = 0; i < num_steps; i++) {
unliner(y2, y_prev, second_iteration);
}
}
```
## График линейной и не линейной зависимости ##
![graphic linear and non-linear models](picture.png)
51 changes: 51 additions & 0 deletions trunk/ii02311/task_01/src/1OTIS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <iostream>
#include <cmath>

using namespace std;

const double a = 0.5;
const double b = 1;
const double c = 0.15;
const double d = 0.3;
const double u = 1.2;

void liner(double& y1) {
y1 = a * y1 + b * u;
cout << y1 << endl;
}

void unliner(double& y2, double& y_prev, bool& second_iteration) {
if (second_iteration) {
y_prev = y2;
y2 = a * y2 + c * u + d * sin(u);
cout << y2 << endl;
second_iteration = false;
} else {
double temp;
temp = a * y2 - b * pow(y_prev, 2) + c * u + d * sin(u);
y_prev = y2;
y2 = temp;
cout << y2 << endl;
}
}

int main() {
double y1;
double y2;
double y_prev;
bool second_iteration = true;
cout << "Введите температуру: ";
cin >> y1;
y2 = y1;
int num_steps = 10;

cout << "Линейная модель\n" << y1 << endl;
for (int i = 0; i < num_steps; i++) {
liner(y1);
}

cout << "\nНелинейная модель\n" << y2 << endl;
for (int i = 0; i < num_steps; i++) {
unliner(y2, y_prev, second_iteration);
}
}
21 changes: 21 additions & 0 deletions trunk/ii02311/task_01/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# CMakeList.txt: проект CMake для lab1; включите исходный код и определения,
# укажите здесь логику для конкретного проекта.
#
cmake_minimum_required (VERSION 3.8)

# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("1OTIS")

# Добавьте источник в исполняемый файл этого проекта.
add_executable (1OTIS "1OTIS.cpp" )

if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET 1OTIS PROPERTY CXX_STANDARD 20)
endif()

# TODO: Добавьте тесты и целевые объекты, если это необходимо.