Using Chips: Example

From Nova Documentation
Jump to: navigation, search

Here is a basic example of using a Chip as an instance of an entire sublayer within a model. We are going to use the NetDiffuse model from the Model Library.

  • Step 1: Create sublayer

Create a Sub Model layer

In the top left corner of the NOVA GUI - select the white page symbol, New Sub Model. This will create a new sub model within the NetDiffuse model framework. We can name this sub model chip_demo, as shown below.

Name the Sub Model

Now we can see the three layers shown in the bottom left corner of the GUI. We can place the new chip_demo layer between the node and NetDiffuse (which I renamed to NetDiffuse_demo) layers.

New Sub Model

  • Step 2: Create the Chip

Create the Chip

Now we will drag the node Sub Model into the blank chip_demo Model Canvas. A blue Chip will appear. This chip, like all NOVA chips, holds an instance of a Capsule. In this case, that Capsule is the node layer. We can see that the Chip has the same parameters, inputs and outputs, as the node layer. We will attach pins to these inputs and output. This is solely to demonstrate that we can use and think about the Chip as an instance of the node layer that it encapsulates.

Chip has parameters of node layer

  • Step 3: Change CNet Properties

Within the CNet properties at the top layer we will change what it encapsulates to be chip_demo (the intermediate level) instead of the node layer. This means CNet calls 4 instances of the chip_demo layer directly. Each instance of chip_demo consists of a node layer, as we see in the Chip.

CNet calls instances of chip_demo

  • Step 4: Adjust top layer output

Finally, to account for an additional Sub Layer we must made some slight output changes at the top layer.

Adjust tot CodeChip for chip_demo

Originally the inpt into the tot_1 CodeChip was all of the instances of the node layer (from the node term). We could grab the value of temp within each instance. You can see the temp parameter within the node layer. Since we now have an intermediate layer, the chip_demo layer, we have to 'reach-down' into the node layer to 'grab' those values. To do this we write inpt[n].node.temp to reach the temp parameter within each node chip that is within the nth instance of chip_demo.

And the final output on the Dashboard:

Dashboard view of output