3 Creating Custom Modeling Components - MapleSim Help

3 Creating Custom Modeling Components

In this chapter:

3.3 Creating Custom Components with Physical Connections

When you create custom components based on physical connections, each connection port has two variables associated with it: the across variable and the through variable. The through variable represents a flow of a conserved quantity (such as heat, mass, current, force or torque) and the across variable represents the driving force in a system (temperature difference, pressure difference, voltage drop, velocity or relative angular velocity).

Table 3.3: Characteristics of Through and Across Variables
 Characteristics of Through Variables Characteristics of Across Variables Conserved quantity (like heat or mass) Has a direction of flow Satisfies the relationship input = output + accumulation Uniform across a domain Drives the flow of the conserved quantity Is a scalar Defined as the difference between two points within a physical domain

Table 3.4 shows the mathematical relationships defining the connection between various across and through variables.

Table 3.4: Through and Across Variable Mathematical Relationship
 Domain Governing Equation Through Variable Across Variable Ohm’s Law Electrical Domain $I$ $\mathrm{V}$ Hagen–Poiseuille equation Hydraulic Domain $P$ Fourier's law Thermal Domain $T$

Deriving the System Equations for a Resistor

Table 3.5 shows a model of a simple resistor with several variables and one parameter.

Table 3.5: Resistor Variables and Parameters
 Variable Parameter Description i(t) Current v(t) Voltage difference vLeft(t) Voltage on the left port vRight(t) Voltage on the right port R Resistance

Ohm’s Law defines the relationship between the voltage and the current as

$v\left(t\right)={V}_{\mathrm{right}\left(t\right)}-{V}_{\mathrm{left}\left(t\right)}$

Figure 3.9 shows the equations mapped to the custom component ports.

 Figure 3.9: Resistor Port Mapping

The current i(t) on the right port has a negative sign, representing flow out of the resistor. The current on the left port is positive, representing flow into the resistor. The resistance (R) is defined as a parameter available in the Propeties tab ( ).