LIBRARY
Examples.SimpleLQR ​
Usage ​
DiscreteComponents.Examples.SimpleLQR()
Behavior ​
Source ​
dyad
component SimpleLQR
zeroorderhold = DiscreteComponents.ZeroOrderHold() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 380, "y1": 320, "x2": 470, "y2": 410, "rot": 0}
},
"tags": []
}
}
sampler = DiscreteComponents.Sampler() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 720, "y1": 460, "x2": 630, "y2": 550, "rot": 270}
},
"tags": []
}
}
periodicclock = DiscreteComponents.PeriodicClock(dt = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 860, "y1": 700, "x2": 950, "y2": 790, "rot": 0}
},
"tags": []
}
}
integrator = BlockComponents.Continuous.Integrator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 530, "y1": 310, "x2": 630, "y2": 410, "rot": 0}
},
"tags": []
}
}
integrator1 = BlockComponents.Continuous.Integrator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 760, "y1": 310, "x2": 860, "y2": 410, "rot": 0}
},
"tags": []
}
}
"Feedback gain"
mux = DiscreteComponents.Examples.Mux() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 650, "y1": 600, "x2": 570, "y2": 680, "rot": 0}
},
"tags": []
}
}
sampler1 = DiscreteComponents.Sampler() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 870, "y1": 460, "x2": 950, "y2": 540, "rot": 90}
},
"tags": []
}
}
matrixgain = DiscreteComponents.Examples.MatrixGain(ny = 1, K = [[1, 1]]) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 510, "y1": 590, "x2": 410, "y2": 690, "rot": 0}
},
"tags": []
}
}
"Picks a scalar index from an array"
selector = DiscreteComponents.Examples.Selector() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 260, "y1": 480, "x2": 360, "y2": 580, "rot": 270}
},
"tags": []
}
}
relations
connect(integrator.y, sampler.u, integrator1.u) {
"Dyad": {
"edges": [
{"S": 1, "M": [], "E": -1},
{"S": 2, "M": [{"x": 675, "y": 410}, {"x": 670, "y": 410}], "E": -1},
{"S": -1, "M": [], "E": 3}
],
"junctions": [{"x": 670, "y": 360}],
"renderStyle": "standard"
}
}
connect(sampler.y, mux.u1, periodicclock.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 675, "y": 619.2}], "E": 2}],
"renderStyle": "standard"
}
}
connect(sampler1.y, mux.u2) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 910, "y": 660.8}], "E": 2}],
"renderStyle": "standard"
}
}
connect(integrator1.y, sampler1.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 910, "y": 360}], "E": 2}],
"renderStyle": "standard"
}
}
connect(zeroorderhold.y, integrator.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 497.95, "y": 365}, {"x": 497.95, "y": 360}], "E": 2}],
"renderStyle": "standard"
}
}
connect(mux.y, matrixgain.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(matrixgain.y, selector.u) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 310, "y": 640}], "E": 2}]
}
}
connect(selector.y, zeroorderhold.u) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 310, "y": 365}], "E": 2}]
}
}
connect(sampler1.y, mux.u2, periodicclock.y) {
"Dyad": {
"edges": [
{"S": 1, "M": [{"x": 910, "y": 660}], "E": -1},
{"S": -1, "M": [{"x": 713.4, "y": 660}, {"x": 713.4, "y": 660.8}], "E": 2},
{"S": 3, "M": [{"x": 830, "y": 745}], "E": -1}
],
"junctions": [{"x": 830, "y": 660}],
"renderStyle": "standard"
}
}
metadata {
"Dyad": {
"experiments": {},
"tests": {},
"labels": [],
"icons": {"default": "dyad://Dyad/Default.svg"},
"path": {},
"doc": {"behavior": true}
}
}
endFlattened Source
dyad
component SimpleLQR
zeroorderhold = DiscreteComponents.ZeroOrderHold() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 380, "y1": 320, "x2": 470, "y2": 410, "rot": 0}
},
"tags": []
}
}
sampler = DiscreteComponents.Sampler() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 720, "y1": 460, "x2": 630, "y2": 550, "rot": 270}
},
"tags": []
}
}
periodicclock = DiscreteComponents.PeriodicClock(dt = 0.1) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 860, "y1": 700, "x2": 950, "y2": 790, "rot": 0}
},
"tags": []
}
}
integrator = BlockComponents.Continuous.Integrator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 530, "y1": 310, "x2": 630, "y2": 410, "rot": 0}
},
"tags": []
}
}
integrator1 = BlockComponents.Continuous.Integrator() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 760, "y1": 310, "x2": 860, "y2": 410, "rot": 0}
},
"tags": []
}
}
"Feedback gain"
mux = DiscreteComponents.Examples.Mux() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 650, "y1": 600, "x2": 570, "y2": 680, "rot": 0}
},
"tags": []
}
}
sampler1 = DiscreteComponents.Sampler() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 870, "y1": 460, "x2": 950, "y2": 540, "rot": 90}
},
"tags": []
}
}
matrixgain = DiscreteComponents.Examples.MatrixGain(ny = 1, K = [[1, 1]]) {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 510, "y1": 590, "x2": 410, "y2": 690, "rot": 0}
},
"tags": []
}
}
"Picks a scalar index from an array"
selector = DiscreteComponents.Examples.Selector() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 260, "y1": 480, "x2": 360, "y2": 580, "rot": 270}
},
"tags": []
}
}
relations
connect(integrator.y, sampler.u, integrator1.u) {
"Dyad": {
"edges": [
{"S": 1, "M": [], "E": -1},
{"S": 2, "M": [{"x": 675, "y": 410}, {"x": 670, "y": 410}], "E": -1},
{"S": -1, "M": [], "E": 3}
],
"junctions": [{"x": 670, "y": 360}],
"renderStyle": "standard"
}
}
connect(sampler.y, mux.u1, periodicclock.y) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 675, "y": 619.2}], "E": 2}],
"renderStyle": "standard"
}
}
connect(sampler1.y, mux.u2) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 910, "y": 660.8}], "E": 2}],
"renderStyle": "standard"
}
}
connect(integrator1.y, sampler1.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 910, "y": 360}], "E": 2}],
"renderStyle": "standard"
}
}
connect(zeroorderhold.y, integrator.u) {
"Dyad": {
"edges": [{"S": 1, "M": [{"x": 497.95, "y": 365}, {"x": 497.95, "y": 360}], "E": 2}],
"renderStyle": "standard"
}
}
connect(mux.y, matrixgain.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
connect(matrixgain.y, selector.u) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 310, "y": 640}], "E": 2}]
}
}
connect(selector.y, zeroorderhold.u) {
"Dyad": {
"renderStyle": "standard",
"edges": [{"S": 1, "M": [{"x": 310, "y": 365}], "E": 2}]
}
}
connect(sampler1.y, mux.u2, periodicclock.y) {
"Dyad": {
"edges": [
{"S": 1, "M": [{"x": 910, "y": 660}], "E": -1},
{"S": -1, "M": [{"x": 713.4, "y": 660}, {"x": 713.4, "y": 660.8}], "E": 2},
{"S": 3, "M": [{"x": 830, "y": 745}], "E": -1}
],
"junctions": [{"x": 830, "y": 660}],
"renderStyle": "standard"
}
}
metadata {
"Dyad": {
"experiments": {},
"tests": {},
"labels": [],
"icons": {"default": "dyad://Dyad/Default.svg"},
"path": {},
"doc": {"behavior": true}
}
}
endTest Cases ​
No test cases defined.
Related ​
Examples
Experiments
Analyses