blob: 112813648642b4784e68d7270e2bd88cbe1c807a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
exec ("Gravitation.sci",-1)
//Given that
Vi = 1.2 * 10^4 //in m/sec
d = 10*Re;
m = 10 //let say it will mass cancel out later
//Sample Problem 5
printf("**Sample Problem 5**\n")
//we know that E(initial) = E(final)
//=> Ki + Ui = Kf + Uf
//K = .5*m*Vi*Vi (Kinetic Energy)
//U = gravitational potential (Potential Energy)
Ki = .5*m*Vi*Vi;
Ui = GPotential(m,Me,d);
Uf = GPotential(m,Me,Re);
Kf = Ki + Ui -Uf;
Vf = sqrt(2*Kf/m);
printf("The final velocity of the asteroid is equal to %e m/sec", Vf)
|