SharedProblem A.sagewsOpen in CoCalc
sum_resolution = 100

ion_dist = 500000
init_pow = 100

loss_ion   = 96 / 100
loss_ocean = 50 / 100

x = var('x')
y = var('y')
n = var('n')

a_n = (loss_ion^(floor(((n + 1) / 2))) * loss_ocean^(floor((n / 2))) * init_pow) / (4 * pi * (x^2 + (n * ion_dist + y * (-1)^n + (ion_dist + ion_dist * (-1)^(n+1)) / 2  )^2))

show(a_n)

s = sum(a_n.substitute(n == k) for k in xrange(1, sum_resolution + 1))

cplot = contour_plot(10 * log(s / 10^(-12), 10), (x, 0, 5000000), (y, 0, ion_dist), contours=(10,), fill=False)
d2e8-cf6f-49b4-9ba9-09ffe1797ac7