<jupyter_start><jupyter_text>Brewster angle incidence<jupyter_code>import os
os.chdir('../../../')
from rwp.environment import *
from rwp.sspade import *
from rwp.tworay import *
from rwp.vis import *<jupyter_output><empty_output><jupyter_text>Preparing environment<jupyter_code>environment = Troposphere(flat=True)
environment.z_max = 100
ground_material = CustomMaterial(eps=3, sigma=0)
environment.terrain = Terrain(ground_material=ground_material)<jupyter_output><empty_output><jupyter_text>Preparing transmitting antenna<jupyter_code>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, eval_angle=90-b_angle, polarz='V')
h1 = antenna.height_m
h2 = 0
a = abs((h1 - h2) / cm.tan(abs(antenna.eval_angle) * cm.pi / 180))
max_range = 2 * a + 200<jupyter_output><empty_output><jupyter_text>Specifying computational parameters of the finite-difference Pade propagator<jupyter_code>pade_params = HelmholtzPropagatorComputationalParams(two_way=False,
                                                     exp_pade_order=(7, 8),
                                                     max_propagation_angle=abs(antenna.beam_width) + abs(antenna.eval_angle) + 5,
                                                     z_order=5,
                                                     dx_wl=2,
                                                     dz_wl=0.05,
                                                     inv_z_transform_tau=10**(3 / (max_range / antenna.wavelength / 2))
                                                     )<jupyter_output><empty_output><jupyter_text>Calculating the electromagnetic field<jupyter_code>pade_task = TroposphericRadioWaveSSPadePropagator(antenna=antenna, env=environment, max_range_m=max_range, comp_params=pade_params)
pade_field = pade_task.calculate()<jupyter_output><empty_output><jupyter_text>Generating reference solution by the two-ray model<jupyter_code>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<jupyter_output><empty_output><jupyter_text>Visualising results<jupyter_code>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')
plt = pade_vis.plot2d(min=-40, max=0)
plt.xlabel('Range (m)')
plt.ylabel('Height (m)')
plt.tight_layout()
plt.grid(True)
plt.show()
plt = trm_vis.plot2d(min=-40, max=0)
plt.xlabel('Range (m)')
plt.ylabel('Height (m)')
plt.grid(True)
plt.tight_layout()
plt.show()
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()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12198303979125896, 'fraction_numerical': 0.02511415525114155, 'mean_word_length': 3.762422360248447, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '359325', 'license': 'MIT', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1083, 'n_words': 160, 'path': 'docs/source/notebooks/brewster_angle.ipynb', 'repo_name': 'mikelytaev/wave-propagation', 'size': '3066'}