Skip to content
ProductTest.md

ProductTest

Multiplies two constant values together.

This component takes two constant values (3 and 2) and multiplies them together using a Product block, resulting in an output value of 6. The component demonstrates the basic connection patterns for creating a multiplication operation between constant signals in the modeling language.

Usage

ProductTest()

Behavior

product.u1(t)=c1.y(t)product.u2(t)=c2.y(t)c1.y(t)=c1.kc2.y(t)=c2.kproduct.y(t)=product.u2(t)product.u1(t)

Source

dyad
# Multiplies two constant values together.
#
# This component takes two constant values (3 and 2) and multiplies them together using a Product block,
# resulting in an output value of 6. The component demonstrates the basic connection patterns for creating
# a multiplication operation between constant signals in the modeling language.
test component ProductTest
  # Constant block that outputs the value 3
  c1 = Constant(k = 3) [{
    "Dyad": {
      "placement": {"icon": {"iconName": "constant1", "x1": -50, "y1": 100, "x2": 50, "y2": 300}}
    }
  }]
  # Constant block that outputs the value 2
  c2 = Constant(k = 2) [{
    "Dyad": {
      "placement": {"icon": {"iconName": "constant2", "x1": -50, "y1": 700, "x2": 50, "y2": 900}}
    }
  }]
  # Product block that multiplies its two inputs
  product = Product() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "product", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
relations
  # Connects the output of constant c1 to the first input of the product block
  connect(product.u1, c1.y)
  # Connects the output of constant c2 to the second input of the product block
  connect(product.u2, c2.y)
metadata {
  "Dyad": {"tests": {"case1": {"stop": 5, "expect": {"final": {"product.y": 6}}}}}
}
end
Flattened Source
dyad
# Multiplies two constant values together.
#
# This component takes two constant values (3 and 2) and multiplies them together using a Product block,
# resulting in an output value of 6. The component demonstrates the basic connection patterns for creating
# a multiplication operation between constant signals in the modeling language.
test component ProductTest
  # Constant block that outputs the value 3
  c1 = Constant(k = 3) [{
    "Dyad": {
      "placement": {"icon": {"iconName": "constant1", "x1": -50, "y1": 100, "x2": 50, "y2": 300}}
    }
  }]
  # Constant block that outputs the value 2
  c2 = Constant(k = 2) [{
    "Dyad": {
      "placement": {"icon": {"iconName": "constant2", "x1": -50, "y1": 700, "x2": 50, "y2": 900}}
    }
  }]
  # Product block that multiplies its two inputs
  product = Product() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "product", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
relations
  # Connects the output of constant c1 to the first input of the product block
  connect(product.u1, c1.y)
  # Connects the output of constant c2 to the second input of the product block
  connect(product.u2, c2.y)
metadata {
  "Dyad": {"tests": {"case1": {"stop": 5, "expect": {"final": {"product.y": 6}}}}}
}
end


Test Cases

Test Case case1

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.