1 package net.sf.openrocket.motor;
3 import net.sf.openrocket.util.Coordinate;
5 public interface Motor {
8 * Enum of rocket motor types.
10 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
13 SINGLE("Single-use", "Single-use solid propellant motor"),
14 RELOAD("Reloadable", "Reloadable solid propellant motor"),
15 HYBRID("Hybrid", "Hybrid rocket motor engine"),
16 UNKNOWN("Unknown", "Unknown motor type");
18 private final String name;
19 private final String description;
21 Type(String name, String description) {
23 this.description = description;
26 public static Type fromName( String name ) {
30 if ("single-use".equalsIgnoreCase(name)) {
32 } else if ("hybrid".equalsIgnoreCase(name)) {
34 } else if ("reloadable".equalsIgnoreCase(name)) {
42 * Return a short name of this motor type.
43 * @return a short name of the motor type.
45 public String getName() {
50 * Return a long description of this motor type.
51 * @return a description of the motor type.
53 public String getDescription() {
58 public String toString() {
65 * Ejection charge delay value signifying a "plugged" motor with no ejection charge.
66 * The value is that of <code>Double.POSITIVE_INFINITY</code>.
68 public static final double PLUGGED = Double.POSITIVE_INFINITY;
72 * Below what portion of maximum thrust is the motor chosen to be off when
73 * calculating average thrust and burn time. NFPA 1125 defines the "official"
74 * burn time to be the time which the motor produces over 5% of its maximum thrust.
76 public static final double MARGINAL_THRUST = 0.05;
81 * Return the motor type.
83 * @return the motorType
85 public Type getMotorType();
89 * Return the designation of the motor.
91 * @return the designation
93 public String getDesignation();
96 * Return the designation of the motor, including a delay.
98 * @param delay the delay of the motor.
99 * @return designation with delay.
101 public String getDesignation(double delay);
105 * Return extra description for the motor. This may include for example
106 * comments on the source of the thrust curve. The returned <code>String</code>
107 * may include new-lines.
109 * @return the description
111 public String getDescription();
115 * Return the maximum diameter of the motor.
117 * @return the diameter
119 public double getDiameter();
122 * Return the length of the motor. This should be a "characteristic" length,
123 * and the exact definition may depend on the motor type. Typically this should
124 * be the length from the bottom of the motor to the end of the maximum diameter
125 * portion, ignoring any smaller ejection charge compartments.
129 public double getLength();
132 public MotorInstance getInstance();
135 public Coordinate getLaunchCG();
136 public Coordinate getEmptyCG();
139 public double getBurnTimeEstimate();
140 public double getAverageThrustEstimate();
141 public double getMaxThrustEstimate();
142 public double getTotalImpulseEstimate();
144 public double[] getTimePoints();
145 public double[] getThrustPoints();
146 public Coordinate[] getCGPoints();