public void TestPhysicalRocket() { double burnArea = .0030; double burnDepth = .06; double burnVolume = burnArea * burnDepth; double fuelMass = burnVolume * FUEL_DENSITY; double totalMass = fuelMass * 1.1; double burnRate = .020; PhysicalRocket r = new PhysicalRocket(burnArea, burnRate, fuelMass, totalMass); double bt = burnDepth / burnRate; double tol = 0.01; Assert.AreEqual(bt, r.GetBurnTime(), tol, "check burn time"); Assert.AreEqual(totalMass, r.GetMass(0), tol, "initial mass"); Assert.AreEqual(totalMass - fuelMass, r.GetMass(bt), tol, "burnt out mass"); Assert.AreEqual(totalMass - fuelMass * .5, r.GetMass(bt / 2), tol, "half mass"); Assert.AreEqual(SPECIFIC_IMPULSE * FUEL_DENSITY * burnArea * burnRate, r.GetThrust(bt / 2), tol, "thrust"); }
public void TestPhysicalRocket() { double burnArea = .0030; double burnDepth = .06; double burnVolume = burnArea * burnDepth; double fuelMass = burnVolume * FUEL_DENSITY; double totalMass = fuelMass * 1.1; double burnRate = .020; PhysicalRocket r = new PhysicalRocket(burnArea, burnRate, fuelMass, totalMass); double bt = burnDepth / burnRate; double tol = 0.01; Assertion.AssertEquals("sprawdzenie czasu spalania", bt, r.GetBurnTime(), tol); Assertion.AssertEquals("masa pocz¹tkowa", totalMass, r.GetMass(0), tol); Assertion.AssertEquals("masa wypalona", totalMass - fuelMass, r.GetMass(bt), tol); Assertion.AssertEquals("po³owa masy", totalMass - fuelMass * .5, r.GetMass(bt / 2), tol); Assertion.AssertEquals("ci¹g", SPECIFIC_IMPULSE * FUEL_DENSITY * burnArea * burnRate, r.GetThrust(bt / 2), tol); }