Upgrading Models with Legacy Physical Signal Blocks
In R2019a, all blocks in the Physical Signals library have been reimplemented with untyped inputs and outputs, to facilitate signal size and unit propagation. These new blocks do not automatically replace the respective legacy blocks in your model. To upgrade your blocks to the latest version, use the Upgrade Advisor.
After running the Check and update outdated Simscape Physical Signal blocks check, you get a list of links to the outdated blocks in the right pane of the Upgrade Advisor window. Clicking a link highlights the corresponding block in the model.
Depending on your model, the links can be divided into multiple groups:
Report Section | Upgrade Action |
---|---|
If the model contains outdated blocks that can be updated automatically, they are listed in the first section of the report, followed by the Upgrade link. | Click the Upgrade link under the list of block links. The software automatically replaces each of the listed blocks with its latest library version, while keeping all the parameter values and setting the parameter units, if appropriate. For more information, see Example of an Automatic Upgrade. |
Sometimes, legacy blocks cannot be converted automatically because direct conversion would result in a compilation error or a different answer. These blocks are listed in a table, grouped by the underlying issue. Each row of the table contains:
| Review the table that groups the blocks based on the underlying issue. For each table row, click the Switch to new version link to convert all blocks listed in the first cell of this row, and then visit the affected blocks individually to resolve the issue. For more information, see Example of a Nonautomatic Upgrade. |
Example of an Automatic Upgrade
If the Upgrade Advisor finds legacy Physical Signal blocks that can be updated automatically, it lists all these blocks in the first group of links, followed by the Upgrade link.
This is an example of a model that can be upgraded automatically.
The legacy PS Product block does not propagate units. However, if you replace this block with the current version of the PS Product block, there is no issue with unit propagation. The first input signal, from the Current Sensor, is in A. The second input signal, from the Voltage Sensor, is in V. Their product, the output signal, is in W, which is the expected unit at the input port S of the Controlled Heat Flow Rate Source block.
When you click the Upgrade link, the software automatically replaces the legacy PS Product block with its latest library version.
Example of a Nonautomatic Upgrade
Sometimes, legacy blocks cannot be converted automatically because direct conversion would result in a compilation error or a different answer. In this case, you must inspect the affected blocks individually to resolve the issue and ensure that the model works as intended.
This is an example of a model that cannot be upgraded automatically.
The PS Lookup Table (1D) block in this diagram contains tabulated data of torque loss, in lbf*ft, as a function of shaft speed, in rpm.
The output signal coming from the Ideal Rotational Motion Sensor block is in rad/s, and the input port S of the Ideal Torque Source block, which models the torque loss, expects the unit of N/m. Legacy Physical Signal blocks did not propagate units, therefore the model contains two PS Gain blocks, on each side of the PS Lookup Table (1D) block, to account for unit conversion. For example, the first PS Gain block provides the coefficient to convert rad/s to rpm.
When you run the Check and update outdated Simscape Physical Signal blocks check on this model, the Upgrade Advisor detects the unit mismatch but cannot determine whether the PS Gain blocks address the issue. Therefore, it lists all three blocks in the same row of the table, followed by the error description and the Switch to new version link.
When you click Switch to new version, the three legacy blocks are replaced with their respective latest versions. However, this does not resolve the unit mismatch issue. You have to address it manually.
The new Physical Signal blocks propagate units, and therefore you no longer need the two PS Gain blocks. The correct way to resolve the issue in this model is to delete these two blocks and set the proper units for the PS Lookup Table (1D) block parameters.