Skip to content

Instantly share code, notes, and snippets.

@fakedrake
Created January 29, 2013 20:43
Show Gist options
  • Save fakedrake/4667631 to your computer and use it in GitHub Desktop.
Save fakedrake/4667631 to your computer and use it in GitHub Desktop.
xmin = -10;
xmax = 1;
f[x_, a_] = (x + 1) a + (x + 0.7) (x + 0.2)
g[a_] :=
(y = x /. Solve[f[x, a] == 0, x];
pl1 = Graphics[{PointSize[0.02],
Point[Table[{Re[y[[i]]], Im[y[[i]]]}, {i, 1, Length[y]}]]},
Axes -> True, PlotRange -> {{-3, 0}, {-1, 1}}, Frame -> False,
AspectRatio -> 1, AxesOrigin -> {0, 0}];
pl2 = Plot[f[x, a] /. a -> 1, {x, xmin, xmax},
PlotRange -> {{xmin, xmax}, {-3, 3}}];
GraphicsRow[{pl1, pl2}, ImageSize -> Large])
Export["rootlocus.gif", Table[g[k], {k, 0, 7, 0.1}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment