246 Commits

Author SHA1 Message Date
Daniel_M_Williams
6efbe1e2ab [refactor] ported reduce180 -> reducePi. Because the units are in radians 2020-08-02 16:49:32 -04:00
Daniel_M_Williams
358b3dc527 [fix] Added new BoundingBox tests; adjusted Falcon 9H Properties 2020-07-12 15:39:20 -04:00
Joe Pfeiffer
056c6b2b39
Merge pull request #688 from JoePfeiffer/fin-moi
fixes Fin MOI calculations
2020-07-11 11:33:48 -06:00
JoePfeiffer
69e45029a2 Adjust expected unit test results to account for modified longitudinal MOI calculation 2020-07-08 14:36:28 -06:00
Daniel_M_Williams
9f5d4a2d27 [enable] Re-enables, fixes ComponentAnalysisDialog 2020-07-03 10:05:09 -04:00
JoePfeiffer
87c26cccf4 Modified unit test expected results to match corrected fin MOI.
testAlphaIIIStructure
    Three fins in finset, so Ixx and Iyy are reduced by a factor of 3
    Ixx reduced from 5.2771946530250825E-5 to 1.7590648843416942E-5
    Iyy reduced from 1.3580770106050167E-4 to 4.526923368683389E-5

    Total rocket MOI changed to Ir=1.8763734635622462E-5 and
    It=2.1238394331365588E-4

testFalcon9HComponentMOI
    Three fins in finset, so
    finset rotational MOI  changed from 0.00413298 to 0.001377661595723823
    finset longitudinal MOI changed from 0.01215133 to 0.004050443797127646

testFalcon9HeavyBoosterLaunchMOIs
    Two finsets, each three fins.  Each finset's MOI are reduced as in
    testFalcon9HComponentMOI, resulting in change to totals
    Ir=0.013480523485489424, It=0.07017476021288252

testFalcon9HeavyBoosterSpentMOIs
    Two finsets, each three fins, as above
    Ir=0.010420016485489425, It=0.06398514917026163

testFalcon9HeavyBoosterStageMassOverride
    Two finsets, each three fins, as above
    Ir=0.007100144485489424, It=16.030625168315694

testFalcon9HeavyComponentCMxOverride
    Two finsets, each three fins, as above
    Ir=0.007100144485489424, It=0.047289449862727435

testFalcon9HeavyComponentMassOverride
    Two finsets, each three fins, as above
    Ir=0.026027963480146098, It=0.35928666329363634
2020-06-29 15:02:34 -06:00
Danylo
ce2d29cee0 Enhanced the javadoc of StringUtil's method and added a test.
I added parameter and return value desriptions for the method
StringUtil.isEmpty(String s).
Also, I added a test class StringUtilTest to test this method
(this method didn't have a test before).
2020-06-24 11:09:54 +03:00
Daniel Williams
90173c38a2
Merge pull request #657 from JoePfeiffer/fix-654
Pin CP to axis (Fix 654)
2020-05-08 11:02:16 -04:00
Daniel Williams
5e264c8604
Merge pull request #649 from teyrana/641-fix-cg
[fixes #641] MassCalculator now accounts for rotations in the tree
2020-05-07 18:32:29 -04:00
JoePfeiffer
f0e5902e00 Pin CP to axis when calculating in BarrowmanCalculator.calculateNonAxialForces()
It turns out that the assumption of radial symmetry is absolutely pervasive in our CP calculations.  Looking at FinSetCalc.calculateNonAxialForces(), we don't actually compute the CP of a fin -- we calculate its X value, and pin it to Y=Z=0.

The only exception to this is in BarrowmanCalculator.calculateNonAxialForces(), where the pinning only takes place if there are three or more fins in a FinSet.  If we remove the test for number of fins in the FinSet, we are in essence making the assumption that there are more fins *somewhere* which will end up being radially symmetric.
2020-05-06 16:57:04 -06:00
Daniel_M_Williams
cce900d408 [fix] MassCalculator now accounts for rotation in Component Assembly Instance Trees 2020-05-06 15:32:19 -04:00
Daniel_M_Williams
0c47f2eba3 [fix] adjusted RocketTest unit tests to match auto-radius across stages. 2020-05-03 15:01:12 -04:00
Daniel_M_Williams
bb3cdf2ce8 [refactor] renamed variables in TransitionTest to reflect their containing component type 2020-05-02 13:38:46 -04:00
Daniel_M_Williams
e7ceafe31c [fix] fixed resultant test issues 2020-05-02 13:38:46 -04:00
Daniel_M_Williams
da2fea3468 [fix] fixed unit tests for FreeformFinSet, due to fixing #555 2020-04-25 17:51:52 -04:00
Billy Olsen
58b92be39e Fix FreeformFinSetTest unit test
FreeformFinSetTest.testFreeformCMComputation_triangleOnTransition
was broken with the last merge. This change updates the expected
area for the fin tab to be the area of the triangle under the
curve as well as update the new CG contants in the tests.

Identified in #631

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-04-21 14:40:09 -07:00
Daniel Williams
bd8bef2c85
Merge pull request #602 from wolsen/fix-stage-length
[Fixes 452] Reflect length of selected stages
2020-04-19 22:34:09 -04:00
Billy Olsen
25475a92fb Rework the FlightConfiguration.calculateBounds() for instances
Use the information provided in the getActiveInstances() in order to
calculate the length of the rocket. This change takes each component
instance and uses the component bounds and the instance's transform
in order to determine the instance's actual bounds. The length is
then calculated as the difference between the min and max X values,
using the BoundingBox.

Note, this particular change special-cases a few of the components
in order to get the right length. It is preferred to revisit each
special case in subsequent patches in order to keep this patch set
minimal for the time being.

The length calculations are already stressed during unit tests, but
the results are a bit more accurate and thus the unit tests are
updated to reflect the new values.

Fixes #452

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-04-12 18:18:17 -07:00
Daniel_M_Williams
ebf4d35299 [fix] refactors Testrockets to clone existing fins from Alpha III, instead of replacing with new ones 2020-04-05 20:54:14 -04:00
Daniel_M_Williams
b24184afc7 [fix] Adds 4-fin splits to unittests 2020-04-05 20:54:14 -04:00
Daniel_M_Williams
b8172305f8 [test] adds test to verify that splitting fins reproduces the same results 2020-04-05 20:54:14 -04:00
Daniel Williams
18a8caa5b7
Merge pull request #603 from JoePfeiffer/fix-568
[Fixes 568] Consider all instances of components when calculating drag
2020-03-29 19:53:46 -04:00
JoePfeiffer
ecc8a32891 Modify "fins on pods" test to use a modified Alpha III 2020-03-28 18:57:32 -06:00
Billy Olsen
5bf8a7af15 Update stage logic for DesignReport
Stages need to be activated correctly in order to properly
calculate the mass for all components that contribute to
the current launch scenario.

This change ensures that all of the stages from the top-most
stage to the currently active stage are set as activated when
stage mass is being calculated.

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-03-28 16:49:36 -07:00
Billy Olsen
94534ee8f8 Fix number of motors and stageMass for DesignReport
Fix the number of motors that are reported. A previous change made
the MotorMount.getMotorCount() return the number of motors which
have been configured. However, according to the javadocs of the
MotorMount interface, the getMotorCount() method is supposed to
return the number of motors that a MotorMount can take for
configuring it. This restores the InnerTube and BodyTube getMotorCount
behavior and adds a new getMotorConfigurationCount() method to
provide the new behavior.

Additionally, the stageMass calculations in the DesignReport were
using a deprecated method which does not return proper component
weights. Change this to use the MassCalculator.calculateLaunch(...)
method, which is consistent with the RocketPanel behavior.

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-03-28 16:49:36 -07:00
JoePfeiffer
00abce96ff Add unit test "testPhantomTubes" comparing a simple 3FNC rocket against the same rocket, implemented by replacing the fins by three pods, putting a 0-diameter body tube on each pod, and putting one fin on each pod. 2020-03-25 14:59:52 -06:00
Daniel_M_Williams
d23d25ed15 [fix] Fixes error when loading FinSet angles 2020-03-22 11:07:55 -04:00
Daniel_M_Williams
c4cff028b4 [fixes #540] Fins are now created with a default count of 3 2020-03-21 19:02:39 -04:00
Daniel_M_Williams
65a4698d37 [fix][Intellij] Intellij now correctly builds jars and tests with all the new libraries 2020-03-19 18:19:07 -04:00
Billy Olsen
ddfe7c5c90 Add unit tests for FlightData
Add unit tests to cover some of the FlightData object and
some of the calculations. This specifically covers the bits
for FlightData.getGroundHitVelocity() where the ground hit
velocity is calculated from a FlightDataBranch consisting
of a series of data points and events occuring during flight.

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-03-10 19:14:24 -07:00
Neil Balch
f26e3afcf3 Upgrade codebase to Java 11 2019-10-28 08:56:05 -07:00
Wes Cravens
02634fef6f
Merge pull request #533 from teyrana/fix_525_zero_diameter
Fixes #525; Main Figure display rocket diameter again.
2019-04-10 10:47:46 -05:00
Daniel_M_Williams
93a60c94f7 [fixes #525] main window (again) displays max diameter of centerline components
-- added FlightConfiguration::getCoreComponents() method
2019-03-31 09:34:08 -04:00
JoePfeiffer
efacebf5d8 Refactored MassCalculation.calculateAssembly() to separate calculation
of structure from calculation of motors, so mass and CG overrides
don't affect motors

Modified structure calculation so that when an override is in effect
and children are also being overridden, don't include root of tree as
an element in its own right when computing MOI.

Modified MassCalculatorTest to look for correct MOI value.
2019-03-07 18:05:44 -07:00
JoePfeiffer
eb3a129e67 Modify FinSetCalc to only produce result for one fin, to be summed in
BarrowmanCalculator

Modify BarrowmanCalculator to actually sum fin nonaxial forces

Modify FinSetCalcTest to sum fins in test3Fin() and test4Fin()

Extra bonus:  if at some point we allow fins to be other than radially
symmetrical, this code should still work (not tested)
2019-02-11 15:37:21 -07:00
JoePfeiffer
13f7c583fd Changed logging in BarrowmanCalculator.java to use stderr (easier to
use with unittest)

Added "End Plate Test" rocket to TestRockets and BarrowmanCalcTest
2019-02-04 11:34:35 -07:00
JoePfeiffer
2e7b3da1c0 Addresses Issue 481
Modify BarrowmanCalculator to use InstanceMap and InstanceContext to
iterate through all components.  This addresses 481 by actually
computing nonaxial forces for all components, instead of computing a
single instanceable component and using it as a representative of all
instances.

Modify calculateNonAxialForces to accept a Transformation argument, so
they can use rotations from instances (only actually affects
FinSetCalc and TubeFinSetCalc)
2019-01-30 15:10:41 -07:00
Wes Cravens
1abf0d3834
Merge pull request #513 from teyrana/refactor_instance_map
Refactor instance map
2019-01-26 07:14:39 -06:00
Wes Cravens
7b0724ab0a
Merge pull request #507 from teyrana/fix_387_cp
Increase accuracy of Center-Of-Pressure calculations
2019-01-26 07:13:47 -06:00
Daniel_M_Williams
efabe81790 [feat] FlightConfiguration may now generate an InstanceMap 2019-01-25 22:27:15 -05:00
Daniel M Williams
01fd20ebcc [refactor] added code to tests for negative inertia / intersection case 2019-01-02 19:23:11 -05:00
Daniel M Williams
cf4a935302 [test] Refactored FreeformFinSetTest to de-dup code execution. 2019-01-02 19:11:32 -05:00
Daniel_M_Williams
eed5863790 [fixes #387] Increases accuracy of Center-Of-Pressure calculations on instanced assemblies 2019-01-02 19:06:46 -05:00
Daniel_M_Williams
055132aa99 [test] expands aerodynamics unit-test to verify CP.y, and .z coordinates (of fins on boosters) 2019-01-02 19:06:46 -05:00
Daniel_M_Williams
70b7537614 [fixes #500] May now calculate CG for fins attached to zero-dimension mounts 2018-12-22 04:50:01 -05:00
Daniel_M_Williams
51418e34bc [fixes #387] Fixes one source of off-axis CP error 2018-12-01 13:05:21 -05:00
Daniel_M_Williams
72c6f1d64d [fixes #471] Refactoring FreeformFinSet to accept root points outside of the base. (which generates bridge-points on-load) 2018-11-26 13:53:51 -05:00
Daniel_M_Williams
8ab739a304 [fix] Fixed RocketComponent::setAfter() => added unittest in TestRocket => fixed IntegrationTest 2018-10-27 16:10:31 -04:00
Daniel_M_Williams
166d358c14 [Feature] Freeform Fins may not be attched to variable-shaped body components
- Fins may be attached to Transitions (and subclass NoseCones )

  [Fix] FinSet now implements the Ring-Instanceable interface
  [Refactor] Rocket inherits from ComponentAssembly instead of RocketComponent
  [Fix][Refactor] Fin tabs are now correctly validated upon change
  [Fix] Fin tabs are now corrected to be no-bigger-than their fins
  [Refactor] FinSet.getBodyRadius(..) now requires an argument
  [Fix] restricted fin tab positioning to be strictly top/middle/bottom
  [Refactor] Reimplement FreeformFinSet.setPoint(...)
  [Fix] Prevent Freeform Fins movement past parent's top/front
  [bugfix] Fins are now addable to transitions from the GUI
  [Fix] Fins, Transitions are now drawn correctly in fin-design window
  [Minor] Added makeV2 rocket to TestRockets

  [fix] getRootPoints() impl & test
2018-10-27 14:41:01 -04:00
Daniel_M_Williams
b268d3aa59 [refactor] RocketComponent positioning is now centralized in AxialMethod class
- also relaxed visibility for Component::setAxialMethod(...)
2018-10-27 14:41:01 -04:00