# Chapter 4 – Satellites (Satellite Orbit)

**Posted:**March 23, 2013

**Filed under:**Satellites, ZX Spectrum Astronomy |

**Tags:**Astronomy, Hyperbolic Orbit, Maurice Gavin, Orbit, Parabolic Orbit, Programming, Satellites, Sinclair Basic, ZX Spectrum Astronomy Leave a comment

Launch your own satellites

Earth Orbit, put a satellite into orbit about the Earth

Satellite Orbit, how to put a satellite into orbit around any planet.

## Satellite Orbit

This program is based on the Earth Orbit program, but is extended to cope with modelling a satellite orbit around any planet, or even our Moon.

In addition to INPUTting the start height and initial velocity of the satellite, it is necessary to ENTER details of the planet itself, ie the diameter (in kilometres) and relative mass compared to Earth (Earth = 1). This information is included in the initial display (Figure 4.4) but you need not be confined to it. Various data should be tested including exotic features like tiny diameters and excessive mass. You should not expect the program to cope with all permutations, particularly for the ‘massive’ planet. Insufficient computation plus very rapid orbiting may produce strange results.

**Figure 4.4**

Sample worlds for a satellite to orbit.

The program recognises if a satellite is in a ‘parabolic’ or ‘hyperbolic’ orbit (open-ended) and thus lost to space. Similarly the Spectrum BEEPs a warning if the initial injection velocity proves too low and the satellite crashes on the surface of the planet.

The program specifically recognises one planet (Saturn) and DRAWs in the encircling ring system if this name is ENTERed in the N$. For the sake of clarity, it is advisable to place your satellite outside the Saturnian ring system.

The CLS command is not used, except against a new planet, and so multiple orbits can be overlaid upon one another until you are satisfied with a particular orbit. The information contained at the corners of the display, starting with the top left, is planet data, orbital period individually in minutes, hours and days and, at the bottom of the screen, the elapse time in minutes, x and y relative coordinate positions and the initial height and velocity in kilometres. An option to COPY the screen to the ZX printer is included. See Figures 4.5 and 4.6 for examples.

The program is an excellent way of gaining insight into the behaviour of, for example, the moons of Jupiter or Saturn, where a stronger gravitational field operates than on Earth.

To demonstrate, Jupiter’s moon Io is a similar distance from the centre of Jupiter as is our Moon from the centre of the Earth. Io orbits Jupiter in 1.8 days and our Moon takes 27.3 days (mean sidereal periods) to orbit the Earth. Try testing some set examples with data from a text book but do not expect any great accuracy as the results should be regarded as informative rather than precise.

**Figure 4.5**

The program recognises ‘Saturn’ and draws a ring system. Unfortunately, this satellite is launched from within the rings with insufficient velocity and crashes immediately on to the planet.

**Figure 4.6**

Third time lucky with these orbit attempts around a small mythical world. One satellite is lost to space, one crashes on the far side of the planet.

**10 REM Satellite Orbit
20 GO SUB 1000
30 LET n$=a$(n)
40 LET k=d(n): LET m=m(n)
50 IF n150000 OR k9999 THEN GO TO 140
170 LET disk=(rd/125*16)*z
180 IF disk>40 THEN LET z=z/2: GO TO 170
190 IF n$=”Saturn ” AND disk*2.5>40 THEN LET z=z/2: GO TO 170
200 PRINT PAPER 4;AT 1,0;n$
210 PRINT INK 5;”diam=”;k;”km”‘”grav=”;m;”xE”
220 LET tm=.125/z: LET h=tm
230 LET w=vl: LET x=hi+rd
240 LET ho=x: LET y=0: LET v=0
250 FOR n=0 TO 255 STEP 2
260 PLOT 140,n-100
270 PLOT n,40: NEXT n
280 PRINT AT 16,0;”-x”;AT 16,30;”+x”;AT 3,16;”+y”
290 PRINT AT 19,23;”initial”;AT 20,19;”hgt=”;hi;”km”;AT 21,19;”vel=”;INT w;”km/mn”
300 INK 5
310 FOR j=0 TO PI/2 STEP .1
320 LET px=INT (SIN j*disk)
330 LET py=INT (COS j*disk)
340 PLOT 140-px,40+py
345 DRAW 0,-py*2
350 PLOT 140+px,40+py
355 DRAW 0,-py*2: NEXT j
360 CIRCLE 140,40,disk: INK 9
380 IF n$=”Saturn ” THEN FOR n=1.5 TO 2.5 STEP .2: CIRCLE 140,40,disk*n: NEXT n
390 LET r=x: LET x=x+h/4*v
400 LET s=y: LET y=y+h/4*w
410 GO SUB 580
420 LET x=r: LET v=v+2/4*b
430 LET y=s: LET w=w+h/4*c
440 GO SUB 610
450 FOR t=0 TO 4e4 STEP tm
460 LET x=x+h*v: LET y=y+h*w
470 GO SUB 580
480 IF x>0 AND y>2*ho THEN PRINT FLASH 1; PAPER 2;AT 0,0;”Velocity too high-LOST to space “: GO TO 510
490 IF d>rd THEN GO TO 530
500 PRINT FLASH 1; PAPER 3;AT 0,0;p$;AT 0,0;”Velocity too low-CRASH in “;t;”mn ”
505 PLOT FLASH 1;xx,yy
510 FOR n=45 TO -30 STEP -15: BEEP .5,n-30: NEXT n
520 PAUSE 50: PLOT FLASH 0;xx,yy: GO TO 740
530 LET v=v+h*b: LET w=w+h*c
540 PAPER 0
550 GO SUB 610
560 NEXT t
570 GO TO 130
580 LET e=x*x+y*y: LET d=SQR e
590 LET a=-g/e: LET b=a*x/d
600 LET c=a*y/d: RETURN
610 PRINT AT 19,0;”time=”;t;”mn ”
620 PRINT “x ax=”;INT x;”km ”
630 PRINT “y ax=”;INT y;”km ”
640 LET xx=x/125*16*z+140
650 LET yy=y/125*16*z+40
660 IF x<0 AND y<0 THEN GOTO 690
670 IF xx>255 OR xx<-255 OR yy>175 THEN LET z=z/2: CLS : PRINT AT 0,0;p$;AT 0,0;”Re-scale=”;z: GO TO 170
680 PLOT xx,yy
685 RETURN
690 FOR n=0 TO .5 STEP .02: BEEP n/4,n/5: NEXT n
700 LET hr=INT (t/.3)/100: LET dy=INT (t/.3/24)/100
710 PRINT PAPER 6;AT 0,0;”Half orbit plot-period=”;t*2;”mn”
720 PRINT AT 1,22;” “;AT 2,22;” ”
730 PRINT AT 1,22;”=”;hr;”hr”;AT 2,22;”=”;dy;”dy”
740 PRINT #0; INK 9; PAPER 4;”z=COPY:p=new Planet:o=new Orbit ”
750 PAUSE 0: IF INKEY$=”o” THEN PRINT AT 0,0;p$: GO TO 130
760 IF INKEY$=”z” THEN LPRINT : COPY : GO TO 750
770 RUN
1005 BORDER 0: PAPER 0: INK 9: CLS : RESTORE
1010 LET zz=1: DIM p$(32)
1015 DIM a$(12,7): DIM d(12): DIM m(12)
1020 DATA “Moon”,3476,.165
1030 DATA “Mercury”,4878,.377
1040 DATA “Venus”,12104,.90
1050 DATA “Earth”,12756,1
1060 DATA “Mars”,6794,.379
1070 DATA “Pallas”,532,.022
1080 DATA “Jupiter”,142800,2.69
1090 DATA “Saturn”,120000,1.19
1100 DATA “Uranus”,52000,.93
1110 DATA “Neptune”,48400,1.22
1120 DATA “Pluto”,3000,.2
1125 PRINT ” PAPER 6;” Satellite Modelling Program “”
1130 PRINT PAPER 5;”No Name Diam(km) Mass(Earth=1)”
1140 FOR n=1 TO 11: READ a$(n),d(n),m(n)
1150 PRINT (” ” AND n<10);n;” “;
1155 PRINT a$(n);TAB 12;d(n);TAB 23;m(n)
1160 NEXT n: PRINT PAPER 6;”12 ??? ??? ??? ”
1170 PRINT ‘”Enter Planet no”
1180 INPUT n: IF n12 THEN GO TO 1180
1200 RETURN**

# Chapter 4 – Satellites (Earth Orbit)

**Posted:**March 23, 2013

**Filed under:**Satellites, ZX Spectrum Astronomy |

**Tags:**Apogee, Astronomy, Earth Orbit, Kepler, Laws of Planetary Motion, Maurice Gavin, Perigee, Programming, Satellites, Sinclair Basic, ZX Spectrum Astronomy Leave a comment

Launch your own satellites

Earth Orbit, put a satellite into orbit about the Earth

Satellite Orbit, how to put a satellite into orbit around any planet.

## Earth Orbit

This is a modelling program which enables you to place a satellite in orbit about the Earth. There are two parameters to INPUT, the initial height of the satellite above the surface of the Earth and the initial velocity, and so there are literally thousands of permutations to try, no two being precisely identical. The orbit is PLOTted in real time and the screen presentation is automatically rescaled to contain the orbit on the screen.

To ensure that the satellite is of maximum size as it traces around the Earth, only half the orbit is PLOTted — the second half is a precise mirror image of the first half and no particular advantage is gained by completing the orbit. Once the half-orbit is completed, the full orbital period in minutes, hours and days is displayed at the top right of the screen. Throughout the PLOTting, at the bottom left is the ‘elapse’ time in minutes and the relative x and y coordinate positions as PLOTted. Bottom right shows the initial height and velocity as INPUT.

Of course successful insertion into orbit is not automatically achieved — as space scientists well know. A balance between the initial height and velocity must be made — particularly so for a neat circular orbit.

There is a further problem to consider. Although the satellite will happily orbit the centre of the Earth (this is the centre of the Earth’s gravitational field) the Earth’s surface sometimes gets in the way and the satellite crashes. The Spectrum BEEPs a polite warning and awaits further INPUT instructions.

There is a second possibility of failure — when you have so high an initial velocity that the satellite is lost to outer space. This particular program does not recognise this condition and will keep rescaling the display, via line 560 (if… YY> 175),each time the satellite reaches the top of the screen, constantly hoping that the satellite will return towards Earth. In this case you must BREAK the program and reRUN it. An option to COPY the screen via the ZX printer is included for your successful orbits.

*The Kepler plot*

This program PLOTs the orbits according to Kepler’s Laws of Planetary Motion (which applies to any lesser body orbiting a larger body), with an elliptical trace and the centre of the Earth as one focus. The satellite speeds up as it gets close to Earth to compensate for the stronger gravitational field experienced. With the following INPUTs, it is possible to test that the program gives reasonably accurate results and is a fair simulation of a body orbiting Earth.

1) Initial height 200 miles

Initial velocity 286 miles/minute

= Orbital period 88 minutes

This is the minimum period for the lowest satellite, like Sputnik I.

2) Initial height 240,250 miles

Initial velocity 37 miles/minute

= Orbital period 27.37 days (mean sidereal period)

This matches our natural satellite — the Moon.

*Test examples*

The above INPUTS represent neat circular orbits. More often than not, however, an ellipse is formed. If the orbit PLOT touches the lefthand side of the screen the display is not rescaled but left to continue the PLOTting as a mirror image back towards right again to maintain maximum image size.

The screen COPYs (Figures 4.1, 4.2 and 4.3) show typical results from the program.

**Figure 4.1**

This orbit simulates our natural satellite, the Moon.

**Figure 4.2**

Typical orbit plotted from apogee (point adjacent + x sign).

**Figure 4.3**

Typical orbit started adjacent to globe (perigee). The orbit is mirrored by left hand side of display, plotting towards the right (apogee).

*Mission control*

As an experiment, try ‘designing’ orbits for the Russian and American space programs in long range communications. The West has produced geostationary satellites placed at just sufficient distance from the Earth so as to have a 24-hour orbital period and to remain fixed above the equator at a particular longitude. This would appear to be the ideal solution and was first proposed by Arthur C. Clarke in the 1940s in an article in *Wireless World*.

The Russian approach has been, or was in the 1970s, to send craft into highly elliptical orbits but again of 24-hour orbital periods. As has been demonstrated, such satellites would be constantly changing their velocity according to their current distance from Earth and would remain moderately stationary (so as not to need a tracked aerial) for only a few hours per day, whilst at the point of apogee (the most remote part of the orbit from Earth). Many permutations can be tried on your Spectrum.

