Based on the original Rocket Workbench on SourceForge in CVS at: https://sourceforge.net/projects/rocketworkbench
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
860 B

  1. altitude = 0; # altitude in meter
  2. latitude = 15; # latitude in decimal degree
  3. longitude = 0; # longitude in decimal degree
  4. velocity = 1000; # magnitude of the initial velocity in meter/s
  5. angle = 0; # angle with the horizontal in degree
  6. direction = 90; # direction (0=east 90=north 180=west 270=south)
  7. R = 6.37e6; # earth radius in meter
  8. r = R + altitude;
  9. r_dot = velocity*sin(angle*pi/180);
  10. u_dot = velocity*cos(angle*pi/180)*cos(direction*pi/180)/(r*cos(latitude*pi/180));
  11. l_dot = velocity*cos(angle*pi/180)*sin(direction*pi/180)/r;
  12. init = [ r; latitude*pi/180; longitude*pi/180; r_dot; l_dot; u_dot; ];
  13. t = 0:0.1:200;
  14. y = lsode('flight_vacuum', init, t);
  15. hold off
  16. plot(y(:,1).*cos(y(:,2)), y(:,1).*sin(y(:,2)));
  17. hold on;
  18. plot(R*cos(y(:,2)), R*sin(y(:,2)));
  19. #plot(y(:,3)*180/pi, y(:,2)*180/pi);