Commit 03f8cf9e authored by Dorchies David's avatar Dorchies David
Browse files

fix(jet): `arctan` should be used instead of `arcsin`

- Calculation code modified
- Module test rewrited from simple example of Dominique Courret's Excel sheet

Fix #212
parent 8ed86d49
...@@ -4,7 +4,7 @@ import { MessageCode, ParamCalculability } from "../../src/index"; ...@@ -4,7 +4,7 @@ import { MessageCode, ParamCalculability } from "../../src/index";
function newJet(): Jet { function newJet(): Jet {
return new Jet( return new Jet(
new JetParams(5, 0.3, 77.48, 5, 3.42, 19.0788), new JetParams(5, 0.03, 0, -5.04928, -6, 5.14768),
false false
); );
} }
...@@ -22,10 +22,10 @@ describe("Class Jet − ", () => { ...@@ -22,10 +22,10 @@ describe("Class Jet − ", () => {
const ref: number = p.currentValue; const ref: number = p.currentValue;
jet.calculatedParam.singleValue = jet.calculatedParam.singleValue / 2; jet.calculatedParam.singleValue = jet.calculatedParam.singleValue / 2;
expect(jet.CalcSerie().vCalc).toBeCloseTo(ref, 3); expect(jet.CalcSerie().vCalc).toBeCloseTo(ref, 3);
expect(jet.result.values.t).toBeCloseTo(4, 3); expect(jet.result.values.t).toBeCloseTo(1.03, 3);
expect(jet.result.values.Vx).toBeCloseTo(4.770, 3); expect(jet.result.values.Vx).toBeCloseTo(4.99775, 3);
expect(jet.result.values.Vz).toBeCloseTo(-37.74, 3); expect(jet.result.values.Vz).toBeCloseTo(-9.95437, 3);
expect(jet.result.values.Vt).toBeCloseTo(38.04, 3); expect(jet.result.values.Vt).toBeCloseTo(11.13853, 3);
}); });
} }
} }
...@@ -93,6 +93,7 @@ describe("Class Jet − ", () => { ...@@ -93,6 +93,7 @@ describe("Class Jet − ", () => {
expect(res.log.messages[1].code).toBe(MessageCode.WARNING_JET_START_ELEVATION_UNDERGROUND); expect(res.log.messages[1].code).toBe(MessageCode.WARNING_JET_START_ELEVATION_UNDERGROUND);
}); });
it("jet underground (calculated), there should be two warnings", () => { it("jet underground (calculated), there should be two warnings", () => {
jet.prms.S.singleValue = 0.3;
jet.prms.D.singleValue = 3.003; jet.prms.D.singleValue = 3.003;
jet.prms.ZW.singleValue = 27; jet.prms.ZW.singleValue = 27;
jet.prms.ZF.singleValue = 28.5; jet.prms.ZF.singleValue = 28.5;
......
...@@ -272,6 +272,6 @@ export class Jet extends Nub { ...@@ -272,6 +272,6 @@ export class Jet extends Nub {
} }
private get alpha(): number { private get alpha(): number {
return Math.asin(this.prms.S.v); return Math.atan(this.prms.S.v);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment