예제 #1
0
        delta_action = gm.update(sens[t])

        if t == stime//4 and type == "normal":
            genModPlot.plot_first(t)
        if t == box_time and type == "normal":
            genProcPlot.plot_second(t)

        if len(sens[:t+1]) >= 2:
            dd = np.sum(2*(sens[t-1:t+1] > 0)-1)
            if dd == 0 and sens[t-1] > 0:
                peaks += 1
                if peaks

                 == peaks_max+1:
                    box_time = t + stime//6
        if t % 1200 == 0 or t == stime - 1:
            if t > box_time:
                sim.set_box([0, 1.48])
            sim.update(0.3*np.pi*sens[t],
                       0.3*np.pi*sens_model[t])
            prederr.update([0.3*np.pi*sens[t], 0.3*np.pi*sens_model[t]], t)
            genProcPlot.update([0.3*np.pi*sens[t],
                                0.3*np.pi*ampl[t],
                                t > box_time,
                                0], t)
            genModPlot.update([0.3*np.pi*sens_model[t],
                               0.3*np.pi*ampl_model[t],
                               t > box_time,
                               sigma_s[t]*3 if type != "normal" else 0], t)