Contenido principal

Physical Signal Unit Propagation

Physical signals have units associated with the signal value. You specify the units along with the parameter values in the block dialogs and Property Inspector, and Simscape™ software performs the necessary unit conversion operations when solving a physical network. If the signal is a vector or a matrix, all its elements have the same unit. Unitless signals have their unit designated as 1.

Simscape blocks in the Physical Signals block library (PS blocks) allow you to graphically implement equations inside the physical network by performing math operations and other functions on physical signals. These blocks have untyped input and output ports, to facilitate unit propagation:

  • The physical unit associated with the input signal of a PS block is propagated from the connected output signal.

  • The physical unit associated with the output signal of a PS block is determined by the unit of the input signal and the equations inside the block. If a block performs a math operation, that operation is performed both on the value and the unit of the input physical signal.

For example, consider a PS Gain block connected to a Current Sensor output port. Then, the physical unit at the PS Gain input port is A. The physical unit at the PS Gain output port is the input signal unit multiplied by the unit of the Gain parameter:

  • If the Gain parameter unit is 1 (unitless), then the output signal has the same unit as the input signal, that is, A.

  • If the Gain parameter unit is V, then the output physical signal has the unit of W.

Similarly, the PS Product block multiplies both the values and units of the two input signals.

Unit propagation in a PS Product block

The PS Add and PS Subtract blocks perform addition and subtraction on the two input signals, and therefore, the physical signal units at the two input ports of these blocks must be commensurate. If the two input signals have the same unit, then the output signal unit has that unit as well. If the input signal units are commensurate, then the output signal unit is the fundamental unit for that dimension.

Unit propagation in a PS Add block when input signals have the same unit

Unit propagation in a PS Add block when input signals have commensurate units unit

Unit propagation in a PS Add block when input signal units are not commensurate

The PS Signal Specification block lets you explicitly specify the size and unit of a physical signal. Use this block when the signal size and unit cannot be determined implicitly, based on model connections.

Affine Unit Propagation

Since R2026a

Input and output signals cannot use affine units. If a block parameter uses an affine unit, then physical signal unit propagation converts this unit into its fundamental unit. The conversion type is defined by the Conversion attribute specified in the component file. Physical Signal library blocks use the default Conversion attribute, which is absolute.

In other words, if a block parameter specifies the unit as degC or degF, unit propagation converts it into K as an absolute temperature. If the model uses degC or degF to specify a relative temperature, unit propagation yields results that are numerically incorrect. Use deltadegC or deltadegF to specify relative temperatures.

For example, if a Temperature Sensor block provides input to a PS Lookup Table (1D) block and the Temperature measurement parameter of the Temperature Sensor block is set to Absolute, you can specify degC or degF as the Table grid vector parameter unit of the PS Lookup Table (1D) block.

Affine unit propagation for absolute temperature and one port

If you set the Temperature measurement parameter of the Temperature Sensor block to Difference but connect port B to a Thermal Reference block, you can also specify degC or degF as the Table grid vector parameter unit because essentially the Temperature Sensor block in this case measures absolute temperature.

Affine unit propagation for absolute temperature and two ports

However, if you do not connect port B to a Thermal Reference block, then the Temperature Sensor block measures relative temperature. In this case, specifying degC or degF as the Table grid vector parameter unit yields incorrect numerical results. For this model, you must use deltadegC or deltadegF.

Affine unit propagation for relative temperature

See Also

Topics