{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Show Objectives and Design variables\n\nPlot the 3D geometry of wedges and end-spacers\n\nDownload Input files\n\n* :download:`dipole_2d.data <../../../../../examples/input_files/dipole_iron_trans_opt.data>`\n* :download:`dipole_2d.post.xml <../../../../../examples/input_files/dipole_iron_trans_opt.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_iron_trans_opt.post.xml\",\n \"../input_files/dipole_iron_trans_opt.data\",\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Show Design variables\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "for idx, opt in plots.output.opt.items():\n print(f\"Optimization step nr {idx}:\")\n plots.output_design_variables(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Show Objectives\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plots.output_objective_results(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Retreive tables as pandas Dataframe\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "output = plots.output\ninput = plots.input\n\ndv = plots.tables.print_design_variables(output.opt[1].designVariables, input.design)\nobj = plots.tables.print_objective_results(\n output.opt[1].objectiveResults, input.objective\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Design variable table\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "dv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Objectives table\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "obj" ] } ], "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.20" } }, "nbformat": 4, "nbformat_minor": 0 }