diff --git a/notebooks/V02_die_z-transformation.ipynb b/notebooks/V02_die_z-transformation.ipynb index 22d45a9dc610f97b052a5ef16954bc637f8d6a86..cae36d4ea205565f5a76c4cf7ab8cecd5ebb7367 100644 --- a/notebooks/V02_die_z-transformation.ipynb +++ b/notebooks/V02_die_z-transformation.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 1, "metadata": { "tags": [] }, @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -86,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -108,7 +108,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -180,7 +180,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -203,7 +203,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "a65599e6ce5f4796812bf1c51c969756", + "model_id": "ca30547dbe06476b9f5d912fa8432e96", "version_major": 2, "version_minor": 0 }, @@ -217,7 +217,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "824be968914f4d2593144c6f82dcca84", + "model_id": "12fee63fe9674b9f90d1d581d2aa5965", "version_major": 2, "version_minor": 0 }, @@ -759,30 +759,30 @@ "tini = 0 # Start time\n", "tfinal = 1.5 # End time\n", "dt = 0.001 # Time Step\n", - "nflows = 7 # Number of data flows in the schematic, Zahlenwert entspricht nicht dem in Matlab (hier um 2 größer)\n", + "nflows = 7 # Number of data flows in the schematic\n", "Ts = 0.1 # Sampling time for discrete time\n", "\n", "sc = Schema(tini,tfinal,dt,nflows) # Instance of the simulation schematic\n", "\n", - "c1 = SinusoidalSignalSource(1,0,1,2*pi,0)#SinusoidalSignalSource(out,startv,Am,om,phi)\n", - "c2 = TransferFunction(1,2,[1],[1,1]);#TransferFunction(inp,out,num,den)\n", - "c3 = ZOH(1,3,Ts);#ZOH(inp,out,ts)\n", + "c1 = SinusoidalSignalSource(1,0,1,2*pi,0) # SinusoidalSignalSource(out,startv,Am,om,phi)\n", + "c2 = TransferFunction(1,2,[1],[1,1]) # TransferFunction(inp,out,num,den)\n", + "c3 = ZOH(1,3,Ts) # ZOH(inp,out,ts)\n", "#Example 1 - ZOH at the input:\n", - "c4 = TransferFunction(3,4,[1],[1,1])#TransferFunction(inp,out,num,den)\n", + "c4 = TransferFunction(3,4,[1],[1,1]) # TransferFunction(inp,out,num,den)\n", "#Example 2:\n", - "c5 = DTTransferFunction(1,5,[0.09516],[1, -exp(-0.1)],Ts)#DTTransferFunction(inp,out,num,den,Ts)\n", + "c5 = DTTransferFunction(1,5,[0.09516],[1, -exp(-0.1)],Ts) # DTTransferFunction(inp,out,num,den,Ts)\n", "#Example 3:\n", - "c6 = DTTransferFunction(1,6,[0.1, 0],[1, -exp(-0.1)],Ts) #DTTransferFunction(inp,out,num,den,Ts)\n", + "c6 = DTTransferFunction(1,6,[0.1, 0],[1, -exp(-0.1)],Ts) # DTTransferFunction(inp,out,num,den,Ts)\n", "\n", - "sc.AddListComponents(np.array([c1,c2,c3,c4,c5,c6]));\n", + "sc.AddListComponents(np.array([c1,c2,c3,c4,c5,c6]))\n", "\n", "#Run the schematic and plot:\n", - "out = sc.Run(np.array([2, 3, 4, 5, 6])); #Nummern der zurückgegebene Listen um eins kleiner als in Matlab\n", + "out = sc.Run(np.array([1, 2, 3, 4, 5, 6]))\n", "\n", "fig = plt.figure()\n", "ax = fig.add_subplot(1, 1, 1)\n", "fig.set_dpi(120)\n", - "ax.plot(out[0,:],out[1,:],'blue',out[0,:],out[3,:],'orange',out[0,:],out[4,:],'red',out[0,:],out[5,:],'green')\n", + "ax.plot(out[0,:],out[2,:],'blue',out[0,:],out[4,:],'orange',out[0,:],out[5,:],'red',out[0,:],out[6,:],'green')\n", "ax.grid()\n", "plt.show()\n", "HTML('<img src=\"bilder/v02_regelstrecke.png\"></img>')" diff --git a/notebooks/V04_regelung_diskreter_systeme.ipynb b/notebooks/V04_regelung_diskreter_systeme.ipynb index b363ea8f8798dfefb6e5d05188ee8b04647b2850..3aa6aa421cc40a1af399f32bb0c56b91cc4dd145 100644 --- a/notebooks/V04_regelung_diskreter_systeme.ipynb +++ b/notebooks/V04_regelung_diskreter_systeme.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -293,7 +293,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -331,7 +331,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -368,7 +368,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -418,7 +418,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -459,7 +459,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -481,7 +481,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -533,7 +533,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -570,7 +570,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -606,7 +606,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -637,7 +637,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -678,7 +678,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 45, "metadata": {}, "outputs": [ { @@ -700,7 +700,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 46, "metadata": {}, "outputs": [ { @@ -727,7 +727,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -767,7 +767,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -915,7 +915,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 49, "metadata": {}, "outputs": [ { @@ -979,7 +979,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -1015,7 +1015,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -1059,7 +1059,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ @@ -1072,7 +1072,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 53, "metadata": {}, "outputs": [ { @@ -1112,7 +1112,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -1152,14 +1152,14 @@ "sc.AddListComponents(np.array([c1,c2,c3,c4]));\n", "\n", "#Run the schematic and plot:\n", - "out = sc.Run(np.array([2, 3, 4]));\n", - "plt.plot(out[0,:],out[2,:],\"blue\");\n", + "out = sc.Run(np.array([1, 2, 3, 4]));\n", + "plt.plot(out[0,:],out[3,:],\"blue\");\n", "plt.show()" ] }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 55, "metadata": {}, "outputs": [ { @@ -1176,7 +1176,7 @@ } ], "source": [ - "plt.plot(out[0,:],out[3,:],'orange')\n", + "plt.plot(out[0,:],out[4,:],'orange')\n", "plt.show()" ] }, diff --git a/notebooks/V06_normalformen_in_zustandsraumdarstellung.ipynb b/notebooks/V06_normalformen_in_zustandsraumdarstellung.ipynb index ed8f997cbdaa8613995700a996c195ed7c4c5048..c5501d5d5c07d812063510bb9c871f0ebaa259d7 100644 --- a/notebooks/V06_normalformen_in_zustandsraumdarstellung.ipynb +++ b/notebooks/V06_normalformen_in_zustandsraumdarstellung.ipynb @@ -255,7 +255,7 @@ "sc.AddListComponents(np.array([c1,c2,c3,c4,c5]));\n", "\n", "#Run the schematic and plot:\n", - "out = sc.Run(np.array([2, 3, 4, 5])); #Nummern der zurückgegebene Listen um eins kleiner als in Matlab" + "out = sc.Run(np.array([1, 2, 3, 4, 5])); #Nummern der zurückgegebene Listen um eins kleiner als in Matlab" ] }, { @@ -287,7 +287,7 @@ ], "source": [ "#Ausgang 1\n", - "plt.plot(out[0,:],out[1,:]);\n", + "plt.plot(out[0,:],out[2,:]);\n", "plt.show()" ] }, @@ -320,7 +320,7 @@ ], "source": [ "#Ausgang 2\n", - "plt.plot(out[0,:],out[4,:]);\n", + "plt.plot(out[0,:],out[5,:]);\n", "plt.show()" ] }, @@ -334,7 +334,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -352,7 +352,7 @@ ], "source": [ "#Scope 2:\n", - "plt.plot(out[0,:],out[2,:],out[0,:],out[3,:]);\n", + "plt.plot(out[0,:],out[3,:],out[0,:],out[4,:]);\n", "plt.show()" ] } diff --git a/notebooks/V08_regelung_im_zustandsraum.ipynb b/notebooks/V08_regelung_im_zustandsraum.ipynb index 0b6e4909ed23d3d82563fcff0b4b8c7d477a71a8..c6e9939a1f466ca5ded467cb7f06aef5667a822b 100644 --- a/notebooks/V08_regelung_im_zustandsraum.ipynb +++ b/notebooks/V08_regelung_im_zustandsraum.ipynb @@ -396,8 +396,8 @@ "sc2.AddListComponents(np.array([c2_1,c2_2,c2_3]));\n", "\n", "# Run the schematic and plot\n", - "out2 = sc2.Run(np.array([2,3,4]));\n", - "plt.plot(out2[0,:],out2[1,:],'r',out2[0,:],out2[2,:], 'b'); #Output Signal 1 & 2\n", + "out2 = sc2.Run(np.array([1,2,3,4]));\n", + "plt.plot(out2[0,:],out2[2,:],'r',out2[0,:],out2[3,:], 'b'); #Output Signal 1 & 2\n", "plt.grid()\n", "plt.legend(['State-Space 1, x_{dot}','State-Space 1, y'])\n", "plt.show()" @@ -438,7 +438,7 @@ } ], "source": [ - "plt.plot(out2[0,:],out2[3,:],'g'); # Output_4\n", + "plt.plot(out2[0,:],out2[4,:],'g'); # Output_4\n", "plt.grid()\n", "plt.legend(['out gain F'])\n", "plt.show()" @@ -678,8 +678,8 @@ "sc3.AddListComponents(np.array([c3_1,c3_2,c3_3,c3_4,c3_5,c3_6]));\n", "\n", "#Run the schematic and plot\n", - "out3 = sc3.Run(np.array([3,5,6]));\n", - "plt.plot(out3[0,:],out3[2,:],'b');\n", + "out3 = sc3.Run(np.array([1,2,3,4,5,6]));\n", + "plt.plot(out3[0,:],out3[5,:],'b');\n", "plt.grid()\n", "plt.legend(['Control Signal'])\n", "plt.show()" @@ -712,7 +712,7 @@ } ], "source": [ - "plt.plot(out3[0,:],out3[1,:],'g'); # Output_3\n", + "plt.plot(out3[0,:],out3[3,:],'g'); # Output_3\n", "plt.legend(['out gain F'])\n", "plt.grid()\n", "plt.show()" @@ -1129,8 +1129,8 @@ "sc5.AddListComponents(np.array([c5_1,c5_2,c5_3]));\n", "\n", "# Run the schematic and plot\n", - "out5 = sc5.Run(np.array([2,3,4]))\n", - "plt.plot(out5[0,:],out5[1,:],'b', out5[0,:],out5[2,:],'r'); #Output Signal 1 & 2\n", + "out5 = sc5.Run(np.array([1,2,3,4]))\n", + "plt.plot(out5[0,:],out5[2,:],'b', out5[0,:],out5[3,:],'r'); #Output Signal 2 & 3\n", "plt.legend(['State-Space 1, x_{dot}','State-Space 1, y'])\n", "plt.grid()\n", "plt.show()" @@ -1155,7 +1155,7 @@ } ], "source": [ - "plt.plot(out5[0,:],out5[3,:],'g') # Output_4\n", + "plt.plot(out5[0,:],out5[4,:],'g') # Output_4\n", "plt.legend(['out gain F'])\n", "plt.grid()\n", "plt.show()" @@ -1663,8 +1663,8 @@ "source": [ "sc6.AddListComponents(np.array([c6_1,c6_2,c6_3,c6_4,c6_5,c6_6,c6_7,c6_8]))\n", "\n", - "out6 = sc6.Run(np.array([2,6,10]))\n", - "plt.plot(out6[0,:],out6[1,:],'r', out6[0,:],out6[2,:],'b');\n", + "out6 = sc6.Run(np.array([1,2,3,4,5,6,7,8,9,10]))\n", + "plt.plot(out6[0,:],out6[2,:],'r', out6[0,:],out6[6,:],'b');\n", "plt.legend(['discrete out','continuous out'])\n", "plt.grid()\n", "plt.show()" @@ -1714,8 +1714,8 @@ "\n", "sc7.AddListComponents(np.array([c7_1,c7_2,c7_3,c7_4,c7_5,c7_6,c7_7,c7_8])) #Alles ohne Ts bleibt gleich\n", "\n", - "out7 = sc7.Run(np.array([2,6]))\n", - "plt.plot(out7[0,:],out7[1,:],'r', out7[0,:],out7[2,:],'b');\n", + "out7 = sc7.Run(np.array([1,2,3,4,5,6]))\n", + "plt.plot(out7[0,:],out7[2,:],'r', out7[0,:],out7[6,:],'b');\n", "plt.legend(['discrete out','continuous out'])\n", "plt.grid()\n", "plt.show()"