nochmal
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2026-02-07T16:59:00.652440Z",
|
"end_time": "2026-02-07T20:59:57.191051Z",
|
||||||
"start_time": "2026-02-07T16:59:00.121091Z"
|
"start_time": "2026-02-07T20:59:56.829377Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@@ -14,13 +14,13 @@
|
|||||||
],
|
],
|
||||||
"id": "89aa93e9dbedd113",
|
"id": "89aa93e9dbedd113",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"execution_count": 1
|
"execution_count": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2026-02-07T16:59:02.990888Z",
|
"end_time": "2026-02-07T20:59:59.176074Z",
|
||||||
"start_time": "2026-02-07T16:59:00.668752Z"
|
"start_time": "2026-02-07T20:59:57.791116Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@@ -56,13 +56,13 @@
|
|||||||
],
|
],
|
||||||
"id": "2005e5a8854eea1e",
|
"id": "2005e5a8854eea1e",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"execution_count": 2
|
"execution_count": 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2026-02-07T16:59:03.608664Z",
|
"end_time": "2026-02-07T21:00:00.433740Z",
|
||||||
"start_time": "2026-02-07T16:59:03.014887Z"
|
"start_time": "2026-02-07T21:00:00.217286Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
],
|
],
|
||||||
"id": "90f107a11ff0de7e",
|
"id": "90f107a11ff0de7e",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"execution_count": 3
|
"execution_count": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
@@ -88,13 +88,13 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# dsPart = [60, 125, 600, 1250, 6000, 60000] entspricht bei der Erde ca. 100km, 50km, 10km, 5km, 1km, 100m\n",
|
"# dsPart = [60, 125, 600, 1250, 6000, 60000] entspricht bei der Erde ca. 100km, 50km, 10km, 5km, 1km, 100m\n",
|
||||||
"\n",
|
"\n",
|
||||||
"steps_gha1_num = [20, 50, 100, 200, 500, 1000, 5000]\n",
|
"steps_gha1_num = [200, 500, 1000, 5000, 10000]\n",
|
||||||
"maxM_gha1_ana = [20, 50]\n",
|
"maxM_gha1_ana = [20, 50, 80]\n",
|
||||||
"parts_gha1_ana = [2, 8]\n",
|
"parts_gha1_ana = [2, 8, 32]\n",
|
||||||
"dsPart_gha1_ES = [60, 600, 1250]\n",
|
"dsPart_gha1_ES = [60, 600, 1250]\n",
|
||||||
"dsPart_gha1_approx = [600, 1250, 6000]\n",
|
"dsPart_gha1_approx = [600, 1250, 6000]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"steps_gha2_num = [200, 500, 1000]\n",
|
"steps_gha2_num = [200, 500, 1000, 5000, 10000]\n",
|
||||||
"dsPart_gha2_ES = [60, 600, 1250]\n",
|
"dsPart_gha2_ES = [60, 600, 1250]\n",
|
||||||
"dsPart_gha2_approx = [600, 1250, 6000]"
|
"dsPart_gha2_approx = [600, 1250, 6000]"
|
||||||
],
|
],
|
||||||
@@ -105,224 +105,206 @@
|
|||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2026-02-07T17:00:45.868912Z",
|
"end_time": "2026-02-07T21:00:07.365335Z",
|
||||||
"start_time": "2026-02-07T17:00:44.713991Z"
|
"start_time": "2026-02-07T21:00:07.174675Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"source": [
|
"source": [
|
||||||
"# test = \"Karney\"\n",
|
"test = \"Karney\"\n",
|
||||||
"# test = \"Panou\"\n",
|
"# test = \"Panou\"\n",
|
||||||
"test = \"Random\"\n",
|
"# test = \"Random\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"if test == \"Karney\":\n",
|
"def build_examples(test):\n",
|
||||||
" ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"KarneyTest2024\")\n",
|
" if test == \"Karney\":\n",
|
||||||
" examples = get_examples_karney(4, seed=42)\n",
|
" ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"KarneyTest2024\")\n",
|
||||||
"elif test == \"Panou\":\n",
|
" examples = get_examples_karney(4, seed=42)\n",
|
||||||
" ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"BursaSima1980round\")\n",
|
" elif test == \"Panou\":\n",
|
||||||
" tables = get_tables_panou()\n",
|
" ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"BursaSima1980round\")\n",
|
||||||
" table_indices = []\n",
|
" tables = get_tables_panou()\n",
|
||||||
" examples = []\n",
|
" table_indices = []\n",
|
||||||
" for i, table in enumerate(tables):\n",
|
" examples = []\n",
|
||||||
" for example in table:\n",
|
" for i, table in enumerate(tables):\n",
|
||||||
" table_indices.append(i+1)\n",
|
" for example in table:\n",
|
||||||
" examples.append(example)\n",
|
" table_indices.append(i+1)\n",
|
||||||
"elif test == \"Random\":\n",
|
" examples.append(example)\n",
|
||||||
" ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"BursaSima1980round\")\n",
|
" elif test == \"Random\":\n",
|
||||||
" examples = []\n",
|
" ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"BursaSima1980round\")\n",
|
||||||
" random.seed(42)\n",
|
" examples = []\n",
|
||||||
" for _ in range(50):\n",
|
" random.seed(42)\n",
|
||||||
" beta0 = wu.deg2rad(random.randint(-90, 90))\n",
|
" for _ in range(50):\n",
|
||||||
" lamb0 = wu.deg2rad(random.randint(-179, 180))\n",
|
" beta0 = wu.deg2rad(random.randint(-90, 90))\n",
|
||||||
" alpha0_ell = wu.deg2rad(random.randint(0, 359))\n",
|
" lamb0 = wu.deg2rad(random.randint(-179, 180))\n",
|
||||||
" s = random.randint(10000, int(np.pi*ell.b))\n",
|
" alpha0_ell = wu.deg2rad(random.randint(0, 359))\n",
|
||||||
" examples.append([beta0, lamb0, alpha0_ell, s])\n",
|
" s = random.randint(10000, int(np.pi*ell.b))\n",
|
||||||
" pass"
|
" examples.append([beta0, lamb0, alpha0_ell, s])\n",
|
||||||
|
" pass\n",
|
||||||
|
" return examples\n",
|
||||||
|
"examples = build_examples(test)"
|
||||||
],
|
],
|
||||||
"id": "6770dbd57d475127",
|
"id": "6770dbd57d475127",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"execution_count": 9
|
"execution_count": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"ExecuteTime": {
|
|
||||||
"end_time": "2026-02-07T17:02:10.182032Z",
|
|
||||||
"start_time": "2026-02-07T17:01:58.900380Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"source": [
|
"source": [
|
||||||
"results = {}\n",
|
"def execute_results(test, examples):\n",
|
||||||
"for i, example in enumerate(examples):\n",
|
" results = {}\n",
|
||||||
" print(f\"----- Beispiel {i+1}/{len(examples)}\")\n",
|
" for i, example in enumerate(examples):\n",
|
||||||
" example_results = {}\n",
|
" print(f\"----- Beispiel {i+1}/{len(examples)}\")\n",
|
||||||
|
" example_results = {}\n",
|
||||||
"\n",
|
"\n",
|
||||||
" if test != \"Random\":\n",
|
" if test != \"Random\":\n",
|
||||||
" beta0, lamb0, alpha0_ell, beta1, lamb1, alpha1_ell, s = example\n",
|
" beta0, lamb0, alpha0_ell, beta1, lamb1, alpha1_ell, s = example\n",
|
||||||
" P0 = ell.ell2cart(beta0, lamb0)\n",
|
" P0 = ell.ell2cart(beta0, lamb0)\n",
|
||||||
" P1 = ell.ell2cart(beta1, lamb1)\n",
|
" P1 = ell.ell2cart(beta1, lamb1)\n",
|
||||||
" _, _, alpha0_para = alpha_ell2para(ell, beta0, lamb0, alpha0_ell)\n",
|
" _, _, alpha0_para = alpha_ell2para(ell, beta0, lamb0, alpha0_ell)\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" beta0, lamb0, alpha0_ell, s = example\n",
|
" beta0, lamb0, alpha0_ell, s = example\n",
|
||||||
" P0 = ell.ell2cart(beta0, lamb0)\n",
|
" P0 = ell.ell2cart(beta0, lamb0)\n",
|
||||||
" _, _, alpha0_para = alpha_ell2para(ell, beta0, lamb0, alpha0_ell)\n",
|
" _, _, alpha0_para = alpha_ell2para(ell, beta0, lamb0, alpha0_ell)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # try:\n",
|
" # try:\n",
|
||||||
" # P1, alpha1_para = gha1_ana(ell, P0, alpha0_para, s, maxM=80, maxPartCircum=8)\n",
|
" # P1, alpha1_para = gha1_ana(ell, P0, alpha0_para, s, maxM=80, maxPartCircum=8)\n",
|
||||||
" # beta1, lamb1 = ell.cart2ell(P1)\n",
|
" # beta1, lamb1 = ell.cart2ell(P1)\n",
|
||||||
" # u1, v1 = ell.cart2para(P1)\n",
|
" # u1, v1 = ell.cart2para(P1)\n",
|
||||||
" # _, _, alpha1_ell = alpha_para2ell(ell, u1, v1, alpha1_para)\n",
|
" # _, _, alpha1_ell = alpha_para2ell(ell, u1, v1, alpha1_para)\n",
|
||||||
" # except Exception as e:\n",
|
" # except Exception as e:\n",
|
||||||
" # print(\"Referenz-Berechnung analytisch fehlgeschlagen: \", e)\n",
|
" # print(\"Referenz-Berechnung analytisch fehlgeschlagen: \", e)\n",
|
||||||
" # continue\n",
|
" # continue\n",
|
||||||
"\n",
|
"\n",
|
||||||
" try:\n",
|
" try:\n",
|
||||||
" P1, alpha1_ell = gha1_num(ell, P0, alpha0_ell, s, num=10000)\n",
|
" P1, alpha1_ell = gha1_num(ell, P0, alpha0_ell, s, num=10000)\n",
|
||||||
" beta1, lamb1 = ell.cart2ell(P1)\n",
|
" beta1, lamb1 = ell.cart2ell(P1)\n",
|
||||||
" except Exception as e:\n",
|
" except Exception as e:\n",
|
||||||
" print(\"Referenz-Berechnung numerisch fehlgeschlagen: \", e)\n",
|
" print(\"Referenz-Berechnung numerisch fehlgeschlagen: \", e)\n",
|
||||||
" continue\n",
|
" continue\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for steps in steps_gha1_num:\n",
|
" for steps in steps_gha1_num:\n",
|
||||||
" start = time.perf_counter()\n",
|
|
||||||
" try:\n",
|
|
||||||
" P1_num, alpha1_num_1 = gha1_num(ell, P0, alpha0_ell, s, num=steps)\n",
|
|
||||||
" print(f\"GHA1_num_{steps}\", P1_num)\n",
|
|
||||||
" end = time.perf_counter()\n",
|
|
||||||
" beta1_num, lamb1_num = ell.cart2ell(P1_num)\n",
|
|
||||||
" d_beta1 = abs(beta1_num - beta1)\n",
|
|
||||||
" d_lamb1 = abs(lamb1_num - lamb1)\n",
|
|
||||||
" d_alpha1 = abs(alpha1_num_1 - alpha1_ell)\n",
|
|
||||||
" d_time = end - start\n",
|
|
||||||
" example_results[f\"GHA1_num_{steps}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
|
||||||
" except Exception as e:\n",
|
|
||||||
" print(e)\n",
|
|
||||||
" example_results[f\"GHA1_num_{steps}\"] = (nan, nan, nan, nan)\n",
|
|
||||||
"\n",
|
|
||||||
" for maxM in maxM_gha1_ana:\n",
|
|
||||||
" for parts in parts_gha1_ana:\n",
|
|
||||||
" start = time.perf_counter()\n",
|
" start = time.perf_counter()\n",
|
||||||
" try:\n",
|
" try:\n",
|
||||||
" P1_ana, alpha1_ana_para = gha1_ana(ell, P0, alpha0_para, s, maxM=maxM, maxPartCircum=parts)\n",
|
" P1_num, alpha1_num_1 = gha1_num(ell, P0, alpha0_ell, s, num=steps)\n",
|
||||||
|
" print(f\"GHA1_num_{steps}\", P1_num)\n",
|
||||||
" end = time.perf_counter()\n",
|
" end = time.perf_counter()\n",
|
||||||
" beta1_ana, lamb1_ana = ell.cart2ell(P1_ana)\n",
|
" beta1_num, lamb1_num = ell.cart2ell(P1_num)\n",
|
||||||
" u1_ana, v1_ana = ell.cart2para(P1_ana)\n",
|
" d_beta1 = abs(beta1_num - beta1)\n",
|
||||||
" _, _, alpha1_ana_ell = alpha_para2ell(ell, u1_ana, v1_ana, alpha1_ana_para)\n",
|
" d_lamb1 = abs(lamb1_num - lamb1)\n",
|
||||||
" d_beta1 = abs(beta1_ana - beta1)\n",
|
" d_alpha1 = abs(alpha1_num_1 - alpha1_ell)\n",
|
||||||
" d_lamb1 = abs(lamb1_ana - lamb1)\n",
|
|
||||||
" d_alpha1 = abs(alpha1_ana_ell - alpha1_ell)\n",
|
|
||||||
" d_time = end - start\n",
|
" d_time = end - start\n",
|
||||||
" example_results[f\"GHA1_ana_{maxM}_{parts}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
" example_results[f\"GHA1_num_{steps}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
||||||
" except Exception as e:\n",
|
" except Exception as e:\n",
|
||||||
" print(e)\n",
|
" print(e)\n",
|
||||||
" example_results[f\"GHA1_ana_{maxM}_{parts}\"] = (nan, nan, nan, nan)\n",
|
" example_results[f\"GHA1_num_{steps}\"] = (nan, nan, nan, nan)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for dsPart in dsPart_gha1_ES:\n",
|
" for maxM in maxM_gha1_ana:\n",
|
||||||
" ds = ell.ax/dsPart\n",
|
" for parts in parts_gha1_ana:\n",
|
||||||
" start = time.perf_counter()\n",
|
" start = time.perf_counter()\n",
|
||||||
" try:\n",
|
" try:\n",
|
||||||
" P1_ES, alpha1_ES = gha1_ES(ell, beta0, lamb0, alpha0_ell, s, maxSegLen=ds)\n",
|
" P1_ana, alpha1_ana_para = gha1_ana(ell, P0, alpha0_para, s, maxM=maxM, maxPartCircum=parts)\n",
|
||||||
" end = time.perf_counter()\n",
|
" end = time.perf_counter()\n",
|
||||||
" beta1_ES, lamb1_ES = ell.cart2ell(P1_ES)\n",
|
" beta1_ana, lamb1_ana = ell.cart2ell(P1_ana)\n",
|
||||||
" d_beta1 = abs(beta1_ES - beta1)\n",
|
" u1_ana, v1_ana = ell.cart2para(P1_ana)\n",
|
||||||
" d_lamb1 = abs(lamb1_ES - lamb1)\n",
|
" _, _, alpha1_ana_ell = alpha_para2ell(ell, u1_ana, v1_ana, alpha1_ana_para)\n",
|
||||||
" d_alpha1 = abs(alpha1_ES - alpha1_ell)\n",
|
" d_beta1 = abs(beta1_ana - beta1)\n",
|
||||||
" d_time = end - start\n",
|
" d_lamb1 = abs(lamb1_ana - lamb1)\n",
|
||||||
" example_results[f\"GHA1_ES_{dsPart}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
" d_alpha1 = abs(alpha1_ana_ell - alpha1_ell)\n",
|
||||||
" except Exception as e:\n",
|
" d_time = end - start\n",
|
||||||
" print(e)\n",
|
" example_results[f\"GHA1_ana_{maxM}_{parts}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
||||||
" example_results[f\"GHA1_ES_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
" except Exception as e:\n",
|
||||||
|
" print(e)\n",
|
||||||
|
" example_results[f\"GHA1_ana_{maxM}_{parts}\"] = (nan, nan, nan, nan)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for dsPart in dsPart_gha1_approx:\n",
|
" for dsPart in dsPart_gha1_ES:\n",
|
||||||
" ds = ell.ax/dsPart\n",
|
" ds = ell.ax/dsPart\n",
|
||||||
" start = time.perf_counter()\n",
|
" start = time.perf_counter()\n",
|
||||||
" try:\n",
|
" try:\n",
|
||||||
" P1_approx, alpha1_approx = gha1_approx(ell, P0, alpha0_ell, s, ds=ds)\n",
|
" P1_ES, alpha1_ES = gha1_ES(ell, beta0, lamb0, alpha0_ell, s, maxSegLen=ds)\n",
|
||||||
" end = time.perf_counter()\n",
|
" end = time.perf_counter()\n",
|
||||||
" beta1_approx, lamb1_approx = ell.cart2ell(P1_approx)\n",
|
" beta1_ES, lamb1_ES = ell.cart2ell(P1_ES)\n",
|
||||||
" d_beta1 = abs(beta1_approx - beta1)\n",
|
" d_beta1 = abs(beta1_ES - beta1)\n",
|
||||||
" d_lamb1 = abs(lamb1_approx - lamb1)\n",
|
" d_lamb1 = abs(lamb1_ES - lamb1)\n",
|
||||||
" d_alpha1 = abs(alpha1_approx - alpha1_ell)\n",
|
" d_alpha1 = abs(alpha1_ES - alpha1_ell)\n",
|
||||||
" d_time = end - start\n",
|
" d_time = end - start\n",
|
||||||
" example_results[f\"GHA1_approx_{dsPart}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
" example_results[f\"GHA1_ES_{dsPart}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
||||||
" except Exception as e:\n",
|
" except Exception as e:\n",
|
||||||
" print(e)\n",
|
" print(e)\n",
|
||||||
" example_results[f\"GHA1_approx_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
" example_results[f\"GHA1_ES_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # ----------------------------------------------\n",
|
" for dsPart in dsPart_gha1_approx:\n",
|
||||||
|
" ds = ell.ax/dsPart\n",
|
||||||
|
" start = time.perf_counter()\n",
|
||||||
|
" try:\n",
|
||||||
|
" P1_approx, alpha1_approx = gha1_approx(ell, P0, alpha0_ell, s, ds=ds)\n",
|
||||||
|
" end = time.perf_counter()\n",
|
||||||
|
" beta1_approx, lamb1_approx = ell.cart2ell(P1_approx)\n",
|
||||||
|
" d_beta1 = abs(beta1_approx - beta1)\n",
|
||||||
|
" d_lamb1 = abs(lamb1_approx - lamb1)\n",
|
||||||
|
" d_alpha1 = abs(alpha1_approx - alpha1_ell)\n",
|
||||||
|
" d_time = end - start\n",
|
||||||
|
" example_results[f\"GHA1_approx_{dsPart}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n",
|
||||||
|
" except Exception as e:\n",
|
||||||
|
" print(e)\n",
|
||||||
|
" example_results[f\"GHA1_approx_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for steps in steps_gha2_num:\n",
|
" # ----------------------------------------------\n",
|
||||||
" start = time.perf_counter()\n",
|
|
||||||
" try:\n",
|
|
||||||
" with warnings.catch_warnings():\n",
|
|
||||||
" warnings.simplefilter(\"ignore\", RuntimeWarning)\n",
|
|
||||||
" alpha0_num, alpha1_num_2, s_num = gha2_num(ell, beta0, lamb0, beta1, lamb1, n=steps)\n",
|
|
||||||
" print(alpha0_num, alpha1_num_2, s_num)\n",
|
|
||||||
" end = time.perf_counter()\n",
|
|
||||||
" d_alpha0 = abs(alpha0_num - alpha0_ell)\n",
|
|
||||||
" d_alpha1 = abs(alpha1_num_2 - alpha1_ell)\n",
|
|
||||||
" d_s = abs(s_num - s)\n",
|
|
||||||
" d_time = end - start\n",
|
|
||||||
" example_results[f\"GHA2_num_{steps}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n",
|
|
||||||
" except Exception as e:\n",
|
|
||||||
" print(e)\n",
|
|
||||||
" example_results[f\"GHA2_num_{steps}\"] = (nan, nan, nan, nan)\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
" for dsPart in dsPart_gha2_ES:\n",
|
" for steps in steps_gha2_num:\n",
|
||||||
" ds = ell.ax/dsPart\n",
|
" start = time.perf_counter()\n",
|
||||||
" start = time.perf_counter()\n",
|
" try:\n",
|
||||||
" try:\n",
|
" with warnings.catch_warnings():\n",
|
||||||
" with suppress_print():\n",
|
" warnings.simplefilter(\"ignore\", RuntimeWarning)\n",
|
||||||
" alpha0_ES, alpha1_ES, s_ES = gha2_ES(ell, P0, P1, maxSegLen=ds)\n",
|
" alpha0_num, alpha1_num_2, s_num = gha2_num(ell, beta0, lamb0, beta1, lamb1, n=steps)\n",
|
||||||
" end = time.perf_counter()\n",
|
" print(alpha0_num, alpha1_num_2, s_num)\n",
|
||||||
" d_alpha0 = abs(alpha0_ES - alpha0_ell)\n",
|
" end = time.perf_counter()\n",
|
||||||
" d_alpha1 = abs(alpha1_ES - alpha1_ell)\n",
|
" d_alpha0 = abs(alpha0_num - alpha0_ell)\n",
|
||||||
" d_s = abs(s_ES - s)\n",
|
" d_alpha1 = abs(alpha1_num_2 - alpha1_ell)\n",
|
||||||
" d_time = end - start\n",
|
" d_s = abs(s_num - s)\n",
|
||||||
" example_results[f\"GHA2_ES_{dsPart}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n",
|
" d_time = end - start\n",
|
||||||
" except Exception as e:\n",
|
" example_results[f\"GHA2_num_{steps}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n",
|
||||||
" print(e)\n",
|
" except Exception as e:\n",
|
||||||
" example_results[f\"GHA2_ES_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
" print(e)\n",
|
||||||
|
" example_results[f\"GHA2_num_{steps}\"] = (nan, nan, nan, nan)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" for dsPart in dsPart_gha2_approx:\n",
|
" for dsPart in dsPart_gha2_ES:\n",
|
||||||
" ds = ell.ax/dsPart\n",
|
" ds = ell.ax/dsPart\n",
|
||||||
" start = time.perf_counter()\n",
|
" start = time.perf_counter()\n",
|
||||||
" try:\n",
|
" try:\n",
|
||||||
" alpha0_approx, alpha1_approx, s_approx = gha2_approx(ell, P0, P1, ds=ds)\n",
|
" with suppress_print():\n",
|
||||||
" end = time.perf_counter()\n",
|
" alpha0_ES, alpha1_ES, s_ES = gha2_ES(ell, P0, P1, maxSegLen=ds)\n",
|
||||||
" d_alpha0 = abs(alpha0_approx - alpha0_ell)\n",
|
" end = time.perf_counter()\n",
|
||||||
" d_alpha1 = abs(alpha1_approx - alpha1_ell)\n",
|
" d_alpha0 = abs(alpha0_ES - alpha0_ell)\n",
|
||||||
" d_s = abs(s_approx - s)\n",
|
" d_alpha1 = abs(alpha1_ES - alpha1_ell)\n",
|
||||||
" d_time = end - start\n",
|
" d_s = abs(s_ES - s)\n",
|
||||||
" example_results[f\"GHA2_approx_{dsPart}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n",
|
" d_time = end - start\n",
|
||||||
" except Exception as e:\n",
|
" example_results[f\"GHA2_ES_{dsPart}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n",
|
||||||
" print(e)\n",
|
" except Exception as e:\n",
|
||||||
" example_results[f\"GHA2_approx_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
" print(e)\n",
|
||||||
|
" example_results[f\"GHA2_ES_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" results[f\"beta0: {wu.rad2deg(beta0):.3f}, lamb0: {wu.rad2deg(lamb0):.3f}, alpha0: {wu.rad2deg(alpha0_ell):.3f}, s: {s}\"] = example_results"
|
" for dsPart in dsPart_gha2_approx:\n",
|
||||||
|
" ds = ell.ax/dsPart\n",
|
||||||
|
" start = time.perf_counter()\n",
|
||||||
|
" try:\n",
|
||||||
|
" alpha0_approx, alpha1_approx, s_approx = gha2_approx(ell, P0, P1, ds=ds)\n",
|
||||||
|
" end = time.perf_counter()\n",
|
||||||
|
" d_alpha0 = abs(alpha0_approx - alpha0_ell)\n",
|
||||||
|
" d_alpha1 = abs(alpha1_approx - alpha1_ell)\n",
|
||||||
|
" d_s = abs(s_approx - s)\n",
|
||||||
|
" d_time = end - start\n",
|
||||||
|
" example_results[f\"GHA2_approx_{dsPart}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n",
|
||||||
|
" except Exception as e:\n",
|
||||||
|
" print(e)\n",
|
||||||
|
" example_results[f\"GHA2_approx_{dsPart}\"] = (nan, nan, nan, nan)\n",
|
||||||
|
"\n",
|
||||||
|
" results[f\"beta0: {wu.rad2deg(beta0):.3f}, lamb0: {wu.rad2deg(lamb0):.3f}, alpha0: {wu.rad2deg(alpha0_ell):.3f}, s: {s}\"] = example_results\n",
|
||||||
|
" return results\n",
|
||||||
|
"results = execute_results(test, examples)"
|
||||||
],
|
],
|
||||||
"id": "fc45e0f618a0e4d8",
|
"id": "fc45e0f618a0e4d8",
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
"execution_count": null
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"----- Beispiel 1/4\n",
|
|
||||||
"----- Beispiel 2/4\n",
|
|
||||||
"----- Beispiel 3/4\n",
|
|
||||||
"Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid\n",
|
|
||||||
"Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid\n",
|
|
||||||
"Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid\n",
|
|
||||||
"Fehler in der Umrechnung cart2ell\n",
|
|
||||||
"----- Beispiel 4/4\n",
|
|
||||||
"Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid\n",
|
|
||||||
"Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid\n",
|
|
||||||
"Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid\n",
|
|
||||||
"Fehler in der Umrechnung cart2ell\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"execution_count": 15
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
@@ -330,31 +312,85 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"source": [
|
"source": [
|
||||||
"# with open(f\"gha_results{test}.pkl\", \"wb\") as f:\n",
|
"def save_results(test, results):\n",
|
||||||
"# pickle.dump(results, f)"
|
" with open(f\"gha_results{test}.pkl\", \"wb\") as f:\n",
|
||||||
|
" pickle.dump(results, f)\n",
|
||||||
|
"# save_results(test, results)"
|
||||||
],
|
],
|
||||||
"id": "74fbd4d33c288839"
|
"id": "74fbd4d33c288839"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"metadata": {},
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [],
|
||||||
|
"execution_count": null,
|
||||||
|
"source": [
|
||||||
|
"test = \"Panou\"\n",
|
||||||
|
"examples_panou = build_examples(test)\n",
|
||||||
|
"results_panou = execute_results(test, examples_panou)\n",
|
||||||
|
"save_results(test, results_panou)"
|
||||||
|
],
|
||||||
|
"id": "58697308664fa539"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metadata": {},
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [],
|
||||||
|
"execution_count": null,
|
||||||
|
"source": [
|
||||||
|
"test = \"Karney\"\n",
|
||||||
|
"examples_karney = build_examples(test)\n",
|
||||||
|
"results_karney = execute_results(test, examples_karney)\n",
|
||||||
|
"save_results(test, results_karney)"
|
||||||
|
],
|
||||||
|
"id": "5d35a01ba8d6e2b1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metadata": {},
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [],
|
||||||
|
"execution_count": null,
|
||||||
|
"source": [
|
||||||
|
"test = \"Random\"\n",
|
||||||
|
"examples_random = build_examples(test)\n",
|
||||||
|
"results_random = execute_results(test, examples_random)\n",
|
||||||
|
"save_results(test, results_random)"
|
||||||
|
],
|
||||||
|
"id": "848eab44283945c6"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2026-02-06T21:26:49.148361Z",
|
"end_time": "2026-02-07T21:00:12.376487Z",
|
||||||
"start_time": "2026-02-06T21:26:48.975151Z"
|
"start_time": "2026-02-07T21:00:12.071794Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"source": [
|
"source": [
|
||||||
"with open(f\"gha_results{test}.pkl\", \"rb\") as f:\n",
|
"with open(f\"gha_results{test}_all.pkl\", \"rb\") as f:\n",
|
||||||
" results = pickle.load(f)"
|
" results = pickle.load(f)"
|
||||||
],
|
],
|
||||||
"id": "4c20a0579c0f7038",
|
"id": "4c20a0579c0f7038",
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"ename": "FileNotFoundError",
|
||||||
|
"evalue": "[Errno 2] No such file or directory: 'gha_resultsKarney.pkl'",
|
||||||
|
"output_type": "error",
|
||||||
|
"traceback": [
|
||||||
|
"\u001B[31m---------------------------------------------------------------------------\u001B[39m",
|
||||||
|
"\u001B[31mFileNotFoundError\u001B[39m Traceback (most recent call last)",
|
||||||
|
"\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[6]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[38;5;28;01mwith\u001B[39;00m \u001B[38;5;28;43mopen\u001B[39;49m\u001B[43m(\u001B[49m\u001B[33;43mf\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mgha_results\u001B[39;49m\u001B[38;5;132;43;01m{\u001B[39;49;00m\u001B[43mtest\u001B[49m\u001B[38;5;132;43;01m}\u001B[39;49;00m\u001B[33;43m.pkl\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mrb\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m)\u001B[49m \u001B[38;5;28;01mas\u001B[39;00m f:\n\u001B[32m 2\u001B[39m results = pickle.load(f)\n",
|
||||||
|
"\u001B[36mFile \u001B[39m\u001B[32m~\\PythonInterpreter\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:343\u001B[39m, in \u001B[36m_modified_open\u001B[39m\u001B[34m(file, *args, **kwargs)\u001B[39m\n\u001B[32m 336\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m file \u001B[38;5;129;01min\u001B[39;00m {\u001B[32m0\u001B[39m, \u001B[32m1\u001B[39m, \u001B[32m2\u001B[39m}:\n\u001B[32m 337\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[32m 338\u001B[39m \u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33mIPython won\u001B[39m\u001B[33m'\u001B[39m\u001B[33mt let you open fd=\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mfile\u001B[38;5;132;01m}\u001B[39;00m\u001B[33m by default \u001B[39m\u001B[33m\"\u001B[39m\n\u001B[32m 339\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mas it is likely to crash IPython. If you know what you are doing, \u001B[39m\u001B[33m\"\u001B[39m\n\u001B[32m 340\u001B[39m \u001B[33m\"\u001B[39m\u001B[33myou can use builtins\u001B[39m\u001B[33m'\u001B[39m\u001B[33m open.\u001B[39m\u001B[33m\"\u001B[39m\n\u001B[32m 341\u001B[39m )\n\u001B[32m--> \u001B[39m\u001B[32m343\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mio_open\u001B[49m\u001B[43m(\u001B[49m\u001B[43mfile\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n",
|
||||||
|
"\u001B[31mFileNotFoundError\u001B[39m: [Errno 2] No such file or directory: 'gha_resultsKarney.pkl'"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"execution_count": 6
|
"execution_count": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2026-02-07T17:02:37.451141Z",
|
"end_time": "2026-02-07T20:59:54.841038500Z",
|
||||||
"start_time": "2026-02-07T17:02:15.854020Z"
|
"start_time": "2026-02-07T17:02:15.854020Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user