{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Simple steady VLM demo\n\nMinimal example of simulation execution.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport ezaero.vlm.steady as vlm\n\n# definition of wing, mesh and flight condition parameters\nwing = vlm.WingParameters(\n    root_chord=1,\n    tip_chord=0.6,\n    planform_wingspan=4,\n    sweep_angle=30 * np.pi / 180,\n    dihedral_angle=15 * np.pi / 180,\n)\nmesh = vlm.MeshParameters(m=4, n=16)\nflcond = vlm.FlightConditions(ui=100, aoa=3 * np.pi / 180, rho=1.0)\n\nsim = vlm.Simulation(wing=wing, mesh=mesh, flight_conditions=flcond)\n\nstart = time.time()\nres = sim.run()\nprint(f\"Wing lift coefficient: {res.cl_wing}\")\nprint(f\"Elapsed time: {time.time() - start} s\")\n\n# plot wing panels, vortex panels, and collocation points\nsim.plot_wing()\nplt.show()\n\n# plot cl distribution on wing\nsim.plot_cl()\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.7.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}