Please have a look at the example_na_controlling_the_pml.ipynb
notebook file to see the example in action.
We can verify the correctness of Python implementation by saving intermediate/final variable states from the Matlab script
and comparing them against Pyton version. Saving the variable states can be done manually by running the Matlab script,
pausing it in appropriate places and saving the variables using save(...)
method. However, this is very involved process.
To automate the process a bit, we followed the steps below.
- Grab the original example file from K-wave repository (link: example_na_controlling_the_PML.m)
- Modify the file such that we are running for all scenarios (4 different simulation cases) and saving the output sensor data + visualized figures each time. We saved the modified script in the
modified_matlab_example.m
file. - Run the modified file from the step above. Now we should have 4x
.mat
and.png
files for the captured sensor data and visualized figure, respectively. - We check against these files in the
example_na_controlling_the_pml.ipynb
notebook.