Code covered by the BSD License  

Highlights from
raytrace

5.0

5.0 | 2 ratings Rate this file 28 Downloads (last 30 days) File Size: 5.05 KB File ID: #26253
image thumbnail

raytrace

by Val Schmidt

 

03 Jan 2010 (Updated 24 Apr 2012)

A function to model acoustic refraction due to variations in sound speed.

| Watch this File

File Information
Description

In ocean acoustics a common task is to model the propagation of sound through the water column. The speed of sound varies with temperature, salinity and pressure (depth). To a first approximation, the ocean is horizontally stratified and these parameters only vary with depth. Variations in sound speed in layers of the water column cause a "ray" of acoustic energy to be refracted (to bend) as the ray passes through it.

When given a starting location, launch angle, vertical sound speed profile and total travel time, the attached function, raytrace.m, models the propagation of sound though a water column. It handles both reflection from the surface of the water and the bottom (the deepest depth given in the sound speed profile) as well as caustics (places in which the ray is bent back in the direction from which it came). Raytrace automatically plots the provided sound speed profile and the results of the ray-trace.

Although raytrace.m is designed for ocean acoustics, the mathematics for optical refraction is the same and where the assumptions apply raytrace.m will produce reasonable results.

BUG: raytrace.m currently does not handle launch angles above horizontal. Sorry about that.

Acknowledgements
This submission has inspired the following:
Water sound speed calculator
MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
30 Dec 2010 Prakash Manandhar

Thanks, this is fantastic.

21 Dec 2011 Saurabh Singh

Very very useful. Thanks a lot, Val. :)

Please login to add a comment or rating.
Updates
24 Apr 2012

Fixed bug that prevented proper ray tracing for rays with launch angles above horizontal.
Fixed bug in which a discontinuity was created as rays passed through a caustic.

Tag Activity for this File
Tag Applied By Date/Time
acoustics Val Schmidt 04 Jan 2010 13:41:56
ocean engineering Val Schmidt 04 Jan 2010 13:41:56
ray tracing Val Schmidt 04 Jan 2010 13:41:56
underwater acoustics Val Schmidt 04 Jan 2010 13:41:56
modeling Val Schmidt 04 Jan 2010 13:41:56
refraction Val Schmidt 04 Jan 2010 13:41:56
ray tracing Abiodun 25 May 2010 08:05:33

Contact us at files@mathworks.com