Safe landing

Back to Problem Solutions forum

Leonid_Manieiev     2016-09-03 16:14:12

Hello.

I'm working on Safe Landing problem and I don't understand thing about simulation step (dt = 0.1).

Am I right, that we do all calculations (increasing decreasing variables) on each 0.1 step, but reread from input burning rate only, then dt is multiple of 10 (dt % 10 == 0)? And should we read burning rate from input at the begin (dt == 0.0) or it should be equal to 0?

Thanks!

Leonid_Manieiev     2016-09-03 17:57:16

BTW, I submit my code, so those who already solve this problem can look at it and maybe give me a hint, what is wrong.

Quandray     2016-09-04 08:19:53
User avatar

Hi,

Your simulation should be calculated every 0.1 of a second and the burning rate should be read at the start and then every 10 seconds.

Your code has i%10 not dt%10, so when i is a multiple of 10 I think only 1 second has elapsed.

I don't understand why your code has this in one place

height -= velocity * dt;
velocity += g*dt - dV;

and this in another place

height -= velocity;
velocity += g;

Also, if dt is the simulation step, and you use it in calculating changes in height and velocity, I don't think it makes sense to keep changing dt.

Leonid_Manieiev     2016-09-04 09:39:20

Thank you very much! Solved it.

Please login and solve 5 problems to be able to post at forum