Skip to content

Note

Click here to download the full example code

Custom center frequency

This example demonstrates how to use a customized center frequency using ndk

Steady-State Wave Amplitude

Out:

Estimated time to complete simulation: 44 seconds. Memory required is 8.10010166030443 GB (available 73.624051712 GB). These values are approximated.
/home/circleci/.cache/pypoetry/virtualenvs/neurotechdevkit-3aSsmiER-py3.10/lib/python3.10/site-packages/devito/finite_differences/differentiable.py:224: DeprecationWarning: NotImplemented should not be used in a boolean context
  return super(Differentiable, self).__eq__(other) and\
/home/circleci/.cache/pypoetry/virtualenvs/neurotechdevkit-3aSsmiER-py3.10/lib/python3.10/site-packages/devito/finite_differences/differentiable.py:224: DeprecationWarning: NotImplemented should not be used in a boolean context
  return super(Differentiable, self).__eq__(other) and\
gcc -O3 -g -fPIC -Wall -std=c99 -march=native -Wno-unused-result -Wno-unused-variable -Wno-unused-but-set-variable -ffast-math -shared -fopenmp /tmp/devito-jitcache-uid1001/5e93aad3fe47b34cc09b102dd111206c20f0f734.c -lm -o /tmp/devito-jitcache-uid1001/5e93aad3fe47b34cc09b102dd111206c20f0f734.so


import neurotechdevkit as ndk

CENTER_FREQUENCY = 6e5

scenario = ndk.scenarios.built_in.Scenario0()

# Customizing material properties
scenario.material_properties = {
    "tumor": ndk.materials.Material(
        vp=1850.0, rho=1250.0, alpha=0.8, render_color="#94332F"
    ),
}
scenario.center_frequency = CENTER_FREQUENCY
scenario.make_grid()
scenario.compile_problem()
result = scenario.simulate_steady_state()
assert isinstance(result, ndk.results.SteadyStateResult2D)
result.render_steady_state_amplitudes(show_material_outlines=False)

Total running time of the script: ( 0 minutes 15.999 seconds)

Download Python source code: plot_customized_center_frequency.py

Download Jupyter notebook: plot_customized_center_frequency.ipynb

Gallery generated by mkdocs-gallery