FeedbackTest ​
Computes the difference between two input signals.
The FeedbackTest component demonstrates a basic feedback mechanism by subtracting the value of one constant (2) from another constant (1), resulting in an output of -1. This illustrates the core functionality of a feedback control system where one signal is subtracted from another.
Usage ​
BlockComponents.FeedbackTest()
Behavior ​
Source ​
dyad
"""
Computes the difference between two input signals.
The `FeedbackTest` component demonstrates a basic feedback mechanism by subtracting the value of
one constant (2) from another constant (1), resulting in an output of -1. This illustrates the
core functionality of a feedback control system where one signal is subtracted from another.
"""
test component FeedbackTest
"Constant block with value 1 that provides the primary input signal"
c1 = Constant(k = 1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 80, "y1": 90, "x2": 180, "y2": 190, "rot": 0}
}
}
}
"Constant block with value 2 that provides the feedback signal to be subtracted"
c2 = Constant(k = 2) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 80, "y1": 300, "x2": 180, "y2": 400, "rot": 0}
}
}
}
"Feedback block that subtracts the second input from the first"
feedback = Feedback() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 360, "y1": 170, "x2": 460, "y2": 270, "rot": 0}
}
}
}
relations
"Connects the output of constant block c1 to the primary input of the feedback block"
connect(feedback.u1, c1.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 300, "y": 190}, {"x": 300, "y": 140}], "E": 2}],
"renderStyle": "standard"
}
}
"Connects the output of constant block c2 to the feedback input of the feedback block"
connect(feedback.u2, c2.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 300, "y": 250}, {"x": 300, "y": 350}], "E": 2}],
"renderStyle": "standard"
}
}
metadata {
"Dyad": {
"icons": {"default": "dyad://BlockComponents/Example.svg"},
"tests": {"case1": {"stop": 5, "expect": {"final": {"feedback.y": -1}}}}
}
}
endFlattened Source
dyad
"""
Computes the difference between two input signals.
The `FeedbackTest` component demonstrates a basic feedback mechanism by subtracting the value of
one constant (2) from another constant (1), resulting in an output of -1. This illustrates the
core functionality of a feedback control system where one signal is subtracted from another.
"""
test component FeedbackTest
"Constant block with value 1 that provides the primary input signal"
c1 = Constant(k = 1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 80, "y1": 90, "x2": 180, "y2": 190, "rot": 0}
}
}
}
"Constant block with value 2 that provides the feedback signal to be subtracted"
c2 = Constant(k = 2) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 80, "y1": 300, "x2": 180, "y2": 400, "rot": 0}
}
}
}
"Feedback block that subtracts the second input from the first"
feedback = Feedback() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 360, "y1": 170, "x2": 460, "y2": 270, "rot": 0}
}
}
}
relations
"Connects the output of constant block c1 to the primary input of the feedback block"
connect(feedback.u1, c1.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 300, "y": 190}, {"x": 300, "y": 140}], "E": 2}],
"renderStyle": "standard"
}
}
"Connects the output of constant block c2 to the feedback input of the feedback block"
connect(feedback.u2, c2.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 300, "y": 250}, {"x": 300, "y": 350}], "E": 2}],
"renderStyle": "standard"
}
}
metadata {
"Dyad": {
"icons": {"default": "dyad://BlockComponents/Example.svg"},
"tests": {"case1": {"stop": 5, "expect": {"final": {"feedback.y": -1}}}}
}
}
end