3
$\begingroup$

I am not so adept at mathematica. Despite, indirectly, finding a few examples, I cannot find a particular plot I am looking for.

enter image description here

The plot you see has a clear representation of complex eigenvalues. In MATLAB, it can be created with sgrid function but it is not so good looking. Any suggestions?

Premise:

Say you have a range of eigenvalue sets for varying parameter as seen in the plot. How do you make a nice plot this?

$\endgroup$
1
$\begingroup$

I will give you a starting point. I assume that your data consists of N points and looks like

{{angle 1, radius 1, eigenvalue 1}, ... , {angle N, radius N, eigenvalue N}}.

At first I create such a set of data randomly.

n = 20;
data = Transpose@{RandomReal[2 Pi, n], RandomReal[5, n],RandomReal[{0, 2},n]};

After that we create new sublists with the same eigenvalue using GatherBy :

data2 = GatherBy[data, Last];
eigenv = #[[1, -1]] & /@ data2;

And finally the Plot:

ListPolarPlot[#[[All, {1, 2}]] & /@ data2, 
PolarGridLines -> Automatic, Frame -> True,
PlotMarkers -> {"\[Cross]", 30}, 
PlotStyle -> (ColorData["DarkRainbow"][Rescale[#, MinMax[eigenv]]] & /@ eigenv), 
PlotLegends -> BarLegend[{"DarkRainbow", MinMax[eigenv]}]]

enter image description here

$\endgroup$
  • $\begingroup$ whatever you plots looks like something I would want but I want to be able to manipulate it to exactly what I want. I do not have polar coordinates as you mention. For Gatherby I think you make individual sets only. What does eigenv does and whats with the first argument of ListPolarPlot? I am sorry, it may be trivial but I am still getting my head around #. In my case I would create set of eigenvalues for each value of parameter say $k$ which would be on the BarLegend. Again thank you for the patience! $\endgroup$ – Zero Sep 26 '16 at 19:46
  • $\begingroup$ Can you please create such a set of data? Then I will answer your questions. $\endgroup$ – bienti Sep 27 '16 at 7:53
0
$\begingroup$

Looks like a RootLocusPlot to me.

https://reference.wolfram.com/language/ref/RootLocusPlot.html

$\endgroup$
  • $\begingroup$ Nope sorry but root locus gives gain for the entire closed loop function. This is more on the side of being able to vary a parameters and see its affect! $\endgroup$ – Zero Sep 26 '16 at 7:54
  • $\begingroup$ @Zero I think you'd just need to run several root locus plots and overlay the results. $\endgroup$ – Chris Degnen Sep 26 '16 at 7:59
  • $\begingroup$ I have 3 parameters to be varied actually $k_1$, $k_2$ and $v_x$ (not shown here). While $k_1$ and $k_2$ are gains corresponing to two states, $v_x$ is a system parameter. The feedback is of the form $u_{fb}=k_1x_1+k_2x_2$. Now for using root locus to study the effect, you can imagine first I have to write the system in the proper form to use root locus (one gain only). This would be not so straightforward for the system parameter. I think it is not at all a viable. $\endgroup$ – Zero Sep 26 '16 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.