-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRocket.java
69 lines (58 loc) · 1.43 KB
/
Rocket.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import static java.lang.Math.log;
public class Rocket
{
public double dryMass;
public double finalMass;
public double specificImpulse;
public double engineThrust;
protected final void ChangeDryMass(double newDryMass)
{
this.dryMass = newDryMass;
}
protected final double DryMass()
{
return this.dryMass;
}
protected final void ChangeFinaMass(double newFinalMass)
{
this.finalMass = newFinalMass;
}
protected final double FinalMass()
{
return this.finalMass;
}
protected final void ChangeSpecificImpulse(double newSpecificImpulse)
{
this.specificImpulse = newSpecificImpulse;
}
protected final double SpecificImpuls()
{
return this.specificImpulse;
}
protected final void ChangeEngineThrust(double newEngineThrust)
{
this.engineThrust = newEngineThrust;
}
protected final double EngineThrust()
{
return this.engineThrust;
}
public Rocket(double finalMass, double dryMass, double specificImpulse, double engineThrust)
{
this.ChangeDryMass(dryMass);
this.ChangeFinaMass(finalMass);
this.ChangeSpecificImpulse(specificImpulse);
this.ChangeEngineThrust(engineThrust);
}
public Rocket()
{
}
public double DeltaVCalc()
{
double exhaustV = this.specificImpulse * 9.80665; //Specific Impulse measured in seconds, masses are measured in kg
double deltaVOne = this.finalMass / this.dryMass;
double deltaVTwo = log(deltaVOne);
double deltaV = exhaustV * deltaVTwo;
return deltaV;
}
}