CheckMotorWithLosses model

Requirements.Examples.MotorsWithLosses.CheckMotorWithLosses  ยท source

Icon of CheckMotorWithLosses

Check model Modelica.Electrical.Machines.Examples.DCMachines.DCPM_withLosses

Extends Modelica.Icons.Example

Example that checks requirements of the two permanent magnet DC motors of the Modelica Standard Library example Modelica.Electrical.Machines.Examples.DCMachines.DCPM_withLosses, which is instantiated unchanged as DCPM_withLosses. For each motor (dcpm1 and dcpm2) the following requirements are checked by DCMotorRequirements:

  • R_SpeedMax: the absolute speed is at most 1.2 times the nominal speed wNominal.
  • R_IaMax: the absolute armature current is at most 1.5 times the nominal current IaNominal.

The motor variables are bound to the requirements in the modifier of checkRequirements (Components.Verify): a MotorData record is built for each motor with an explicit record constructor and mapped by watchDCMotor to a DCMotorWatching record. The example demonstrates that requirements can be attached to an existing model without modifying it. Simulate for 2 s; the PrintViolations block inside checkRequirements prints the verdicts at the end of the simulation. checkRequirements.evaluationTime is set to the StopTime (2 s), so that the verdicts are also taken at the end of the simulation when useEvaluationTime is switched on.

Revisions

DateDescription
Sept. 14, 2026The two motor instances are no longer passed to watchDCMotor themselves; the call site builds Components.MotorData with an explicit record constructor. Passing the instance is a Dymola extension, and the record cast MotorData(dcpm1) of the Modelica Language Specification (section 12.6.1) is implemented by Dymola alone; OpenModelica 1.27 and Modelon Impact run the explicit form (H. Tummescheit, Model Based Innovation LLC)
Dec. 3, 2026checkRequirements.evaluationTime set to the StopTime (2 s) like in every other example; the default 1 s took the verdict in the middle of the run when useEvaluationTime is set (H. Tummescheit, Model Based Innovation LLC)

Components and variables

NameTypeDescription
DCPM_withLossesModelica.Electrical.Machines.Examples.DCMachines.DCPM_withLossesMSL example with two permanent magnet DC motors (dcpm1, dcpm2) whose requirements are checked
checkRequirementsComponents.VerifyChecks the speed and current requirements of both DC motors