{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# 2D Forces plots\n\nUse the output of a harmonic coil and show the Field quality\n\nDownload Input files\n\n* :download:`dipole_2d.data <../../../../../examples/input_files/dipole_2d.data>`\n* :download:`dipole_2d.post.xml <../../../../../examples/input_files/dipole_2d.post.xml>`\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setting up\nStandard Loading of input, Parsing and Initializing RoxiePlotOutputs object\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from roxieapi.output.plots import RoxiePlotOutputs\n\nplots = RoxiePlotOutputs(\n \"../input_files/dipole_2d.post.xml\", \"../input_files/dipole_2d.data\"\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting the Roxie standard Forces plot\nShow all forces as Graph, with y=Force, and x=Conductor number\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "parser = plots.output\nforces = parser.get_conductor_forces()\nif forces is not None:\n fig = plots.graphs.plot_forces(forces)\n fig" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting as 2D crossection plot\nSame information, but for each force plot a separate crosssection plot\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plots.plots2d.plot_conductor_forces()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Show as table\nMost output data is stored in Pandas Dataframes, so they can be used for tabular output (to display or files)\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "forces" ] } ], "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.19" } }, "nbformat": 4, "nbformat_minor": 0 }