Creating Device Systems
For certain global interfaces that do not have any distributed dependent variables (no spatial dependence), the complexity of the system often lies in the large number of dependent variables it needs. It is usually rather complicated to define a set of dependent variables to solve for, so there is a special frame work for handling such systems.
You define a hierarchy of device models that defines a set of variables and equations. A Device Model specifies a type of a device. The device model also needs ports that define how devices communicate with other devices.
A port also has a type, called a Port Model. A port model defines a set of variables that take part in the communication between devices. A typical example of this rather abstract description is an electrical circuit. All resistors in a circuit belongs to the same device model, the resistor model. The resistor model defines two ports representing the two pins that a resistor has. Each resistor is a device where the two ports to communicate with other resistors and possibly other types of devices like capacitors and inductors. The port model for the port needs a voltage and a current. The voltage represents the node potential of the connection, and is the same for all ports that are connected. The current that flows out of a port must flow into the other ports, so the sum of all currents must be zero. The port model declares this behavior.