I'm trying to expand upon the Snell's Law example: http://www.k-wave.org/documentation/example_tvsp_snells_law.php
But instead of a single straight boundary, I would like the boundaries to be diagonal to model a waveguide that tapers into a narrower point like so: https://i.imgur.com/KzxoVBc.png
Is there a way to assign a medium.sound_speed
such that it has some curvature? Currently I'm using the following code to generate two parallel boundaries, but ultimately I would like to tilt the boundaries so they act as a funnel.
medium.sound_speed(:, 64+width/2 : 64+width/2+1) = c02;
medium.sound_speed(:, 64-width/2-1 : 64-width/2) = c02;
Is there a way to do this?
Thank you very much in advance.
Edit:
I managed to create a rudimentary funnel that tapers at a 45 degree then spreads out again, but it's far from elegant:
width = 18;
medium.sound_speed(1:60, 64+width/2 : 64+width/2+1) = c02;
medium.sound_speed(1:60, 64-width/2-1 : 64-width/2) = c02;
for i=1:1:60
medium.sound_speed(i, i) = c02;
end
for i=1:1:60
medium.sound_speed(i, 128-i) = c02;
end
width=5;
medium.sound_speed(60:80, 64+width/2 : 64+width/2+1) = c02;
medium.sound_speed(60:80, 64-width/2-1 : 64-width/2) = c02;