-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecuteBurnVisualiser.ks
More file actions
48 lines (41 loc) · 1.14 KB
/
executeBurnVisualiser.ks
File metadata and controls
48 lines (41 loc) · 1.14 KB
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
// Project: KSPtoMars
// Program: executeBurnVisualiser.ks
//
// Description: program to add visual representation of inputs for executeBurn.ks
//
// Dependencies: executeBurn.ks
//
// Parameters: prograde component :scalar
// radial component :scalar
// normal component :scalar
// start time :absolute time (seconds)
// delta time :seconds
//
// Notes: THIS PROGRAM DOES NOT EXECUTE THE MANUVER NODE.
// It just adds a maneuver node to the flight plan for easy visual inspection of the planned burn.
//
//
clearscreen.
DECLARE PARAMETER pro, rad, nor, startt, deltat.
SET mi TO 0.
// =-=-=-=-=-= Calculate and add dummy maneuver node =-=-=-=-=-=-=
LIST ENGINES IN enginList.
FOR eng IN enginList {
IF eng:IGNITION = true {
SET mi TO mi + ( eng:MAXTHRUST / eng:ISP ).
}
}
SET Ispg TO ( MAXTHRUST / mi ) * 9.81.
SET mr TO MAXTHRUST / Ispg.
SET mf TO MASS - ( deltat * mr ).
SET dV TO Ispg * ln( MASS / mf ).
SET tempV TO V( rad, nor, pro ):NORMALIZED.
SET tempNode TO NODE(
startt + (.5 * deltat),
tempV:X * dV,
tempV:Y * dV,
tempV:Z * dV
).
ADD tempNode.
RUN executeBurn(pro, rad, nor, startt, deltat).
REMOVE tempNode.