Repository navigation
Assign all limited outputs of Spice3 diodeModelLineInitEquations - #4858
Open
hubertus65 wants to merge 1 commit into
Open
hubertus65 wants to merge 1 commit into
hubertus65 wants to merge 1 commit into
Conversation
hubertus65
added a commit
to hubertus65/ModelicaStandardLibrary
that referenced
this pull request
Nov 3, 2026
…e3 fix With diodeModelLineInitEquations assigning all limited outputs (modelica#4858), vDiode.m_gradingCoeff, m_activationEnergy and m_depletionCapCoeff are 0.5, 1.11 and 0.5 instead of undefined (0 in Impact). Completion check run: 87/87 checks pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@hubertus65 if Claude isn't capable of defining reviewers, labels and milestone, you have to take care of that. |
The function set out_v.m_gradingCoeff, m_activationEnergy and m_depletionCapCoeff only when the input exceeded its limit, so for every input within the limits these outputs were never assigned and their values were undefined (tools return 0 or arbitrary values). Assign the input value when no limit applies, as SPICE3 does (DIOsetup limits the model parameters in place) and as diodeRenameParameters already does for the same three parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
beutlich
force-pushed
the
fix-spice3-diode-model-line-limits
branch
from
November 11, 2026 12:31
a418252 to
3fe5b8a
Compare
|
Success: Regression testing passed successfully. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modelica.Electrical.Spice3.Internal.Diode.diodeModelLineInitEquationslimits three model line parameters, but it only assigns them when a limit applies:For any input within the limits (including the defaults M=0.5, EG=1.11, FC=0.5),
out_v.m_gradingCoeff,out_v.m_activationEnergyandout_v.m_depletionCapCoeffare never assigned, so their values are undefined. Different tools return different values: in a cross-tool run, Modelon Impact and the old OpenModelica frontend gave 0, while the new OpenModelica frontend gave 273.15 form_depletionCapCoeff.The fix assigns the input value when no limit applies. This matches SPICE3, where
DIOsetuplimits the model parameters in place, and it uses the same form asdiodeRenameParameters, which already applies the same three limits:No Spice3 model calls this function, so no example results change. Checked with OpenModelica 1.27.1: with default model card values the function now returns 0.5 / 1.11 / 0.5, and with M=0.95, EG=0.05, FC=0.99 it returns 0.9 / 0.1 / 0.95.
🤖 Generated with Claude Code