2
$\begingroup$

I have generated a stream plot, with curves on it using the following code:

f1[x1_, x2_] := 
  -ω x2 + a x1^2 + b x1 x2 + c x2^2 + d x1^3 + e x1^2 x2 + f x1 x2^2 + g x2^3
g1[x1_, x2_] := 
  ω x1 + h x1^2 + i x1 x2 + j x2^2 + k x1^3 + l x1^2 x2 + m x1 x2^2 + n x2^3

constants = 
  {a -> 6/5, b -> 11/10, c -> 78/100, d -> -3/5, e -> 1/2, f -> -9/10, g -> 1/10, 
   h -> 1/3, i -> -1/10, j -> 69/100, k -> -6/5, l -> 1/2, m -> 1/5, n -> 1/5, 
   ω -> 1};

{pol1, pol2} = {f1[x1, x2], g1[x1, x2]} /. constants
jacobian = {{D[pol1, x1] , D[pol1, x2]},{D[pol2, x1], D[pol2, x1]}};
acc = [jacobian.{pol1, pol2}];

Show[
  ContourPlot[{acc[[1]] == 0, acc[[2]] == 0}, {x1, -6, 1}, {x2, -3/2, 1}, 
    ContourStyle -> {Red, Green}], 
  StreamPlot[{pol1, pol2}, {x1, -3/2, 1}, {x2, -3/2, 1}, 
    StreamStyle -> Gray]]    

Although, it's not the nicest code, it does the job, and results the following plot:

I am willing to generate a directed graph, where the vertices are the regions, or closed sets of the plane, that are defined by the curves, (i.e, the curves split up the the plane to closed and open areas), and the the edges show, whether there is flow between two neighbouring areas.

I thought about generating a map first and then a graph, but I have no clue, how to begin. Any help would be appreciated.

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.