hydraulicToIsothermalLiquid
Upgrade hydraulic block diagram system to use isothermal liquid blocks
Since R2020a
Syntax
Description
replaces blocks from the Foundation > Hydraulic library in the specified block diagram
system, newfile
= hydraulicToIsothermalLiquid(oldfile
,newpath
)oldfile
, with equivalent Isothermal Liquid library blocks,
while trying to preserve the parameter values and connections between the blocks, where
possible. If you have a Simscape™
Fluids™ license, this tool also replaces blocks from the Fluids > Hydraulics
(Isothermal) library with equivalent blocks from the Fluids > Isothermal Liquid and
Foundation > Isothermal Liquid libraries. oldfile
can be a model,
subsystem, or library.
Isothermal Liquid block libraries are structured similar to other fluid domains, such as
Thermal Liquid, and often there is no one-to-one correspondence between the Isothermal
Liquid and Hydraulic library blocks. The conversion tool lists all the issues encountered
during the conversion in an HTML report, saves both the report and the converted block
diagram system in the location specified by newpath
, and returns the
name of the converted system, newfile
.
Both the newfile
and the newpath
arguments are
optional. If you omit the newpath
argument, you must have write
permissions for your current working folder, because the tool then saves the converted
system and the report in the current folder.
The new file is based on the last saved version of the old file. That is, if you modify the original block diagram system and do not save it before using the conversion tool, the modifications are not reflected in the new system. It is also good practice to make sure that the original block diagram system compiles without issues before using the conversion tool.
For more information on upgrade considerations and process, see Upgrading Hydraulic Models to Use Isothermal Liquid Blocks.
converts a list of files, newfiles
= hydraulicToIsothermalLiquid(oldfiles
)oldfiles
, where each of the files can be a
model, subsystem, or library. When you convert a list of files, the conversion tool
preserves the links between the converted files in the list. Use this syntax to convert
models containing references or links to other libraries, models, or subsystems.
If a file listed in oldfiles
contains blocks from the Foundation >
Hydraulic library or Fluids > Hydraulics (Isothermal) library, the tool replaces them with
equivalent Isothermal Liquid library blocks, appends _converted
to the
name of the original file, and saves each converted file in the same folder as the original
file. If a file does not contain hydraulic blocks and does not refer to a file listed in
oldfiles
that contains hydraulic blocks, the tool leaves this file
unchanged. The tool returns the list of converted file names, newfiles
,
and saves the conversion report at the location of the first file listed in
oldfiles
. The conversion report, named
HtoIL_report
, lists all the issues encountered during the conversion of
all the files in the oldfiles
list.
converts all the models, subsystems, and libraries in the folder
newfiles
= hydraulicToIsothermalLiquid(toppath
)toppath
and its subfolders, while preserving the links between the
converted files in the list. Use this syntax to convert custom libraries and other models
containing references or links to other libraries, models, or subsystems.
Both toppath
and its subfolders must be on the MATLAB® path. If a model, subsystem, or library contains blocks from the Foundation >
Hydraulic library or Fluids > Hydraulics (Isothermal) library, the tool replaces them with
equivalent Isothermal Liquid library blocks, appends _converted
to the
name of the original file, and saves each converted file in the same folder as the original
file. If a file does not contain hydraulic blocks and does not refer to a file in
toppath
folder hierarchy that contains hydraulic blocks, the tool
leaves this file unchanged. The tool returns the list of converted file names,
newfiles
, and saves the conversion report, named
HtoIL_report
, in the toppath
folder.
replaces custom hydraulic blocks listed in newfiles
= hydraulicToIsothermalLiquid(___,oldcustomblocks
,newcustomblocks
)oldcustomblocks
with
corresponding isothermal liquid blocks, newcustomblocks
. For any of the
input argument combinations in the previous syntaxes, specify two cell arrays of custom
block names after all the other input arguments. Use this syntax to convert models
containing customized hydraulic blocks, such as masked library blocks or custom blocks
written in Simscape language.
Before you can use this syntax, prepare the equivalent isothermal liquid version of the customized blocks:
For custom library blocks and subsystems that contain blocks from the Foundation > Hydraulic library or Fluids > Hydraulics (Isothermal) library, run the conversion tool on these custom libraries.
For custom hydraulic blocks written in Simscape language, manually create equivalent versions of these blocks that use the isothermal liquid domain.
If, during conversion, the tool encounters a block listed in
oldcustomblocks
, then the tool replaces that block with the
equivalent block listed in newcustomblocks
. The two cell arrays,
oldcustomblocks
and newcustomblocks
, must have
the same number of elements, each element corresponding to a block name. The respective
blocks listed in each array must have the same number of ports, matching port order, and the
same programmatic parameter names.