Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Added code for graph (python)
Browse files Browse the repository at this point in the history
  • Loading branch information
gleb7499 committed Sep 20, 2024
1 parent 06a4d79 commit 878f852
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tasks/task_02/src/graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import matplotlib.pyplot as plt

# Данные
time = [1, 2, 3, 4, 5]
linear_model = [2, 3, 4, 5, 6]
nonlinear_model = [2.84147, 3.68294, -2.54954, -14.2721, -18.9308]
error = [-0.841471, -0.682942, 6.54954, 19.2721, 24.9308]
control_signal = [-2.52441, -2.04883, 18.8072, 56.292, 79.8177]

# Построение графика
plt.plot(time, linear_model, label='Linear Model', color='blue')
plt.plot(time, nonlinear_model, label='Nonlinear Model', color='red')
plt.plot(time, error, label='Error', color='green')
plt.plot(time, control_signal, label='Control Signal', color='black')

# Настройка графика
plt.xlabel('Time')
plt.ylabel('Values')
plt.title('Graph of Models and Control Signal')
plt.legend()
plt.grid(True)

# Показать график
plt.show()

0 comments on commit 878f852

Please sign in to comment.