% A gradient-index lens: no interface at all, just a region where sound % travels more slowly. % % The speed dips smoothly to c0*(1 - dn) at the centre of a Gaussian of width % `w` metres, so a plane wave crossing it is retarded most in the middle and % the wavefront curves. The focus lands a little way past the lens and is % much brighter than anything else on the grid, which is worth remembering % when reading the colour scale. % % This is the case where a sharp-interface scatterer has nothing to say: there % is no reflection to speak of, only refraction, and the field is smooth % everywhere. It is also the easiest scene for the solver, since nothing on % the grid is under-resolved. function [c, sig] = medium(x, y, L, h, c0, dn, w, x0) r2 = ((x - x0).^2 + y.^2) / (w*w); c = c0 * (1 - dn * exp(-r2)); sig = sponge(x, y, L, 0.2*L, 1700); end