Attachment 'incline3.c'
Download 1 // incline3.c
2 // incline for logarithmic altitude launch loop track
3 // with ramp and new track
4 // also reverse track
5
6 #define CL 80000.0 // cable material support length
7 #define C0 20000.0 // z0 for cable
8 #define CS 0.7 // Sideways fraction for cable
9
10 #define OX -156323.926 // x data offset in meters
11
12 #define X0 -20000.0 // Before ramps
13 #define X1 200000.0 // End of track
14 #define WZ 50550.0 // West station east altitude
15 #define WA 5.48 // West station angle degrees
16 #define WR 14000.0 // West station curvature radius
17 #define TC 3.2E-7 // track curvature at west station
18
19 #define VR 14000.0 // rotor speed at top of loop
20 #define RE 6378000.0 // Earth Radius
21 #define AG 9.81 // ag0
22 #define A0 20.0 // incline start angle degrees
23 #define MF 3.000 // ms/mr
24 #define MR 3.000 // rotor mass per meter
25 #define DX 1 // computation delta x in meters
26 #define NP 1000 // number of computation points per print
27 #define HT 80000.0 // top of loop, meters
28 #define LL 2000000.0 // launch loop length
29 #define K 1000.0 // kilo
30 #define EPS 1E-4 // comparison error
31
32 #include <stdio.h>
33 #include <math.h>
34
35 int p ; // print counter
36 double ra ; // degrees to radians
37 double x ; // horizontal distance in meters
38 double z ; // height in meters
39 double zp ; // slope
40 double zpp ; // curvature in inverse meters
41 double vr ; // rotor speed
42 double vr2 ; // rotor speed squared
43 double vr0 ; // surface rotor speed
44 double l ; // length of incline
45 double dl2 ; // delta length squared
46 double g ; // cable angle ratio
47 double wz ; // west station magnet radius center z
48 double wx ; // west station magnet radius center x
49 double ag ; // gravity at altitude
50 double zw ; // west station west end altitude
51 double dx ; // increment for drawing west station
52 double xw ; // west station x length
53 double rx ; // ramp center horizontal
54 double rz ; // ramp center vertical
55 double a0 ; // ramp angle in radians
56 double a1 ; // ramp feed part angle in radians
57 double an ; // ramp angle loop index
58 double da ; // ramp angle loop increment
59 double z1 ; // height of reverse track
60 double zp1 ; // slope of reverse track
61
62 // -----------------------------------------
63
64 int prxz() {
65 double sprt = MR * ((vr*vr*(zpp+1.0/RE)/ag) - 1.0 ) ;
66 double xo = x + OX ;
67 printf( "%11.6f%11.6f%12.6f%10.6f%10.3f%11.3f%9.5f%11.6f\n",
68 xo/K, z/K, l/K, zp, sprt, vr, ag, z1/K );
69 return 0 ;
70 }
71
72 // -----------------------------------------
73 int main() {
74
75 // initialization -------------------------------------------------------
76
77 ra = atan(1.0)/45.0 ; // degrees to radians conversion constant
78 vr0 = sqrt( VR*VR+2.0*AG*HT/( 1.0 + HT/RE ) ) ; // rotor ground speed
79 ag = AG ; // gravity at ground
80
81 // -----------------------------------------------------------------------
82 // ramp
83
84 dx = 0.2*rx ;
85
86 a0 = ra*A0 ; // radians, second upturn and start of ramp
87 a1 = acos(0.5*(1.0+cos(a0))) ; // radians, downturn and first upturn
88
89 x = X0 ;
90 z = 0.0 ;
91 l = x - WR * ( (a0-sin(a0)) + 2.0*(a1-sin(a1)) ) ;
92 zp = 0.0 ;
93 zpp = 1.0/RE ;
94 vr = vr0 ;
95
96 z1 = z ;
97 prxz();
98
99 // ramp downturn
100
101 rx = -WR*(sin(a0)+2*sin(a1));
102 rz = -WR ;
103
104 da = 0.2*a1 ;
105
106 for( an=0.0 ; an < a1-EPS ; an += da ) {
107 x = rx+WR*sin(an);
108 z = rz+WR*cos(an);
109 l = WR*(a0+2.0*a1-an);
110 zp = -tan( an );
111 zpp = 1.0/(WR*cos(an)*cos(an)) ;
112 vr2 = vr0*vr0-2.0*AG*z/(1.0 + z/RE ) ;
113 vr = sqrt( vr2 );
114 ag = 1.0/(1.0+(z/RE)) ;
115 ag *= AG*ag ;
116
117 z1 = z ;
118 prxz();
119 }
120
121 // ramp upturn
122
123 rx = -WR*sin(a0) ;
124 rz = WR*cos(a0) ;
125
126 da = 0.1*(a0+a1) ;
127 for( an= -a1 ; an < a0-EPS ; an += da ) {
128 x = rx+WR*sin(an);
129 z = rz-WR*cos(an);
130 l = WR*(a0-an);
131 zp = tan( an );
132 zpp = -1.0/(WR*cos(an)*cos(an)) ;
133 vr2 = vr0*vr0-2.0*AG*z/(1.0 + z/RE ) ;
134 vr = sqrt( vr2 );
135 ag = 1.0/(1.0+(z/RE)) ;
136 ag *= AG*ag ;
137
138 z1 = z ;
139 prxz();
140 }
141
142 // -----------------------------------------------------------------------
143 // incline
144
145 // initialize
146
147 x = 0.0 ;
148 p = NP ;
149 z = 0.0 ; //
150 zp = tan( a0 ) ; // first spatial derivative
151 l = 0.0 ;
152 wz = WZ - WR * cos( ra*WA ) ;
153
154 // main loop
155 while( p >= 0 ) {
156 ag = 1.0/(1.0+(z/RE)) ;
157 ag *= AG*ag ;
158 vr2 = vr0*vr0-2.0*AG*z/(1.0 + z/RE ) ;
159 vr = sqrt( vr2 );
160 g = sqrt( exp( 2.0*( z+C0 ) / CL ) - 1.0 ) ;
161 dl2 = 1.0+zp*zp ;
162 zpp = dl2 * ( (1.0/(RE+z)) + dl2*ag*MF/(vr2*(1.0-g*zp )) ) ;
163
164 if( p++ >= NP ) {
165 z1 = z ;
166 prxz() ; // print every 1000 meters
167 p = 1 ;
168 }
169
170 // increment values
171 x += DX ;
172 zp -= zpp * DX ;
173 z += zp * DX ;
174 l += DX*sqrt(dl2);
175
176 // compute west station west end height WZ
177
178 zw = wz + WR / sqrt( 1.0 + zp*zp ) ;
179
180 // test for completion
181
182 if ( z > zw ) { p = -NP ; }
183 }
184 z1 = z ;
185 prxz();
186
187 // --------------------------------------------------------------------
188 // now, compute points for west station
189
190 wx = x + WR*zp/sqrt( 1.0+zp*zp) ; // west station radius x center
191 xw = wx - WR*sin( ra * WA ) ; // west station east end x location
192
193 // find angles
194
195 a0 = -acos( ( z-wz)/WR ) ;
196 a1 = -acos( (WZ-wz)/WR ) ;
197 da = 0.2*(a1-a0) ;
198
199 for( an = a0+da ; an < a1+EPS ; an += da ) {
200 x = wx + WR*sin( an );
201 z = wz + WR*cos( an );
202 zp = -tan( an );
203 zpp = 1.0/(WR*cos(a0)*cos(a0)) ;
204 ag = 1.0/(1.0+(z/RE)) ;
205 ag *= AG*ag ;
206 vr2 = vr0*vr0-2.0*AG*z/(1.0 + z/RE ) ;
207 vr = sqrt( vr2 );
208 l += da*WR ;
209
210 // reverse track
211 z1 = z ;
212 prxz();
213 }
214
215 // --------------------------------------------------------------------
216 // compute points for first part of track, constant curvature
217 // also reverse track
218
219 p = 1 ;
220 zpp = TC ;
221 zp = tan( ra * WA );
222 zp1 = (HT-WZ)/LL ;
223
224 while ( x <= X1 ) {
225 x += DX ;
226 z += zp*DX ;
227 zp -= zpp*DX ;
228 l += DX*sqrt(1.0+zp*zp);
229 ag = 1.0/(1.0+(z/RE)) ;
230 ag *= AG*ag ;
231 vr2 = vr0*vr0-2.0*AG*z/(1.0 + z/RE ) ;
232 vr = sqrt( vr2 );
233
234 if( p++ >= NP ) {
235
236 // reverse track, more station then flat
237
238 dx = x - wx ;
239
240 if( dx < 0 ) {
241 z1 = wz + sqrt( WR*WR-dx*dx );
242 } else {
243 z1 = dx*zp1+wz+WR ;
244 }
245
246 prxz() ; // print every 1000 meters
247 p = 1 ;
248 }
249 }
250
251 // --------------------------------------------------------------------
252 return 0 ;
253 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.