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

Clocked noise example modifying something not in constraining class #3971

Closed
HansOlsson opened this issue Apr 7, 2022 · 1 comment
Closed
Assignees
Labels
L: Clocked Issue addresses Modelica.Clocked
Milestone

Comments

@HansOlsson
Copy link
Contributor

Modelica.Clocked.Examples.SimpleControlledDrive.ClockedWith_AD_DA_Effects has:

Clocked.RealSignals.Sampler.SampleWithADeffects sample1(noisy=true, noise(
        noiseMax=0.01))
    annotation (Placement(transformation(extent={{38,-36},{26,-24}})));

where noise is declared as:

replaceable Clocked.RealSignals.Sampler.Utilities.Internal.UniformNoise noise if noisy
    constrainedby Clocked.RealSignals.Interfaces.PartialNoise ...

But noiseMax is not part of the constraining class Clocked.RealSignals.Interfaces.PartialNoise, which means that the following will give an error even if it is correct in itself:

package Broken
  model NoNoise
    extends Modelica.Clocked.RealSignals.Interfaces.PartialNoise;
  equation 
    y=u;
  end NoNoise;
  model BrokenModel
  extends 
    Modelica.Clocked.Examples.SimpleControlledDrive.ClockedWith_AD_DA_Effects(
      sample1(redeclare NoNoise noise));
   end BrokenModel;
end Broken;

If you don't like randomly building such models to find errors and have Dymola (standalone or as part of 3DExperience platform) you can use checkModel("Modelica.Clocked.Examples.SimpleControlledDrive.ClockedWith_AD_DA_Effects", constraint=true); for finding it.

The possible corrections are:

  • Extend interface of PartialNoise to include the common parameters like noiseMax.
  • Redeclare the noise to the given default-component-class - possibly keeping it as replaceable
  • More?
@HansOlsson HansOlsson added the L: Clocked Issue addresses Modelica.Clocked label Apr 7, 2022
christoff-buerger added a commit to christoff-buerger/ModelicaStandardLibrary that referenced this issue Feb 22, 2023
@HansOlsson
Copy link
Contributor Author

Closed by #4074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Clocked Issue addresses Modelica.Clocked
Projects
None yet
Development

No branches or pull requests

3 participants