Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit example LightningSegmentedTransmissionLine #4315

Merged
merged 1 commit into from Feb 27, 2024

Conversation

AHaumer
Copy link
Contributor

@AHaumer AHaumer commented Feb 13, 2024

... i.e. excessive size of the simulation result.

  1. The elements R[N+1], L[N+1], G[N] and C[N] are protected again, but voltages v[N] and currents i[N+1] are mirrored to to alias variables to be able to initialize and to track traveling waves along the line.
  2. The output interval of the example has been relaxed to 1e-6,
  3. The comparisonSignals,txt has been updated: It doesn't make sense to compare both current and voltage at the load resistor, but the voltage in the middle of the line is useful.

@AHaumer AHaumer added bug Critical/severe issue L: Electrical.Analog Issue addresses Modelica.Electrical.Analog labels Feb 13, 2024
@AHaumer AHaumer added this to the MSL4.1.0 milestone Feb 13, 2024
@AHaumer AHaumer self-assigned this Feb 13, 2024
Copy link
Member

@beutlich beutlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result file size is now less than 1 GB and therefore manageable.

Name                                    Size            Date                    Attr
LightningSegmentedTransmissionLine.mat	890.394.816	14.02.2024 20:33	-a--
$ matdump LightningSegmentedTransmissionLine.mat -f whos
Name                       Size           Bytes          Class

Aclass                     4x11                 88  mxCHAR_CLASS
name                      50x9357           935700  mxCHAR_CLASS
description               95x9357          1777830  mxCHAR_CLASS
dataInfo                   4x9357           299424  mxDOUBLE_CLASS
data_1                  3286x2               52576  mxDOUBLE_CLASS
data_2                  2222x50002       888835552  mxDOUBLE_CLASS

@beutlich beutlich added example Issue only addresses example(s) V: 4.1.0-dev Issue originates in MSL v4.1.0-dev (and is not present in earlier releases) and removed bug Critical/severe issue labels Feb 15, 2024
@AHaumer
Copy link
Contributor Author

AHaumer commented Feb 15, 2024

@beutlich Somehow I don't understand your result file sizes. Dymola 2024x on Windows 11:
grafik
How does this compare to your 890.394.816 bytes (21 times my size)?

@beutlich
Copy link
Member

beutlich commented Feb 15, 2024

Dymola regression testing uses stricter settings on solver tolerance and output interval:

// Experiment settings (standardized annotation)
StartTime=0
StopTime=0.025 // from model
Interval=5e-07 // used annotation from model, multiplied by 0.5
Tolerance=1e-07 // used annotation from model, multiplied by 0.1

// Experiment settings (tool specific)
// The following lines can be used as mos-script in Dymola
Advanced.PedanticModelica := false;
Evaluate := false;
OutputCPUtime := false;
translateModel("Modelica.Electrical.Analog.Examples.Lines.LightningSegmentedTransmissionLine");
Advanced.StoreProtectedVariables := true;
Advanced.EfficientMinorEvents := false;
Advanced.PlaceDymolaSourceFirst := 2;
experimentSetupOutput(
  textual=false,
  doublePrecision=true,
  states=true,
  derivatives=true,
  inputs=true,
  outputs=true,
  auxiliaries=true,
  equidistant=true,
  events=true,
  debug=false);
simulateModel(
  problem="Modelica.Electrical.Analog.Examples.Lines.LightningSegmentedTransmissionLine",
  startTime=0,
  stopTime=0.025,
  outputInterval=5e-07,
  method="Dassl",
  tolerance=1e-07,
  resultFile="LightningSegmentedTransmissionLine");

@HansOlsson
Copy link
Contributor

  • I noticed some changes of the diagram, I assume that is unintentional; can they be reverted?
  • Apart from that I'm a bit unsure about the change for OLine as it makes variables protected, and it is not protected - that's not something we want in a non-Example.

@AHaumer
Copy link
Contributor Author

AHaumer commented Feb 16, 2024

@HansOlsson no the changes in the diagram are just shifting the "lightning" a little bit to the middle, looks better now.
The components R[N+1], L[N+1], G[N] and C[N] in OLine have been protected previously.
Then I "unprotected" them to be able to initialize the model properly.
Now I protected them again to save size of the result, but introduced alias variables for initialization.
What's the problem? We have an improved situation.

@HansOlsson
Copy link
Contributor

@HansOlsson no the changes in the diagram are just shifting the "lightning" a little bit to the middle, looks better now. The components R[N+1], L[N+1], G[N] and C[N] in OLine have been protected previously. Then I "unprotected" them to be able to initialize the model properly. Now I protected them again to save size of the result, but introduced alias variables for initialization. What's the problem? We have an improved situation.

I was not aware of those details, but based on that it seems ok.

@AHaumer AHaumer merged commit ace6673 into modelica:master Feb 27, 2024
2 checks passed
@beutlich beutlich removed this from the MSL4.1.0 milestone Feb 27, 2024
@beutlich beutlich changed the title resolves #4306 Revisit example LightningSegmentedTransmissionLine Feb 27, 2024
@arunkumar-narasimhan arunkumar-narasimhan added this to the MSL4.1.0 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Issue only addresses example(s) L: Electrical.Analog Issue addresses Modelica.Electrical.Analog V: 4.1.0-dev Issue originates in MSL v4.1.0-dev (and is not present in earlier releases)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants