pterasoftware.plot_results_versus_time()¶
- pterasoftware.plot_results_versus_time(
- unsteady_solver: UnsteadyRingVortexLatticeMethodSolver,
- /,
- *,
- show: bool | np.bool = True,
- figure_size_in: Sequence[int | float] = (6.4, 4.8),
- save: bool | np.bool = False,
- save_csv: bool | np.bool = False,
- directory: str | Path = '.',
- prefix: str = '',
- resolution_dpi: int | float = 300.0,
- file_format: str = 'png',
- show_titles: bool | np.bool = True,
- font_size: int | float | None = None,
- text_color: str | Sequence[float] | None = None,
- line_width: int | float | None = None,
Plots the loads and load coefficients of an UnsteadyRingVortexLatticeMethodSolver or one of its subclasses (the aeroelastic or free flight solver) as a function of time.
For a FreeFlightUnsteadyRingVortexLatticeMethodSolver, this also plots the first Airplane's six-degree-of-freedom state history: its position, velocity, orientation, angular velocity, and aerodynamic angles versus time. These describe the first Airplane, the rigid body the dynamics integrate, so they are plotted once for the whole simulation rather than per Airplane.
Each file is named after the Airplane it describes, so an Airplane whose name holds a path separator is rejected when save or save_csv is True. Such a name would compose a destination outside the directory that was asked for.
- Parameters:
unsteady_solver -- The UnsteadyRingVortexLatticeMethodSolver whose loads and load coefficients will be plotted. Its subclasses, the AeroelasticUnsteadyRingVortexLatticeMethodSolver and the FreeFlightUnsteadyRingVortexLatticeMethodSolver, are also accepted. For a FreeFlightUnsteadyRingVortexLatticeMethodSolver, the first Airplane's state history is plotted as well.
show -- Set this to True to show the plots. It can be a bool or a numpy bool and will be converted internally to a bool. The default is True.
figure_size_in -- The width and height, in inches, of each figure. Multiplying this by resolution_dpi gives the resolution of each saved PNG. It must be a sequence of two positive numbers. The default is (6.4, 4.8), which is Matplotlib's own default.
save -- Set this to True to save the plots in the format named by file_format. It can be a bool or a numpy bool and will be converted internally to a bool. The default is False.
save_csv -- Set this to True to save the plotted data as CSVs, which is independent of save, so the data can be exported without rendering any images. One file holds the loads and load coefficients of each Airplane, and, for a FreeFlightUnsteadyRingVortexLatticeMethodSolver, a second holds the first Airplane's state history. The two are separate files because the load histories begin at the solver's first results step while the state history begins at time step 0, so they have different numbers of rows. It can be a bool or a numpy bool and will be converted internally to a bool. The default is False.
directory -- The directory to save the plots and CSVs in. It can be a str or a Path and must already exist. This has no effect unless save or save_csv is True. The default is ".", the current working directory.
prefix -- A prefix to prepend to each file's name, which distinguishes one run's output from another's. It must be a str and must be a file name component rather than a path. With the default, an empty string, each file is named after its Airplane and the quantity it holds, as in "example_airplane_forces.png". With a non-empty prefix, each name becomes "<prefix>_<airplane>_<quantity>.<ext>". The Airplane's name is included either way, since dropping it would collide across the Airplanes of a formation simulation. This has no effect unless save or save_csv is True.
resolution_dpi -- The dots per inch at which to save each PNG. It can be an int or a float and will be converted internally to a float. This has no effect unless save is True and file_format is "png". The default is 300.0.
file_format -- The file format to save the plots in, which is also each plot file's extension. It must be "png", "svg", or "pdf". A PNG is a raster image with a transparent background. An SVG and a PDF are vector images, with their text kept as selectable text in an embedded font. Use a PDF for documents, such as LaTeX papers, and an SVG for the web and for slides. This has no effect unless save is True. The default is "png".
show_titles -- Set this to False to omit each figure's title and subtitle, for instance when a caption in a paper will carry them instead. It can be a bool or a numpy bool and will be converted internally to a bool. The default is True.
font_size -- The size, in points, of every piece of text in each figure. Text is sized against figure_size_in, so for a paper, set figure_size_in to the width the figure will print at and font_size to the size the publisher asks for. It can be an int or a float and will be converted internally to a float. It must be positive. Pass None to size each piece of text by Matplotlib's defaults, with the subtitle smaller than the rest. The default is None.
text_color -- The color of the text, the axis spines, and the ticks in each figure. It can be any color Matplotlib accepts, such as a name like "black", a hex string like "#333333", or a sequence of three or four numbers from 0.0 to 1.0. Pass None to use the gray the rendered visualizations' text uses. The default is None.
line_width -- The middle line width, in points, in each figure. A figure's lines are drawn from thickest to thinnest so that all remain visible where they overlap, with widths spread evenly from 1.4 times this width down to 0.6 times it, and the legend draws every line at this width. Like font_size, it is measured against figure_size_in, so a figure printed at a small width usually calls for thinner lines. It can be an int or a float and will be converted internally to a float. It must be positive. Pass None to use a width of 2.5, which spreads the lines from 3.5 to 1.5. The default is None.
- Returns:
None