Advertisement
hiddenGem

Energy to Accelerate a Spaceship

Aug 6th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.61 KB | None | 0 0
  1. %% Energy to Acclerate a Spaceship to Relativistic Speed
  2. % Determines the energy required to accelerate a spaceship and how many
  3. % missions are possible in a year
  4.  
  5. % Constants
  6. c = 3.00*10^8;                  % [m/s] Speed of Light
  7.  
  8. % Inputs and Variables
  9. M0 = input('Mass of spaceship\n');
  10. Beta = input('Speed of spaceship without c\n');
  11. K = input('Energy from the sun\n');
  12. eff = input('Efficiency in percent\n')*10^-2;
  13.  
  14. % Outputs and Equations
  15. Work = M0*c^2*((1/sqrt(1-Beta^2))-1);
  16. missions = K*365*eff/Work;
  17. missions = floor(missions);
  18. fprintf('Energy required: %.3e J\nMissions: %f\n', Work, missions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement