Initial commit of "Rocket Workbench".
Taken from sources in CVS at:
https://sourceforge.net/projects/rocketworkbench/
Sources extracted in two steps:
1. Pull entire project tree into a subdir "rwb" via "rsync":
rsync -a a.cvs.sourceforge.net::cvsroot/rocketworkbench/ rwb/.
2. Export sources:
export CVSROOT=$(pwd)/rwb
SUBDIRS="analyser cpropep cpropep-web CVSROOT data libcompat libcpropep libnum libsimulation libthermo prop rocketworkbench rockflight"
mkdir rwbx; cd rwbx
cvs export -D now ${SUBDIRS}
After this (and some backups for safety), the directory content was
added to a Git repo:
git init .
git add *
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
function rho = density(y)
|
||||
|
||||
P0 = 1.013e5; # standard stmospheric pressure
|
||||
Ma = 0.0289644; # atmosphere molar mass
|
||||
Rg = 8.3145; # perfect gas constant
|
||||
T = 273.15; # standard temperature
|
||||
|
||||
G = 6.67259e-11; # gravitational constant
|
||||
Mt = 5.98e24; # earth mass
|
||||
Rt = 6370000; # earth radius
|
||||
|
||||
rho = (P0*Ma/(Rg*T))*exp( ((Ma*G*Mt)/(Rg*T))*((1/(Rt+y))-(1/Rt)) );
|
||||
|
||||
endfunction
|
||||
@@ -0,0 +1,27 @@
|
||||
function dy = flight(y, t)
|
||||
|
||||
G = 6.672e-11;
|
||||
M = 5.98e24;
|
||||
W = 7.27e-5;
|
||||
|
||||
m = 100; # kg
|
||||
Cd = 0.75;
|
||||
A = 0.1;
|
||||
rho = density(y(1)-6370000);
|
||||
Cr = 0.5*Cd*rho*A;
|
||||
|
||||
v = sqrt( y(4)^2 + (y(1)*y(6)*cos(y(2)))^2 + (y(1)*y(5))^2);
|
||||
|
||||
dy(1) = y(4);
|
||||
dy(2) = y(5);
|
||||
dy(3) = y(6);
|
||||
|
||||
dy(4) = -(G*M)/(y(1)^2) - Cr*v*y(4)/m + y(1)*(y(5)^2) + ((W + y(6))^2)*y(1)*(cos(y(2))^2);
|
||||
|
||||
dy(5) = (-1/y(1))*( Cr*v*y(1)*y(5)/m + y(1)*cos(y(2))*sin(y(2))*(W+y(6))^2 +
|
||||
2*y(4)*y(5));
|
||||
dy(6) = (-1/(y(1)*cos(y(2)))) * (Cr*v*y(1)*y(6)*cos(y(2))/m +
|
||||
2*(W*(y(4)-y(1)*y(5))+y(4)*y(6))*cos(y(2)) -
|
||||
2*y(1)*y(6)*y(5)*sin(y(2)));
|
||||
|
||||
endfunction
|
||||
@@ -0,0 +1,16 @@
|
||||
function dy = flight_vacuum(y, t)
|
||||
|
||||
G = 6.672e-11;
|
||||
M = 5.98e24;
|
||||
W = 7.27e-5;
|
||||
|
||||
dy(1) = y(4);
|
||||
dy(2) = y(5);
|
||||
dy(3) = y(6);
|
||||
|
||||
dy(4) = -(G*M)/(y(1)^2) + y(1)*(y(5)^2) + ((W + y(6))^2)*y(1)*(cos(y(2))^2);
|
||||
dy(5) = (-1/y(1))*( y(1)*cos(y(2))*sin(y(2))*(W+y(6))^2 + 2*y(4)*y(5));
|
||||
dy(6) = (-1/(y(1)*cos(y(2))))*(2*(W*(y(4)-y(1)*y(5))+y(4)*y(6))*cos(y(2)) -
|
||||
2*y(1)*y(6)*y(5)*sin(y(2)));
|
||||
|
||||
endfunction
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
altitude = 0; # altitude in meter
|
||||
latitude = 15; # latitude in decimal degree
|
||||
longitude = 0; # longitude in decimal degree
|
||||
|
||||
velocity = 1000; # magnitude of the initial velocity in meter/s
|
||||
angle = 0; # angle with the horizontal in degree
|
||||
direction = 90; # direction (0=east 90=north 180=west 270=south)
|
||||
|
||||
R = 6.37e6; # earth radius in meter
|
||||
|
||||
r = R + altitude;
|
||||
r_dot = velocity*sin(angle*pi/180);
|
||||
u_dot = velocity*cos(angle*pi/180)*cos(direction*pi/180)/(r*cos(latitude*pi/180));
|
||||
l_dot = velocity*cos(angle*pi/180)*sin(direction*pi/180)/r;
|
||||
|
||||
init = [ r; latitude*pi/180; longitude*pi/180; r_dot; l_dot; u_dot; ];
|
||||
|
||||
t = 0:0.1:200;
|
||||
|
||||
y = lsode('flight_vacuum', init, t);
|
||||
|
||||
hold off
|
||||
plot(y(:,1).*cos(y(:,2)), y(:,1).*sin(y(:,2)));
|
||||
hold on;
|
||||
plot(R*cos(y(:,2)), R*sin(y(:,2)));
|
||||
|
||||
#plot(y(:,3)*180/pi, y(:,2)*180/pi);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user