Accelerating the pace of engineering and science

Documentation Center

• Trial Software

Essential Hydraulic Modeling Techniques

Overview of Modeling Rules

SimHydraulics® models are essentially Simscape™ block diagrams. When building a SimHydraulics model, you use a combination of SimHydraulics blocks with the blocks from the Simscape Foundation and Utilities libraries. Each SimHydraulics diagram must have at least one Solver Configuration block from the Simscape Utilities library. You can use basic hydraulic, electrical, and one-dimensional translational and rotational mechanical elements from the Simscape Foundation library and directly connect them to SimHydraulics blocks. You can also use basic Simulink® blocks, such as sources and scopes, but you need to connect them through the Simulink-PS Converter and PS-Simulink Converter blocks from the Simscape Utilities library.

The rules that you must follow when building a hydraulic model are described in Basic Principles of Modeling Physical Networks in the Simscape documentation. This section briefly reviews these rules.

• SimHydraulics blocks, in general, feature Conserving ports and Physical Signal inports and outports .

• There are three types of Physical Conserving ports used in SimHydraulics blocks: hydraulic, mechanical translational, and mechanical rotational. Each type has specific Through and Across variables associated with it.

• You can connect Conserving ports only to other Conserving ports of the same type.

• The Physical connection lines that connect Conserving ports together are nondirectional lines that carry physical variables (Across and Through variables, as described above) rather than signals. You cannot connect Physical lines to Simulink ports or to Physical Signal ports.

• Two directly connected Conserving ports must have the same values for all their Across variables (such as pressure or angular velocity).

• You can branch Physical connection lines. When you do so, components directly connected with one another continue to share the same Across variables. Any Through variable (such as flow rate or torque) transferred along the Physical connection line is divided among the multiple components connected by the branches. How the Through variable is divided is determined by the system dynamics.

For each Through variable, the sum of all its values flowing into a branch point equals the sum of all its values flowing out.

• You can connect Physical Signal ports to other Physical Signal ports with regular connection lines, similar to Simulink signal connections. These connection lines carry physical signals between SimHydraulics blocks.

• You can connect Physical Signal ports to Simulink ports through special converter blocks. Use the Simulink-PS Converter block to connect Simulink outports to Physical Signal inports. Use the PS-Simulink Converter block to connect Physical Signal outports to Simulink inports.

• Unlike Simulink signals, which are essentially unitless, Physical Signals can have units associated with them. SimHydraulics block dialogs let you specify the units along with the parameter values, where appropriate. Use the converter blocks to associate units with an input signal and to specify the desired output signal units.

For examples of applying these rules when creating an actual hydraulic model, see Creating and Simulating a Simple Hydraulic Model.

MathWorks recommends that you build, simulate, and test your model incrementally. Start with an idealized, simplified model of your system, simulate it, verify that it works the way you expected. Then incrementally make your model more realistic, factoring in effects such as friction loss, motor shaft compliance, hard stops, and the other things that describe real-world phenomena. Simulate and test your model at every incremental step. Use subsystems to capture the model hierarchy, and simulate and test your subsystems separately before testing the whole model configuration. This approach helps you keep your models well organized and makes it easier to troubleshoot them.

Working with Fluids

A change in the working fluid of your SimHydraulics model affects the global parameters of the system. Global parameters, determined by the type of working fluid, are used in equations for most hydraulic blocks. For example, valves, orifices, and pipelines use fluid density and fluid kinematic viscosity; chambers and cylinders use fluid bulk modulus; and so on. When you change the type of fluid, the appropriate changes to the global parameter values are propagated to all the blocks in the hydraulic circuit.

Each topologically distinct hydraulic circuit in a diagram requires exactly one hydraulic fluid to be associated with it. You can specify the fluid by connecting a Hydraulic Fluid block or Custom Hydraulic Fluid block to the circuit.

• The Custom Hydraulic Fluid block, available in the Simscape Foundation library, lets you directly specify the fluid properties, such as fluid density, kinematic viscosity, bulk modulus, and the amount of entrapped air, in the block dialog.

• The Hydraulic Fluid block lets you select a type of fluid from a predefined list and specify the amount of entrapped air and fluid temperature. SimHydraulics software determines the fluid properties associated with this type of fluid and these conditions, and displays them in the block dialog.

In both cases, SimHydraulics software then applies the fluid properties as global parameters to all the blocks in the hydraulic circuit.

 Note   If no Hydraulic Fluid block or Custom Hydraulic Fluid block is attached to a circuit, the hydraulic blocks in this circuit use the default fluid, which is equivalent to fluid defined by a Custom Hydraulic Fluid block with the default parameter values. See the Custom Hydraulic Fluid block reference page for more information.