Succeeded in making a optimial angle calculator, which calculates the lowest possible angle to horizontal teh projectile should make to reach a target(a distance away) within some tolerance, travelling at a known inital velocity. . I then decided to plot a graph of optimal angle with max range. I also plotted a graph of speed against target/ranges. I used targets 30m, 60m, 45m, 90m, and calculated the lowest possible velocity and the angle which causes projectile to hit the target within tolerance. Originally, I though to loop through each value and try out combinations, which resulted in a very slow program, since the rk4 function was being called over 10000 times, given each call also had a dt = 0.01s, it took around 200s just to output the optimum angle. After that, I switched to programming a binary + tenary search which solved it in much quicker time <25s. To speed it up even more, I used my adaptive time model that i created earlier, this reduced the fixed dt= 0.01, reducing the total number of cycles needed to scan through whole motion
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.