# coding=utf-8 import numpy as np from pythonpic import plotting_parser from pythonpic.configs.run_beamplasma import initial, plots args = plotting_parser("Weak beam instability") np.random.seed(0) s = initial("beamplasma1").lazy_run() plots(s, *args, alpha=0.5)
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.configs.run_laser import initial, impulse_duration, n_macroparticles, number_cells args = plotting_parser("Hydrogen shield") perturbation_amplitude = 0 powers = [21, 22, 23] polarizations = ["Ey", "Circular"] for power, number_particles, n_cells, polarization in [ [21, 75000, int(number_cells), "Ey"], [21, 75000, int(number_cells), "Circular"], [23, 75000, int(number_cells), "Ey"], [23, 75000, int(number_cells), "Circular"], ]: intensity = 10**power s = initial(f"{number_particles}_{n_cells}_run_{power}_{polarization}", number_particles, n_cells, impulse_duration, intensity, perturbation_amplitude, laser_polarization=polarization).lazy_run().plots_3d(*args) del s
# coding=utf-8 from pythonpic import plotting_parser, BoundaryCondition from pythonpic.configs.run_wave import wave_propagation, plots args = plotting_parser("Wave propagation") for filename, boundary_function in zip(["Wave", "Envelope", "Laser"], [ BoundaryCondition.Laser(1, 1e-6, 1e-5 / 2, 2e-6).laser_wave, BoundaryCondition.Laser(1, 1e-6, 1e-5 / 2, 2e-6).laser_envelope, BoundaryCondition.Laser(1, 1e-6, 1e-5 / 2, 2e-6).laser_pulse, ]): s = wave_propagation(filename, bc=boundary_function).lazy_run() plots(s, *args, alpha=0.5)
# coding=utf-8 import numpy as np from pythonpic import plotting_parser from pythonpic.configs.run_beamplasma import initial, plots args = plotting_parser("Weak beam instability") np.random.seed(0) s = initial("beamplasma1").lazy_run() plots(s, *args, alpha=0.5)
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.configs import run_coldplasma, run_laser from pythonpic.visualization import static_plots, time_snapshots from pythonpic.configs.run_laser import initial, impulse_duration, n_macroparticles, number_cells import pathlib args = plotting_parser("Cold plasma oscillations") plasma_frequency = 1 push_mode = 2 N_electrons = 1024 NG = 64 qmratio = -1 T = 10 scaling = 1 c = 10 epsilon_zero = 1 plot_folder = pathlib.Path("/home/dominik/Inzynierka/ThesisText/Images/") S = run_coldplasma.initial(f"energy_plot", qmratio=qmratio, plasma_frequency=plasma_frequency, NG=NG, N_electrons=N_electrons, epsilon_zero=epsilon_zero, push_mode=push_mode, save_data=False, T=T, scaling=scaling, c=c).lazy_run() static_plots.publication_plots(S, str(plot_folder / "ESE_energy_plot.pdf"),
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.configs.run_laser import laser, impulse_duration, n_macroparticles, plots args = plotting_parser("Hydrogen shield") perturbation_amplitude = 0 number_particles = 10000 powers = range(23, 20, -1) for power in powers: intensity = 10**power s = laser(f"{number_particles}_run_{power}_{perturbation_amplitude}", number_particles, impulse_duration, intensity, perturbation_amplitude).lazy_run() if any(args): plots(s, *args, frames="few")
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.configs.dense_uniform import initial, plots, number_cells args = plotting_parser("stab2") for number_particles, n_cells in [ [2, int(number_cells/2)], # # [10000, int(number_cells/2)], # # [10000, int(number_cells/3)], # # [20000, number_cells], # # [20000, int(number_cells/2)], # ]: s = initial(f"{number_particles}_{n_cells}_stability2", number_particles, n_cells).lazy_run().plots_3d(*args) del s
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.helper_functions.physics import did_it_thermalize from pythonpic.configs.run_twostream import two_stream_instability, plots args = plotting_parser("Two stream instability") S = two_stream_instability("TS1", NG=512, N_electrons=4096, plasma_frequency=0.05 / 4, ).lazy_run() print(did_it_thermalize(S)) plots(S, *args) S = two_stream_instability("TS2", NG=512, N_electrons=4096, plasma_frequency=0.05, ).lazy_run() print(did_it_thermalize(S)) plots(S, *args) S = two_stream_instability("TS3", NG=512, N_electrons=4096, plasma_frequency=0.05 * 10, ).lazy_run() print(did_it_thermalize(S)) plots(S, *args) S = two_stream_instability("TSRANDOM1", NG=512, N_electrons=4096,
# coding=utf-8 from pythonpic import plotting_parser, BoundaryCondition from pythonpic.configs.run_wave import initial args = plotting_parser("Wave propagation") for filename, boundary_function in zip(["Wave", "Envelope", "Laser"], [BoundaryCondition.LaserCircular(1, 1e-6, 1e-5/2, 2e-6, bc_function="pulse"), BoundaryCondition.LaserCircular(1, 1e-6, 1e-5/2, 2e-6, bc_function="wave"), BoundaryCondition.LaserCircular(1, 1e-6, 1e-5/2, 2e-6, bc_function="envelope"), ]): s = initial(filename, bc=boundary_function).lazy_run().wave_1d(*args)
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.configs.run_twostream import initial args = plotting_parser("Two stream instability") S = initial("TS_UNSTABLE_LARGE", v0 = 0.01, N_electrons=25000, plasma_frequency=0.1, T = 6000, ).lazy_run().phase_1d(*args)
# coding=utf-8 from pythonpic import plotting_parser from pythonpic.configs.run_coldplasma import initial from pythonpic.visualization import animation args = plotting_parser("Cold plasma oscillations") plasma_frequency = 1 push_mode = 2 N_electrons = 1024 * 4 NG = 256 qmratio = -1 T = 50 scaling = 1 c = 10 epsilon_zero = 1 S = initial(f"CO_LINEAR", qmratio=qmratio, plasma_frequency=plasma_frequency, NG=NG, N_electrons=N_electrons, epsilon_zero=epsilon_zero, push_mode=push_mode, push_amplitude=0.1, save_data=False, T = T, scaling=scaling, c=c).lazy_run().plots_1d(*args) S = initial(f"CO_NONLINEAR3_1_DOUBLE_RES", qmratio=qmratio, plasma_frequency=plasma_frequency, NG=NG*2, N_electrons=N_electrons, epsilon_zero=epsilon_zero, push_mode=1, push_amplitude=0.3, save_data=False, T = T, scaling=scaling, c=c).lazy_run().phase_1d(*args) S = initial(f"CO_NONLINEAR4", qmratio=qmratio, plasma_frequency=plasma_frequency, NG=NG, N_electrons=N_electrons, epsilon_zero=epsilon_zero, push_mode=push_mode,