diff --git a/MasterclassCode.ipynb b/MasterclassCode.ipynb index c0f575e..4b33096 100644 --- a/MasterclassCode.ipynb +++ b/MasterclassCode.ipynb @@ -1785,7 +1785,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "id": "0f97fbe7", "metadata": { "scrolled": true @@ -1826,7 +1826,7 @@ { "data": { "text/latex": [ - "$\\displaystyle Jacobian = \\frac{h_{\\theta}}{B_{pol}} = h_{\\theta} x$" + "$\\displaystyle Jacobian = \\frac{h_{\\theta}}{B_{pol}} = 0.0081 \\left(0.111111111111111 x + 1\\right)^{2}$" ], "text/plain": [ "" @@ -1838,7 +1838,7 @@ { "data": { "text/latex": [ - "$\\displaystyle Bpol = \\frac{1}{x}$" + "$\\displaystyle Bpol = \\frac{1}{0.01 x + 0.09}$" ], "text/plain": [ "" @@ -1850,7 +1850,7 @@ { "data": { "text/latex": [ - "$\\displaystyle Btor = \\frac{1}{R}$" + "$\\displaystyle Btor = \\frac{1}{- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1}$" ], "text/plain": [ "" @@ -1862,7 +1862,7 @@ { "data": { "text/latex": [ - "$\\displaystyle Bxy = \\sqrt{\\frac{1}{x^{2}} + \\frac{1}{R^{2}}}$" + "$\\displaystyle Bxy = 11.1111111111111 \\sqrt{\\frac{0.0081}{\\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}} + \\frac{1}{\\left(0.111111111111111 x + 1\\right)^{2}}}$" ], "text/plain": [ "" @@ -1874,7 +1874,7 @@ { "data": { "text/latex": [ - "$\\displaystyle gxx = \\frac{R^{2}}{x^{2}}$" + "$\\displaystyle gxx = \\frac{123.456790123457 \\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}}{\\left(0.111111111111111 x + 1\\right)^{2}}$" ], "text/plain": [ "" @@ -1886,7 +1886,7 @@ { "data": { "text/latex": [ - "$\\displaystyle gzz = \\frac{I^{2} R^{2}}{x^{2}} + \\frac{x^{2} \\left(\\frac{1}{x^{2}} + \\frac{1}{R^{2}}\\right)}{R^{2}}$" + "$\\displaystyle gzz = \\frac{123.456790123457 I^{2} \\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}}{\\left(0.111111111111111 x + 1\\right)^{2}} + \\frac{0.0081 \\left(0.111111111111111 x + 1\\right)^{2} \\left(\\frac{1.0}{\\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}} + \\frac{123.456790123457}{\\left(0.111111111111111 x + 1\\right)^{2}}\\right)}{\\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}}$" ], "text/plain": [ "" @@ -1924,7 +1924,7 @@ { "data": { "text/latex": [ - "$\\displaystyle b = z^{2} + 2 \\left(\\frac{I^{2} R^{2}}{x^{2}} + \\frac{x^{2} \\left(\\frac{1}{x^{2}} + \\frac{1}{R^{2}}\\right)}{R^{2}}\\right) \\left(x + y + \\sin{\\left(2 \\pi z \\right)}\\right)$" + "$\\displaystyle b = z^{2} + 2.0 \\left(\\frac{123.456790123457 I^{2} \\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}}{\\left(0.111111111111111 x + 1\\right)^{2}} + \\frac{0.0081 \\left(0.111111111111111 x + 1\\right)^{2} \\left(\\frac{1.0}{\\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}} + \\frac{123.456790123457}{\\left(0.111111111111111 x + 1\\right)^{2}}\\right)}{\\left(- \\left(0.01 x + 0.09\\right) \\cos{\\left(y \\right)} + 1\\right)^{2}}\\right) \\left(x + y + \\sin{\\left(2 \\pi z \\right)}\\right)$" ], "text/plain": [ "" @@ -1938,7 +1938,7 @@ "output_type": "stream", "text": [ "result that is copiable to c++ NOTE: change ** to pow(a,b) to avoid errors in c++\n", - "z**2 + 2*(I**2*R**2/x**2 + x**2*(x**(-2) + R**(-2))/R**2)*(x + y + sin(2*pi*z))\n", + "z**2 + 2.0*(123.456790123457*I**2*(-(0.01*x + 0.09)*cos(y) + 1)**2/(0.111111111111111*x + 1)**2 + 0.0081*(0.111111111111111*x + 1)**2*(1.0/(-(0.01*x + 0.09)*cos(y) + 1)**2 + 123.456790123457/(0.111111111111111*x + 1)**2)/(-(0.01*x + 0.09)*cos(y) + 1)**2)*(x + y + sin(2*pi*z))\n", "\n" ] } @@ -1963,11 +1963,16 @@ "#write Jacobian, metric tensors and functions for B and R\n", "#start with B functions as then, when the Jacobian and metric tensors are applied, the functions are subbed in.\n", "\n", - "Bpol = 1/x\n", - "Btor = 1/R\n", + "eps =.1\n", + "r = eps*(0.9 +0.1*x)\n", + "theta = y-pi\n", + "Rxy = 1 + r*cos(theta)\n", + "h=r\n", + "Bpol = 1/r\n", + "Btor = 1/Rxy\n", "Bxy = sqrt(Bpol**2 + Btor**2)\n", "JClebsch = h/Bpol\n", - "clebschMetricTensor = [(R*Bpol)**2, 1/(h)**2,I**2*(R*Bpol)**2+Bxy**2/(R*Bpol)**2]\n", + "clebschMetricTensor = [(Rxy*Bpol)**2, 1/(h)**2,I**2*(Rxy*Bpol)**2+Bxy**2/(Rxy*Bpol)**2]\n", "\n", "A = x+y+sin(2*pi*z)\n", "D = 1\n",