From e3839a820af327728117bbc7f5219227575178cf Mon Sep 17 00:00:00 2001
From: Luke Naylor <l.naylor@sms.ed.ac.uk>
Date: Wed, 10 May 2023 18:23:19 +0100
Subject: [PATCH] Add plots with example of bounds on d for large r

---
 main.tex | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 103 insertions(+), 7 deletions(-)

diff --git a/main.tex b/main.tex
index df4844f..a2e6ffe 100644
--- a/main.tex
+++ b/main.tex
@@ -585,19 +585,115 @@ radius of the circular wall must be positive. As discussed in (TODO ref), this
 is equivalent to $\chern^{\beta}_2(E) > 0$, which yields:
 
 \begin{sagesilent}
-	positive_radius_condition = (
-		(
-			(0 > - u.twist(beta).ch[2])
-			+ d # rearrange for d
-		)
-		.subs(solve(q == u.twist(beta).ch[1], c)[0]) # express c in term of q
-		.expand()
+positive_radius_condition = (
+	(
+		(0 > - u.twist(beta).ch[2])
+		+ d # rearrange for d
 	)
+	.subs(solve(q == u.twist(beta).ch[1], c)[0]) # express c in term of q
+	.expand()
+)
 \end{sagesilent}
 
 \begin{equation*}
 	\sage{positive_radius_condition}
 \end{equation*}
+\begin{sagesilent}
+def beta_min(chern):
+  ts = stability.Tilt()
+  return min(
+    map(
+      lambda soln: soln.rhs(),
+      solve(
+        (ts.degree(chern))
+          .expand()
+          .subs(ts.alpha == 0),
+        beta
+      )
+    )
+  )
+
+v_example = Chern_Char(3,2,-2)
+q_example = 7/3
+
+def plot_d_bound(v_example, q_example, ymax=5, ymin=-2, xmax=20):
+
+  # Equations to plot imminently representing the bounds on d:
+  eq1 = (
+    bgmlv1_d_lowerbound
+    .subs(R == v_example.ch[0])
+    .subs(C == v_example.ch[1])
+    .subs(D == v_example.ch[2])
+    .subs(beta = beta_min(v_example))
+    .subs(q == q_example)
+  )
+
+  eq2 = (
+    bgmlv2_d_upperbound
+    .subs(R == v_example.ch[0])
+    .subs(C == v_example.ch[1])
+    .subs(D == v_example.ch[2])
+    .subs(beta = beta_min(v_example))
+    .subs(q == q_example)
+  )
+
+  eq3 = (
+    bgmlv3_d_upperbound
+    .subs(R == v_example.ch[0])
+    .subs(C == v_example.ch[1])
+    .subs(D == v_example.ch[2])
+    .subs(beta = beta_min(v_example))
+    .subs(q == q_example)
+  )
+
+  eq4 = (
+    positive_radius_condition.rhs()
+    .subs(q == q_example)
+    .subs(beta = beta_min(v_example))
+  )
+
+  example_bounds_on_d_plot = (
+    plot(
+      eq3,
+      (r,v_example.ch[0],xmax),
+      color='green',
+			linestyle = "dashed",
+      legend_label=r"upper bound: $\Delta(G) \geq 0$",
+			title=r"$q :=\mathrm{ch}_1^{\beta_{-}}(E)=" + latex(q_example) + r"$"
+    )
+    + plot(
+      eq2,
+      (r,0,xmax),
+      color='blue',
+			linestyle = "dashed",
+      legend_label=r"upper bound: $\Delta(E) \geq 0$"
+    )
+    + plot(
+      eq4,
+      (r,0,xmax),
+      color='orange',
+			linestyle = "dotted",
+      legend_label=r"lower bound: $\mathrm{ch}_2^{\beta_{-}}(E)>0$"
+    )
+    + plot(
+      eq1,
+      (r,v_example.ch[0]/2,xmax),
+      color='red',
+			linestyle = "dotted",
+      legend_label=r"lower bound: $\Delta(E) + \Delta(G) \leq \Delta(F)$"
+    )
+  )
+  example_bounds_on_d_plot.ymin(ymin)
+  example_bounds_on_d_plot.ymax(ymax)
+  example_bounds_on_d_plot.axes_labels(['$r$', '$d$'])
+  return example_bounds_on_d_plot
+
+\end{sagesilent}
+
+\sageplot{plot_d_bound(v_example, 0)}
+\sageplot{plot_d_bound(v_example, 2)}
+\sageplot{plot_d_bound(v_example, 4)}
+
 \egroup
 
 \section{Conclusion}
-- 
GitLab