basic openmodelica model emitting

This commit is contained in:
2026-07-20 17:34:18 +02:00
parent 42bf09610b
commit d368b36b8c
26 changed files with 1608 additions and 594 deletions

View File

@@ -6,51 +6,18 @@
},
"roots": [
{
"id": "57fe8127-ea9d-4a8b-8d09-da430ffbbd92",
"name": "PID",
"id": "6060fdd6-e816-4da9-8bb6-fde1a66d3e92",
"name": "Test",
"position": {
"x": 0.0,
"y": 0.0
},
"rotation": 0.0,
"interface": {
"inputs": [
{
"id": "port-1342716d",
"name": "in",
"position": {
"x": -384.0,
"y": -112.0
},
"properties": {
"iconPosition": {
"x": 0.0,
"y": 0.0
}
},
"type": "signal",
"multipleConnections": false
}
],
"outputs": [
{
"id": "port-c75d0f16",
"name": "out",
"position": {
"x": 320.0,
"y": -112.0
},
"properties": {
"iconPosition": {
"x": 0.0,
"y": 0.0
}
},
"type": "signal",
"multipleConnections": false
}
]
"inputs": [],
"outputs": []
},
"parameters": [],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
@@ -89,17 +56,124 @@
"showName": false
},
"library": {
"showSubtree": false
"showSubtree": true
},
"implementation": {
"kind": "graph",
"graph": {
"blocks": [
{
"id": "cbfb5d1f-38cc-412e-b8e3-53aa82e46eb8",
"name": "g_D",
"id": "2e6a192c-5aeb-45d6-80ee-d64a72392b76",
"name": "Constant0",
"position": {
"x": -128.0,
"x": -160.0,
"y": -160.0
},
"rotation": 0.0,
"interface": {
"inputs": [],
"outputs": [
{
"id": "port-ddc97277",
"name": "y",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 88.0,
"y": 40.0
}
},
"type": "signal",
"multipleConnections": false
}
]
},
"parameters": [
{
"id": "parameter-022177fc",
"name": "v",
"type": "real",
"value": "1"
}
],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
"border": "#303030",
"text": "Text",
"size": {
"width": 128.0,
"height": 128.0
},
"elements": [
{
"cornerRadius": 5.0,
"fill": "#f4f4f4",
"height": 64.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#303030",
"type": "rectangle",
"width": 64.0,
"x": 32.0,
"y": 32.0
},
{
"fill": "none",
"height": 48.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#00007f",
"type": "line",
"width": 0.0,
"x": 40.0,
"y": 40.0
},
{
"fill": "none",
"height": 0.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#00007f",
"type": "line",
"width": 48.0,
"x": 40.0,
"y": 88.0
},
{
"fill": "none",
"height": 0.0,
"lineStyle": "solid",
"lineWidth": 1.0,
"stroke": "#ffaa00",
"type": "line",
"width": 48.0,
"x": 40.0,
"y": 64.0
}
]
},
"properties": {
"showName": true
},
"library": {
"showSubtree": true
},
"implementation": {
"kind": "text",
"source": {
"equations": "y = v;"
}
}
},
{
"id": "f4a78255-8b73-4bb3-ae8e-24b566c72bc0",
"name": "gain0",
"position": {
"x": -32.0,
"y": -160.0
},
"rotation": 0.0,
@@ -107,7 +181,7 @@
"inputs": [
{
"id": "port-df34ce84",
"name": "in",
"name": "u",
"position": {
"x": 0.0,
"y": 0.0
@@ -125,7 +199,7 @@
"outputs": [
{
"id": "port-fe9e6486",
"name": "out",
"name": "y",
"position": {
"x": 0.0,
"y": 0.0
@@ -141,6 +215,14 @@
}
]
},
"parameters": [
{
"id": "parameter-61a43a86",
"name": "k",
"type": "real",
"value": "2.5"
}
],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
@@ -188,49 +270,24 @@
"implementation": {
"kind": "text",
"source": {
"equations": "out = k*in;",
"parameters": [
{
"id": "parameter-61a43a86",
"name": "k",
"type": "real",
"value": "1"
}
]
"equations": "y = k*u;"
}
}
},
{
"id": "478e7ff8-baa1-467f-8707-e375b99395f6",
"name": "differentiate0",
"id": "0b29c706-eb1b-4839-8ad2-bbed64efc01e",
"name": "const_and_time",
"position": {
"x": 0.0,
"y": -160.0
"x": -160.0,
"y": -32.0
},
"rotation": 0.0,
"interface": {
"inputs": [
{
"id": "port-1cbabc8f",
"name": "in",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 64.0,
"y": 64.0
}
},
"type": "signal",
"multipleConnections": false
}
],
"inputs": [],
"outputs": [
{
"id": "port-4eeea4e7",
"name": "out",
"id": "port-ddc97277",
"name": "y",
"position": {
"x": 0.0,
"y": 0.0
@@ -246,6 +303,14 @@
}
]
},
"parameters": [
{
"id": "parameter-022177fc",
"name": "v",
"type": "real",
"value": "4.8"
}
],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
@@ -269,123 +334,37 @@
"y": 32.0
},
{
"color": "#00007f",
"fill": "#ffffff",
"fontSize": 18.0,
"fill": "none",
"height": 48.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#00007f",
"text": "d/dt",
"type": "text",
"width": 48.0,
"type": "line",
"width": 0.0,
"x": 40.0,
"y": 40.0
}
]
},
"properties": {
"showName": false
},
"library": {
"showSubtree": true
},
"implementation": {
"kind": "text",
"source": {
"equations": "initial out = initial;\nout = der(in);",
"parameters": [
{
"id": "parameter-331e38be",
"name": "initial",
"type": "real",
"value": "0"
}
]
}
}
},
{
"id": "9011e8f6-940a-40ca-8bdf-773f0ed1c9f3",
"name": "g_P",
"position": {
"x": -64.0,
"y": -288.0
},
"rotation": 0.0,
"interface": {
"inputs": [
{
"id": "port-df34ce84",
"name": "in",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 64.0,
"y": 64.0
}
},
"type": "signal",
"multipleConnections": false
}
],
"outputs": [
{
"id": "port-fe9e6486",
"name": "out",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 88.0,
"y": 40.0
}
},
"type": "signal",
"multipleConnections": false
}
]
},
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
"border": "#303030",
"text": "Text",
"size": {
"width": 128.0,
"height": 128.0
},
"elements": [
{
"cornerRadius": 5.0,
"fill": "#f4f4f4",
"height": 64.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#303030",
"type": "rectangle",
"width": 64.0,
"x": 32.0,
"y": 32.0
},
{
"color": "#00007f",
"fill": "#ffffff",
"fontSize": 24.0,
"height": 48.0,
"fill": "none",
"height": 0.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#00007f",
"text": "K",
"type": "text",
"type": "line",
"width": 48.0,
"x": 40.0,
"y": 40.0
"y": 88.0
},
{
"fill": "none",
"height": 0.0,
"lineStyle": "solid",
"lineWidth": 1.0,
"stroke": "#ffaa00",
"type": "line",
"width": 48.0,
"x": 40.0,
"y": 64.0
}
]
},
@@ -398,23 +377,15 @@
"implementation": {
"kind": "text",
"source": {
"equations": "out = k*in;",
"parameters": [
{
"id": "parameter-61a43a86",
"name": "k",
"type": "real",
"value": "1"
}
]
"equations": "y = v+time;"
}
}
},
{
"id": "1995074c-4580-4ca3-8691-6923aedc5833",
"name": "g_I",
"id": "43f739a0-e50f-44ae-bd95-0e0c1a10d1cf",
"name": "gain1",
"position": {
"x": -128.0,
"x": -32.0,
"y": -32.0
},
"rotation": 0.0,
@@ -422,7 +393,7 @@
"inputs": [
{
"id": "port-df34ce84",
"name": "in",
"name": "u",
"position": {
"x": 0.0,
"y": 0.0
@@ -440,7 +411,7 @@
"outputs": [
{
"id": "port-fe9e6486",
"name": "out",
"name": "y",
"position": {
"x": 0.0,
"y": 0.0
@@ -456,6 +427,14 @@
}
]
},
"parameters": [
{
"id": "parameter-61a43a86",
"name": "k",
"type": "real",
"value": "-5"
}
],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
@@ -503,31 +482,23 @@
"implementation": {
"kind": "text",
"source": {
"equations": "out = k*in;",
"parameters": [
{
"id": "parameter-61a43a86",
"name": "k",
"type": "real",
"value": "1"
}
]
"equations": "y = k*u;"
}
}
},
{
"id": "c7440f4d-f206-4c27-9fd2-5722950f207f",
"id": "59bb51be-8185-4b0b-a894-e38db61aff18",
"name": "add0",
"position": {
"x": 128.0,
"y": -160.0
"x": 96.0,
"y": -96.0
},
"rotation": 0.0,
"interface": {
"inputs": [
{
"id": "port-c995845c",
"name": "in",
"name": "u",
"position": {
"x": 0.0,
"y": 0.0
@@ -545,7 +516,7 @@
"outputs": [
{
"id": "port-a2f0dea6",
"name": "out",
"name": "y",
"position": {
"x": 0.0,
"y": 0.0
@@ -561,6 +532,7 @@
}
]
},
"parameters": [],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
@@ -607,251 +579,20 @@
"implementation": {
"kind": "text",
"source": {
"equations": "out = sum(in[i] for i in 1:in.N);",
"parameters": []
}
}
},
{
"id": "48af4110-839a-45f7-a105-7e7dbc51676b",
"name": "integrate0",
"position": {
"x": 0.0,
"y": -32.0
},
"rotation": 0.0,
"interface": {
"inputs": [
{
"id": "port-12903207",
"name": "in",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 64.0,
"y": 64.0
}
},
"type": "signal",
"multipleConnections": false
}
],
"outputs": [
{
"id": "port-b3370b1a",
"name": "out",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 88.0,
"y": 40.0
}
},
"type": "signal",
"multipleConnections": false
}
]
},
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
"border": "#303030",
"text": "Text",
"size": {
"width": 128.0,
"height": 128.0
},
"elements": [
{
"cornerRadius": 5.0,
"fill": "#f4f4f4",
"height": 64.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#303030",
"type": "rectangle",
"width": 64.0,
"x": 32.0,
"y": 32.0
},
{
"color": "#00007f",
"fill": "#ffffff",
"fontSize": 18.0,
"height": 48.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#00007f",
"text": "dt",
"type": "text",
"width": 28.0,
"x": 64.0,
"y": 40.0
},
{
"color": "#00007f",
"fill": "none",
"fontSize": 32.0,
"height": 54.0,
"lineStyle": "none",
"lineWidth": 1.5,
"stroke": "#00007f",
"text": "\u222b",
"type": "text",
"width": 28.0,
"x": 40.0,
"y": 32.0
}
]
},
"properties": {
"showName": false
},
"library": {
"showSubtree": true
},
"implementation": {
"kind": "text",
"source": {
"equations": "initial out = initial;\nder(out) = in;",
"parameters": [
{
"id": "parameter-6bdc1c76",
"name": "initial",
"type": "real",
"value": "0"
}
]
"equations": "y = sum(u[i] for i in 1:$u_N$ );"
}
}
}
],
"connections": [
{
"id": "f89a8edb-b662-4a55-aa00-6d681b0bf6ae",
"id": "df23ff13-2a30-4c85-be66-56f66114d58e",
"source": {
"block": "9011e8f6-940a-40ca-8bdf-773f0ed1c9f3",
"port": "port-fe9e6486"
"block": "2e6a192c-5aeb-45d6-80ee-d64a72392b76",
"port": "port-ddc97277"
},
"target": {
"block": "c7440f4d-f206-4c27-9fd2-5722950f207f",
"port": "port-c995845c"
},
"name": "",
"properties": {
"waypoints": [
{
"x": 192.0,
"y": -224.0
}
]
}
},
{
"id": "c1a2f8e2-b98f-45ee-9ef6-fad8cd42b71b",
"source": {
"block": "478e7ff8-baa1-467f-8707-e375b99395f6",
"port": "port-4eeea4e7"
},
"target": {
"block": "c7440f4d-f206-4c27-9fd2-5722950f207f",
"port": "port-c995845c"
},
"name": "",
"properties": {
"waypoints": []
}
},
{
"id": "e889f7bd-c684-4e59-8e9d-1693bd2ba87f",
"source": {
"block": "cbfb5d1f-38cc-412e-b8e3-53aa82e46eb8",
"port": "port-fe9e6486"
},
"target": {
"block": "478e7ff8-baa1-467f-8707-e375b99395f6",
"port": "port-1cbabc8f"
},
"name": "",
"properties": {
"waypoints": []
}
},
{
"id": "1cebb01c-7da4-48c7-b7ea-5585f64cd524",
"source": {
"block": "1995074c-4580-4ca3-8691-6923aedc5833",
"port": "port-fe9e6486"
},
"target": {
"block": "48af4110-839a-45f7-a105-7e7dbc51676b",
"port": "port-12903207"
},
"name": "",
"properties": {
"waypoints": []
}
},
{
"id": "6d16540e-d902-4ebf-a6a1-dcdda0cc8458",
"source": {
"block": "48af4110-839a-45f7-a105-7e7dbc51676b",
"port": "port-b3370b1a"
},
"target": {
"block": "c7440f4d-f206-4c27-9fd2-5722950f207f",
"port": "port-c995845c"
},
"name": "",
"properties": {
"waypoints": [
{
"x": 192.0,
"y": 32.0
}
]
}
},
{
"id": "206f1501-4509-4ba7-a28e-156e35de51ea",
"source": {
"block": "c7440f4d-f206-4c27-9fd2-5722950f207f",
"port": "port-a2f0dea6"
},
"target": {
"interface": "port-c75d0f16"
},
"name": "",
"properties": {
"waypoints": []
}
},
{
"id": "5d234bec-8754-46e8-b9e8-1c802bb9f9ba",
"source": {
"interface": "port-1342716d"
},
"target": {
"junction": "7a552e5e-b15d-46ca-a891-37e5129f88d1"
},
"name": "",
"properties": {
"waypoints": []
}
},
{
"id": "33ba6f27-6f3a-4290-baac-b3cddcaa6b50",
"source": {
"junction": "7a552e5e-b15d-46ca-a891-37e5129f88d1"
},
"target": {
"block": "cbfb5d1f-38cc-412e-b8e3-53aa82e46eb8",
"block": "f4a78255-8b73-4bb3-ae8e-24b566c72bc0",
"port": "port-df34ce84"
},
"name": "",
@@ -860,58 +601,54 @@
}
},
{
"id": "ee4a3409-fc46-485c-b475-b456dddb93b5",
"id": "00f7d291-641b-4200-afa3-f1ec941faed7",
"source": {
"junction": "7a552e5e-b15d-46ca-a891-37e5129f88d1"
"block": "0b29c706-eb1b-4839-8ad2-bbed64efc01e",
"port": "port-ddc97277"
},
"target": {
"block": "9011e8f6-940a-40ca-8bdf-773f0ed1c9f3",
"block": "43f739a0-e50f-44ae-bd95-0e0c1a10d1cf",
"port": "port-df34ce84"
},
"name": "",
"properties": {
"waypoints": [
{
"x": -192.0,
"y": -224.0
}
]
"waypoints": []
}
},
{
"id": "8d1a5f3c-b706-4671-873a-2121f55f748b",
"id": "7a776aab-deb5-4e50-838e-b6b4635f349c",
"source": {
"junction": "7a552e5e-b15d-46ca-a891-37e5129f88d1"
"block": "f4a78255-8b73-4bb3-ae8e-24b566c72bc0",
"port": "port-fe9e6486"
},
"target": {
"block": "1995074c-4580-4ca3-8691-6923aedc5833",
"port": "port-df34ce84"
"block": "59bb51be-8185-4b0b-a894-e38db61aff18",
"port": "port-c995845c"
},
"name": "",
"properties": {
"waypoints": [
{
"x": -192.0,
"y": 32.0
}
]
"waypoints": []
}
},
{
"id": "5b3d71c3-282a-4c2d-85f8-b92bba5bf2df",
"source": {
"block": "43f739a0-e50f-44ae-bd95-0e0c1a10d1cf",
"port": "port-fe9e6486"
},
"target": {
"block": "59bb51be-8185-4b0b-a894-e38db61aff18",
"port": "port-c995845c"
},
"name": "",
"properties": {
"waypoints": []
}
}
],
"annotations": [],
"junctions": [
{
"id": "7a552e5e-b15d-46ca-a891-37e5129f88d1",
"position": {
"x": -192.0,
"y": -96.0
},
"type": "signal"
}
],
"simulation": {
"enabled": true
}
"junctions": [],
"simulation": {}
}
}
}