# 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[] , i /. equiscR[]};
Print["DFE=", DFE = {s /. equiscR[], i /. equiscR[]}, " , inv=",
inv = {s /. equiscR[], i /. equiscR[]}, " , EEs2R=",
EEs2R = {s /. equiscR[], i /. equiscR[]}, " ,EEs1R= ", EEs1R]

epi = {{PointSize[Large], Style[Point[{DFE[], DFE[]}], Orange]},
Text["DFE",
Offset[{0, 10}, {DFE[], DFE[]}]], {PointSize[Large],
Style[Point[{inv[], inv[]}], Red]},
Text["sp",
Offset[{0, 10}, {inv[], inv[]}]], {PointSize[Large],
Style[Point[{Re[EEs1R[]], Re[EEs1R[]]}], Blue]},
Text["EES",
Offset[{20, 0}, {Re[EEs1R[]], Re[EEs1R[]]}]], {PointSize[
Large], Point[{EEs2R[], EEs2R[]}]},
Text["EESp", Offset[{0, 10}, {EEs2R[], EEs2R[]}]]} //. 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 :)

• You can try a different inset:

``````epi2 = {{PointSize[0.05], White, Point[{EEs2R[], EEs2R[]}]},
Style[Text["EESp", Offset[{0, 30}, {EEs2R[], EEs2R[]}]],
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]
`````` 