Skip to content

Document how values are computed based on resonance frequency. - #4780

Open
HansOlsson wants to merge 3 commits into
modelica:masterfrom
HansOlsson:Pi1
Open

HansOlsson wants to merge 3 commits into
modelica:masterfrom
HansOlsson:Pi1

Conversation

@HansOlsson

Copy link
Copy Markdown
Contributor

It also makes the models unit correct, but the main goal is to make it easier to explain the models - by replacing literal values with unclear relations with somewhat understandable parameters, and clear formulas.
(It could be made even better by explaining the derivation of them.)

A benefit is that it is straightforward to modify the resonance frequency (or resistance.) and re-run the simulation to see the impact. (Based on similar idea in #4774 )

In terms of units more work is needed - there are more models that don't work well if pi have unit "rad" or "1"; all indicating unit issues e.g.,:

  • More computations of inductance using similar formulas (in other models).
  • Frequency calculations.

Does not require Modelica Language version 3.7 or updated pi-definition.

@HansOlsson
HansOlsson requested a review from AHaumer April 27, 2026 11:02
@HansOlsson HansOlsson added L: Electrical.Analog Issue addresses Modelica.Electrical.Analog L: Electrical.QuasiStatic Issue addresses Modelica.Electrical.QuasiStatic labels Apr 27, 2026
@HansOlsson HansOlsson added this to the MSL4.2.0 milestone Sep 7, 2026
@HansOlsson
HansOlsson requested a review from henrikt-ma October 26, 2026 12:24
@AHaumer

AHaumer commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

That goes into the right direction. Sorry that it got stuck for such a long time.
Talking about electric resonant cricuits, we could refer to the enclosed document.
(about the naming, e.g. "characteristic impedance" instead of "scaling")

Resonance.pdf

@HansOlsson

Copy link
Copy Markdown
Contributor Author

That goes into the right direction. Sorry that it got stuck for such a long time. Talking about electric resonant cricuits, we could refer to the enclosed document. (about the naming, e.g. "characteristic impedance" instead of "scaling")

Resonance.pdf

Good. I understood the concept, but I didn't know the specific name for it in the electrical domain.

Comment thread Modelica/Electrical/Analog/Examples/ParallelResonance.mo Outdated
Comment thread Modelica/Electrical/Analog/Examples/SeriesResonance.mo Outdated
Comment thread Modelica/Electrical/QuasiStatic/SinglePhase/Examples/ParallelResonance.mo Outdated
Suggested by A. Haumer

Co-authored-by: Hans Olsson <HansOlsson@users.noreply.github.com>
@AHaumer

AHaumer commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Sorry there was a bug in the pdf:
Char. impedance Y0 (in the right column) should read as Char. admittance Y0

Pls. don't use "R" as characteristic impedance, "R" is a resistance.
Rather use "Z0" as characteristic impedance instead of R.

@AHaumer

AHaumer commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

We could take the following code snippet as a reference (also for other PRs):

import Modelica.Units.SI;
import Modelica.Constants.pi;
parameter SI.Frequency f=50;
parameter SI.AngularFrequency omega=2*pi*f;
//serial connection of resistor and inductor
parameter SI.Resistance R=1;
parameter SI.Inductance L=0.001;
parameter SI.Reactance X=omega*L;
parameter SI.Impedance Z=sqrt(R^2 + X^2);
//parallel connection of conductor and capacitor
parameter SI.Conductance G=1;
parameter SI.Capacitance C=0.001;
parameter SI.Susceptance B=omega*C;
parameter SI.Admittance Y=sqrt(G^2 + B^2);
//resonant circuits
parameter SI.Frequency f0=100 "Resonant frequency";
//series resonance
parameter SI.Impedance Z0=1 "Characteristic impedance";
parameter SI.Inductance Ls=Z0/(2*pi*f0);
parameter SI.Capacitance Cs=1/(2*pi*f0*Z0);
//parallel resonance
parameter SI.Admittance Y0=1 "Characteristic admittance";
parameter SI.Inductance Lp=1/(2*pi*f0*Y0);
parameter SI.Capacitance Cp=Y0/(2*pi*f0);
//stray inductance of a machine
parameter SI.Frequency fNominal=50 "Nominal frequency";
parameter SI.Reactance Xsigma=0.01 "Stray reactance at fNominal";
parameter SI.Inductance Lsigma=Xsigma/(2*pi*fNominal) "Stray inductance";

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: Electrical.Analog Issue addresses Modelica.Electrical.Analog L: Electrical.QuasiStatic Issue addresses Modelica.Electrical.QuasiStatic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants