{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Acoustofluidics 2022: Minimal Example Plotting Scattering Fields\nThis is the minimal example on how to plot the scattered pressure field around\na polystyrene particle suspended in water and subjected to an acoustic standing\nwave from the abstract book from the Acoustofluidics 2022 conference.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "We import ``osaft`` and initialise the model from Yosioka & Kawasima.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from matplotlib import pyplot as plt\n\nimport osaft\n\nyosioka = osaft.yosioka1955.ScatteringField(\n    f=1e6,\n    R_0=1e-6,\n    rho_s=1020,\n    c_s=2350,\n    rho_f=997,\n    c_f=1498,\n    p_0=1e5,\n    wave_type=osaft.WaveType.STANDING,\n    position=osaft.pi / 4,\n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "The model is passed to the plotting class and the pressure field is\nplotted. The option ``incident=False`` makes sure that only the\nscattered field is plotted but not the incident field.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "plot = osaft.FluidScatteringPlot(yosioka, r_max=4e-6)\n\nplot.plot_pressure(incident=False)\n\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.9.15"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}