Fixed some bugs

This commit is contained in:
2026-07-22 19:16:56 +02:00
parent 2d49f65ec4
commit 8a6203d01e
7 changed files with 243 additions and 221 deletions

View File

@@ -177,13 +177,13 @@
"source": {
"equations": "der(state) = p.f;\np.e = state/c;",
"declarations": "",
"initialEquations": ""
"initialEquations": "state = 0;"
}
}
},
{
"id": "bfa506d8-ee41-4bab-ae19-a97fd67bfcf6",
"name": "1",
"name": "j1",
"position": {
"x": -96.0,
"y": -160.0
@@ -256,8 +256,8 @@
"implementation": {
"kind": "text",
"source": {
"equations": "flow = p[1].f;\nsum(p[i].e for i in 1:$p_N$) = 0;\nfor i in 2:$p_N$ loop\n p[i].f = p[i-1].f;\nend for;",
"declarations": "Real flow;",
"equations": "f = s[1] * p[1].f;\nsum(s[i] * p[i].e for i in 1:$p_N$) = 0;\nfor i in 2:$p_N$ loop\n s[i] * p[i].f = s[i-1] * p[i-1].f;\nend for;",
"declarations": "parameter Real s[$p_N$] = $p_S$;\nReal f;",
"initialEquations": ""
}
}
@@ -399,7 +399,7 @@
"parameters": [
{
"id": "parameter-d056bc27",
"name": "effort",
"name": "e",
"type": "real",
"value": "1",
"quantity": "",
@@ -446,15 +446,15 @@
"implementation": {
"kind": "text",
"source": {
"equations": "p.e = effort;\nflow = p.f;",
"declarations": "Real flow;",
"equations": "p.e = e;\nf = p.f;",
"declarations": "Real f;",
"initialEquations": ""
}
}
},
{
"id": "140ae14b-9dbb-4756-aa25-29101ef2a99e",
"name": "0",
"name": "j0",
"position": {
"x": -96.0,
"y": -32.0
@@ -527,130 +527,8 @@
"implementation": {
"kind": "text",
"source": {
"equations": "effort = p[1].e;\nsum(p[i].f for i in 1:$p_N$) = 0;\nfor i in 2:$p_N$ loop\n p[i].e = p[i-1].e;\nend for;",
"declarations": "Real effort;",
"initialEquations": ""
}
}
},
{
"id": "6a6fbadd-28ec-4d10-b854-876752a6b287",
"name": "C0",
"position": {
"x": -96.0,
"y": 96.0
},
"rotation": 0.0,
"interface": {
"ports": [
{
"id": "port-2e1d884f",
"name": "p",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 64.0,
"y": 64.0
}
},
"type": "power",
"multipleConnections": false,
"valueType": "real",
"quantity": "",
"unit": "",
"dimensions": {
"rows": 1,
"columns": 1
},
"description": "",
"orientation": "input",
"domain": "power",
"causality": "preferred effort out"
},
{
"id": "port-ca7716d5",
"name": "state",
"position": {
"x": 0.0,
"y": 0.0
},
"properties": {
"iconPosition": {
"x": 88.0,
"y": 40.0
}
},
"type": "signal",
"multipleConnections": false,
"valueType": "real",
"quantity": "",
"unit": "",
"dimensions": {
"rows": 1,
"columns": 1
},
"description": "",
"orientation": "output",
"domain": "power",
"causality": "indifferent"
}
]
},
"parameters": [
{
"id": "parameter-d056bc27",
"name": "c",
"type": "real",
"value": "1",
"quantity": "",
"unit": "",
"dimensions": {
"rows": 1,
"columns": 1
},
"description": ""
}
],
"icon": {
"shape": "rectangle",
"fill": "#f4f4f4",
"border": "#303030",
"text": "Text",
"size": {
"width": 128.0,
"height": 128.0
},
"elements": [
{
"type": "text",
"x": 40.0,
"y": 40.0,
"width": 48.0,
"height": 48.0,
"text": "C",
"color": "#303030",
"fontSize": 32.0,
"lineStyle": "solid",
"lineWidth": 1.5,
"stroke": "#303030",
"fill": "#ffffff"
}
]
},
"properties": {
"showName": false
},
"library": {
"showSubtree": true
},
"implementation": {
"kind": "text",
"source": {
"equations": "der(state) = p.f;\np.e = state/c;",
"declarations": "",
"equations": "e = p[1].e;\nsum(p[i].f for i in 1:$p_N$) = 0;\nfor i in 2:$p_N$ loop\n p[i].e = p[i-1].e;\nend for;",
"declarations": "Real e;",
"initialEquations": ""
}
}
@@ -699,7 +577,7 @@
"id": "parameter-d056bc27",
"name": "r",
"type": "real",
"value": "1",
"value": "10",
"quantity": "",
"unit": "",
"dimensions": {
@@ -868,7 +746,7 @@
"source": {
"equations": "der(state) = p.e;\np.f = state/i;",
"declarations": "",
"initialEquations": ""
"initialEquations": "state = 0;"
}
}
}
@@ -906,23 +784,6 @@
"waypoints": []
},
"type": "power",
"causality": "target"
},
{
"id": "ae95fbfc-c771-47f2-8f9e-1c823daaf6b8",
"source": {
"block": "140ae14b-9dbb-4756-aa25-29101ef2a99e",
"port": "port-3e53bf80"
},
"target": {
"block": "6a6fbadd-28ec-4d10-b854-876752a6b287",
"port": "port-2e1d884f"
},
"name": "",
"properties": {
"waypoints": []
},
"type": "power",
"causality": "source"
},
{
@@ -977,7 +838,7 @@
"causality": "target"
},
{
"id": "d6940de3-5b4c-42be-a247-639b3803d85e",
"id": "e67f412c-39ae-404d-a513-d4a0c389ef40",
"source": {
"block": "bfa506d8-ee41-4bab-ae19-a97fd67bfcf6",
"port": "port-3e53bf80"
@@ -996,7 +857,13 @@
],
"annotations": [],
"junctions": [],
"simulation": {}
"simulation": {
"startTime": 0.0,
"stopTime": 10.0,
"intervalMode": "numberOfIntervals",
"numberOfIntervals": 500,
"intervalTime": 0.002
}
}
}
}