Pythonfiles

This commit is contained in:
2025-12-15 14:16:27 +01:00
parent 4db713b2da
commit 7fc47363af
3 changed files with 126 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ def iterative_ausgleichung(
v = l - A * dx #Residuenvektor v
Q_vv = modell.berechne_Qvv(A, Q_ll, Q_xx) #Kofaktormatrix der Verbesserungen Qvv
Q_vv = modell.berechne_Qvv(A, P, Q_xx) #Kofaktormatrix der Verbesserungen Qvv
R = modell.berechne_R(Q_vv, P) #Redundanzmatrix R
r = modell.berechne_r(R) #Redundanzanteile als Vektor r
@@ -44,10 +44,21 @@ def iterative_ausgleichung(
"sigma0_groups": dict(modell.sigma0_groups),
})
if all(abs(val - 1.0) < tol for val in sigma_hat.values()): #Abbruchkriterium
print(f"Konvergenz nach {it + 1} Iterationen erreicht.")
break
# --- Abbruchkriterium ---
if sigma_hat:
max_rel_change = 0.0
for g, new_val in sigma_hat.items():
old_val = modell.sigma0_groups.get(g, 1.0)
if old_val != 0:
rel = abs(new_val - old_val) / abs(old_val)
max_rel_change = max(max_rel_change, rel)
if max_rel_change < tol:
print(f"Konvergenz nach {it + 1} Iterationen erreicht (max. rel. Änderung = {max_rel_change:.2e}).")
modell.update_sigma0_von_vks(sigma_hat)
break
# Varianzfaktoren für nächste Iteration übernehmen
modell.update_sigma0_von_vks(sigma_hat)
return {