<< Graphics`Graphics`

n = 500; ωmin = 5; ωmax = 50. ; 
    vyr[ω_] = 
      a*Log[(ω/ω)min] + (1 + 
            bb*Log[(ω/ω)max]);
rs = Solve[{vyr[ωmin] == 0, 
              vyr[ωmax] == 
                1. }][[1]];
fce[ω_] = vyr[ω] /. rs;
barva[kk_] := RGBColor[fce[kk], 0. , 1 - fce[kk]]; 
    ClearAll[kplot, kplotkruh];
\(\(kplot[f_] := 
        Module[{p, b, plotpom, body, opsny, novebody}, 
          b = Table[
              barva[om], {om, ωmin, ωmax, \(ωmax - ωmin\)\/n}]; 
          p = Table[{Re[f[I*ω]], 
                Im[f[I*ω]]}, {ω, ωmin, ωmax, \(ωmax - ωmin\)\/n}]; 
          plotpom := 
            ListPlot[p, AxesLabel -> {"Re", "Im"}, 
              DisplayFunction -> Identity, PlotRange -> All]; 
          body = plotpom[\([1]\)]; opsny = plotpom[\([2]\)]; 
          novebody = 
            Table[{b[\([i]\)], PointSize[0.01], body[\([i]\)]}, {i, n}]; 
          Show[Graphics[novebody, opsny], 
            DisplayFunction -> $DisplayFunction]];\)\)
kruh = 
        ParametricPlot[{Cos[fi], Sin[fi]}, {fi, 0, 2  Pi}, 
          AspectRatio -> Automatic, DisplayFunction -> Identity, 
          AxesLabel -> {"Re", "Im"}];
kplotkruh[f_] := 
        DisplayTogether[kruh, kplot[f], 
          PlotRange -> {{-1.5, 1.5}, {-1.5, 
                1.5}}];

ClearAll[Fz, Fm, Fo, Fzpozdeny];
Fm[p_] := (2/(p*(0.2  p + 1)));
Fz[p_] := 
        (5/((0.02  p + 1)*(0.04  p + 1)));
Fo[p_] := Fm[p]*Fz[p];
kplot[Fo]
kplotkruh[Fo]

omegazesilenijedna = ω /. 
        FindRoot[
          Abs[Fo[I*ω]] == 1, {ω, 0.1, 10}]

Pi + Arg[Fo[I*omegazesilenijedna]]

(*ukazat i k = 1*) 
k = 
        1;

    Tdk = ((2  k*Pi)/omegazesilenijedna) + ((Pi + Arg[Fo[I*omegazesilenijedna]])/omegazesilenijedna)

Fzpozdeny[p_] := Fo[p]*Exp[-p*Tdk];
kplotkruh[Fzpozdeny];

omegapruseciksezapornouRe = ω /. 
        FindRoot[Im[Fo[I*ω]] == 0, {ω, 1, 10}]

mko = 
      m /. FindRoot[
          m*Abs[Fo[I*omegapruseciksezapornouRe]] == 1, {m, 0.5, 
            2}]

Print["fazova bezpecnost=  ", 1/mko]

Fzvetseneonebezpecnost[p_] = mko*Fo[p];
Fzvetsebezpecnost[p_] = (mko^2)*Fo[p];
pp1 := 
        kplotkruh[Fzvetseneonebezpecnost];
pp2 := kplotkruh[Fzvetsebezpecnost];
pp3 := kplotkruh[Fo];
DisplayTogether[pp1, pp2, pp3];

Show[
      ListPlot[Table[i, {i, 10}]] /. 
        Point[{uu_, vv_}] -> {Hue[(vv/10)], PointSize[0.02], 
            Point[{uu, (vv^2)}]}]