In getLongitudinalUnitInertia(), modify so parallel axis theorem is only applied to Izz (yaw), not Iyy (pitch).
Modify code for getLongitudinalUnitInertia() and getRotationalUnitInertia() so similar functions have more similar code. Add comments to clarify getLongitudinalUnitInertia() and getRotationalUnitInertia()
This commit is contained in:
parent
87c26cccf4
commit
224e0ea3fd
@ -643,12 +643,12 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab
|
|||||||
*
|
*
|
||||||
* 1. Approximate the fin with a rectangular fin
|
* 1. Approximate the fin with a rectangular fin
|
||||||
*
|
*
|
||||||
* 2. The inertia of one fin is taken as the average of the moments of inertia
|
* 2. The unitary moment of inertia of one fin is taken as the average
|
||||||
* through its center perpendicular to the plane, and the inertia through
|
* of the unitary moments of inertia through its center perpendicular
|
||||||
* its center parallel to the plane
|
* to the plane (Izz/M), and through its center parallel to the plane (Iyy/M)
|
||||||
*
|
*
|
||||||
* 3. If there are multiple fins, the inertia is shifted to the center of the fin
|
* 3. If there are multiple fins, the inertia is shifted to the center of the
|
||||||
* set and multiplied by the number of fins.
|
* Finset.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public double getLongitudinalUnitInertia() {
|
public double getLongitudinalUnitInertia() {
|
||||||
@ -661,23 +661,28 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab
|
|||||||
double w = getLength();
|
double w = getLength();
|
||||||
double h = getSpan();
|
double h = getSpan();
|
||||||
double w2, h2;
|
double w2, h2;
|
||||||
|
|
||||||
if (MathUtil.equals(w * h, 0)) {
|
// If either h or w is 0, we punt and treat the fin as square
|
||||||
|
if (MathUtil.equals(h * w, 0)) {
|
||||||
w2 = singlePlanformArea;
|
w2 = singlePlanformArea;
|
||||||
h2 = singlePlanformArea;
|
h2 = singlePlanformArea;
|
||||||
} else {
|
} else {
|
||||||
w2 = w * singlePlanformArea / h;
|
w2 = w * singlePlanformArea / h;
|
||||||
h2 = h * singlePlanformArea / w;
|
h2 = h * singlePlanformArea / w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Iyy = h * w^3 / 12, so Iyy/M = w^2 / 12
|
||||||
|
// Izz = h * w * (h^2 + w^2) / 12, so Izz/M = (h^2 + w^2) / 12
|
||||||
|
// (Iyy / M + Izz / M) / 2 = (h^2 + 2 * w^2)/24
|
||||||
final double inertia = (h2 + 2 * w2) / 24;
|
final double inertia = (h2 + 2 * w2) / 24;
|
||||||
|
|
||||||
if (finCount == 1)
|
if (finCount == 1)
|
||||||
return inertia;
|
return inertia;
|
||||||
|
|
||||||
final double rFront = this.getFinFront().y;
|
// recheck (yet again) when I get home. Need to apply parallel axis theorem
|
||||||
|
// to Izz, but not to Iyy. Since we're looking at average of Iyy and Izz,
|
||||||
return inertia + MathUtil.pow2(MathUtil.safeSqrt(h2) + rFront);
|
// weight parallel axis theorem by 1/2.
|
||||||
|
return inertia + MathUtil.pow2(MathUtil.safeSqrt(h2) / 2 + getBodyRadius()) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -685,11 +690,12 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab
|
|||||||
* Return an approximation of the rotational unitary inertia of the fin set.
|
* Return an approximation of the rotational unitary inertia of the fin set.
|
||||||
* The process is the following:
|
* The process is the following:
|
||||||
*
|
*
|
||||||
* 1. Approximate the fin with a rectangular fin and calculate the inertia of the
|
* 1. Approximate the fin with a rectangular fin and calculate the
|
||||||
* rectangular approximate
|
* unitary rotational inertia (Ixx/M) of the rectangular approximation,
|
||||||
|
* about the center of the approximated fin.
|
||||||
*
|
*
|
||||||
* 2. If there are multiple fins, shift the inertia center to the fin set center
|
* 2. If there are multiple fins, shift the inertia axis to the center
|
||||||
* and multiply with the number of fins.
|
* of the Finset
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public double getRotationalUnitInertia() {
|
public double getRotationalUnitInertia() {
|
||||||
@ -698,23 +704,25 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Approximate fin with a rectangular fin
|
// Approximate fin with a rectangular fin
|
||||||
|
// h2 is square of fin height
|
||||||
double w = getLength();
|
double w = getLength();
|
||||||
double h = getSpan();
|
double h = getSpan();
|
||||||
|
double h2;
|
||||||
|
|
||||||
|
// If either h or w is 0, punt and treat it as a square fin
|
||||||
if (MathUtil.equals(w * h, 0)) {
|
if (MathUtil.equals(w * h, 0)) {
|
||||||
h = MathUtil.safeSqrt(singlePlanformArea);
|
h2 = singlePlanformArea;
|
||||||
} else {
|
} else {
|
||||||
h = MathUtil.safeSqrt(h * singlePlanformArea/ w);
|
h2 = h * singlePlanformArea / w;
|
||||||
}
|
}
|
||||||
|
|
||||||
final double inertia = h * h / 12;
|
// Ixx = w * h^3 / 12, so Ixx / M = h^2 / 12
|
||||||
|
final double inertia = h2 / 12;
|
||||||
|
|
||||||
if (finCount == 1)
|
if (finCount == 1)
|
||||||
return inertia;
|
return inertia;
|
||||||
|
|
||||||
final double rFront = this.getFinFront().y;
|
return inertia + MathUtil.pow2(MathUtil.safeSqrt(h2) / 2 + getBodyRadius());
|
||||||
|
|
||||||
return inertia + MathUtil.pow2(h / 2 + rFront);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user