### Import PyWaveProp Modules Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Load necessary classes for source definition, environment setup, computation, and visualization. ```python from uwa.source import GaussSource from uwa.environment import UnderwaterEnvironment, Bathymetry from uwa.sspade import UWASSpadeComputationalParams, uwa_ss_pade from uwa.vis import AcousticPressureFieldVisualiser2d ``` -------------------------------- ### Initialize Environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Set up the working directory and suppress warnings. ```python import os os.chdir('../../../') import warnings warnings.filterwarnings('ignore') ``` -------------------------------- ### Initialize environment and imports Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_deep_water.html Set up the working directory and import necessary PyWaveProp modules for underwater acoustic simulation. ```python import os os.chdir('../../../') import warnings warnings.filterwarnings('ignore') ``` ```python from uwa.source import GaussSource from uwa.environment import UnderwaterEnvironment, Bathymetry, munk_profile from uwa.sspade import UWASSpadeComputationalParams, uwa_ss_pade from uwa.vis import AcousticPressureFieldVisualiser2d import math as fm ``` -------------------------------- ### Initialize environment and imports Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Sets up the working directory and imports necessary modules for the RWP simulation. ```python import os os.chdir('../../../') from rwp.environment import * from rwp.sspade import * from rwp.tworay import * from rwp.vis import * ``` -------------------------------- ### Initialize environment and imports Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/irregular_terrain.html Sets up the working directory and imports necessary modules for the simulation. ```python import os os.chdir('../../../') from rwp.antennas import GaussAntenna from rwp.environment import * from rwp.sspade import * from rwp.vis import * ``` -------------------------------- ### Initialize simulation environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Sets up the working directory and imports necessary modules for the RWP simulation. ```python import os os.chdir('../../../') from rwp.sspade import * from rwp.environment import * from rwp.vis import * ``` -------------------------------- ### Initialize environment and imports Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/std_atmosphere.html Sets up the working directory and imports necessary modules for environment, computation, and visualization. ```python import os os.chdir('../../../') from rwp.environment import * from rwp.sspade import * from rwp.vis import * ``` -------------------------------- ### Initialize field visualizers Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Creates visualizer objects for both the Pade propagator and the two-ray model results. ```python pade_vis = FieldVisualiser(pade_field, env=environment, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='Pade + nonlocal BC', x_mult=1) trm_vis = FieldVisualiser(trm_field, env=environment, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v))-7, label='Two-ray model') ``` -------------------------------- ### Set up Padé propagator Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Configures the Helmholtz propagator using Padé approximation parameters for high-order accuracy. ```python computational_params78 = HelmholtzPropagatorComputationalParams(exp_pade_order=(7, 8), z_order=4, dx_wl=400, dz_wl=1, x_output_filter=1, z_output_filter=1, two_way=True, max_propagation_angle=10) pade78_task = TroposphericRadioWaveSSPadePropagator(antenna=antenna, env=environment, max_range_m=max_range, comp_params=computational_params78) ``` -------------------------------- ### Importing required modules Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/five_knife_edges.html Initializes the environment by changing the working directory and importing necessary classes from the rwp package. ```python import os os.chdir('../../') from rwp.kediffraction import * from rwp.antennas import * from rwp.environment import * from rwp.vis import * ``` -------------------------------- ### Importing required modules Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/one_knife_edge.html Initializes the working directory and imports necessary classes for knife-edge diffraction modeling. ```python import os os.chdir('../../../') from rwp.kediffraction import * from rwp.antennas import * from rwp.environment import * from rwp.vis import * ``` -------------------------------- ### Set up Crank-Nicolson propagator Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Configures the Helmholtz propagator using Crank-Nicolson parameters for the simulation task. ```python computational_params_cn = HelmholtzPropagatorComputationalParams(exp_pade_order=(1, 1), two_way=True, z_order=2, dx_wl=80, x_output_filter=5, dz_wl=1, z_output_filter=1, max_propagation_angle=10) crank_nicolson_task = TroposphericRadioWaveSSPadePropagator(antenna=antenna, env=environment, max_range_m=max_range, comp_params=computational_params_cn) ``` -------------------------------- ### Configure transmitting antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Sets up a Gaussian antenna with specific wavelength, height, beam width, and polarization. ```python antenna = GaussAntenna(wavelength=0.1, height=30, beam_width=2, elevation_angle=0, polarz='H') ``` -------------------------------- ### Defining the environment and antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/one_knife_edge.html Sets up a flat troposphere environment with a single knife-edge obstacle and a source antenna. ```python env = Troposphere(flat=True) env.z_max = 150 env.knife_edges = [KnifeEdge(range=500, height=50)] antenna = Source(wavelength=1, height_m=50) ``` -------------------------------- ### Visualize Results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Generate 2D plots of the acoustic pressure field amplitude. ```python vis = AcousticPressureFieldVisualiser2d(field=field, env=env) vis.plot2d(min_val=-50, max_val=-5, grid=True, show_terrain=True).show() ``` ```python vis = AcousticPressureFieldVisualiser2d(field=field, env=env) vis.plot2d(-50, -5, grid=True, show_terrain=True).show() ``` ```python vis = AcousticPressureFieldVisualiser2d(field=field, env=env) plt = vis.plot2d(-50, -5, grid=True, show_terrain=True) plt.show() ``` -------------------------------- ### Simulate with irregular bottom Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_deep_water.html Define an environment with a variable bottom profile and re-run the simulation. ```python env = UnderwaterEnvironment( sound_speed_profile_m_s=lambda x, z: munk_profile(z), bottom_profile=Bathymetry(func=lambda z: 5000 - fm.exp((-(z-100E3)**2)/1E9)*3000, max_depth=5000), bottom_sound_speed_m_s = 1700, bottom_density_g_cm = 1.5, bottom_attenuation_dm_lambda = 0.5 ) ``` ```python field = uwa_ss_pade( src=src, env=env, params=params ) ``` ```python vis = AcousticPressureFieldVisualiser2d(field=field, env=env) vis.plot2d(min_val=-80, max_val=0, grid=True, show_terrain=True).show() ``` -------------------------------- ### Calculating knife-edge diffraction Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/two_knife_edges.html Initializes the calculator with the antenna and environment, then computes the field. ```python kdc = KnifeEdgeDiffractionCalculator(src=antenna, env=env, max_range_m=1000) field = kdc.calculate() ``` -------------------------------- ### Visualize acoustic results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_deep_water.html Visualize the sound speed profile and the resulting 2D acoustic pressure field. ```python vis = AcousticPressureFieldVisualiser2d(field=field, env=env) ``` ```python vis.sound_speed_profile().show() ``` ```python vis.plot2d(min_val=-80, max_val=0, grid=True, show_terrain=True).show() ``` -------------------------------- ### Configuring environment and antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/five_knife_edges.html Defines the tropospheric environment with five specific knife-edges and sets up a Gaussian antenna source. ```python env = Troposphere(flat=True) env.z_max = 150 env.knife_edges = [KnifeEdge(range=100, height=25), KnifeEdge(range=200, height=50), KnifeEdge(range=300, height=75), KnifeEdge(range=600, height=50), KnifeEdge(range=800, height=125)] antenna = GaussAntenna(freq_hz=300e6, height=50, beam_width=15, elevation_angle=0, polarz='H') ``` -------------------------------- ### Visualize field results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Initializes the field visualizer with a logarithmic transformation function. ```python vis = FieldVisualiser(field, env=environment, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='Pade + Transparent BC', x_mult=1E-3) ``` -------------------------------- ### Visualize acoustic results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound.html Visualizes the sound speed profile and the 2D acoustic pressure field amplitude. ```python vis = AcousticPressureFieldVisualiser2d(field=field, env=env) vis.sound_speed_profile().show() vis.plot2d(min_val=-20, max_val=30, grid=True, show_terrain=True).show() ``` -------------------------------- ### Execute field calculation Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Runs the calculation for both the Padé and Crank-Nicolson propagation tasks. ```python pade78_field = pade78_task.calculate() crank_nicolson_field = crank_nicolson_task.calculate() ``` -------------------------------- ### Configuring the troposphere and antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/two_knife_edges.html Defines the troposphere environment with two knife-edges and sets up a Gaussian antenna. ```python env = Troposphere(flat=True) env.z_max = 150 env.knife_edges = [KnifeEdge(range=200, height=50), KnifeEdge(range=800, height=50)] antenna = GaussAntenna(freq_hz=300e6, height=50, beam_width=15, elevation_angle=0, polarz='H') ``` -------------------------------- ### Define Gaussian source Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound_pond.html Create a Gaussian source with specific frequency, depth, and beam characteristics. ```python src = GaussSource( freq_hz=31.4E3, depth_m=2, beam_width_deg=20, elevation_angle_deg=0, multiplier=0.1 ) ``` -------------------------------- ### Compute Acoustic Pressure Field Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Execute the SS-Pade solver using the defined source, environment, and parameters. ```python field = uwa_ss_pade( src=src, env=env, params=params ) ``` -------------------------------- ### Configure underwater environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound_pond.html Define the pond environment parameters including sound speed, bathymetry, and bottom properties. ```python max_range_m = 100 env = UnderwaterEnvironment( sound_speed_profile_m_s=lambda x, z: 1500, bottom_profile=Bathymetry( ranges_m=[0, max_range_m], depths_m=[4, 1]), bottom_sound_speed_m_s = 1700, bottom_density_g_cm = 1.5, bottom_attenuation_dm_lambda = 0.1 ) ``` -------------------------------- ### Set computational parameters Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Defines the Helmholtz propagator parameters for the finite-difference Pade method. ```python pade_params = HelmholtzPropagatorComputationalParams(two_way=False, exp_pade_order=(7, 8), max_propagation_angle=abs(antenna.beam_width) + abs(antenna.elevation_angle) + 5, z_order=5, dx_wl=2, dz_wl=0.05, inv_z_transform_tau=10**(3 / (max_range / antenna.wavelength / 2)) ) ``` -------------------------------- ### Visualize simulation results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Generates horizontal and 2D plots to visualize the field intensity in decibels. ```python pade78_vis = FieldVisualiser(pade78_field, env=environment, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='Pade-[7/8] + NLBC', x_mult=1E-3) crank_nicolson_vis = FieldVisualiser(crank_nicolson_field, env=environment, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='Claerbout-CN', x_mult=1E-3) plt = crank_nicolson_vis.plot_hor(150, pade78_vis) plt.xlabel('Range (km)') plt.ylabel('10log|u| (dB)') plt.tight_layout() plt.grid(True) plt.show() plt = crank_nicolson_vis.plot2d(min=-70, max=0) plt.xlabel('Range (km)') plt.ylabel('Height (m)') plt.tight_layout() plt.grid(True) plt.show() plt = pade78_vis.plot2d(min=-70, max=0) plt.title('10log|u|') plt.xlabel('Range (km)') plt.ylabel('Height (m)') plt.tight_layout() plt.grid(True) plt.show() ``` -------------------------------- ### Set Computational Parameters Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Define the grid and range limits for the SS-Pade computation. ```python params = UWASSpadeComputationalParams( max_range_m=max_range_m, max_depth_m=500, dx_m=1, # output grid steps affects only on the resulting field, NOT the computational grid dz_m=1, ) ``` -------------------------------- ### Calculating the diffraction field Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/one_knife_edge.html Initializes the diffraction calculator and computes the field over the specified range. ```python kdc = KnifeEdgeDiffractionCalculator(src=antenna, env=env, max_range_m=1000) field = kdc.calculate() ``` -------------------------------- ### Simulate antenna inside thermocline Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound.html Updates source depth to 7m and re-runs the simulation to observe propagation changes. ```python src.depth_m = 7 field2 = uwa_ss_pade( src=src, env=env, params=params ) vis2 = AcousticPressureFieldVisualiser2d(field=field2, env=env) vis2.plot2d(min_val=-20, max_val=30, grid=True, show_terrain=True).show() ``` -------------------------------- ### Define acoustic source Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_deep_water.html Configure a Gaussian source for the acoustic simulation. ```python src = GaussSource( freq_hz=50, depth_m=100, beam_width_deg=3, elevation_angle_deg=0, multiplier=5 ) ``` -------------------------------- ### Simulate antenna below thermocline Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound.html Updates source depth to 10m and re-runs the simulation. ```python src.depth_m = 10 field3 = uwa_ss_pade( src=src, env=env, params=params ) vis3 = AcousticPressureFieldVisualiser2d(field=field3, env=env) vis3.plot2d(min_val=-20, max_val=30, grid=True, show_terrain=True).show() ``` -------------------------------- ### Visualize acoustic field results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound_pond.html Visualize the 2D field amplitude and compare different elevation angles. ```python vis1 = AcousticPressureFieldVisualiser2d(field=field1, env=env, label="Horizontal") ``` ```python vis1.plot2d(min_val=-60, max_val=0, grid=True, show_terrain=True).show() ``` ```python src.elevation_angle_deg = -60 ``` ```python field2 = uwa_ss_pade( src=src, env=env, params=params ) ``` ```python vis2 = AcousticPressureFieldVisualiser2d(field=field2, env=env, label="Vertical") vis2.plot2d(min_val=-60, max_val=0, grid=True, show_terrain=True).show() ``` ```python vis1.plot_hor(0.5, [-70, -10], vis2).show() ``` ```python vis1.plot_hor(2, [-70, -10], vis2).show() ``` -------------------------------- ### Calculate electromagnetic field Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Initializes the SSPade propagator and computes the field based on the defined antenna and environment. ```python propagator = TroposphericRadioWaveSSPadePropagator(antenna=antenna, env=environment, max_range_m=max_range) field = propagator.calculate() ``` -------------------------------- ### Define Underwater Environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Configure the sound speed profile and bottom bathymetry parameters. ```python max_range_m = 3000 env = UnderwaterEnvironment( sound_speed_profile_m_s=lambda x, z: 1500 + z*0, bottom_profile=Bathymetry( ranges_m=[0, max_range_m], depths_m=[300, 300]), bottom_sound_speed_m_s = 1700, bottom_density_g_cm = 1.5, bottom_attenuation_dm_lambda = 0.01 ) ``` ```python env = UnderwaterEnvironment( sound_speed_profile_m_s=lambda x, z: 1500 + z*0, bottom_profile=Bathymetry( ranges_m=[0, max_range_m], depths_m=[400, 0]), bottom_sound_speed_m_s = 1700, bottom_density_g_cm = 1.5, bottom_attenuation_dm_lambda = 0.05 ) ``` -------------------------------- ### Configure deep water environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_deep_water.html Define the underwater environment with a Munk sound speed profile and flat bottom bathymetry. ```python max_range_m = 200E3 env = UnderwaterEnvironment( sound_speed_profile_m_s=lambda x, z: munk_profile(z), bottom_profile=Bathymetry(ranges_m=[0], depths_m=[5000]), bottom_sound_speed_m_s = 1700, bottom_density_g_cm = 1.5, bottom_attenuation_dm_lambda = 0.5 ) ``` -------------------------------- ### Generate reference two-ray model Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Calculates the reference field using the two-ray model for comparison. ```python trm = TwoRayModel(src=antenna, env=environment) x_grid_m = np.linspace(1, max_range, 5000) z_grid_m = np.linspace(1, environment.z_max, 500) trm_f = trm.calculate(x_grid_m, z_grid_m) trm_field = Field(x_grid=x_grid_m, z_grid=z_grid_m, freq_hz=antenna.freq_hz) trm_field.field[:, :] = trm_f ``` -------------------------------- ### Visualizing field results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/five_knife_edges.html Generates 2D intensity plots and vertical amplitude profiles at specific ranges using the FieldVisualiser. ```python vis = FieldVisualiser(field, env=env, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='ke') plt = vis.plot2d(min=-40, max=0) plt.title('The intensity of the field component 10log10|u|') plt.xlabel('Range (m)') plt.ylabel('Height (m)') plt.show() plt = vis.plot_ver(175) plt.title('x = 175 m') plt.xlabel('Amplitude, dB') plt.ylabel('Height, m') plt.show() plt = vis.plot_ver(700) plt.title('x = 700 m') plt.xlabel('Amplitude, dB') plt.ylabel('Height, m') plt.show() ``` -------------------------------- ### Configure antenna parameters Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/std_atmosphere.html Defines the transmitting antenna characteristics for a given frequency. ```python antenna = GaussAntenna(freq_hz=300E6, height=30, beam_width=2, elevation_angle=0, polarz='H') ``` ```python antenna = GaussAntenna(freq_hz=3E9, height=30, beam_width=2, elevation_angle=0, polarz='H') ``` -------------------------------- ### Visualizing diffraction results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/one_knife_edge.html Generates 2D field intensity plots and horizontal cross-section plots for the calculated diffraction field. ```python vis = FieldVisualiser(field, env=env, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='ke') plt = vis.plot2d(min=-40, max=0) plt.title('The intensity of the field component 10log10|u|') plt.xlabel('Range (m)') plt.ylabel('Height (m)') plt.show() plt = vis.plot_hor(50) plt.title('The intensity of the field component 10log10|u| at the height 50 m') plt.xlabel('Range (m)') plt.ylabel('10log|u| (dB)') plt.show() ``` -------------------------------- ### Visualizing diffraction results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/two_knife_edges.html Generates 2D field intensity plots and horizontal intensity plots at a specific height. ```python vis = FieldVisualiser(field, env=env, trans_func=lambda v: 10 * cm.log10(1e-16 + abs(v)), label='ke') plt = vis.plot2d(min=-40, max=0) plt.title('The intensity of the field component 10log10|u|') plt.xlabel('Range (m)') plt.ylabel('Height (m)') plt.show() plt = vis.plot_hor(51) plt.title('The intensity of the field component 10log10|u| at the height 51 m') plt.xlabel('Range (m)') plt.ylabel('10log|u| (dB)') plt.show() ``` -------------------------------- ### Configure Transmitting Antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_shallow_water.html Define the Gaussian source properties including frequency, depth, and beam characteristics. ```python src = GaussSource( freq_hz=1000, depth_m=100, beam_width_deg=1, elevation_angle_deg=-30, multiplier=5 ) ``` ```python src = GaussSource( freq_hz=200, depth_m=150, beam_width_deg=10, elevation_angle_deg=10, multiplier=5 ) ``` -------------------------------- ### Simulate propagation without thermocline Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/uwa/uwa_ultrasound.html Resets the sound speed profile to a constant value and visualizes the resulting field. ```python env.sound_speed_profile_m_s = lambda x, z: 1500+z*0 field4 = uwa_ss_pade( src=src, env=env, params=params ) vis4 = AcousticPressureFieldVisualiser2d(field=field4, env=env) vis4.plot2d(min_val=-20, max_val=30, grid=True, show_terrain=True).show() ``` -------------------------------- ### Configure troposphere environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/irregular_terrain.html Defines the terrain elevation, ground material, M-profile, and vegetation impediments. ```python environment = Troposphere() environment.terrain = Terrain( elevation=gauss_hill_func( height_m=125, length_m=40E3, x0_m=50E3 ), ground_material=WetGround() ) elevated_duct = interp1d( x=[0, 100, 150, 300], y=[0, 32, 10, 45], fill_value="extrapolate") environment.M_profile = lambda x, z: elevated_duct(z) environment.vegetation = [Impediment( left_m=30E3, right_m=70E3, height_m=25, material=CustomMaterial(eps=1.004, sigma=180e-6) )] ``` -------------------------------- ### Define tropospheric environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Configures the refractive index profile, terrain, and knife-edge obstacle for the simulation. ```python elevated_duct = interp1d(x=[0, 100, 150, 300], y=[0, 32, 10, 50], fill_value="extrapolate") environment = Troposphere() environment.terrain = Terrain(ground_material=PerfectlyElectricConducting()) environment.z_max = 300 environment.M_profile = lambda x, z: elevated_duct(z) environment.knife_edges = [KnifeEdge(range=70e3, height=150)] max_range = 100000 ``` -------------------------------- ### Visualize field results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/std_atmosphere.html Creates visual representations of the calculated field data. ```python vis300mhz = FieldVisualiser(field, env=environment, label='Pade + Transparent BC: 300 MHz', x_mult=1E-3) ``` ```python plt = vis300mhz.plot2d(min=-120, max=0) plt.title('10log|u|') plt.xlabel('Range (km)') plt.ylabel('Height (m)') plt.tight_layout() plt.grid(True) plt.show() ``` ```python vis3ghz = FieldVisualiser(field, env=environment, label='Pade + Transparent BC: 3 GHz', x_mult=1E-3) ``` ```python plt = vis3ghz.plot_hor(30, vis300mhz) plt.xlabel('Range (km)') plt.ylabel('10log|u| (dB)') plt.grid(True) plt.tight_layout() plt.show() ``` ```python plt = vis3ghz.plot2d(min=-120, max=0) plt.title('10log|u|') plt.xlabel('Range (km)') plt.ylabel('Height (m)') plt.tight_layout() plt.grid(True) plt.show() ``` -------------------------------- ### Plot horizontal field comparison Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Plots a comparison of the horizontal field values between the Pade propagator and the two-ray model. ```python plt = pade_vis.plot_hor(50, trm_vis) plt.xlabel('Range (m)') plt.ylabel('10log|u| (dB)') plt.tight_layout() plt.grid(True) plt.show() ``` -------------------------------- ### Configure transmitting antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/knife_edge_in_elevated_duct.html Defines the Gaussian antenna properties including wavelength, height, and beam characteristics. ```python antenna = GaussAntenna(wavelength=0.1, height=30, beam_width=2, elevation_angle=0, polarz='H') ``` -------------------------------- ### Plot two-ray model results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Generates a 2D plot for the two-ray model field. ```python plt = trm_vis.plot2d(min=-40, max=0) plt.xlabel('Range (m)') plt.ylabel('Height (m)') plt.grid(True) plt.tight_layout() plt.show() ``` -------------------------------- ### Configure transmitting antenna Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Sets the antenna parameters, including the elevation angle calculated based on the Brewster angle. ```python freq_hz = 3000e6 b_angle = brewster_angle(1, ground_material.complex_permittivity(freq_hz)).real antenna = GaussAntenna(freq_hz=freq_hz, height=50, beam_width=5, elevation_angle=90-b_angle, polarz='V') h1 = antenna.height_m h2 = 0 a = abs((h1 - h2) / cm.tan(abs(antenna.elevation_angle) * cm.pi / 180)) max_range = 2 * a + 200 ``` -------------------------------- ### Calculate electromagnetic field Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Executes the propagation task using the defined antenna, environment, and computational parameters. ```python pade_task = TroposphericRadioWaveSSPadePropagator(antenna=antenna, env=environment, max_range_m=max_range, comp_params=pade_params) pade_field = pade_task.calculate() ``` -------------------------------- ### Compute electromagnetic field Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/std_atmosphere.html Calculates the field using the Pade approximation based on the provided environment, antenna, and computational parameters. ```python params = RWPSSpadeComputationalParams( max_range_m=150E3, max_height_m=300, dx_m = 100, # output grid steps affects only on the resulting field, NOT the computational grid dz_m = 1 ) field = rwp_ss_pade(antenna=antenna, env=environment, params=params) ``` ```python field = rwp_ss_pade(antenna=antenna, env=environment, params=params) ``` -------------------------------- ### Plot Pade propagator results Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Generates a 2D plot for the Pade propagator field. ```python plt = pade_vis.plot2d(min=-40, max=0) plt.xlabel('Range (m)') plt.ylabel('Height (m)') plt.tight_layout() plt.grid(True) plt.show() ``` -------------------------------- ### Plot 2D field distribution Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Generates a 2D heatmap of the field amplitude over the range and height. ```python plt = vis.plot2d(min=-70, max=0) plt.title('10log|u|') plt.xlabel('Range (km)') plt.ylabel('Height (m)') plt.tight_layout() plt.show() ``` -------------------------------- ### Specify elevated duct M-profile Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Defines the refractive index profile using a 1D interpolation function applied to the environment. ```python profile1d = interp1d(x=[0, 100, 150, 300], y=[0, 32, 10, 45], fill_value="extrapolate") environment.M_profile = lambda x, z: profile1d(z) ``` -------------------------------- ### Define tropospheric environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/brewster_angle.html Configures the simulation environment with a flat troposphere and custom ground material properties. ```python environment = Troposphere(flat=True) environment.z_max = 100 ground_material = CustomMaterial(eps=3, sigma=0) environment.terrain = Terrain(ground_material=ground_material) ``` -------------------------------- ### Plot horizontal field amplitude Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Generates a 1D plot of the field amplitude at a specific height. ```python plt = vis.plot_hor(30) plt.xlabel('Range (km)') plt.ylabel('10log|u| (dB)') plt.grid(True) plt.tight_layout() plt.show() ``` -------------------------------- ### Define tropospheric environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/elevated_duct.html Configures the base troposphere environment with ground terrain and a maximum propagation range. ```python environment = Troposphere() environment.terrain = Terrain(ground_material=WetGround()) max_range = 150e3 ``` -------------------------------- ### Define troposphere environment Source: https://wave-propagation.readthedocs.io/en/latest/notebooks/std_atmosphere.html Configures the troposphere with a specific terrain type. ```python environment = Troposphere() environment.terrain = Terrain(ground_material=WetGround()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.