From da13c8f3439243afc1ff010a08f59f1080545e34 Mon Sep 17 00:00:00 2001 From: Steven Burns Date: Fri, 13 Nov 2026 17:04:54 -0800 Subject: [PATCH] Count two unknowns per patch in the sequential frequency loop execute_frequency_loop_sequential() sized the system as N + M while num_eq_sym is NP + 2MP, so factor_block_matrix() reported SYMMETRY ERROR and onec exited 1 on every deck with a surface patch (a single SP is enough). NEC-2's NEQ is N + 2M, as process_deck_sequential() and control.c already compute. NEC-2 example 4 with its GX written out as eight explicit SPs now gives 180.728+j217.649 (nec2c 1.3.1: 180.73+j217.65). Example 4 as published, with GX 0 110 reflecting the patches, still disagrees (95.397+j249.73); that is a separate symmetry/patch defect, not touched here. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SKce1woVSs18wmKo1ukoqf --- src/reporting.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/reporting.c b/src/reporting.c index 17476a9..734e75f 100644 --- a/src/reporting.c +++ b/src/reporting.c @@ -1953,7 +1953,10 @@ static int execute_frequency_loop_sequential(context_t *ctx, deck_t *deck, geometry_t *geom = &ctx->geometry; /* Allocate matrix and other structures for frequency loop */ - if (allocate_frequency_loop_storage(ctx, geom->num_segs + geom->num_patches) != 0) { + /* Each patch carries two unknowns (NEC-2's NEQ = N + 2M), as + * process_deck_sequential() and control.c both count them; N + M made + * factor_block_matrix() reject every deck with a surface patch. */ + if (allocate_frequency_loop_storage(ctx, geom->num_segs + 2 * geom->num_patches) != 0) { add_error(ctx, &ctx->errors, "Failed to allocate frequency loop storage", FATAL); return -1; }