-
Notifications
You must be signed in to change notification settings - Fork 165
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
Problem with final qualifier in MultiPhase models #2318
Comments
|
This is the test model: within ;
model MultiPhaseFinalT
"A simple example to showcase problem with modifier of T parameter"
Modelica.Electrical.Analog.Basic.Ground ground
annotation (Placement(transformation(extent={{-10,-60},{10,-40}})));
Modelica.Electrical.MultiPhase.Basic.Star star annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-20})));
Modelica.Electrical.MultiPhase.Basic.Resistor resistor(R={2,2,2}) annotation
(Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={20,10})));
Modelica.Electrical.MultiPhase.Sources.SineVoltage sineVoltage(V={10,10,10},
freqHz={50,50,50}) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-20,10})));
equation
connect(sineVoltage.plug_p, resistor.plug_p)
annotation (Line(points={{-20,20},{0,20},{20,20}}, color={0,0,255}));
connect(sineVoltage.plug_n, resistor.plug_n)
annotation (Line(points={{-20,0},{0,0},{20,0}}, color={0,0,255}));
connect(ground.p, star.pin_n)
annotation (Line(points={{0,-40},{0,-30}}, color={0,0,255}));
connect(star.plug_p, resistor.plug_n)
annotation (Line(points={{0,-10},{0,0},{20,0}}, color={0,0,255}));
annotation (uses(Modelica(version="3.x.x")), experiment(StopTime=0.1));
end MultiPhaseFinalT; Reverting 970c5b5 does solve the problem. |
Resolved in master by 43c6cd8. |
After updating the documentation according to #2276 and committing to Github I realized that this issue is not yet resolved. There are still errors caused by the final temperature parameters in the following libraries:
@beutlich please check the examples of the listed Modelica sub packages. |
@christiankral Should Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SinglePhaseWinding.resistor use TRef or TOperational as reference temperature? This looks like a real modeling bug to me that was not covered by MSL 3.2.2 (without the changes of #2307). Edit: Same issue in Modelica.Magnetic.QuasiStatic.FundamentalWave.BasicMachines.Components.QuasiStaticAnalogWinding.resistor. |
@christiankral Can you please point me to the issue in Modelica.Electrical.PowerConverters as I did not found any invalid occurence of overwriting a final modification! |
In PowerConverters, this issue refers to examples which use a DC machine model:
|
@christiankral I resolved the obvious ones by 6e618d5, but leave the tricky ones (Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SinglePhaseWinding.resistor and Modelica.Magnetic.QuasiStatic.FundamentalWave.BasicMachines.Components.QuasiStaticAnalogWinding.resistor) to you. |
@christiankral Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SymmetricMultiPhaseWinding has unsued parameter TOperational. To me it looks like TOperational can be removed from all these models and only have TRef. This will solve this issue. |
OK, I will have a look at it in the next days. |
When extending from the conditional heat port, the parameter T must not be set final. The reason is, that if the heat port is not present, the operational temperature T is used. The default value of the operational temperature T is equal to T_ref, but the attribute final is wrong, as the user may pick a operating temperature differing from T_ref. I consequently removed the attribute final in 90425cc and now the machine models check OK again. |
I added tags according to affected packages |
Hmm, your commit 90425cc is unexpected to me and to be honest, I do not get it.
I created a tiny example package for easier testing. Revision 1 shows the current implementation in MSL master (w/o final temperature). Revision 2 are my proposed changes to set the temperature modifier T final. @HansOlsson Can you please advice and give me a clue if final is to be used or not, that is Revision 2 or 1? Thanks a lot! |
To me it makes sense to separate reference and operational temperature (so "Revision 1" seem correct). The reference is a reference - so that e.g. in a resistor we specific R at reference temperature, and its linear temperature dependency. The operational temperature is the temperature it is actually used at; unless we have a heat-port and let this vary dynamically (to add to the confusion the ConditionalHeatport this is called "T" and not "Toperational"). On one hand it makes sense that they as default are the same, but on the other hand it also makes sense to specify them separately (if you have a circuit with specified resistor and want to see what happens if you heat it up), and thus the correct solution seems to be to not have "final" modifier for T. But it also seems clear that some more documentation is needed for this - I hope my description above is right, but I don't see it explicitly described anywhere. A user should be able to understand why to set T and T_ref differently without having to understand the models in this detail. |
Attributes Changes, which still may have to be considered, are (I need more time for this):
|
See also #2312 |
Thanks @HansOlsson for clarification. I can now see that the trouble comes from the Resistor.T_ref parameter which is used both as reference temperature (for the linear temperature dependency of the resistance) and as operational temperature (if no conditional heat port is available). I updated the demo example package by Revision 3 which shows the clean solution I was thinking of. Setting the new parameter TOperational = T_ref by default in the Resistor model whould guarantee backward compatibility. The current implementation (i.e., Revision 1) is a short hand notation in order to not introduce another temperature TOperational at the Resistor model, which then requires to have no final modification for T. This is kind of OK but still confusing and I agree, that it should be better noted in the documentation. Even more confusing is that TOperational then is introduced in the component models (e.g., M in my demo example) just to pass it to the resistor instance. |
T_ref is used both as reference temperature (for the linear temperature dependency of the resistance/conductance) and as operational temperature (if no conditional heat port is available). With the introduction of T_operational the confusion can be avoided by a clean separation of the two temperatures. Furthermore, parameter T can now be modified as final.
@christiankral Anything left to do? |
As #2312 is a separate ticket, I think we are fine on this issue and resolved everything. |
I tried to simulate a very simple multiphase circuit (a sine voltage source in parallel with a resistive load) and got this problem:
I believe this is due to @beutlich's latest 970c5b5 commit. Similar to what is discussed by @christiankral in #2307.
The problem in this case lies, in my opinion, in Multiphase.Basic.Resistor:
I have the impression that this applies to all of the models in MultiPhase that include conditional heat ports.
Additionally, shouldn't all of the modifications to the parameters of
resistor
use theeach
keyword? It's certainly not required, because I'm able to run the simulation after deletingfinal T=T
, but wouldn't it be more correct to include that?The text was updated successfully, but these errors were encountered: