From 21b8579734fb8d681d6be118a758e0dc66874eb9 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Mon, 1 Jun 2026 17:33:45 -0400 Subject: [PATCH] Found the error with rg_maxres, which is that it was being used in one place as ohms and another as milliohms. Changed it to be milliohms always, except when written as output to the lumped resistance file or as diagnostic output. The result makes more sense, but now has the issue that the maximum resistance is always an over-estimate and may need to account for resistances in parallel. --- resis/ResRex.c | 6 +++--- resis/ResSimple.c | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/resis/ResRex.c b/resis/ResRex.c index 0f098ab9..6dfb2b8c 100644 --- a/resis/ResRex.c +++ b/resis/ResRex.c @@ -1933,7 +1933,7 @@ ResWriteLumpFile(node, resisdata) } else { - lumpedres = resisdata->rg_maxres; + lumpedres = resisdata->rg_maxres * MILLIOHMSTOOHMS; } fprintf(ResLumpFile, "R %s %d\n", node->name, lumpedres); } @@ -2046,7 +2046,7 @@ ResWriteExtFile(celldef, node, resisdata, nidx, eidx) { if (ResOptionsFlags & ResOpt_Debug) TxPrintf("Not adding %s (maxres = %.2fohm)\n", node->name, - resisdata->rg_maxres / 1000.0); + resisdata->rg_maxres * MILLIOHMSTOOHMS); return 0; } } @@ -2078,7 +2078,7 @@ ResWriteExtFile(celldef, node, resisdata, nidx, eidx) if (resisdata->mindelay == 0) { TxPrintf("Adding %s (maxres = %.2fohm)\n", node->name, - resisdata->rg_maxres / 1000.0); + resisdata->rg_maxres * MILLIOHMSTOOHMS); } else { diff --git a/resis/ResSimple.c b/resis/ResSimple.c index 213762d4..0ff28105 100644 --- a/resis/ResSimple.c +++ b/resis/ResSimple.c @@ -934,7 +934,6 @@ ResDoSimplify(resisdata) for (node = ResNodeList; node != NULL; node = node->rn_more) bigres = MAX(bigres, node->rn_noderes); - bigres /= OHMSTOMILLIOHMS; resisdata->rg_maxres = bigres; #ifdef PARANOID