1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| plt.figure() plt.subplot(2, 1, 1) plt.plot(T, np.abs(vc), label = 'Cavity probe continous sim') plt.plot(T, np.abs(vc2), '--', label = 'Cavity probe discrete sim SS') plt.plot(T, np.abs(vc3), '-.', label = 'Cavity probe discrete sim Euler') plt.plot(T, np.abs(vr), label = 'Reflected continous sim') plt.plot(T, np.abs(vr2), '--', label = 'Reflected discrete sim SS') plt.plot(T, np.abs(vr3), '-.', label = 'Reflected discrete sim Euler') plt.legend() plt.grid() plt.xlabel('Time (s)') plt.ylabel('Amplitude (V)') plt.subplot(2, 1, 2) plt.plot(T, np.angle(vc, deg = True), label = 'Cavity probe continous sim') plt.plot(T, np.angle(vc2, deg = True), '--', label = 'Cavity probe discrete sim SS') plt.plot(T, np.angle(vc3, deg = True), '-.', label = 'Cavity probe discrete sim Euler') plt.plot(T, np.angle(vr, deg = True), label = 'Reflected continous sim') plt.plot(T, np.angle(vr2, deg = True), '--', label = 'Reflected discrete sim SS') plt.plot(T, np.angle(vr3, deg = True), '-.', label = 'Reflected discrete sim Euler') plt.legend() plt.grid() plt.xlabel('Time (s)') plt.ylabel('Phase (deg)') plt.suptitle('Cavity Response Simulated with Discrete Models') plt.show(block = False)
status, for_power, ref_power, C = for_ref_volt2power(roQ, QL, vf, vr) plt.figure() plt.plot(T, for_power / 1000) plt.plot(T, ref_power / 1000) plt.grid() plt.xlabel('Time (s)') plt.ylabel('Power (kW)') plt.show(block = False)
|