clear all
close all
clc

Tvz = 10;
Zadana = 0;
Merena = 102;
Sumace = 0;
P = 4143;
D = 12800000;
N = 0.0148;
Time = 1:10:500;
Akc_Real = zeros(size(Time));
Sum = zeros(size(Time));
Tvz_counter = 0;

for i = 1:1:50
    Odchylka_Real = Zadana - Merena;
    Odchylka_Real = Odchylka_Real/1024;
    Akc_Real(i) = (P * Odchylka_Real) + (Odchylka_Real * N + Sumace) * D;
    Sum(i) = Sumace;
    %Sumace = -(Sumace * N + Odchylka_Real * N )* Tvz; 
    Sumace = (Sumace + (Odchylka_Real*N + Sumace)*(-N)*10);
end
subplot(2, 1, 1);
plot(Time, Akc_Real);
subplot(2, 1, 2);
plot(Time, Sum);