R_1

R_2

n_{nv}=%v

n_{rv}=%v

X6_sub = (58.46987340062269, 70.21232642629556)
xmax = 183.33638408304495
xmin = -70.14814878892734
ymax = 182.88733174057458
X5_sub = (44.735294117647044, 49.19083969465651)
X4_sub = (83.27647058823528, 45.82442748091605)
X3_sub = (81.79411764705881, 99.20610687022902)
X2_sub = (79.5705882352941, 67.9465648854962)
X1_sub = (59.92941176470587, 34.76335877862598)
step = 1 (slider from 1 to 4, step 1)
E1orig_sub = (70.67647058823528, 39.091603053435136)
S0(x) = 1 / (1 + ℯ^((-x)))
sigma_min: 1.0E-4
flip1 = 0
I1: 50
sigma1: 40
theta1: 420
M1: 100
W12: 15
theta1_eff = If(W12 ≟ 0, M1 / (1 + exp(((-(I1 - theta1))) / sigma1)), (theta1 - I1) / W12)
M1uhalf_goal = If(W12 ≟ 0, theta1_eff, M1 / 2)
sigma1_eff = If(W12 ≟ 0, sigma1, sigma1 / W12)
T1a_sub = (50, 24.666666666666668)
dx = 10
dy = 10
ymin = -71.0400034962997
T1a = DynamicCoordinates(T1a_sub, If[x(T1a_sub) > (floor(xmax / dx) * dx), (floor(xmax / dx) * dx), If[x(T1a_sub) < (ceil(xmin / dx) * dx), (ceil(xmin / dx) * dx), (round((x(T1a_sub) - M1uhalf_goal) / dx) * dx) + M1uhalf_goal]], If[y(T1a_sub) > (floor(ymax / dy) * dy), (floor(ymax / dy) * dy), If[y(T1a_sub) < (ceil(ymin / dy) * dy), (ceil(ymin / dy) * dy), (round((y(T1a_sub) - theta1_eff) / dy) * dy) + theta1_eff]])
M1u = If(flip1 ≟ 1, (2 * x(T1a)), (2 * y(T1a)))
T1boptionlength: sqrt((M1u / 4)^(2) + ((log(3) * sigma1_eff))^(2))
theta1u_sub = If(flip1 ≟ 1, y(T1a), x(T1a))
T1b_options = If(flip1 ≟ 1, {((3 * M1u / 4), (log(3) * sigma1_eff) + theta1u_sub), ((3 * M1u / 4), ((-log(3)) * sigma1_eff) + theta1u_sub), (M1u / 2 + (sgn(M1u) * Min[M1u / 2, T1boptionlength]), theta1u_sub), (M1u / 2, T1boptionlength + theta1u_sub), (M1u / 2, (-T1boptionlength) + theta1u_sub)}, {((log(3) * sigma1_eff) + theta1u_sub, (3 * M1u / 4)), (((-log(3)) * sigma1_eff) + theta1u_sub, (3 * M1u / 4)), (theta1u_sub, M1u / 2 + (sgn(M1u) * Min[M1u / 2, T1boptionlength])), (T1boptionlength + theta1u_sub, M1u / 2), ((-T1boptionlength) + theta1u_sub, M1u / 2)})
T1b = Point(T1b_options)
sigma1u = If(flip1 ≟ 1, If[x(T1b) ≟ M1u / 2, Infinity, If[y(T1b) ≟ theta1u_sub, sigma_min, (y(T1b) - theta1u_sub) / log(3)]], If[y(T1b) ≟ M1u / 2, Infinity, If[x(T1b) ≟ theta1u_sub, sigma_min, (x(T1b) - theta1u_sub) / log(3)]])
S1baseinv(x) = theta1u_sub - (sigma1u * log(M1u / x - 1))
S1base(x) = (M1u * If[sigma1u ≟ Infinity, 1 / 2, S0((x - theta1u_sub) / sigma1u)])
lim1bot: S1base(theta1u_sub - (6 * sigma1u))
lim1top: S1base(theta1u_sub + (6 * sigma1u))
T2a_sub = (27.5, 60)
W21: 12
M2: 120
theta2: 350
sigma2: 80
sigma2_eff = If(W21 ≟ 0, sigma2, sigma2 / W21)
I2: 20
theta2_eff = If(W21 ≟ 0, M2 / (1 + ℯ^(((-(I2 - theta2))) / sigma2)), (theta2 - I2) / W21)
M2uhalf_goal = If(W21 ≟ 0, theta2_eff, M2 / 2)
T2a = DynamicCoordinates(T2a_sub, If[x(T2a_sub) > (floor(xmax / dx) * dx), (floor(xmax / dx) * dx), If[x(T2a_sub) < (ceil(xmin / dx) * dx), (ceil(xmin / dx) * dx), (round((x(T2a_sub) - theta2_eff) / dx) * dx) + theta2_eff]], If[y(T2a_sub) > (floor(ymax / dy) * dy), (floor(ymax / dy) * dy), If[y(T2a_sub) < (ceil(ymin / dy) * dy), (ceil(ymin / dy) * dy), (round((y(T2a_sub) - M2uhalf_goal) / dy) * dy) + M2uhalf_goal]])
flip2 = 0
theta2u_sub = If(flip2 ≟ 1, y(T2a), x(T2a))
M2u = If(flip2 ≟ 1, (2 * x(T2a)), (2 * y(T2a)))
T2boptionlength: sqrt((M2u / 4)^(2) + ((log(3) * sigma2_eff))^(2))
T2b_options = If(flip2 ≟ 1, {((3 * M2u / 4), (log(3) * sigma2_eff) + theta2u_sub), ((3 * M2u / 4), ((-log(3)) * sigma2_eff) + theta2u_sub), (M2u / 2 + (sgn(M2u) * Min[M2u / 2, T2boptionlength]), theta2u_sub), (M2u / 2, T2boptionlength + theta2u_sub), (M2u / 2, (-T2boptionlength) + theta2u_sub)}, {((log(3) * sigma2_eff) + theta2u_sub, (3 * M2u / 4)), (((-log(3)) * sigma2_eff) + theta2u_sub, (3 * M2u / 4)), (theta2u_sub, M2u / 2 + (sgn(M2u) * Min[M2u / 2, T2boptionlength])), (T2boptionlength + theta2u_sub, M2u / 2), ((-T2boptionlength) + theta2u_sub, M2u / 2)})
T2b = Point(T2b_options)
sigma2u = If(flip2 ≟ 1, If[x(T2b) ≟ M2u / 2, Infinity, If[y(T2b) ≟ theta2u_sub, sigma_min, (y(T2b) - theta2u_sub) / log(3)]], If[y(T2b) ≟ M2u / 2, Infinity, If[x(T2b) ≟ theta2u_sub, sigma_min, (x(T2b) - theta2u_sub) / log(3)]])
S2baseinv(x) = theta2u_sub - (sigma2u * log(M2u / x - 1))
S2base(x) = (M2u * If[sigma2u ≟ Infinity, 1 / 2, S0((x - theta2u_sub) / sigma2u)])
equilibria_fnf = RemoveUndefined(Join[{{Intersect[S2base, S1baseinv, Min[lim1bot, lim1top], Max[lim1bot, lim1top]]}, If[S2base(lim1top) > S1baseinv(lim1top) ∧ sigma1u > 0 ∨ S2base(lim1top) < S1baseinv(lim1top) ∧ sigma1u < 0, {(M1u, S2base(M1u))}, {}], If[S2base(lim1bot) > S1baseinv(lim1bot) ∧ sigma1u < 0 ∨ S2base(lim1bot) < S1baseinv(lim1bot) ∧ sigma1u > 0, {(0, S2base(0))}, {}], If[sigma1u ≟ Infinity, {(M1u / 2, S2base(M1u / 2))}, {}]}])
lim2bot: S2base(theta2u_sub - (6 * sigma2u))
lim2top: S2base(theta2u_sub + (6 * sigma2u))
equilibria_nff = RemoveUndefined(Join[{{Intersect[S1base, S2baseinv, Min[lim2bot, lim2top], Max[lim2bot, lim2top]]}, If[S1base(lim2top) > S2baseinv(lim2top) ∧ sigma2u > 0 ∨ S1base(lim2top) < S2baseinv(lim2top) ∧ sigma2u < 0, {(M2u, S1base(M2u))}, {}], If[S1base(lim2bot) > S2baseinv(lim2bot) ∧ sigma2u < 0 ∨ S1base(lim2bot) < S2baseinv(lim2bot) ∧ sigma2u > 0, {(0, S1base(0))}, {}], If[sigma2u ≟ Infinity, {(M2u / 2, S1base(M2u / 2))}, {}]}])
equilibria_nfnf: {Intersect[S1base, S2base, xmin, xmax]}
equilibria_ff = Zip((y(a), x(a)), a, equilibria_nfnf)
equilibria = RemoveUndefined(Sort[If[flip1 ≟ 1, If[sigma1u ≟ 0, If[flip2 ≟ 1, If[sigma2u ≟ 0, {}, {(S2base(theta1u_sub), theta1u_sub)}], If[sigma2u ≟ 0, {(theta2u_sub, theta1u_sub)}, {(S2baseinv(theta1u_sub), theta1u_sub)}]], If[flip2 ≟ 1, If[sigma2u ≟ 0, {(S1base(theta2u_sub), theta2u_sub)}, equilibria_ff], If[sigma2u ≟ 0, {(theta2u_sub, S1baseinv(theta2u_sub))}, equilibria_fnf]]], If[sigma1u ≟ 0, If[flip2 ≟ 1, If[sigma2u ≟ 0, {(theta1u_sub, theta2u_sub)}, {(theta1u_sub, S2baseinv(theta1u_sub))}], If[sigma2u ≟ 0, {}, {(theta1u_sub, S2base(theta1u_sub))}]], If[flip2 ≟ 1, If[sigma2u ≟ 0, {(S1baseinv(theta2u_sub), theta2u_sub)}, equilibria_nff], If[sigma2u ≟ 0, {(theta2u_sub, S1base(theta2u_sub))}, equilibria_nfnf]]]]])
E1origclose = Max(Sequence[If[Length[E1orig_sub - Element[equilibria, i]] < sqrt(dx^(2) + dy^(2)) / 2, i, 0], i, 1, Length[equilibria]])
dsigma2 = 10
dsigma1 = 10
LL = Corner(1)
UR = Corner(3)
S1f = CurveCartesian(S1base(s), s, s, ymin, ymax)
S1nf = CurveCartesian(s, S1base(s), s, xmin, xmax)
S1 = If(flip1 ≟ 1, S1f, S1nf)
S2f = CurveCartesian(S2base(s), s, s, ymin, ymax)
S2nf = CurveCartesian(s, S2base(s), s, xmin, xmax)
S2 = If(flip2 ≟ 1, S2f, S2nf)
E1orig = DynamicCoordinates(E1orig_sub, If[x(E1orig_sub) > xmax, xmax, If[x(E1orig_sub) < xmin, xmin, If[E1origclose > 0, x(Element[equilibria, E1origclose]), x(E1orig_sub)]]], If[y(E1orig_sub) > ymax, ymax, If[y(E1orig_sub) < ymin, ymin, If[E1origclose > 0, y(Element[equilibria, E1origclose]), y(E1orig_sub)]]])
E1origstable = false
E1origtype = 3
E1label = If(E1origtype ≟ 1, "SN", If[E1origtype ≟ 2, "SS", If[E1origtype ≟ 3, "C", If[E1origtype ≟ 4, "US", If[E1origtype ≟ 5, "UN", "SD"]]]])
E2orig_sub = (37.323529411764696, 57.84732824427483)
E2origclose = Max(Sequence[If[Length[E2orig_sub - Element[equilibria, i]] < sqrt(dx^(2) + dy^(2)) / 2, i, 0], i, 1, Length[equilibria]])
E2orig = DynamicCoordinates(E2orig_sub, If[x(E2orig_sub) > xmax, xmax, If[x(E2orig_sub) < xmin, xmin, If[E2origclose > 0, x(Element[equilibria, E2origclose]), x(E2orig_sub)]]], If[y(E2orig_sub) > ymax, ymax, If[y(E2orig_sub) < ymin, ymin, If[E2origclose > 0, y(Element[equilibria, E2origclose]), y(E2orig_sub)]]])
E2origtype = 1
E2origstable = true
E2label = If(E2origtype ≟ 1, "SN", If[E2origtype ≟ 2, "SS", If[E2origtype ≟ 3, "C", If[E2origtype ≟ 4, "US", If[E2origtype ≟ 5, "UN", "SD"]]]])
E3orig_sub = (60.670588235294105, 89.587786259542)
E3origclose = Max(Sequence[If[Length[E3orig_sub - Element[equilibria, i]] < sqrt(dx^(2) + dy^(2)) / 2, i, 0], i, 1, Length[equilibria]])
E3orig = DynamicCoordinates(E3orig_sub, If[x(E3orig_sub) > xmax, xmax, If[x(E3orig_sub) < xmin, xmin, If[E3origclose > 0, x(Element[equilibria, E3origclose]), x(E3orig_sub)]]], If[y(E3orig_sub) > ymax, ymax, If[y(E3orig_sub) < ymin, ymin, If[E3origclose > 0, y(Element[equilibria, E3origclose]), y(E3orig_sub)]]])
E3origtype = 2
E3origstable = true
E3label = If(E3origtype ≟ 1, "SN", If[E3origtype ≟ 2, "SS", If[E3origtype ≟ 3, "C", If[E3origtype ≟ 4, "US", If[E3origtype ≟ 5, "UN", "SD"]]]])
n_e = 0 (slider from 0 to 3, step 1)
E2origfound: step ≥ 2 ∧ E1orig ≠ E2orig ∧ E2origclose > 0
E1origfound: step ≥ 2 ∧ E1origclose > 0
E3origfound: step ≥ 2 ∧ E1orig ≠ E3orig ∧ E2orig ≠ E3orig ∧ E3origclose > 0
xlabeldisplayed: "" + (LaTeX[xlabel]) + ""
ylabeldisplayed: "" + (LaTeX[ylabel]) + ""
null2label: "" + (LaTeX[ylabel]) + "\text{-nullcline}"
null1label: "" + (LaTeX[xlabel]) + "\text{-nullcline}"
gridx = Sequence(Segment[((i * dx), ymin), ((i * dx), ymax)], i, ceil(xmin / dx), floor(xmax / dx))
gridy = Sequence(Segment[(xmin, (i * dy)), (xmax, (i * dy))], i, ceil(ymin / dy), floor(ymax / dy))
dx2 = 50
dy2 = 50
gridx2 = Sequence(Segment[((i * dx2), ymin), ((i * dx2), ymax)], i, ceil(xmin / dx2), floor(xmax / dx2))
gridy2 = Sequence(Segment[(xmin, (i * dy2)), (xmax, (i * dy2))], i, ceil(ymin / dy2), floor(ymax / dy2))
xminustheta1: If[flip1 ≟ 1, ylabel, xlabel] + (If[theta1u_sub ≟ 0, "", If[theta1u_sub ≤ 0, "+", ""] + ((-theta1u_sub))])
xminustheta2: If[flip2 ≟ 1, ylabel, xlabel] + (If[theta2u_sub ≟ 0, "", If[theta2u_sub ≤ 0, "+", ""] + ((-theta2u_sub))])
P1onS2 = Point(S2)
P2onS1 = Point(S1)
P2onS2 = Point(S2)
P1onS1 = Point(S1)
vecmult: (sqrt(((xmax - xmin) / dx)^(2) + ((ymax - ymin) / dy)^(2)) * 0.04)
vecdirs: (vecmult * {(dx, 0), (0, dy), ((-dx), 0), (0, (-dy)), (dx / sqrt(2), dy / sqrt(2)), (dx / sqrt(2), ((-dy)) / sqrt(2)), (((-dx)) / sqrt(2), ((-dy)) / sqrt(2)), (((-dx)) / sqrt(2), dy / sqrt(2))})
P1onS1_h = Point(P1onS1 + vecdirs)
P2onS1_h = Point(P2onS1 + vecdirs)
P1onS2_h = Point(P1onS2 + vecdirs)
P2onS2_h = Point(P2onS2 + vecdirs)
v1onS1 = Vector(P1onS1, P1onS1_h)
v2onS1 = Vector(P2onS1, P2onS1_h)
v1onS2 = Vector(P1onS2, P1onS2_h)
v2onS2 = Vector(P2onS2, P2onS2_h)
M1correct: M1u ≟ M1
M2correct: M2u ≟ M2
theta1u = If(flip1 ≟ 1, If[x(T1b) ≟ x(T1a), x(T1a), y(T1a)], If[y(T1b) ≟ y(T1a), y(T1a), x(T1a)])
theta1correct: theta1u ≟ theta1_eff
theta2u = If(flip2 ≟ 1, If[x(T2b) ≟ x(T2a), x(T2a), y(T2a)], If[y(T2b) ≟ y(T2a), y(T2a), x(T2a)])
theta2correct: theta2u ≟ theta2_eff
null1correctorientation: flip1 ≟ 1
null2correctorientation: flip2 ≟ 0
sigma1correct = If(W12 ≟ 0, sigma1u ≟ Infinity, sigma1u ≟ sigma1_eff)
sigma2correct = If(W21 ≟ 0, sigma2u ≟ Infinity, sigma2u ≟ sigma2_eff)
nequilibria = Length(equilibria)
P3onS2 = Point(S2)
P4onS2 = Point(S2)
P3onS1 = Point(S1)
P4onS1 = Point(S1)
P3onS1_h = Point(P3onS1 + vecdirs)
P4onS1_h = Point(P4onS1 + vecdirs)
P3onS2_h = Point(P3onS2 + vecdirs)
P4onS2_h = Point(P4onS2 + vecdirs)
v3onS1 = Vector(P3onS1, P3onS1_h)
v4onS1 = Vector(P4onS1, P4onS1_h)
v3onS2 = Vector(P3onS2, P3onS2_h)
v4onS2 = Vector(P4onS2, P4onS2_h)
ER1 = Element(equilibria, 1)
ER2 = Element(equilibria, 2)
ER3 = Element(equilibria, 3)
equilibria_order = If(y(ER1) < y(ER2) ∧ y(ER2) < y(ER3), 1, 2)
equilibriaorder_eps: 0.01
P1onS1region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P1onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS1) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P1onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P1onS1) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P1onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P1onS1) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P1onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P1onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P1onS1) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P1onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P1onS1) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P1onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P1onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS1) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P1onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P1onS1) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P1onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P1onS1) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
P2onS1region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P2onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS1) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P2onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P2onS1) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P2onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P2onS1) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P2onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P2onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P2onS1) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P2onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P2onS1) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P2onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P2onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS1) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P2onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P2onS1) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P2onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P2onS1) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
P3onS1region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P3onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS1) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P3onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P3onS1) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P3onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P3onS1) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P3onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P3onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P3onS1) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P3onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P3onS1) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P3onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P3onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS1) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P3onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P3onS1) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P3onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P3onS1) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
P4onS1region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P4onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS1) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P4onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P4onS1) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P4onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P4onS1) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P4onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P4onS1) ≤ x(ER2) + equilibriaorder_eps ∧ y(P4onS1) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P4onS1) ≤ x(ER3) + equilibriaorder_eps ∧ y(P4onS1) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P4onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS1) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P4onS1) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS1) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P4onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P4onS1) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P4onS1) ≥ x(ER1) - equilibriaorder_eps ∧ y(P4onS1) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
P1onS2region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P1onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS2) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P1onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P1onS2) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P1onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P1onS2) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P1onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P1onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P1onS2) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P1onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P1onS2) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P1onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P1onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P1onS2) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P1onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P1onS2) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P1onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P1onS2) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
P2onS2region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P2onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS2) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P2onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P2onS2) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P2onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P2onS2) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P2onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P2onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P2onS2) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P2onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P2onS2) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P2onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P2onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P2onS2) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P2onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P2onS2) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P2onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P2onS2) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
P3onS2region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P3onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS2) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P3onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P3onS2) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P3onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P3onS2) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P3onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P3onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P3onS2) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P3onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P3onS2) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P3onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P3onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P3onS2) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P3onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P3onS2) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P3onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P3onS2) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
X1 = DynamicCoordinates(X1_sub, If[x(X1_sub) > xmax, xmax, If[x(X1_sub) < xmin, xmin, x(X1_sub)]], If[y(X1_sub) > ymax, ymax, If[y(X1_sub) < ymin, ymin, y(X1_sub)]])
X2 = DynamicCoordinates(X2_sub, If[x(X2_sub) > xmax, xmax, If[x(X2_sub) < xmin, xmin, x(X2_sub)]], If[y(X2_sub) > ymax, ymax, If[y(X2_sub) < ymin, ymin, y(X2_sub)]])
X3 = DynamicCoordinates(X3_sub, If[x(X3_sub) > xmax, xmax, If[x(X3_sub) < xmin, xmin, x(X3_sub)]], If[y(X3_sub) > ymax, ymax, If[y(X3_sub) < ymin, ymin, y(X3_sub)]])
X4 = DynamicCoordinates(X4_sub, If[x(X4_sub) > xmax, xmax, If[x(X4_sub) < xmin, xmin, x(X4_sub)]], If[y(X4_sub) > ymax, ymax, If[y(X4_sub) < ymin, ymin, y(X4_sub)]])
P4onS2region = If(nequilibria ≟ 3, If[equilibria_order ≟ 2, If[x(P4onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS2) ≥ y(ER1) - equilibriaorder_eps, 1, If[x(P4onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P4onS2) ≥ y(ER2) - equilibriaorder_eps, 2, If[x(P4onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P4onS2) ≥ y(ER3) - equilibriaorder_eps, 3, 4]]], If[x(P4onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P4onS2) ≤ x(ER2) + equilibriaorder_eps ∧ y(P4onS2) ≤ y(ER2) + equilibriaorder_eps, 2, If[x(P4onS2) ≤ x(ER3) + equilibriaorder_eps ∧ y(P4onS2) ≤ y(ER3) + equilibriaorder_eps, 3, 4]]]], If[x(P4onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS2) ≤ y(ER1) + equilibriaorder_eps, 1, If[x(P4onS2) ≤ x(ER1) + equilibriaorder_eps ∧ y(P4onS2) ≥ y(ER1) - equilibriaorder_eps, 2, If[x(P4onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P4onS2) ≤ y(ER1) + equilibriaorder_eps, 3, If[x(P4onS2) ≥ x(ER1) - equilibriaorder_eps ∧ y(P4onS2) ≥ y(ER1) - equilibriaorder_eps, 4, 5]]]])
X6 = DynamicCoordinates(X6_sub, If[x(X6_sub) > xmax, xmax, If[x(X6_sub) < xmin, xmin, x(X6_sub)]], If[y(X6_sub) > ymax, ymax, If[y(X6_sub) < ymin, ymin, y(X6_sub)]])
X5 = DynamicCoordinates(X5_sub, If[x(X5_sub) > xmax, xmax, If[x(X5_sub) < xmin, xmin, x(X5_sub)]], If[y(X5_sub) > ymax, ymax, If[y(X5_sub) < ymin, ymin, y(X5_sub)]])
X1_h = Point(X1 + vecdirs)
X2_h = Point(X2 + vecdirs)
X3_h = Point(X3 + vecdirs)
X4_h = Point(X4 + vecdirs)
X5_h = Point(X5 + vecdirs)
X6_h = Point(X6 + vecdirs)
v1 = Vector(X1, X1_h)
v2 = Vector(X2, X2_h)
v3 = Vector(X3, X3_h)
v4 = Vector(X4, X4_h)
v5 = Vector(X5, X5_h)
v6 = Vector(X6, X6_h)
S1b: S1
S2b: S2
E1origb: E1orig
E2origb: E2orig
E3origb: E3orig
E1found: step ≥ 2 ∧ (n_e ≥ 1 ∧ E1origclose ≟ 1 ∨ n_e ≥ 2 ∧ E2origclose ≟ 1 ∨ n_e ≥ 3 ∧ E3origclose ≟ 1)
E1stable = If(E1found, If[E1origclose ≟ 1, E1origstable, If[E2origclose ≟ 1, E2origstable, If[E3origclose ≟ 1, E3origstable, -1]]], -1)
E2found: step ≥ 2 ∧ (n_e ≥ 1 ∧ E1origclose ≟ 2 ∨ n_e ≥ 2 ∧ E2origclose ≟ 2 ∨ n_e ≥ 3 ∧ E3origclose ≟ 2)
E3found: step ≥ 2 ∧ (n_e ≥ 1 ∧ E1origclose ≟ 3 ∨ n_e ≥ 2 ∧ E2origclose ≟ 3 ∨ n_e ≥ 3 ∧ E3origclose ≟ 3)
E2stable = If(E2found, If[E1origclose ≟ 2, E1origstable, If[E2origclose ≟ 2, E2origstable, If[E3origclose ≟ 2, E3origstable, -1]]], -1)
E3stable = If(E3found, If[E1origclose ≟ 3, E1origstable, If[E2origclose ≟ 3, E2origstable, If[E3origclose ≟ 3, E3origstable, -1]]], -1)
E1type = If(E1found, If[E1origclose ≟ 1, E1origtype, If[E2origclose ≟ 1, E2origtype, If[E3origclose ≟ 1, E3origtype, -1]]], -1)
E2type = If(E2found, If[E1origclose ≟ 2, E1origtype, If[E2origclose ≟ 2, E2origtype, If[E3origclose ≟ 2, E3origtype, -1]]], -1)
E3type = If(E3found, If[E1origclose ≟ 3, E1origtype, If[E2origclose ≟ 3, E2origtype, If[E3origclose ≟ 3, E3origtype, -1]]], -1)
dR1positive = If(flip1 ≟ 1, x < S1base(y), y < S1base(x))
dR2positive = If(flip2 ≟ 1, x < S2base(y), y < S2base(x))
X1dir: (vecmult * ((If[IsInRegion[X1, dR1positive], 1, -1] * dx), (If[IsInRegion[X1, dR2positive], 1, -1] * dy)) / sqrt(2))
n_nv = 1 (slider from 1 to 4, step 1)
n_rv = 1 (slider from 1 to 6, step 1)
X2dir: (vecmult * ((If[IsInRegion[X2, dR1positive], 1, -1] * dx), (If[IsInRegion[X2, dR2positive], 1, -1] * dy)) / sqrt(2))
X3dir: (vecmult * ((If[IsInRegion[X3, dR1positive], 1, -1] * dx), (If[IsInRegion[X3, dR2positive], 1, -1] * dy)) / sqrt(2))
X4dir: (vecmult * ((If[IsInRegion[X4, dR1positive], 1, -1] * dx), (If[IsInRegion[X4, dR2positive], 1, -1] * dy)) / sqrt(2))
X5dir: (vecmult * ((If[IsInRegion[X5, dR1positive], 1, -1] * dx), (If[IsInRegion[X5, dR2positive], 1, -1] * dy)) / sqrt(2))
X6dir: (vecmult * ((If[IsInRegion[X6, dR1positive], 1, -1] * dx), (If[IsInRegion[X6, dR2positive], 1, -1] * dy)) / sqrt(2))
X1dircorrect: step ≥ 3 ∧ n_rv ≥ 1 ∧ X1dir ≟ X1_h - X1
X2dircorrect: step ≥ 3 ∧ n_rv ≥ 2 ∧ X2dir ≟ X2_h - X2
X3dircorrect: step ≥ 3 ∧ n_rv ≥ 3 ∧ X3dir ≟ X3_h - X3
X4dircorrect: step ≥ 3 ∧ n_rv ≥ 4 ∧ X4dir ≟ X4_h - X4
X5dircorrect: step ≥ 3 ∧ n_rv ≥ 5 ∧ X5dir ≟ X5_h - X5
X6dircorrect: step ≥ 3 ∧ n_rv ≥ 6 ∧ X6dir ≟ X6_h - X6
X2diffregion: step ≥ 3 ∧ n_rv ≥ 2 ∧ (X2dir ≠ X1dir ∨ ((x(X1) - x(ER2)) * (x(X2) - x(ER2))) < 0 ∧ ((y(X1) - y(ER2)) * (y(X2) - y(ER2))) < 0)
X3diffregion: step ≥ 3 ∧ n_rv ≥ 3 ∧ (X3dir ≠ X1dir ∨ ((x(X1) - x(ER2)) * (x(X3) - x(ER2))) < 0 ∧ ((y(X1) - y(ER2)) * (y(X3) - y(ER2))) < 0) ∧ (X3dir ≠ X2dir ∨ ((x(X2) - x(ER2)) * (x(X3) - x(ER2))) < 0 ∧ ((y(X2) - y(ER2)) * (y(X3) - y(ER2))) < 0)
X4diffregion: step ≥ 3 ∧ n_rv ≥ 4 ∧ (X4dir ≠ X1dir ∨ ((x(X1) - x(ER2)) * (x(X4) - x(ER2))) < 0 ∧ ((y(X1) - y(ER2)) * (y(X4) - y(ER2))) < 0) ∧ (X4dir ≠ X2dir ∨ ((x(X2) - x(ER2)) * (x(X4) - x(ER2))) < 0 ∧ ((y(X2) - y(ER2)) * (y(X4) - y(ER2))) < 0) ∧ (X4dir ≠ X3dir ∨ ((x(X3) - x(ER2)) * (x(X4) - x(ER2))) < 0 ∧ ((y(X3) - y(ER2)) * (y(X4) - y(ER2))) < 0)
X5diffregion: step ≥ 3 ∧ n_rv ≥ 5 ∧ (X5dir ≠ X1dir ∨ ((x(X1) - x(ER2)) * (x(X5) - x(ER2))) < 0 ∧ ((y(X1) - y(ER2)) * (y(X5) - y(ER2))) < 0) ∧ (X5dir ≠ X2dir ∨ ((x(X2) - x(ER2)) * (x(X5) - x(ER2))) < 0 ∧ ((y(X2) - y(ER2)) * (y(X5) - y(ER2))) < 0) ∧ (X5dir ≠ X3dir ∨ ((x(X3) - x(ER2)) * (x(X5) - x(ER2))) < 0 ∧ ((y(X3) - y(ER2)) * (y(X5) - y(ER2))) < 0) ∧ (X5dir ≠ X4dir ∨ ((x(X4) - x(ER2)) * (x(X5) - x(ER2))) < 0 ∧ ((y(X4) - y(ER2)) * (y(X5) - y(ER2))) < 0)
X6diffregion: step ≥ 3 ∧ n_rv ≥ 6 ∧ (X6dir ≠ X1dir ∨ ((x(X1) - x(ER2)) * (x(X6) - x(ER2))) < 0 ∧ ((y(X1) - y(ER2)) * (y(X6) - y(ER2))) < 0) ∧ (X6dir ≠ X2dir ∨ ((x(X2) - x(ER2)) * (x(X6) - x(ER2))) < 0 ∧ ((y(X2) - y(ER2)) * (y(X6) - y(ER2))) < 0) ∧ (X6dir ≠ X3dir ∨ ((x(X3) - x(ER2)) * (x(X6) - x(ER2))) < 0 ∧ ((y(X3) - y(ER2)) * (y(X6) - y(ER2))) < 0) ∧ (X6dir ≠ X4dir ∨ ((x(X4) - x(ER2)) * (x(X6) - x(ER2))) < 0 ∧ ((y(X4) - y(ER2)) * (y(X6) - y(ER2))) < 0) ∧ (X6dir ≠ X5dir ∨ ((x(X5) - x(ER2)) * (x(X6) - x(ER2))) < 0 ∧ ((y(X5) - y(ER2)) * (y(X6) - y(ER2))) < 0)
P3onS2diffreg: step ≥ 4 ∧ n_nv ≥ 3 ∧ P3onS2region ≠ P1onS2region ∧ P3onS2region ≠ P2onS2region
P3onS1diffreg: step ≥ 4 ∧ n_nv ≥ 3 ∧ P3onS1region ≠ P1onS1region ∧ P3onS1region ≠ P2onS1region
P4onS1diffreg: step ≥ 4 ∧ n_nv ≥ 4 ∧ P4onS1region ≠ P1onS1region ∧ P4onS1region ≠ P2onS1region ∧ P4onS1region ≠ P3onS1region
P4onS2diffreg: step ≥ 4 ∧ n_nv ≥ 4 ∧ P4onS2region ≠ P1onS2region ∧ P4onS2region ≠ P2onS2region ∧ P4onS2region ≠ P3onS2region
P1onS1dircorrect: step ≥ 4 ∧ n_nv ≥ 1 ∧ P1onS1_h ≟ P1onS1 + (0, ((vecmult * If[IsInRegion[P1onS1, dR2positive], 1, -1]) * dy))
P2onS2diffreg: step ≥ 4 ∧ n_nv ≥ 2 ∧ P2onS2region ≠ P1onS2region
P2onS1diffreg: step ≥ 4 ∧ n_nv ≥ 2 ∧ P2onS1region ≠ P1onS1region
P2onS1dircorrect: step ≥ 4 ∧ n_nv ≥ 2 ∧ P2onS1_h ≟ P2onS1 + (0, ((vecmult * If[IsInRegion[P2onS1, dR2positive], 1, -1]) * dy))
P3onS1dircorrect: step ≥ 4 ∧ n_nv ≥ 3 ∧ P3onS1_h ≟ P3onS1 + (0, ((vecmult * If[IsInRegion[P3onS1, dR2positive], 1, -1]) * dy))
P4onS1dircorrect: step ≥ 4 ∧ n_nv ≥ 4 ∧ P4onS1_h ≟ P4onS1 + (0, ((vecmult * If[IsInRegion[P4onS1, dR2positive], 1, -1]) * dy))
P1onS2dircorrect: step ≥ 4 ∧ n_nv ≥ 1 ∧ P1onS2_h ≟ P1onS2 + (((vecmult * If[IsInRegion[P1onS2, dR1positive], 1, -1]) * dx), 0)
P2onS2dircorrect: step ≥ 4 ∧ n_nv ≥ 2 ∧ P2onS2_h ≟ P2onS2 + (((vecmult * If[IsInRegion[P2onS2, dR1positive], 1, -1]) * dx), 0)
P3onS2dircorrect: step ≥ 4 ∧ n_nv ≥ 3 ∧ P3onS2_h ≟ P3onS2 + (((vecmult * If[IsInRegion[P3onS2, dR1positive], 1, -1]) * dx), 0)
P4onS2dircorrect: step ≥ 4 ∧ n_nv ≥ 4 ∧ P4onS2_h ≟ P4onS2 + (((vecmult * If[IsInRegion[P4onS2, dR1positive], 1, -1]) * dx), 0)
S1text: If[flip1 ≟ 1, xlabel, ylabel] + "=" + (If[sigma1u ≟ Infinity, theta1u + "", "\frac{" + M1u + "}{1+ e^{-\left(\frac{" + xminustheta1 + "}{" + sigma1u + "}\right)}}"])
S2text: If[flip2 ≟ 1, xlabel, ylabel] + "=" + (If[sigma2u ≟ Infinity, theta2u + "", "\frac{" + M2u + "}{1+ e^{-\left(\frac{" + xminustheta2 + "}{" + sigma2u + "}\right)}}"])
show_correct = false
n_er = Length(equilibria)
nequilibriacorrect: step ≥ 2 ∧ n_e ≟ n_er
ER1type: 1
ER2type: 0
ER3type: 2
E2correcttype: step ≥ 2 ∧ n_e ≥ 2 ∧ E2type ≟ ER2type
E3correcttype: step ≥ 2 ∧ n_e ≥ 3 ∧ E3type ≟ ER3type
E1correcttype: step ≥ 2 ∧ n_e ≥ 1 ∧ E1type ≟ ER1type