Skip to content

Count two unknowns per patch in the sequential frequency loop - #45

Merged
maurymarkowitz merged 1 commit into
maurymarkowitz:mainfrom
stevenmburns:patch-two-unknowns
Nov 21, 2026
Merged

maurymarkowitz merged 1 commit into
maurymarkowitz:mainfrom
stevenmburns:patch-two-unknowns

Conversation

@stevenmburns

Copy link
Copy Markdown
Contributor

execute_frequency_loop_sequential() sizes the system as N + M, while
num_eq_sym is NP + 2MP. Each surface patch carries two unknowns: NEC-2's
NEQ is N + 2M, as process_deck_sequential() and control.c already count
it. As a result factor_block_matrix() reports SYMMETRY ERROR, and onec exits
1 on every deck with a surface patch. A single SP is enough.

The change is one line in src/reporting.c: allocate the frequency-loop
storage for num_segs + 2 * num_patches.

Example 4 in your own examples/DL5SAY collection/EX4.nec, with an FR 0 1 0 0 299.8 card added (issue below):

  • before: SYMMETRY ERROR - NROW: 32 NCOL: 20, exit 1;
  • after: it runs. With its GX written out as eight explicit SP cards it gives 180.728+j217.649, against nec2c's 180.73+j217.65 (measured when we made the fix, on 2.4.1).

The deck as published, with GX 0 110 reflecting the patches, still
disagrees. That's a separate problem, filed as its own issue.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKce1woVSs18wmKo1ukoqf
@maurymarkowitz
maurymarkowitz merged commit 2a6fef9 into maurymarkowitz:main Nov 21, 2026
6 checks passed
@maurymarkowitz

Copy link
Copy Markdown
Owner

Another regression in sequential! Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants