As described in Creating Device Systems, the
Device Model (

) defines a set of variables and equations that corresponds to a certain device characteristic. Typical examples from the field of electrical circuits are capacitors, resistors, voltages sources, and bipolar transistors.
To add a Device Model to a
Physics Interface (

) or any physics feature or physics property node, right-click the node and choose
Device Model from the
Devices submenu. If added under any of these nodes or a
Component node, the device item belongs to the device models closest in the hierarchy. For most cases this will be the device model added by the physics interface.
The Settings window has the following sections:
In the Type field you define a unique string that identifies the device model. When you create a
Device, you must specify a device model for that device. The device then instantiates the device model. A device model type should be unique, but if you declare several device models with the same type, the last one is used. In the
Inherited type field, you can enter a parent type that this device model inherits all inputs, ports, variables, and equations from. Leave this field empty to skip inheritance. A device model can also be abstract, meaning that you can only specify this type as an inherited type of another device model. A device cannot instantiate an abstract device model. Select the
Abstract model type checkbox to make a device model abstract.
The Device system type list only supports the option
Normal.
From the Device naming convention list, choose from the options
Dot hierarchy and dot-separated array indices,
Dot hierarchy and dot-separated array indices, and
Underscore hierarchy with no support for arrays. The first option is the default for new interfaces, and the last option is mainly used by interfaces created in a previous version before version 6.4. The setting controls the variable names generated by the device system. For example, a device named
R1 containing a variable
v will get the full name
id.R1.v using a dot-separated hierarchy and
id.R1_v using an underscore-separated hierarchy. The latter version is less flexible with variable names because a variable name with an underscore have to be escaped, so using
R1_load in the above example leads to the full name
id.R1__load_v, while the name using dot-separation will simply be
R1_load.v.Therefore, the dot-separated convention is the recommended choice. The dot-separated convention has two variants that controls the naming convention for the scalar component names of array variables. A 3-by-1 array variable
v from the above example will get the scalar components
id.R1.v.1,
id.R1.v.2, and
id.R1.v.3, using dot-separated array indices, or
id.R1.v_1,
id.R1.v_2, and
id.R1_3, using underscore-separated array indices.