Register

"Sky" space flight simulator for Prizm

Topics on released projects. Only the author of a program should start a topic on it.
Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

"Sky" space flight simulator for Prizm

Postby nsg » Fri Apr 12, 2013 10:03 pm

Since today is the anniversary of the first manned spaceflight, I would like to release a beta of Sky -- space flight simulator for Prizm.

Sky

It currently models a movement of a single spaceship near the non-rotating body with no atmosphere.
The challenges (scenario) supplied with the simulator are based on Apollo program's LM which operates on the Earth's Moon.
However, the entire point of a simulator is to simulate different environments, so feel free to modify the parameters of a spaceship and a planet to simulate other existing, imaginary or future missions.

I have come up with 3 scenarios so far: landing, suborbital ballistic flight and establishing orbit.
As I include rendezvous and docking to the simulation model, I will add more scenarios.

Chapter "Landing" intentionally resembles the "Lunar lander" calculator game of the 80's, not sure how closely. IF you landed the lander back then, now it is time to bring it back.

Chapter 1. Landing.
This story begins when your LM has just:
1) successfully separated from CSM,
2) performed descent orbit insertion,
3) reached orbit's periselene of 15 km,
4) decelerated to a complete stop.
You are 15 km above the surface.
1834 kg of fuel (less than a quarter of original amount) remains in your fuel tanks.
You need to land your LM with touchdown speed of less than 5 m/s.
Anything more than that means that the damage to a module is too great to complete the mission. More than 10 m/s would, likely, mean damage to the ascent stage that will prevent you from launching and you will be stranded on the surface until the oxygen and supplies run out.
(Warning: software does not check for max thrust. Do not specify fuel rates higher than 15 kg/s to keep thrust under realistic 44400 N)
Thrust direction controls and horizontal speed/distance indicator are disabled in this scenario to keep you focused on the main goal, successful landing.

Chapter 2. Escape.
The landing did not go as planned. One of the fuel tanks has developed a leak and lost all its fuel. The remaining fuel is not enough to reach the orbit. NASA dispatched a rescue LM, but due to rushed nature of a mission and no human at the controls, it landed 200 km away. With 1170 kg of fuel left, launch and land as close as possible to the rescue LM. More than 5 km miss means, that you are, probably, not going to make it. Also, since ascent stage is not designed for landing, the touchdown speed should be below 1 m/s with horizontal component less than 0.1 m/s.
(Warning: software does not check for max thrust. Do not specify fuel rates higher than 5.25 kg/s to keep thrust under realistic 16000 N)

Chapter 3. Orbit.
You found the rescue LM fully fueled and ready to launch. The original rescue plan requires you to establish circular orbit at 110 km altitude, where you will meet with the CSM that will take you home. Establish orbit as close to circular as you can at 110 km with periselene and aposelene within 110 km±100 m.
(Warning: software does not check for max thrust. Do not specify fuel rates higher than 5.25 kg/s to keep thrust under realistic 16000 N)

User avatar
Posts: 89
Joined: Thu Apr 05, 2012 3:16 pm
Location: Akron, OH, USA
Calculators: Casio fx-9750GII, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby flyingfisch » Sat Apr 13, 2013 12:25 am

Wow, this is really advanced, I'll have to wait til I get some time to devote to figuring it out. :)

Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby nsg » Sat Apr 13, 2013 6:49 am

Stay tuned. I plan to add walkthroughs for some of the stories, though I am not sure they are really needed.
The first one (landing) is really easy, you can do it right away without knowing what you are doing. Amount of fuel left is ridiculously high. I must have missed something because real LMs apparently had difficulties at this phase -- Armstrong allegedly almost ran out of fuel during landing and on later missions LMs were assisted into descent orbit by CSM.
Second one is harder and you need to plan ahead, but all you need to know is some middle school physics. Orbiting is not difficult, you just need to know some theory -- orbit is big and round and hard to miss. Now, when and if i get to rendezvous and docking scenarios, that is where you really need to know what you are doing. And finally, trans-earth injection and en-route corrections to stay where you need to be, again, not difficult, but requires some theory.

User avatar
Posts: 89
Joined: Thu Apr 05, 2012 3:16 pm
Location: Akron, OH, USA
Calculators: Casio fx-9750GII, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby flyingfisch » Sat Apr 13, 2013 2:14 pm

I can't seem to be able to land... which direction is my engine pointing, what's my attitude? If I add thrust, will I decrease or increase descent speed?

Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby nsg » Sat Apr 13, 2013 4:43 pm

