Simulation of the propagation of ultrasonic waves for the characterization of complex media