Test_AndLogical Icon
Test_AndLogical
Usage
PrimitiveComponents.Test_AndLogical()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( step_{1_{+}y(t)}, and_{logical\_1_{+}u1(t)} \right) \\ \mathrm{connect}\left( step_{2_{+}y(t)}, and_{logical\_1_{+}u2(t)} \right) \\ \mathrm{connect}\left( step_{3_{+}y(t)}, and_{logical\_2_{+}u1(t)} \right) \\ \mathrm{connect}\left( step_{4_{+}y(t)}, and_{logical\_2_{+}u2(t)} \right) \\ \mathtt{and\_logical\_1.c1}\left( t \right) = check\_with\_target\_value\left( \mathtt{and\_logical\_1.u1}\left( t \right), \mathtt{and\_logical\_1.target\_value}, \mathtt{and\_logical\_1.abs\_tol} \right) \\ \mathtt{and\_logical\_1.c2}\left( t \right) = check\_with\_target\_value\left( \mathtt{and\_logical\_1.u2}\left( t \right), \mathtt{and\_logical\_1.target\_value}, \mathtt{and\_logical\_1.abs\_tol} \right) \\ \mathtt{and\_logical\_1.y}\left( t \right) = ifelse\left( \neg \mathtt{and\_logical\_1.c1}\left( t \right) \wedge \neg \mathtt{and\_logical\_1.c2}\left( t \right), 1, 0 \right) \\ \mathtt{and\_logical\_2.c1}\left( t \right) = check\_with\_target\_value\left( \mathtt{and\_logical\_2.u1}\left( t \right), \mathtt{and\_logical\_2.target\_value}, \mathtt{and\_logical\_2.abs\_tol} \right) \\ \mathtt{and\_logical\_2.c2}\left( t \right) = check\_with\_target\_value\left( \mathtt{and\_logical\_2.u2}\left( t \right), \mathtt{and\_logical\_2.target\_value}, \mathtt{and\_logical\_2.abs\_tol} \right) \\ \mathtt{and\_logical\_2.y}\left( t \right) = ifelse\left( \neg \mathtt{and\_logical\_2.c1}\left( t \right) \wedge \neg \mathtt{and\_logical\_2.c2}\left( t \right), 1, 0 \right) \\ \mathtt{step\_1.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_1.start\_time}, \mathtt{step\_1.height} + \mathtt{step\_1.offset}, \mathtt{step\_1.offset} \right) \\ \mathtt{step\_2.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_2.start\_time}, \mathtt{step\_2.height} + \mathtt{step\_2.offset}, \mathtt{step\_2.offset} \right) \\ \mathtt{step\_3.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_3.start\_time}, \mathtt{step\_3.height} + \mathtt{step\_3.offset}, \mathtt{step\_3.offset} \right) \\ \mathtt{step\_4.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_4.start\_time}, \mathtt{step\_4.height} + \mathtt{step\_4.offset}, \mathtt{step\_4.offset} \right) \\ \end{array} \right] \end{equation} \]
Source
component Test_AndLogical
and_logical_1 = PrimitiveComponents.LogicGates.Logical_AND(target_value = 0.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": 160, "x2": 550, "y2": 260, "rot": 0}
}
}
}
and_logical_2 = PrimitiveComponents.LogicGates.Logical_AND(target_value = 1.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": 650, "x2": 550, "y2": 750, "rot": 0}
}
}
}
step_1 = BlockComponents.Step(start_time = 2, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 150, "y1": 20, "x2": 250, "y2": 120, "rot": 0}
}
}
}
step_2 = BlockComponents.Step(start_time = 5, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 150, "y1": 290, "x2": 250, "y2": 390, "rot": 0}
}
}
}
step_3 = BlockComponents.Step(start_time = 2, height = 1.05, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 170, "y1": 560, "x2": 270, "y2": 660, "rot": 0}
}
}
}
step_4 = BlockComponents.Step(start_time = 5, height = 1, offset = 0.05) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 170, "y1": 780, "x2": 270, "y2": 880, "rot": 0}
}
}
}
relations
connect(step_1.y, and_logical_1.u1) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 349, "y": 70}, {"x": 349, "y": 187}], "E": 2}]}
}
connect(and_logical_1.u2, step_2.y) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 349, "y": 232}, {"x": 349, "y": 340}], "E": 2}]}
}
connect(and_logical_2.u1, step_3.y) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 359, "y": 677}, {"x": 359, "y": 610}], "E": 2}]}
}
connect(and_logical_2.u2, step_4.y) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 359, "y": 722}, {"x": 359, "y": 830}], "E": 2}]}
}
metadata {
"Dyad": {
"experiments": {"Test_AndLogical_": {"stop": 10}},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["and_logical_1.y", "and_logical_2.y"]}
}
}
}
}
end
Flattened Source
component Test_AndLogical
and_logical_1 = PrimitiveComponents.LogicGates.Logical_AND(target_value = 0.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": 160, "x2": 550, "y2": 260, "rot": 0}
}
}
}
and_logical_2 = PrimitiveComponents.LogicGates.Logical_AND(target_value = 1.0, abs_tol = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": 650, "x2": 550, "y2": 750, "rot": 0}
}
}
}
step_1 = BlockComponents.Step(start_time = 2, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 150, "y1": 20, "x2": 250, "y2": 120, "rot": 0}
}
}
}
step_2 = BlockComponents.Step(start_time = 5, height = 1, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 150, "y1": 290, "x2": 250, "y2": 390, "rot": 0}
}
}
}
step_3 = BlockComponents.Step(start_time = 2, height = 1.05, offset = 0) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 170, "y1": 560, "x2": 270, "y2": 660, "rot": 0}
}
}
}
step_4 = BlockComponents.Step(start_time = 5, height = 1, offset = 0.05) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 170, "y1": 780, "x2": 270, "y2": 880, "rot": 0}
}
}
}
relations
connect(step_1.y, and_logical_1.u1) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 349, "y": 70}, {"x": 349, "y": 187}], "E": 2}]}
}
connect(and_logical_1.u2, step_2.y) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 349, "y": 232}, {"x": 349, "y": 340}], "E": 2}]}
}
connect(and_logical_2.u1, step_3.y) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 359, "y": 677}, {"x": 359, "y": 610}], "E": 2}]}
}
connect(and_logical_2.u2, step_4.y) {
"Dyad": {"edges": [{"S": 1, "M": [{"x": 359, "y": 722}, {"x": 359, "y": 830}], "E": 2}]}
}
metadata {
"Dyad": {
"experiments": {"Test_AndLogical_": {"stop": 10}},
"tests": {
"case1": {
"stop": 10,
"abstol": 0.00001,
"reltol": 0.00001,
"expect": {"signals": ["and_logical_1.y", "and_logical_2.y"]}
}
}
}
}
endTest Cases
Test Case case1
pltpltRelated
- Examples
- Experiments
- Analyses