Advertisement
Guest User

Kerboscript stageISP calculator

a guest
Jul 1st, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. FUNCTION stageISP {
  2. DECLARE thrustTotal IS 0.
  3. DECLARE mDotTotal IS 0.
  4. DECLARE avgISP IS 0.
  5. LIST ENGINES IN engList.
  6. FOR eng IN engList {
  7. IF eng:IGNITION {
  8. LOCAL t IS eng:MAXTHRUST*eng:thrustlimit/100.
  9. SET thrustTotal to thrustTotal + t.
  10. IF eng:VISP = 0 {
  11. SET mDotTotal to 1.
  12. }.
  13. ELSE {
  14. SET mDotTotal to mDotTotal + t / eng:ISP.
  15. }.
  16. }.
  17. }.
  18. IF mDotTotal = 0 {
  19. SET avgISP TO 0.
  20. } ELSE {
  21. SET avgISP TO thrustTotal/mDotTotal.
  22. }
  23.  
  24. return avgISP.
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement