-
-
Notifications
You must be signed in to change notification settings - Fork 531
[#2525] Add option to plot and export component analysis parameter sweeps #2544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…entAnalysisDialog
# Conflicts: # swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java
The implementation from PR openrocket#2530 had to be remade from scratch because of the refactoring. This implementation is also a bit more flexible and efficient
Wow, it never even occurred to me to have that many components. :) I guess in the future we could change it to a button "Select Components" and a label underneath showing the already selected components. The button would open a new dialog with the component tree, where you can select which components to add. I would grey out and disable components in the component tree that are not relevant for the data type (e.g. only fins have roll characteristics), and have a click behavior where clicking once will toggle the component selection, instead of having to hold Ctrl/Cmd to do multi-component selection. We could also change the component combobox in the plot panel with a button "Select Component" which has similar behavior, but with only single-component selection. (Or we can change the behavior to have multi-component selection in the plot panel instead of having to add a new Y axis type for each component, and then have the component series be split up automatically; don't know).
I'll see what I can do. |
Fixed. |
Yeah that's not a normal or typical sim. :) I think what you have right now is probably good for initial release, and we can enhance in the future as needed. |
|
Oh, this is great. As always! |





Goal of this PR
This PR fixes #2525 and introduces the ability to perform a parameter sweep over a given domain type (wind direction, angle of attack, mach number, or roll rate), and then plot and export different component analysis outputs (CP, CNa, CD...).
How it works
The UI
The Component Analysis dialog is converted to a tabbed pan with 2 tabs:

GeneralandPlot / Export. TheGeneraltab contains the already existing CA content.The
Plot / Exporttab has a section on top to configure the parameter sweep domain type (the X axis). You can choose the minimum and maximum value for the parameter sweep, as well as the step size. In thePlot / Exporttab is another tabbed pane for plotting (Plot) and exporting (Export).Configuring an analysis sweep
The main configuration for a component analysis sweep is which domain type to choose and the sweep range and step size. As mentioned earlier, this can be set at the top of the
Plot / Exporttab.The other parameters for the CA sweep are taken from the
Generaltab. For instance, if I do a sweep over Mach number, then the analysis uses the values in theGeneraltab for wind direction, angle of attack and roll rate).Plotting
Configuring a plot is similar to configuring a simulation plot, with two differences:
I have added one plot preset:

Total CD vs. Mach number, which does a parameter sweep over the mach number, and plots the total CD of the rocket. For instance, for 'A simple model rocket':Here is an example plot of a CD plot for all rocket components of 'A simple model rocket':
Exporting
Configuring an export is very similar to a sim export. The only difference is that you must specify for which rocket components you wish to export a data type. If no components are selected, a warning dialog will appear and that data type will be ignored during the export.
Here's is an example export for a Three-staged rocket:
Imported in Excel:

Demo
Screen.Recording.2024-08-27.at.02.01.02.mp4
Additional notes
For this PR to work, I refactored all the plot and export UI code from the simulation plot/export, so we wouldn't have to maintain duplicate code. I also had to re-implement #2530 for the refactored code.