diff --git a/README.md b/README.md index 410c3d3f..84fb5e21 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,16 @@ pathview/ │ ├── backend.py # Python backend API +│ ├── components/ # JSx components + +│ ├── python/ # python package source + +│ ├── main.jsx + +│ ├── App.jsx # main App + +│ ├── nodeConfig.js # file to configure all the nodes + ``` # Installation and Setup diff --git a/example_graphs/stick_slip.json b/example_graphs/stick_slip.json index b833ee81..b30d6c11 100644 --- a/example_graphs/stick_slip.json +++ b/example_graphs/stick_slip.json @@ -1,7 +1,7 @@ { "version": { "pathsim_version": "0.8.2", - "pathview_version": "0.1.dev470+g017515800.d20250812" + "pathview_version": "0.2.dev12+gf6e0ac326" }, "nodes": [ { @@ -142,8 +142,8 @@ "id": "11", "type": "function", "position": { - "x": -54.52837524178651, - "y": 186.62617481093713 + "x": 124.20448463464157, + "y": 166.46144190180163 }, "data": { "label": "Function", @@ -163,8 +163,8 @@ "id": "12", "type": "source", "position": { - "x": -257.2259405285811, - "y": 57.613473116620824 + "x": -267.3083069831488, + "y": 56.69689434802376 }, "data": { "label": "source", @@ -417,11 +417,11 @@ "selected": false }, { - "id": "e10-4-to_target-0", - "source": "10", - "target": "4", + "id": "e4-5", + "source": "4", + "target": "5", "sourceHandle": null, - "targetHandle": "target-0", + "targetHandle": null, "type": "smoothstep", "data": {}, "style": { @@ -436,11 +436,11 @@ } }, { - "id": "e12-4-to_target-1", - "source": "12", - "target": "4", + "id": "e4-6", + "source": "4", + "target": "6", "sourceHandle": null, - "targetHandle": "target-1", + "targetHandle": null, "type": "smoothstep", "data": {}, "style": { @@ -452,12 +452,13 @@ "width": 20, "height": 20, "color": "#ECDFCC" - } + }, + "selected": false }, { - "id": "e4-5", + "id": "e4-19", "source": "4", - "target": "5", + "target": "19", "sourceHandle": null, "targetHandle": null, "type": "smoothstep", @@ -474,11 +475,11 @@ } }, { - "id": "e4-6", - "source": "4", - "target": "6", + "id": "e10-4-to_target-1", + "source": "10", + "target": "4", "sourceHandle": null, - "targetHandle": null, + "targetHandle": "target-1", "type": "smoothstep", "data": {}, "style": { @@ -493,11 +494,11 @@ } }, { - "id": "e4-19", - "source": "4", - "target": "19", + "id": "e10-11-to_target-0", + "source": "10", + "target": "11", "sourceHandle": null, - "targetHandle": null, + "targetHandle": "target-0", "type": "smoothstep", "data": {}, "style": { @@ -512,9 +513,9 @@ } }, { - "id": "e4-11-to_target-0", - "source": "4", - "target": "11", + "id": "e12-4-to_target-0", + "source": "12", + "target": "4", "sourceHandle": null, "targetHandle": "target-0", "type": "smoothstep", @@ -581,5 +582,5 @@ "id": 1755090603806 } ], - "pythonCode": "import numpy as np\n#initial position and velocity\nx0, v0 = 0, 0\n\n#system parameters\nm = 20.0 # mass\nk = 70.0 # spring constant\nd = 10.0 # spring damping\nmu = 1.5 # friction coefficient\ng = 9.81 # gravity\nv = 3.0 # belt velocity magnitude\nT = 50.0 # excitation period\n\nF_c = mu * m * g # friction force\n\n#function for belt velocity\ndef v_belt(t):\n return v * np.sin(2*np.pi*t/T)\n\n#function for coulomb friction force\ndef f_coulomb(v, vb):\n return F_c * np.sign(vb - v)\n\ndef slip_to_stick_evt(t):\n _1, v_box , _2 = switch_4()\n _1, v_belt, _2 = source_12()\n dv = v_box - v_belt\n\n return dv\n\ndef slip_to_stick_act(t):\n\n #change switch state\n switch_4.state = 1\n\n integrator_1_10.off()\n function_11.off()\n\n E_slip_to_stick.off()\n E_stick_to_slip.on()\n\ndef stick_to_slip_evt(t):\n _1, F, _2 = add_8()\n return F_c - abs(F)\n\ndef stick_to_slip_act(t):\n\n #change switch state\n switch_4.state = 0\n\n integrator_1_10.on()\n function_11.on()\n\n #set integrator state\n _1, v_box , _2 = switch_4()\n integrator_1_10.engine.set(v_box)\n\n E_slip_to_stick.on()\n E_stick_to_slip.off()\n" + "pythonCode": "import numpy as np\n#initial position and velocity\nx0, v0 = 0, 0\n\n#system parameters\nm = 20.0 # mass\nk = 70.0 # spring constant\nd = 10.0 # spring damping\nmu = 1.5 # friction coefficient\ng = 9.81 # gravity\nv = 3.0 # belt velocity magnitude\nT = 50.0 # excitation period\n\nF_c = mu * m * g # friction force\n\n#function for belt velocity\ndef v_belt(t):\n return v * np.sin(2*np.pi*t/T)\n\n#function for coulomb friction force\ndef f_coulomb(v, vb):\n return F_c * np.sign(vb - v)\n\ndef slip_to_stick_evt(t):\n _1, v_box , _2 = switch_4()\n _1, v_belt, _2 = source_12()\n dv = v_box - v_belt\n\n return dv\n\ndef slip_to_stick_act(t):\n\n #change switch state\n switch_4.select(0)\n\n integrator_1_10.off()\n function_11.off()\n\n E_slip_to_stick.off()\n E_stick_to_slip.on()\n\ndef stick_to_slip_evt(t):\n _1, F, _2 = add_8()\n return F_c - abs(F)\n\ndef stick_to_slip_act(t):\n\n #change switch state\n switch_4.select(1)\n\n integrator_1_10.on()\n function_11.on()\n\n #set integrator state\n _1, v_box , _2 = switch_4()\n integrator_1_10.engine.set(v_box)\n\n E_slip_to_stick.on()\n E_stick_to_slip.off()\n" } \ No newline at end of file