Borrar filtros
Borrar filtros

How to use of physical units within Simulink systems?

3 visualizaciones (últimos 30 días)
Klaus Webers
Klaus Webers el 17 de Oct. de 2021
Comentada: Klaus Webers el 19 de Nov. de 2021
How to use of physical units within Simulink systems?
Consistent use of physical units with all signals, also within subsystems, would be desirable (not only for didactic reasons). Unfortunately, I have not yet found a satisfactory approach to this. So far, I've considered the following alternatives:
Defined Simulink.Signal objects per signal
For each signal in the model, a Simulink.Signal object is created first, including unit specification.
uResistance = Simulink.Signal; uResistance.Unit='V';
uInductance = Simulink.Signal; uInductance.Unit='V';
tMotor = Simulink.Signal; tMotor.Unit='N*m';
tFriction = Simulink.Signal; tFriction.Unit='N*m';
Each signal is then bound to the corresponding object by property "Signal must resolve to Simulink signal object".
  • Advantage: Consistent and visible use of units (per InformationOverlay->Units).
  • Disadvantage: Impractical, high effort and inflexible regarding model changes. Double signal definition.
Defined Simulink.Signal object per "physical quantity"
For each physical quantity, e.g. voltage or torque, a Simulink.Signal object is created. Important: This object type can be reused multiple times in a Simulink model (setting-dependent).
% physical quantities ("signal classes")
voltage = Simulink.Signal; voltage.Unit='V';
current = Simulink.Signal; current.Unit='A';
torque = Simulink.Signal; torque.Unit='N*m';
Each individual signal is then bound to a physical quantity (i.e. signal-object).
  • Advantage: consistent and visible use of units. Additionally: intuitve plausi-check for consistent physical quantities, e.g. at summation points (by klicking variable voltage in ModelDataEditor). Moderate effort, flexible model adaptation.
  • Disadvantage: The individual signal name does no longer appear at the signal line. (although an individual signal name may be assigned, per SignalProperties->CustomLoggingName)
Explicit signal specification block for each signal in the model.
Each signal is defined, incl. unit-propertiy, within the model-layout by application of the SignalSpecification-block.
  • Advantage: Continuous and visible units. Individual signal name recognizable.
  • Disadvantage: High effort. Confusing model due to loads of "unnecessary" blocks
None of the variants solves the problem satisfactorily. Easy definition of output signal properties / quantities (incl. unit) at each Simulink block would be desirable.
Is there a simple and practicable solution for this?
(if so, of course next steps already foreshadow. Particularly, use of some Simulink.Parameter property to plausi-check physical quantities with Ohm's law at gain transforming current to voltage. And/or proper application of time-unit "A/s -> A" with integrator blocks)

Respuesta aceptada

Pavan Guntha
Pavan Guntha el 16 de Nov. de 2021
Hello Klaus,
You could use Simscape in order to model systems such as electric motors, hydraulic actuators etc., which supports units for each of the quantities like Resistance, Torque etc., By using Simscape you could overcome the issues which have been mentioned. For more information on Simscape, you could look at the documentation page here. You could also leverage Simscape Onramp to learn basics of Simscape.
Hope this helps!
  1 comentario
Klaus Webers
Klaus Webers el 19 de Nov. de 2021
Hello Pavan,
The way units are handeled in Simscape is, ideed, exemplary. However, as the question at hand is to improve (pure) Simulink-models, Simscape is not an option, by definition. Perhaps a suitable unit-handling scheme can be taken into account in future releases?
Thank you anyway.

Iniciar sesión para comentar.

Más respuestas (0)


Más información sobre Nonlinear Operators en Help Center y File Exchange.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by