How to get StreamPlots where the density of arrows adapted (discretization ) adapts to the presence of funnels, saddle-points, etc?

I want to draw a phase portrait where the density of arrows adapted (discretization ) adapts to the presence of funnels, saddle points, and other phenomena. For example, in the code attached, the aim is to shed the light on the saddle point in the interior of the domain and make the orbits adaptable and visible for the dynamical phenomena;

Clear["Global`*"];

cn = { \[Beta] -> 4, \[Gamma] -> 1/2 , \[Gamma]r -> 
    1/6,  \[CapitalLambda] -> 
    40/400, \[Mu] -> \[CapitalLambda] , \[Nu]i -> 5,  \[Gamma]s -> 
    38/10, tru -> 9/10, \[Nu]r -> 6, 
   R ->  \[Beta]/((\[Gamma] + \[Mu] + \[Nu]i))};
s1 = - \[Beta]  s i  - \[Gamma]s s +  \[Nu]i s i +  \[Nu]r s (1 - s - 
      i);
i1 =  \[Beta] s i - (\[Gamma] + \[Nu]i  ) i  +   \[Nu]i  i^2 +   \
\[Nu]r  i (1 - s - i);
dyn = {s1, i1};
var = {s, i};
vz = {0, 0};
dynn = {s1, i1} //. cn;
eqscR = Thread[dyn == vz]; equscR = Solve[eqscR, var] // FullSimplify;
equiscR = equscR //. cn // N;

EEs1R = {s /. equiscR[[3]] , i /. equiscR[[3]]};
Print["DFE=", DFE = {s /. equiscR[[1]], i /. equiscR[[1]]}, " , inv=",
  inv = {s /. equiscR[[2]], i /. equiscR[[2]]}, " , EEs2R=", 
 EEs2R = {s /. equiscR[[4]], i /. equiscR[[4]]}, " ,EEs1R= ", EEs1R]

epi = {{PointSize[Large], Style[Point[{DFE[[1]], DFE[[2]]}], Orange]},
     Text["DFE", 
     Offset[{0, 10}, {DFE[[1]], DFE[[2]]}]], {PointSize[Large], 
     Style[Point[{inv[[1]], inv[[2]]}], Red]}, 
    Text["sp", 
     Offset[{0, 10}, {inv[[1]], inv[[2]]}]], {PointSize[Large], 
     Style[Point[{Re[EEs1R[[1]]], Re[EEs1R[[2]]]}], Blue]}, 
    Text["EES", 
     Offset[{20, 0}, {Re[EEs1R[[1]]], Re[EEs1R[[2]]]}]], {PointSize[
      Large], Point[{EEs2R[[1]], EEs2R[[2]]}]}, 
    Text["EESp", Offset[{0, 10}, {EEs2R[[1]], EEs2R[[2]]}]]} //. cn;
bup1 = StreamPlot[dynn, {s, 0, 0.10}, {i, 0.3, 0.5}, 
     RegionFunction -> Function[{s, i}, s + i <= tru //. cn], 
     ImageSize -> 200, Epilog -> epi, StreamColorFunction -> Hue,  
     Frame -> True, Frame -> True, FrameLabel -> {"s", "i"}, 
     LabelStyle -> Directive[Black, Medium]] //. cn // N;
sp = StreamPlot[dynn, {s, 0, 1}, {i, 0, 1}, 
    RegionFunction -> Function[{s, i}, s + i <= tru //. cn], 
    Epilog -> epi, ImageSize -> 400, Frame -> True, 
    StreamColorFunction -> Hue,  FrameLabel -> {"s", "i"}, 
    LabelStyle -> Directive[Black, Medium], 
    Prolog -> Inset[bup1, {0.7, 0.7}]] //. cn // N

Thanks :)

Answers 1

  • You can try a different inset:

    epi2 = {{PointSize[0.05], White, Point[{EEs2R[[1]], EEs2R[[2]]}]}, 
        Style[Text["EESp", Offset[{0, 30}, {EEs2R[[1]], EEs2R[[2]]}]], 
         White, FontSize -> 18]} //. cn;
    LineIntegralConvolutionPlot[{dynn, {"noise", 500, 10}}, {s, 0, 
      0.10}, {i, 0.3, 0.5}, ColorFunction -> "Rainbow", 
     LightingAngle -> 90, Frame -> False, Epilog -> epi2]
    

    enter image description here


Related Questions