Complicated transducer array setup

The setup shown here is a doublesided array where the two halves are standing vertically 3 cm above a reflecting surface.

In this example no optimization is done, but all optimization functions support complex arrangements like this one.

[1]:
import numpy as np
import levitate

Reflections from planar reflections are handled as a transducer object. In this case, we wrap a CircularPiston object, to include some directivity as well.

[2]:
transducer = levitate.transducers.TransducerReflector(
    levitate.transducers.CircularPiston, effective_radius=3e-3,
    plane_intersect=(0, 0, 0), plane_normal=(0, 0, 1))

The transducer array is created by using the DoublesidedArray class, which takes the type of array to use as the singlesided template as one of the inputs.

[3]:
array = levitate.arrays.DoublesidedArray(
    levitate.arrays.RectangularArray, separation=200e-3,
    normal=(1, 0, 0), offset=(0, 0, 50e-3),
    shape=(5, 10), transducer=transducer
)

We visualize the sound pressure field, as well as the velocity magnitude field.

[4]:
phases = array.focus_phases(np.array([25e-3, 0, 40e-3]))
amps = levitate.complex(phases)
array.visualize.zlimits = (0, 0.1)
array.visualize.append('Pressure')
array.visualize.append('Velocity')
array.visualize(amps).show()