GHA1 ES implementiert

This commit is contained in:
Tammo.Weber
2026-02-06 13:06:32 +01:00
parent 81ca8a4770
commit 9591045ee2

View File

@@ -537,11 +537,12 @@ def toggle_ds(v):
Input("button-calc-gha1", "n_clicks"), Input("button-calc-gha1", "n_clicks"),
State("cb-ana-1", "value"), State("cb-ana-1", "value"),
State("cb-num-1", "value"), State("cb-num-1", "value"),
State("cb-stoch-1", "value"),
State("cb-approx-1", "value"), State("cb-approx-1", "value"),
prevent_initial_call=True, prevent_initial_call=True,
) )
def gha1_method_hint(n, a, nu, ap): def gha1_method_hint(n, a, nu, st, ap):
any_on = any("on" in (v or []) for v in (a, nu, ap)) any_on = any("on" in (v or []) for v in (a, nu, st, ap))
return "" if any_on else html.Span("Bitte Berechnungsverfahren wählen.", style={"color": "red"}) return "" if any_on else html.Span("Bitte Berechnungsverfahren wählen.", style={"color": "red"})
# -- GHA 1 --- # -- GHA 1 ---
@@ -670,16 +671,15 @@ def compute_gha1_num(n1, cb_num, n_in, beta0, lamb0, s, a0, ax, ay, b):
State("input-ax", "value"), State("input-ax", "value"),
State("input-ay", "value"), State("input-ay", "value"),
State("input-b", "value"), State("input-b", "value"),
State("method-checklist-1", "value"),
prevent_initial_call=True, prevent_initial_call=True,
) )
def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b, method1): def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b):
if not n1: if not n1:
return no_update, no_update return no_update, no_update
if "on" not in (cb_stoch or []): if "on" not in (cb_stoch or []):
return "", None return "", None
n_in = int(n_in) if n_in else 100 n_in = int(n_in) if n_in else 1000
ell = EllipsoidTriaxial(ax, ay, b) ell = EllipsoidTriaxial(ax, ay, b)
beta_rad = wu.deg2rad(float(beta0)) beta_rad = wu.deg2rad(float(beta0))
@@ -687,17 +687,10 @@ def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b, metho
alpha_rad = wu.deg2rad(float(a0)) alpha_rad = wu.deg2rad(float(a0))
s_val = float(s) s_val = float(s)
betas, lambs, alphas, S_real = gha1_ES( P1_stoch, alpha = gha1_ES(ell, beta0=beta_rad, omega0=lamb_rad, alpha0=alpha_rad, s_total=s_val, maxSegLen=n_in)
beta_rad, lamb_rad, alpha_rad,
s_val,
10000,
ell
)
beta1_stoch = betas[-1]
lamb1_stoch = lambs[-1]
P0 = ell.ell2cart(beta_rad, lamb_rad) P0 = ell.ell2cart(beta_rad, lamb_rad)
P1_stoch = ell.ell2cart(beta1_stoch, lamb1_stoch) beta1_stoch, lamb1_stoch = ell.cart2ell(P1_stoch)
out = html.Div([ out = html.Div([
html.Strong("Stochastisch: "), html.Strong("Stochastisch: "),