11{
22 "version" : {
33 "pathsim_version" : " 0.8.2" ,
4- "pathview_version" : " 0.1.dev470+g017515800.d20250812 "
4+ "pathview_version" : " 0.2.dev12+gf6e0ac326 "
55 },
66 "nodes" : [
77 {
142142 "id" : " 11" ,
143143 "type" : " function" ,
144144 "position" : {
145- "x" : -54.52837524178651 ,
146- "y" : 186.62617481093713
145+ "x" : 124.20448463464157 ,
146+ "y" : 166.46144190180163
147147 },
148148 "data" : {
149149 "label" : " Function" ,
163163 "id" : " 12" ,
164164 "type" : " source" ,
165165 "position" : {
166- "x" : -257.2259405285811 ,
167- "y" : 57.613473116620824
166+ "x" : -267.3083069831488 ,
167+ "y" : 56.69689434802376
168168 },
169169 "data" : {
170170 "label" : " source" ,
417417 "selected" : false
418418 },
419419 {
420- "id" : " e10-4-to_target-0 " ,
421- "source" : " 10 " ,
422- "target" : " 4 " ,
420+ "id" : " e4-5 " ,
421+ "source" : " 4 " ,
422+ "target" : " 5 " ,
423423 "sourceHandle" : null ,
424- "targetHandle" : " target-0 " ,
424+ "targetHandle" : null ,
425425 "type" : " smoothstep" ,
426426 "data" : {},
427427 "style" : {
436436 }
437437 },
438438 {
439- "id" : " e12-4-to_target-1 " ,
440- "source" : " 12 " ,
441- "target" : " 4 " ,
439+ "id" : " e4-6 " ,
440+ "source" : " 4 " ,
441+ "target" : " 6 " ,
442442 "sourceHandle" : null ,
443- "targetHandle" : " target-1 " ,
443+ "targetHandle" : null ,
444444 "type" : " smoothstep" ,
445445 "data" : {},
446446 "style" : {
452452 "width" : 20 ,
453453 "height" : 20 ,
454454 "color" : " #ECDFCC"
455- }
455+ },
456+ "selected" : false
456457 },
457458 {
458- "id" : " e4-5 " ,
459+ "id" : " e4-19 " ,
459460 "source" : " 4" ,
460- "target" : " 5 " ,
461+ "target" : " 19 " ,
461462 "sourceHandle" : null ,
462463 "targetHandle" : null ,
463464 "type" : " smoothstep" ,
474475 }
475476 },
476477 {
477- "id" : " e4-6 " ,
478- "source" : " 4 " ,
479- "target" : " 6 " ,
478+ "id" : " e10-4-to_target-1 " ,
479+ "source" : " 10 " ,
480+ "target" : " 4 " ,
480481 "sourceHandle" : null ,
481- "targetHandle" : null ,
482+ "targetHandle" : " target-1 " ,
482483 "type" : " smoothstep" ,
483484 "data" : {},
484485 "style" : {
493494 }
494495 },
495496 {
496- "id" : " e4-19 " ,
497- "source" : " 4 " ,
498- "target" : " 19 " ,
497+ "id" : " e10-11-to_target-0 " ,
498+ "source" : " 10 " ,
499+ "target" : " 11 " ,
499500 "sourceHandle" : null ,
500- "targetHandle" : null ,
501+ "targetHandle" : " target-0 " ,
501502 "type" : " smoothstep" ,
502503 "data" : {},
503504 "style" : {
512513 }
513514 },
514515 {
515- "id" : " e4-11 -to_target-0" ,
516- "source" : " 4 " ,
517- "target" : " 11 " ,
516+ "id" : " e12-4 -to_target-0" ,
517+ "source" : " 12 " ,
518+ "target" : " 4 " ,
518519 "sourceHandle" : null ,
519520 "targetHandle" : " target-0" ,
520521 "type" : " smoothstep" ,
581582 "id" : 1755090603806
582583 }
583584 ],
584- "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"
585+ "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"
585586}
0 commit comments