From 02a451b905ee9f30699aa38a1077d91600f450bd Mon Sep 17 00:00:00 2001
From: Lars Hubatsch <hubatsch@pks.mpg.de>
Date: Tue, 15 Sep 2020 18:41:27 +0200
Subject: [PATCH] Profiles amended. Bleaching close to zero instead of middle.
 Phi_tot accordingly.

---
 FloryHugg_DiffUnbleached.ipynb | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/FloryHugg_DiffUnbleached.ipynb b/FloryHugg_DiffUnbleached.ipynb
index 26a4836..f988466 100644
--- a/FloryHugg_DiffUnbleached.ipynb
+++ b/FloryHugg_DiffUnbleached.ipynb
@@ -60,26 +60,28 @@
     "# c0.interpolate(df.Expression(('(x[0]<0.5) && sqrt((x[0])*(x[0])+(x[1])*(x[1])+(x[2])*(x[2]))<0.2 ? 0 :'\n",
     "#                               '0.4*tanh(-350*(sqrt((x[0])*(x[0])+(x[1])*(x[1])+(x[2])*(x[2]))-0.2)) + 0.5'),\n",
     "#                              degree=1))\n",
-    "# 1D, high partitioning\n",
     "\n",
+    "\n",
+    "# 1D, no partitioning\n",
     "c0_1 = df.Function(F)\n",
     "c_tot_1 = df.Function(F)\n",
     "Ga0_1 = df.Function(F)\n",
-    "c_tot_1.interpolate(df.Expression('0.4*tanh(-350000*(sqrt((x[0]-0.5)*(x[0]-0.5))-0.001))+0.5', degree=1))\n",
-    "c0_1.interpolate(df.Expression(('sqrt((x[0]-0.5)*(x[0]-0.5))<0.001 ? 0 :'\n",
-    "                              '0.4*tanh(-350000*(sqrt((x[0]-0.5)*(x[0]-0.5))-0.001)) +0.5'),\n",
+    "c_tot_1.interpolate(df.Expression('0*tanh(35000*(x[0]-0.01))+0.9', degree=1))\n",
+    "c0_1.interpolate(df.Expression(('x[0]<0.01 ? 0 :'\n",
+    "                              '0*tanh(35000*(x[0]-0.01))+0.9'),\n",
     "                             degree=1))\n",
-    "Ga0_1.interpolate(df.Expression('0*(tanh(-350000*(sqrt((x[0]-0.5)*(x[0]-0.5))-0.001))+1)+1', degree=1))\n",
+    "Ga0_1.interpolate(df.Expression('4.*(tanh(35000*(x[0]-0.01))+1)+1', degree=1))\n",
     "\n",
-    "# 1D, no partitioning\n",
+    "# 1D, high partitioning\n",
     "c0_9 = df.Function(F)\n",
     "c_tot_9 = df.Function(F)\n",
     "Ga0_9 = df.Function(F)\n",
-    "c_tot_9.interpolate(df.Expression('0*tanh(-350000*(sqrt((x[0]-0.5)*(x[0]-0.5))-0.001))+0.9', degree=1))\n",
-    "c0_9.interpolate(df.Expression(('sqrt((x[0]-0.5)*(x[0]-0.5))<0.001 ? 0 :'\n",
-    "                              '0*tanh(-350000*(sqrt((x[0]-0.5)*(x[0]-0.5))-0.001)) +0.9'),\n",
+    "c_tot_9.interpolate(df.Expression('0.4*tanh(-35000*(x[0]-0.01))+0.5', degree=1))\n",
+    "c0_9.interpolate(df.Expression(('x[0]<0.01 ? 0 :'\n",
+    "                              '0.4*tanh(-35000*(x[0]-0.01))+0.5'),\n",
     "                             degree=1))\n",
-    "Ga0_9.interpolate(df.Expression('4.*(tanh(350000*(sqrt((x[0]-0.5)*(x[0]-0.5))-0.001))+1)+1', degree=1))\n",
+    "Ga0_9.interpolate(df.Expression('0*(tanh(-35000*(x[0]-0.01))+1)+1', degree=1))\n",
+    "\n",
     "\n",
     "c0_1 = calc_sim(c0_1, c_tot_1, Ga0_1)\n",
     "c0_9 = calc_sim(c0_9, c_tot_9, Ga0_9)"
@@ -94,7 +96,7 @@
     "# 1D:\n",
     "plt.plot(np.linspace(0, 1, 10000), [c0_1([x]) for x in np.linspace(0, 1, 10000)])\n",
     "plt.plot(np.linspace(0, 1, 10000), [c0_9([x]) for x in np.linspace(0, 1, 10000)])\n",
-    "plt.xlim(0.495, 0.505)\n",
+    "plt.xlim(0, 0.1)\n",
     "# plt.ylim(0, 0.3)\n",
     "# 3D:\n",
     "# plt.plot(np.linspace(0, 0.5, 1000), [c0([x, 0, 0]) for x in np.linspace(0, 0.5, 1000)])"
@@ -107,8 +109,8 @@
    "outputs": [],
    "source": [
     "# 1D:\n",
-    "plt.plot(np.linspace(0, 1, 10000), [c0([x]) for x in np.linspace(0, 1, 10000)])\n",
-    "plt.xlim(0.495, 0.505)\n",
+    "plt.plot(np.linspace(0, 1, 10000), [c0_9([x]) for x in np.linspace(0, 1, 10000)])\n",
+    "plt.xlim(0, 0.1)\n",
     "plt.ylim(0., 0.3)"
    ]
   },
@@ -118,7 +120,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "plt.plot(np.linspace(0, 1, 2000), [Ga0([x]) for x in np.linspace(0, 1, 2000)])"
+    "plt.plot(np.linspace(0, 1, 2000), [Ga0_1([x]) for x in np.linspace(0, 1, 2000)])\n",
+    "plt.xlim(0, 0.1)"
    ]
   },
   {
@@ -127,7 +130,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "plt.plot(np.linspace(0, 1, 1000), [c_tot([x]) for x in np.linspace(0, 1, 1000)])"
+    "plt.plot(np.linspace(0, 1, 1000), [c_tot_9([x]) for x in np.linspace(0, 1, 1000)])"
    ]
   },
   {
-- 
GitLab