More fixes and extended lib

This commit is contained in:
2026-08-18 15:44:24 +02:00
parent 1d535c1f5b
commit 16d9cc7651
20 changed files with 1057 additions and 101 deletions

View File

@@ -608,11 +608,219 @@
]
}
},
"ac5011ce-4659-4bdd-900a-63a1c779652c": {
"404e82f4-19e2-44ad-b409-3f021e483a39": {
"name": "integrator",
"interface": {
"ports": {
"441a44d0-bbe5-49f0-bb0e-5bc891218aca": {
"port_type": "signal",
"name": "y",
"direction": "output",
"multiplicity": false,
"matrix_size": [
1,
1
],
"description": null,
"value_type": "real",
"quantity": null,
"unit": null
},
"8d4b0f2c-2e13-4cfd-a8da-6c03ade4fbbf": {
"port_type": "signal",
"name": "u",
"direction": "input",
"multiplicity": false,
"matrix_size": [
1,
1
],
"description": null,
"value_type": "real",
"quantity": null,
"unit": null
}
}
},
"parameters": {
"7150c82e-8c78-4f83-9bc8-e46057a367a8": {
"name": "k",
"value": "1.0",
"value_type": "real",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Integrator gain"
},
"f7b9691a-22a4-41e0-9871-44f8dd0e02d2": {
"name": "initType",
"value": "3",
"value_type": "int",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"
},
"3b636a9c-257c-4368-855a-094051f29041": {
"name": "y_start",
"value": "0.0",
"value_type": "real",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Initial or guess value of output (= state)"
}
},
"implementation": {
"implementation_type": "equation",
"declarations": [],
"initial_equations": [
"if initType == 2 then",
"\tder(y) = 0;",
"elseif initType >= 3 then",
"\ty = y_start;",
"end if;"
],
"equations": [
"der(y) = k*u;"
]
}
},
"2b0156f6-9977-4735-88dd-14f5eb3d87b5": {
"name": "derivative",
"interface": {
"ports": {
"d61847c9-0628-4e86-ad91-9390f92f926d": {
"port_type": "signal",
"name": "y",
"direction": "output",
"multiplicity": false,
"matrix_size": [
1,
1
],
"description": null,
"value_type": "real",
"quantity": null,
"unit": null
},
"f18c8fd2-dda5-4e8d-a5a7-a22a38abb091": {
"port_type": "signal",
"name": "u",
"direction": "input",
"multiplicity": false,
"matrix_size": [
1,
1
],
"description": null,
"value_type": "real",
"quantity": null,
"unit": null
}
}
},
"parameters": {
"ec421126-1ff4-4627-8bdd-1841318f3eb6": {
"name": "k",
"value": "1.0",
"value_type": "real",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Integrator gain"
},
"0c364769-5f07-4f3e-bb93-91d86a1f2dae": {
"name": "initType",
"value": "3",
"value_type": "int",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"
},
"ab3a2bae-ea7f-41ca-9493-93d8debcee27": {
"name": "y_start",
"value": "0.0",
"value_type": "real",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Initial or guess value of output (= state)"
},
"e04d9fc5-761c-4b3d-bd7b-93da9896bd35": {
"name": "T",
"value": "0.01",
"value_type": "real",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Time constants (T>0 required; T=0 is ideal derivative block)"
},
"29669830-2738-4692-8255-115d1546619c": {
"name": "x_start",
"value": "0.0",
"value_type": "real",
"matrix_size": [
1,
1
],
"quantity": null,
"unit": null,
"description": "Initial or guess value of state\""
}
},
"implementation": {
"implementation_type": "equation",
"declarations": [
"parameter Boolean zeroGain = abs(k) < Modelica.Constants.eps;",
"Real x(start=x_start);"
],
"initial_equations": [
"if initType == 2 then",
"\tder(x) = 0;",
"elseif initType == 3 then",
"\tx = x_start;",
"elseif initType >= 4 then",
"\tif zeroGain then",
"\t\tx = u;",
"\telse",
"\t\ty = y_start;",
"\tend if;",
"end if;"
],
"equations": [
"der(x) = if zeroGain then 0 else (u-x)/T;",
"y = if zeroGain then 0 else (k/T)*(u-x);"
]
}
},
"927326ff-f73a-4f98-b7fd-aaf97989121e": {
"name": "pulse",
"interface": {
"ports": {
"69974610-3bd6-42c1-a8bb-afe6086ef0f3": {
"4f9f6b29-36f0-460e-9fd9-d4bdf0ea3c80": {
"port_type": "signal",
"name": "y",
"direction": "output",
@@ -629,7 +837,7 @@
}
},
"parameters": {
"8e128f7a-cf97-4f27-a664-488921819395": {
"b6460a26-0b89-49e0-8ec7-99281a66668b": {
"name": "amplitude",
"value": "1.0",
"value_type": "real",
@@ -641,7 +849,7 @@
"unit": null,
"description": null
},
"5ff17831-f2f9-4833-9e4b-4facf7c28c0c": {
"983d6c65-8e81-4f49-9faa-d024e8e6a9d3": {
"name": "width",
"value": "50.0",
"value_type": "real",
@@ -653,7 +861,7 @@
"unit": null,
"description": "Pulse width in %"
},
"b036592b-4dc0-498b-a966-7146cf9cf95b": {
"c9ccd873-f83a-4b08-8827-4a88a06d502a": {
"name": "offset",
"value": "0",
"value_type": "real",
@@ -665,7 +873,7 @@
"unit": null,
"description": null
},
"df82150d-973d-4a8a-9bd5-6ce21a2e8bbb": {
"9cd46f38-6ddb-4d69-946d-df96e9f30078": {
"name": "period",
"value": "1.0",
"value_type": "real",
@@ -677,7 +885,7 @@
"unit": null,
"description": null
},
"1195c93e-3309-494e-9a56-96e8fd5e330c": {
"4e1d29eb-48c8-479a-8968-8f57fd95ea9f": {
"name": "nperiod",
"value": "-1",
"value_type": "int",
@@ -689,7 +897,7 @@
"unit": null,
"description": "Number of periods (<0 means infinite)"
},
"3f5f7b5c-2794-4e75-a5c8-1ef2b0ecd87d": {
"68102f0d-b58b-4c10-af0d-dffae406fb07": {
"name": "startTime",
"value": "0.0",
"value_type": "real",
@@ -723,11 +931,11 @@
]
}
},
"ec0599cb-b57b-4194-b166-526d5cd5382a": {
"ac215607-dd97-4142-b42f-f23502e51cfa": {
"name": "plusminus",
"interface": {
"ports": {
"23a8b215-7c2f-4ccf-b020-4d274d7a228f": {
"baadcb27-0807-4366-819f-7396a1ed205d": {
"port_type": "signal",
"name": "plus",
"direction": "input",
@@ -741,7 +949,7 @@
"quantity": null,
"unit": null
},
"4c4771f8-22c8-4829-a060-913470e2b2fc": {
"53cc98de-2e05-49ea-af26-e26d5dcd99e7": {
"port_type": "signal",
"name": "minus",
"direction": "input",
@@ -755,7 +963,7 @@
"quantity": null,
"unit": null
},
"a186a0e1-7aea-4fb6-871c-0ba70d78b8ac": {
"0574652d-df52-4798-8072-da0a26eee873": {
"port_type": "signal",
"name": "y",
"direction": "output",
@@ -835,15 +1043,25 @@
"source": "a2709c23-7485-43b2-bc87-28a0f4c37c0b",
"target": "8bd1cc42-03b9-4c46-b31b-c1f46933dc9e"
},
"42f8d11c-8b31-476a-8e56-dd1ac3703508": {
"122eaf51-7baf-457f-a944-f946b6ab321a": {
"connection_type": "signal",
"source": "69974610-3bd6-42c1-a8bb-afe6086ef0f3",
"target": "23a8b215-7c2f-4ccf-b020-4d274d7a228f"
"source": "4f9f6b29-36f0-460e-9fd9-d4bdf0ea3c80",
"target": "baadcb27-0807-4366-819f-7396a1ed205d"
},
"81e6b0d7-65f2-4edc-a303-6eee78ac1972": {
"8b1c34a9-03c2-4bb5-81ab-7fa66bcafe8e": {
"connection_type": "signal",
"source": "5807dc83-d049-4f0f-9708-d041a752fcd0",
"target": "4c4771f8-22c8-4829-a060-913470e2b2fc"
"target": "53cc98de-2e05-49ea-af26-e26d5dcd99e7"
},
"3c659d9e-8218-48ac-9a3d-4297fba275c2": {
"connection_type": "signal",
"source": "0574652d-df52-4798-8072-da0a26eee873",
"target": "8d4b0f2c-2e13-4cfd-a8da-6c03ade4fbbf"
},
"9b5ab2d7-d302-48e8-98dc-0d60ba54ca01": {
"connection_type": "signal",
"source": "0574652d-df52-4798-8072-da0a26eee873",
"target": "f18c8fd2-dda5-4e8d-a5a7-a22a38abb091"
}
}
}
@@ -1333,9 +1551,9 @@
]
}
},
"ac5011ce-4659-4bdd-900a-63a1c779652c": {
"404e82f4-19e2-44ad-b409-3f021e483a39": {
"shapes": {
"7a9115fe-4e40-49d9-ab50-2f399ca1038b": {
"29dafe3d-8392-49c0-98ee-80e941b32a52": {
"layer": 0,
"type": "rectangle",
"pos": [
@@ -1350,7 +1568,95 @@
"line_color": "#00007fff",
"fill_color": "#ebebebff"
},
"80e150dc-07d3-4d27-9fe0-eecb82fb2689": {
"d24da1c9-bae9-41e6-aee4-79e5f238ea72": {
"layer": 1,
"type": "text",
"pos": [
-15,
-47
],
"width": 31.0,
"height": 81.0,
"color": "#00007fff",
"bold": false,
"italic": false,
"size": 72.0,
"text": "∫"
}
},
"port_positions": {
"441a44d0-bbe5-49f0-bb0e-5bc891218aca": [
7,
-7
],
"8d4b0f2c-2e13-4cfd-a8da-6c03ade4fbbf": [
-22,
-7
]
}
},
"2b0156f6-9977-4735-88dd-14f5eb3d87b5": {
"shapes": {
"702ce5c1-a37a-4f89-8261-0be4b433ae79": {
"layer": 0,
"type": "rectangle",
"pos": [
-48,
-48
],
"width": 96.0,
"height": 96.0,
"line_type": "solid",
"line_thickness": 5.0,
"corner_radius": 8.0,
"line_color": "#00007fff",
"fill_color": "#ebebebff"
},
"32ccfd50-07dd-4524-be5d-e96a3136d520": {
"layer": 1,
"type": "text",
"pos": [
-40,
-31
],
"width": 78.0,
"height": 62.0,
"color": "#00007fff",
"bold": false,
"italic": false,
"size": 38.0,
"text": "d/dt"
}
},
"port_positions": {
"d61847c9-0628-4e86-ad91-9390f92f926d": [
7,
-7
],
"f18c8fd2-dda5-4e8d-a5a7-a22a38abb091": [
-22,
-7
]
}
},
"927326ff-f73a-4f98-b7fd-aaf97989121e": {
"shapes": {
"89e11690-3faa-482b-a054-10a2c7565c43": {
"layer": 0,
"type": "rectangle",
"pos": [
-48,
-48
],
"width": 96.0,
"height": 96.0,
"line_type": "solid",
"line_thickness": 5.0,
"corner_radius": 8.0,
"line_color": "#00007fff",
"fill_color": "#ebebebff"
},
"de170a5b-c959-4d6d-afda-fa867dfbca51": {
"layer": 4,
"type": "line",
"pos": [
@@ -1365,7 +1671,7 @@
"line_thickness": 3.0,
"line_color": "#000000ff"
},
"66c7fb78-2866-4f9f-9df2-95cfa4c57a2d": {
"94fc1429-0ef2-403b-aa5d-7edcb7b3ebf2": {
"layer": 2,
"type": "line",
"pos": [
@@ -1380,7 +1686,7 @@
"line_thickness": 3.0,
"line_color": "#000000ff"
},
"b1b1f425-eea6-48e7-a61d-f9eb221984b7": {
"0d82b577-e3fb-4434-adfb-883e1918e30f": {
"layer": 3,
"type": "line",
"pos": [
@@ -1388,79 +1694,138 @@
14
],
"end": [
3,
-14,
14
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
},
"0c0b7ec3-557d-4fb4-b8b8-b6b6a269ec55": {
"531dcbea-2c2d-4ed9-bcbc-dfc9b0145527": {
"layer": 5,
"type": "line",
"pos": [
3,
-13,
14
],
"end": [
3,
-13,
-12
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
},
"c4476a1b-7216-4eab-aad6-69ecb5af4b79": {
"layer": 6,
"type": "line",
"pos": [
-13,
-13
],
"end": [
4,
-13
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
},
"e5c99d8a-69db-4915-b1e7-84ac5e52de02": {
"layer": 6,
"2b69a1e2-0f80-4a1a-b31c-1f32b91bc46a": {
"layer": 7,
"type": "line",
"pos": [
3,
4,
-13
],
"end": [
32,
4,
14
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
},
"7fac6744-2d5b-49a4-bfca-27cc8889a5b6": {
"layer": 8,
"type": "line",
"pos": [
4,
14
],
"end": [
21,
14
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
},
"81390b87-3648-4556-a439-9456232781df": {
"layer": 9,
"type": "line",
"pos": [
21,
14
],
"end": [
21,
-13
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
},
"c3c9eddf-f4c7-4f76-8bc5-7c313fc9ea72": {
"layer": 10,
"type": "line",
"pos": [
21,
-14
],
"end": [
32,
-14
],
"line_type": "solid",
"line_thickness": 2.0,
"line_color": "#ffaa00ff"
}
},
"port_positions": {
"69974610-3bd6-42c1-a8bb-afe6086ef0f3": [
"4f9f6b29-36f0-460e-9fd9-d4bdf0ea3c80": [
-8,
-8
]
}
},
"ec0599cb-b57b-4194-b166-526d5cd5382a": {
"ac215607-dd97-4142-b42f-f23502e51cfa": {
"shapes": {
"ecbbad0e-67e3-4d13-ba25-7660f50bc38e": {
"layer": 0,
"type": "rectangle",
"9336da30-7335-4eea-a8a2-ae69d8cad9e1": {
"layer": 1,
"type": "ellipse",
"pos": [
-48,
-48
-36,
-36
],
"width": 96.0,
"height": 96.0,
"width": 72.0,
"height": 72.0,
"line_type": "solid",
"line_thickness": 5.0,
"corner_radius": 8.0,
"line_thickness": 8.0,
"line_color": "#00007fff",
"fill_color": "#ebebebff"
}
},
"port_positions": {
"23a8b215-7c2f-4ccf-b020-4d274d7a228f": [
"baadcb27-0807-4366-819f-7396a1ed205d": [
-24,
9
],
"4c4771f8-22c8-4829-a060-913470e2b2fc": [
"53cc98de-2e05-49ea-af26-e26d5dcd99e7": [
-24,
-26
],
"a186a0e1-7aea-4fb6-871c-0ba70d78b8ac": [
"0574652d-df52-4798-8072-da0a26eee873": [
11,
-8
]
@@ -1557,6 +1922,30 @@
"ec0599cb-b57b-4194-b166-526d5cd5382a": [
-120,
656
],
"83dd8220-554c-4907-b713-c37e1f600f0d": [
-96,
648
],
"404e82f4-19e2-44ad-b409-3f021e483a39": [
228,
640
],
"2b0156f6-9977-4735-88dd-14f5eb3d87b5": [
232,
828
],
"927326ff-f73a-4f98-b7fd-aaf97989121e": [
-428,
552
],
"ac215607-dd97-4142-b42f-f23502e51cfa": [
-96,
636
],
"b3e059a3-4517-435d-aa63-ddfbbf6fa071": [
488,
552
]
},
"component_labels": {
@@ -1667,6 +2056,17 @@
"dassl_tolerance": 1e-06
}
}
},
"port_metadata_database": {
"format_version": 1,
"ports": {
"53cc98de-2e05-49ea-af26-e26d5dcd99e7": {
"connection_annotation": "-"
},
"baadcb27-0807-4366-819f-7396a1ed205d": {
"connection_annotation": "+"
}
}
}
}
}