In the first chapter, the thrust is always directed upward (engines are pointing directly downward).
The velocity is positive when you are moving up (altitude H is increasing) and negative (shown in red color) when you are moving down.
So, when you fire the engines with enough thrust, the speed should decrease.
Here is example.
H=15000 V=0 -- initial values
Let's let it fall for a while:
dt:=10, dm:=0 ( [1] 10 [exe] [2] 0 [exe] [F6] )
H=14920.4 V=-15.9
As you can see, the module fell down a little bit and picked up some speed. It is moving downward, as expected.
Repeat the step -- wait another 10 seconds ( [F6] )
H=14681.5 V=-31.9
Let's fire the engines at maximum thrust.
dt:=1 dm:=15 ([1] 1 [EXE] [2] 15 [EXE]
Instead of "ENG.OFF" display should show now 15.0 in red (red is a remainder that your engines are on)
Perfrom the step: [F6]
H=14651.6 V=-28.0 a=5.4711791
As you can see, the speed decreased a little (from 31 to 28), but you are still falling, because it is still negative and altitude H is still decreasing. There is a new meaningful value to look at: "a", the acceleration due to thrust (in m/s^2). Before this step there was only one force acting on your module -- the Moon was pulling it in causing it to accelerate downward at about 1.6 m/s^2. Now you fired the engines and there is a new force in the picture -- this one is causing you accelerate upward at 5.47 m/s^2. Since 5.47>1.6, the resulting acceleration is pointed up and your (negative) velocity became less negative. If you continue, it will become less and less negative, until it becomes zero, and, eventually, positive, meaning that you started moving up.
Repeat the step [F6]
H=14625.5 V=-24.1 a=5.4810111 -- keep firing, [F6]
H=14603.4 V=-20.2 a=5.4908785 -- fire again, [F6]
H=14585.1 V=-16.3 a=5.5007815
Let's increase simulation step to 3 s: [1] 3 [EXE]. To maintain the same thrust, we also need to increase dm: [2]45[EXE]
[F6]
H=14553.9 V=-4.5 a=5.5307059
Ok, we slowed down considerably, but still moving down. Change the step again: [1]1[EXE][2]15[EXE][F6]
H=14551.3 V=-0.6 a=5.5407533 -- [F6]
H=14552.7 V=3.4 a=5.5508371
Somewhen during this last second, the downward velocity stopped and turned upward. Now we are moving up (V is positive and shown in black). Now turn off the engines and let it fall. [2]0[EXE][F6]
H=14555.3 V=1.8 a=0
We are falling, but upwards, altitude is increasing, but the velocity, while still positive has decreased a bit.

User avatar
Posts: 89
Joined: Thu Apr 05, 2012 3:16 pm
Location: Akron, OH, USA
Calculators: Casio fx-9750GII, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby flyingfisch » Mon Apr 15, 2013 8:02 pm

Ah, thanks, that really clears things up now :)

Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby nsg » Sun May 19, 2013 3:35 am

Some screenshots:

Scenario selector
Image

Flight 9 seconds in progress. Trying to reach orbit.
Image

Info screens.
Image
Image
Image
Image

Touchdown screen (speed is 72m/s, this bird is not going to fly any more).
Image

Using graph of speed vs altitude to estimate when to start decelerating. Blue curve is a spacecraft in freefall starting from current altitude and speed. Red curve is spacecraft starting from the surface at maximum thrust. Where lines meet (alt=4047 m, v=188 m/s) is when to start braking.
Image

Using spreadsheet to estimate burn. To get deltaV of 3.11 m/s need to burn 8 kg of fuel.
Image

User avatar
Posts: 89
Joined: Thu Apr 05, 2012 3:16 pm
Location: Akron, OH, USA
Calculators: Casio fx-9750GII, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby flyingfisch » Sun May 19, 2013 3:54 pm

cool. Just curious, how do you access the spreadsheet from BASIC? I didn't think it was possible.

Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

Re: "Sky" space flight simulator for Prizm

Postby nsg » Sun May 19, 2013 5:42 pm

flyingfisch wrote:cool. Just curious, how do you access the spreadsheet from BASIC?


The short answer is "I don't".
I quit basic program, then open spreadsheet. The app remembers the last opened spreadseet, which is a good thing if you switch between a lot. The app does not remember your position in that spreadsheet, which is kind of shame. Also you have to recalculate spreadsheet first time you enter it -- also shame, they could have done it automatically.
What is very cool is that you can use basic variables in spreadsheet formulas. This way you do not need to enter your current values of dry mass, remaining fuel, engine Isp -- spreadsheet formula just takes the values from the
Basic variables.
It would be magacool if you could modify/access spreadsheet from Basic, but no... Maybe that new HP will do it.

Return to Released Projects

Who is online

Users browsing this forum: No registered users and 61 guests