**9 REM ***********************
10 REM Earth Orbit
11 REM ***********************
15 BORDER 0: PAPER 0: INK 9: CLS
20 LET se=7912/2: LET hw=32.12
40 LET dn=.68181818: LET z=1
70 LET g=hw*dn*se*se: LET t=0
80 INPUT “Height above Earth in miles”,eh
90 INPUT “Velocity in miles/min”,sp: IF sp>999 THEN GO TO 90
100 LET tm=2/z: LET h=tm
120 LET w=sp: LET x=eh+se
140 LET y=0: LET v=0
160 FOR n=0 TO 255 STEP 2
170 PLOT INK 5;140,n-100
180 PLOT INK 5;n,40: NEXT n
190 PRINT AT 16,0;”-x”;AT 16,30;”+x”;AT 3,16;”+y”
200 PRINT AT 19,24;”start”;TAB 20;”hgt=”;eh;”ml”;TAB 20;”vel=”;INT w;”ml/mn”
210 CIRCLE INK 4;140,40,30*z
220 LET r=x: LET s=y
230 LET h4=h/4
240 LET x=x+h4*v: LET y=y+h4*w
260 GO SUB 440
270 LET x=r: LET y=s
280 LET h2=h/2
290 LET v=v+h2*b: LET w=w+h2*c
310 GO SUB 500
320 FOR t=0 TO 4e6 STEP tm
330 LET x=x+h*v: LET y=y+h*w
350 GO SUB 440
360 IF d>se THEN GO TO 390
370 FOR n=45 TO -30 STEP -15: BEEP .5,n-30: NEXT n: PRINT INK 3;AT 0,0;”Velocity too low – CRASH”‘”in “;t;” min”
380 GO TO 610
381 REM ***********************
390 LET v=v+h*b: LET w=w+h*c
410 GO SUB 500: NEXT t
440 LET e=x*x+y*y
450 LET d=SQR e: LET a=-g/e
470 LET b=a*x/d: LET c=a*y/d
490 RETURN
500 PRINT AT 19,2;”time=”;t;” min ”
510 PRINT “x axis=”;INT x;” mls ”
517 REM ***********************
520 PRINT “y axis=”;INT y;” mls ”
521 REM ***********************
530 LET xx=x/125*z+140
540 LET yy=y/125*z+40
550 IF x<0 AND y255 OR xx175 THEN LET z=z/2: CLS : PRINT INK 3;”Rescale”: GO TO 100
569 REM ***********************
570 PLOT BRIGHT 1; INK 6;xx,yy
571 REM ***********************
580 RETURN
600 PRINT INK 6;AT 0,0;”Half orbit plot- period=”;t*2;”mn”;AT 1,23;”=”;INT (t/.3)/100;”hr”;AT 2,23;”=”;INT (t/.3/24)/100;”days”
609 REM ***********************
610 PRINT #0; INK 5;”Press ‘C’=COPY ‘N’=Next orbit”: PAUSE 0
620 IF INKEY$=”c” OR INKEY$=”C” THEN COPY : INPUT “”: GO TO 610
630 RUN
631 REM ***********************
9990 SAVE “Eorbit” LINE 1**

# Chapter 4 – Satellites (Launch Your Own Satellite)

**Posted:**March 23, 2013

**Filed under:**Satellites, ZX Spectrum Astronomy |

**Tags:**Astronomy, Maurice Gavin, Satellites, ZX Spectrum Astronomy Leave a comment

Launch your own satellites

Earth Orbit, put a satellite into orbit about the Earth

Satellite Orbit, how to put a satellite into orbit around any planet.

## Launch your own satellites

The launch of Sputnik I by the USSR in 1957 started the space age and added a new word to the common vocabulary — satellite. In the astronomical context, this simply means a moon and our Moon (capital M of course) is the only natural satellite of Earth.

Since Sputnik I, literally thousands of artificial satellites have been sent into Earth orbit. A few have even been sent to orbit other planets like Venus, Mars and our Moon. On a clear night it is now rare for some 30 minutes to elapse before a satellite passes overhead on its silent progress about Earth — a point of light moving quite rapidly on a slight arced course amongst the stars.

The brighter satellites are usually in lower orbits moving from west to east across the sky (never in the reverse direction). The satellites in polar orbits (passing over the north and south pole at each revolution) are usually fainter and almost perfectly aligned to the Earth’s axis so that their movement is in a precise north/south or south/north direction.

Launching satellites can cost millions of pounds each so, before applying for a job at Mission Control, Houston, practise on the simulator programs to follow!