def f2(): solved1 = S1.solve() draw(grid=S1.grid, sol1=solved1, sol2=S1.phase, at_point_ID=int(len(g.X) / 2), at_time_ID=4, do_animation=True)
def f3(): solved2 = S2.solve() draw(grid=S2.grid, sol1=solved2, sol2=S2.phase, at_point_ID=int(len(g.X) / 2), at_time_ID=4, do_animation=True)
def f1(): prec_sol = S.prec_sol phase = S.phase draw(grid=S.grid, sol1=prec_sol, sol2=phase, at_point_ID=int(len(g.X) / 2), at_time_ID=4, do_animation=True)
def run(self): self._pg_plots = None self._prefs = Settings.load_from_json() self._ui = UI() self._infobar_link_connection = None self._blacklisted_charts: List[Tuple[str, str]] = None if self._prefs.is_incomplete(): self.try_detect_etterna() if self._prefs.is_incomplete(): if not self.make_user_choose_paths(): return self._prefs.save_to_json() self._download_blacklisted_charts() box_container, plot_container = self._ui.get_box_container_and_plot_container( ) self._pg_plots = plotter.draw(self._ui.get_qapp(), box_container, plot_container, self._prefs) self._ui.run()
return np.exp(-pow(z, 2) / (2 * pow(a, 2))) if __name__ == '__main__': g = Grid2D_TX( x_start = -L, x_end = L, dx = 0.5/2, t_start = 0.0, t_end = 12.56*2*2, dt = 0.005/2) we = WaveEquation(g, phi, c = 1) prec_sol = we.get_precise_solution().real draw(g, prec_sol[::50]) sol117 = we.solve_2nd_order_approximation_scheme() draw(g, sol117[::50]) # abs_err = abs(sol117 - prec_sol) # plt.plot(g.X.real, np.transpose(abs_err[::100])) # plt.show() sol119 = we.solve_chess_scheme() draw(g, sol119[::50]) # abs_err = abs(sol119 - prec_sol) # plt.plot(g.T[::100], abs_err[::100]) # plt.plot(g.X.real, np.transpose(abs_err[::100])) # plt.show() sol121 = we.solve_PML(a = 1.0, delta = 2.10001)