{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sympy as sp\n",
"\n",
"# 定义变量\n",
"x1, y1, x2, y2, x3, y3 = sp.symbols(\"x1 y1 x2 y2 x3 y3\", real=True)\n",
"k = sp.symbols(\"k\") # 劲度系数\n",
"restlen = sp.symbols(\"restlen\") # 劲度系数\n",
"\n",
"# 计算弹簧的长度\n",
"length1 = sp.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) # 点1和点2之间的弹簧\n",
"length2 = sp.sqrt((x3 - x2) ** 2 + (y3 - y2) ** 2) # 点2和点3之间的弹簧\n",
"length3 = sp.sqrt((x3 - x1) ** 2 + (y3 - y1) ** 2) # 点1和点3之间的弹簧\n",
"\n",
"# 计算势能(三个弹簧的势能之和)\n",
"e = (\n",
" 0.5\n",
" * k\n",
" * ((length1 - restlen) ** 2 + (length2 - restlen) ** 2 + (length3 - restlen) ** 2)\n",
")\n",
"\n",
"\n",
"var = sp.Matrix([x1, y1, x2, y2, x3, y3])\n",
"# 计算梯度\n",
"gradient = sp.diff(e, var)\n",
"\n",
"# 计算 Hessian 矩阵\n",
"hessian = sp.hessian(e, var)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sympy as sp\n",
"from symars import DType, GenScalar, GenNalgebra\n",
"from symars.scalar_cached import GenScalarCached\n",
"\n",
"\n",
"gen = GenScalar(DType.F64)\n",
"ecode = gen.generate(f\"spring3_energy\", e)\n",
"print(ecode)\n",
"\n",
"gen = GenNalgebra(DType.F64)\n",
"gcode = gen.generate(f\"spring3_grad\", mat=gradient)\n",
"print(gcode)\n",
"\n",
"\n",
"gen = GenNalgebra(DType.F64)\n",
"gcode = gen.generate(f\"spring3_hess\", mat=hessian)\n",
"print(gcode)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"4"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sympy as sp\n",
"\n",
"# 定义变量\n",
"x1, y1, x2, y2, x3, y3, x4, y4 = sp.symbols(\"x1 y1 x2 y2 x3 y3 x4 y4\", real=True)\n",
"k = sp.symbols(\"k\") # 劲度系数\n",
"restlen = sp.symbols(\"restlen\") # 劲度系数\n",
"\n",
"# 计算弹簧的长度\n",
"length1 = sp.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) # 点1和点2之间的弹簧\n",
"length2 = sp.sqrt((x3 - x2) ** 2 + (y3 - y2) ** 2) # 点2和点3之间的弹簧\n",
"length3 = sp.sqrt((x4 - x3) ** 2 + (y4 - y3) ** 2) # 点1和点3之间的弹簧\n",
"length4 = sp.sqrt((x4 - x1) ** 2 + (y4 - y1) ** 2) # 点1和点3之间的弹簧\n",
"\n",
"# 计算势能(三个弹簧的势能之和)\n",
"e = (\n",
" 0.5\n",
" * k\n",
" * (\n",
" (length1 - restlen) ** 2\n",
" + (length2 - restlen) ** 2\n",
" + (length3 - restlen) ** 2\n",
" + (length4 - restlen) ** 2\n",
" )\n",
")\n",
"\n",
"\n",
"var = sp.Matrix([x1, y1, x2, y2, x3, y3, x4, y4])\n",
"# 计算梯度\n",
"gradient = sp.diff(e, var)\n",
"\n",
"# 计算 Hessian 矩阵\n",
"hessian = sp.hessian(e, var)\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"/*\n",
"\n",
"* Code generated by Symars. Thank you for using Symars!\n",
" Symars is licensed under MIT licnese.\n",
" Repository: https://github.com/Da1sypetals/Symars\n",
"\n",
"* Computation code is not intended for manual editing.\n",
"\n",
"* If you find an error,\n",
" or if you believe Symars generates incorrect result, \n",
" please raise an issue under our repo with minimal reproducible example.\n",
"\n",
"*/\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_energy(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * ((((((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))).powi(2)) + ((((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))).powi(2)) + ((((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))).powi(2)) + ((((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))).powi(2)))))\n",
"\n",
"}\n",
"\n",
"\n",
"/*\n",
"\n",
"* Code generated by Symars. Thank you for using Symars!\n",
" Symars is licensed under MIT licnese.\n",
" Repository: https://github.com/Da1sypetals/Symars\n",
"\n",
"* Computation code is not intended for manual editing.\n",
"\n",
"* If you find an error,\n",
" or if you believe Symars generates incorrect result, \n",
" please raise an issue under our repo with minimal reproducible example.\n",
"\n",
"*/\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_0_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_1_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_2_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x2) + ((-(x1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_3_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y2) + ((-(y1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_4_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x3) + ((-(x2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_5_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y3) + ((-(y2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_6_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x4) + ((-(x1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((x4) + ((-(x3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_grad_7_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y4) + ((-(y1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((y4) + ((-(y3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"pub fn spring4_grad(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> nalgebra::SMatrix<f64, 8, 1> {\n",
" let mut result = nalgebra::SMatrix::zeros();\n",
"\n",
" \n",
"result[(0, 0)] = spring4_grad_0_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 0)] = spring4_grad_1_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 0)] = spring4_grad_2_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 0)] = spring4_grad_3_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 0)] = spring4_grad_4_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 0)] = spring4_grad_5_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 0)] = spring4_grad_6_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 0)] = spring4_grad_7_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
" result\n",
"}\n",
"\n",
"\n",
"/*\n",
"\n",
"* Code generated by Symars. Thank you for using Symars!\n",
" Symars is licensed under MIT licnese.\n",
" Repository: https://github.com/Da1sypetals/Symars\n",
"\n",
"* Computation code is not intended for manual editing.\n",
"\n",
"* If you find an error,\n",
" or if you believe Symars generates incorrect result, \n",
" please raise an issue under our repo with minimal reproducible example.\n",
"\n",
"*/\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_0_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((x1) + ((-(x2))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((x1) + ((-(x4))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((x2) + ((-(x1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((x4) + ((-(x1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_0_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x2))))) * (((y1) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x4))))) * (((y1) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((y2) + ((-(y1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((y4) + ((-(y1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_0_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x1) + ((-(x2))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x2))))) * (((x2) + ((-(x1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_0_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x2))))) * (((y2) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_0_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_0_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_0_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x1) + ((-(x4))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x4))))) * (((x4) + ((-(x1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_0_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x4))))) * (((y4) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_1_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x2))))) * (((y1) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x4))))) * (((y1) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((y2) + ((-(y1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((y4) + ((-(y1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_1_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((y1) + ((-(y2))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((y1) + ((-(y4))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y1) + ((-(y2))))) * (((y2) + ((-(y1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y1) + ((-(y4))))) * (((y4) + ((-(y1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_1_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x2) + ((-(x1))))) * (((y1) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_1_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y1) + ((-(y2))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((y1) + ((-(y2))))) * (((y2) + ((-(y1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_1_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_1_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_1_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x4) + ((-(x1))))) * (((y1) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_1_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y1) + ((-(y4))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((y1) + ((-(y4))))) * (((y4) + ((-(y1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_2_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x1) + ((-(x2))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x2))))) * (((x2) + ((-(x1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_2_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x2) + ((-(x1))))) * (((y1) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_2_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((x2) + ((-(x1))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((x2) + ((-(x3))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((x2) + ((-(x1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((x3) + ((-(x2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_2_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x2) + ((-(x1))))) * (((y2) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x2) + ((-(x3))))) * (((y2) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x1))))) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((y3) + ((-(y2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_2_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x2) + ((-(x3))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x2) + ((-(x3))))) * (((x3) + ((-(x2))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_2_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x2) + ((-(x3))))) * (((y3) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_2_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_2_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_3_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x2))))) * (((y2) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x2))))) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_3_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y1) + ((-(y2))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((y1) + ((-(y2))))) * (((y2) + ((-(y1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_3_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()) * (((x2) + ((-(x1))))) * (((y2) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x2) + ((-(x3))))) * (((y2) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x1))))) * (((y1) + ((-(y2))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((y3) + ((-(y2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_3_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((y2) + ((-(y1))))).powi(2)) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((y2) + ((-(y3))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y1) + ((-(y2))))) * (((y2) + ((-(y1))))) * (((((((((x2) + ((-(x1))))).powi(2)) + ((((y2) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y2) + ((-(y3))))) * (((y3) + ((-(y2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_3_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x3) + ((-(x2))))) * (((y2) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_3_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y2) + ((-(y3))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((y2) + ((-(y3))))) * (((y3) + ((-(y2))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_3_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_3_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_4_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_4_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_4_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x2) + ((-(x3))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x2) + ((-(x3))))) * (((x3) + ((-(x2))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_4_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x3) + ((-(x2))))) * (((y2) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_4_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((x3) + ((-(x2))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((x3) + ((-(x4))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((x3) + ((-(x2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((x4) + ((-(x3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_4_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x3) + ((-(x2))))) * (((y3) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x3) + ((-(x4))))) * (((y3) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x2))))) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((y4) + ((-(y3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_4_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x3) + ((-(x4))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x3) + ((-(x4))))) * (((x4) + ((-(x3))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_4_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x3) + ((-(x4))))) * (((y4) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_5_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_5_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_5_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x2) + ((-(x3))))) * (((y3) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x2) + ((-(x3))))) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_5_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y2) + ((-(y3))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((y2) + ((-(y3))))) * (((y3) + ((-(y2))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_5_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()) * (((x3) + ((-(x2))))) * (((y3) + ((-(y2))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x3) + ((-(x4))))) * (((y3) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x2))))) * (((y2) + ((-(y3))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((y4) + ((-(y3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_5_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((y3) + ((-(y2))))).powi(2)) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((y3) + ((-(y4))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y2) + ((-(y3))))) * (((y3) + ((-(y2))))) * (((((((((x3) + ((-(x2))))).powi(2)) + ((((y3) + ((-(y2))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y3) + ((-(y4))))) * (((y4) + ((-(y3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_5_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x4) + ((-(x3))))) * (((y3) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_5_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y3) + ((-(y4))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((y3) + ((-(y4))))) * (((y4) + ((-(y3))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_6_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x1) + ((-(x4))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x4))))) * (((x4) + ((-(x1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_6_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x4) + ((-(x1))))) * (((y1) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_6_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_6_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_6_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((x3) + ((-(x4))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x3) + ((-(x4))))) * (((x4) + ((-(x3))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_6_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x4) + ((-(x3))))) * (((y3) + ((-(y4))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_6_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((x4) + ((-(x1))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((x4) + ((-(x3))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((x4) + ((-(x1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((x4) + ((-(x3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_6_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x4) + ((-(x1))))) * (((y4) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x4) + ((-(x3))))) * (((y4) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x4) + ((-(x1))))) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x4) + ((-(x3))))) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_7_0(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x1) + ((-(x4))))) * (((y4) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x1) + ((-(x4))))) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_7_1(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y1) + ((-(y4))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((y1) + ((-(y4))))) * (((y4) + ((-(y1))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_7_2(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub const fn spring4_hess_7_3(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" 0_f64\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_7_4(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x3) + ((-(x4))))) * (((y4) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x3) + ((-(x4))))) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_7_5(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((-2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * ((((y3) + ((-(y4))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((y3) + ((-(y4))))) * (((y4) + ((-(y3))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_7_6(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()) * (((x4) + ((-(x1))))) * (((y4) + ((-(y1))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()) * (((x4) + ((-(x3))))) * (((y4) + ((-(y3))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x4) + ((-(x1))))) * (((y1) + ((-(y4))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((x4) + ((-(x3))))) * (((y3) + ((-(y4))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"\n",
"\n",
"#[inline]\n",
"pub fn spring4_hess_7_7(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> f64 {\n",
"\n",
" ((0.500000000000000_f64) * (k) * (((((2.0000000000000000000_f64) * ((((y4) + ((-(y1))))).powi(2)) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * ((((y4) + ((-(y3))))).powi(2)) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).recip()))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-0.50000000000000000000_f64)) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y1) + ((-(y4))))) * (((y4) + ((-(y1))))) * (((((((((x4) + ((-(x1))))).powi(2)) + ((((y4) + ((-(y1))))).powi(2)))).sqrt()) + ((-(restlen))))))) + (((2.0000000000000000000_f64) * (((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).powf(-1.5000000000000000000_f64)) * (((y3) + ((-(y4))))) * (((y4) + ((-(y3))))) * (((((((((x4) + ((-(x3))))).powi(2)) + ((((y4) + ((-(y3))))).powi(2)))).sqrt()) + ((-(restlen))))))))))\n",
"\n",
"}\n",
"\n",
"\n",
"pub fn spring4_hess(k: f64, restlen: f64, x1: f64, x2: f64, x3: f64, x4: f64, y1: f64, y2: f64, y3: f64, y4: f64) -> nalgebra::SMatrix<f64, 8, 8> {\n",
" let mut result = nalgebra::SMatrix::zeros();\n",
"\n",
" \n",
"result[(0, 0)] = spring4_hess_0_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 1)] = spring4_hess_0_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 2)] = spring4_hess_0_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 3)] = spring4_hess_0_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 4)] = spring4_hess_0_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 5)] = spring4_hess_0_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 6)] = spring4_hess_0_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(0, 7)] = spring4_hess_0_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 0)] = spring4_hess_1_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 1)] = spring4_hess_1_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 2)] = spring4_hess_1_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 3)] = spring4_hess_1_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 4)] = spring4_hess_1_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 5)] = spring4_hess_1_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 6)] = spring4_hess_1_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(1, 7)] = spring4_hess_1_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 0)] = spring4_hess_2_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 1)] = spring4_hess_2_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 2)] = spring4_hess_2_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 3)] = spring4_hess_2_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 4)] = spring4_hess_2_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 5)] = spring4_hess_2_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 6)] = spring4_hess_2_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(2, 7)] = spring4_hess_2_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 0)] = spring4_hess_3_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 1)] = spring4_hess_3_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 2)] = spring4_hess_3_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 3)] = spring4_hess_3_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 4)] = spring4_hess_3_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 5)] = spring4_hess_3_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 6)] = spring4_hess_3_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(3, 7)] = spring4_hess_3_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 0)] = spring4_hess_4_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 1)] = spring4_hess_4_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 2)] = spring4_hess_4_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 3)] = spring4_hess_4_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 4)] = spring4_hess_4_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 5)] = spring4_hess_4_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 6)] = spring4_hess_4_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(4, 7)] = spring4_hess_4_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 0)] = spring4_hess_5_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 1)] = spring4_hess_5_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 2)] = spring4_hess_5_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 3)] = spring4_hess_5_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 4)] = spring4_hess_5_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 5)] = spring4_hess_5_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 6)] = spring4_hess_5_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(5, 7)] = spring4_hess_5_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 0)] = spring4_hess_6_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 1)] = spring4_hess_6_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 2)] = spring4_hess_6_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 3)] = spring4_hess_6_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 4)] = spring4_hess_6_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 5)] = spring4_hess_6_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 6)] = spring4_hess_6_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(6, 7)] = spring4_hess_6_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 0)] = spring4_hess_7_0(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 1)] = spring4_hess_7_1(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 2)] = spring4_hess_7_2(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 3)] = spring4_hess_7_3(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 4)] = spring4_hess_7_4(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 5)] = spring4_hess_7_5(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 6)] = spring4_hess_7_6(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
"result[(7, 7)] = spring4_hess_7_7(k, restlen, x1, x2, x3, x4, y1, y2, y3, y4);\n",
"\n",
"\n",
" result\n",
"}\n",
"\n"
]
}
],
"source": [
"import sympy as sp\n",
"from symars import DType, GenScalar, GenNalgebra\n",
"from symars.scalar_cached import GenScalarCached\n",
"\n",
"\n",
"gen = GenScalar(DType.F64)\n",
"ecode = gen.generate(f\"spring4_energy\", e)\n",
"print(ecode)\n",
"\n",
"gen = GenNalgebra(DType.F64)\n",
"gcode = gen.generate(f\"spring4_grad\", mat=gradient)\n",
"print(gcode)\n",
"\n",
"\n",
"gen = GenNalgebra(DType.F64)\n",
"gcode = gen.generate(f\"spring4_hess\", mat=hessian)\n",
"print(gcode)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "playground",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}