Skip to content

Export generalized (N×N) capacitance and inductance matrices#50

Closed
Copilot wants to merge 2 commits intodevfrom
copilot/export-capacitance-inductance-matrices
Closed

Export generalized (N×N) capacitance and inductance matrices#50
Copilot wants to merge 2 commits intodevfrom
copilot/export-capacitance-inductance-matrices

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

Currently pulmtln.out.json only exports the reduced (N-1)×(N-1) C and L matrices. This adds the full N×N generalized gC and gL matrices that include the reference conductor.

Data structure

PULParameters gains two new fields alongside the existing ones:

mfem::DenseMatrix L, C;   // (N-1)×(N-1), SI units — unchanged
mfem::DenseMatrix gL, gC; // N×N generalized matrices, SI units — new

Computation

  • gC — directly from getGeneralizedCMatrix(false) × ε₀
  • gL — constructed algebraically from standard L via new helper buildGeneralizedL(), which produces an N×N symmetric matrix satisfying:
    • Row sums = 0 (closed-system charge/flux conservation)
    • gL(i,j) − gL(i,0) − gL(0,j) + gL(0,0) = L(i−1, j−1) for i,j ≥ 1 (standard L is exactly recoverable)

JSON output (example — 2-conductor coax, previously 1×1 only)

{
  "C":  [[8.02e-11]],
  "L":  [[4.67e-07]],
  "gC": [[ 8.02e-11, -8.02e-11], [-8.02e-11,  8.02e-11]],
  "gL": [[ 1.17e-07, -1.17e-07], [-1.17e-07,  1.17e-07]]
}

gC/gL are omitted when empty, keeping the format backward compatible with existing JSON consumers.

Original prompt

This section details on the original issue you should resolve

<issue_title>Export also generalized capacitance and inductance matrices</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: lmdiazangulo <4919398+lmdiazangulo@users.noreply.github.com>
Copilot AI changed the title [WIP] Add export for generalized capacitance and inductance matrices Export generalized (N×N) capacitance and inductance matrices Mar 15, 2026
Copilot AI requested a review from lmdiazangulo March 15, 2026 16:31
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