clear all
close all
clc

Tvz = 10;
Zadana = 0;
Merena = 0.1;
Sumace = 0;
P = 4143;
T = 400;
Time = 1:10:5000;
Akc_Real = zeros(size(Time));
Sum = zeros(size(Time));
Tvz_counter = 0;

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