modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
466 stars 166 forks source link

Jumps in signal at very tiny time intervals in PolyphaseTwoLevel_RL reference results #3523

Closed maltelenz closed 7 months ago

maltelenz commented 4 years ago

In the reference results for Modelica.Electrical.PowerConverters.Examples.DCAC.PolyphaseTwoLevel.PolyphaseTwoLevel_RL there are two subsequent jumps at an extremely short distance from each other. You can see this in rows 3433-3436 in the linked csv file (can't direct link because github restrictions on file size).

The variables in question are voltageSensor.v[1] through voltageSensor.v[3]. Plotted: image Please ignore the labeling on the x axis (bug in SystemModeler).

As you can see, SystemModeler (blue) only has a single event iteration leading to the complete jump, while the reference result (orange) takes two jumps very close to each other. The reference reports jumps at 0.030250000000000003 and 0.030250000000115126, a distance of approximately 1.15e-13 apart.

Is there anything in the model that explains the two separate jumps? Is it expected? Do other tools reproduce these two jumps?

AHaumer commented 4 years ago

I can't reproduce that with Dymola, I can't zoom in beyond a resolution of ~1e-7. I can't say that this is expected, but IMHO it's possible - depending on tolerance and event handling. There are time events (fundemantalWaveVoltage, fundemantalWaveCurrent, signalPWM) and state events (signalPWM, inverter). It could happen that a state event is iterated within a very short time span before or after a time event and both results are stored. Does the behaviour change with another choice of the solver and / or the tolerance? Is the difference marked by the comparison tool? IMHO it's neglectible. Sorry I don't have time to dig deeper - we are 150% busy organizing online content for our students.

beutlich commented 4 years ago

Closing as worksforme, finally.

henrikt-ma commented 3 years ago

Instead of closing as worksforme, shouldn't the correct action be to remove the voltageSensors.v signals from the comparison variables? It would comply with @AHaumer's suggestion to not dig deeper, and would still leave us with 44 less problematic variables to be compared.

TManikantan commented 1 year ago

@christiankral Hi ,I recently assumed the role of Project Deputy, would you please take time to look at it? Do contact me for any help that I could provide with this ticket.

TManikantan commented 1 year ago

@christiankral @AHaumer what is your suggestion for this issue?Do you agree with https://github.com/modelica/ModelicaStandardLibrary/issues/3523#issuecomment-760084305

TManikantan commented 1 year ago

As per suggestion from @henrikt-ma in the above comment,i have to remove voltageSensors.v from Modelica/Resources/Reference/Modelica/Electrical/PowerConverters/Examples/DCAC/PolyphaseTwoLevel/PolyphaseTwoLevel_RL/comparisonSignals.txt. I am confused should the result_csv also be changed? if yes, is it fine to just delete the columns from the result_csv or to generate a new set of result. @henrikt-ma , @christiankral your suggestions would be really helpful.

beutlich commented 1 year ago

I am confused should the result_csv also be changed? if yes, is it fine to just delete the columns from the result_csv or to generate a new set of result.

No, the results will be regenerated later when the new release is ready, usually for beta and rc releases.

TManikantan commented 1 year ago

I am confused should the result_csv also be changed? if yes, is it fine to just delete the columns from the result_csv or to generate a new set of result.

No, the results will be regenerated later when the new release is ready, usually for beta and rc releases.

thank you for your response.

casella commented 7 months ago

The discussion continued on the linked PR #4167.