RK4 Solver Issue: Shoot the Moon with C Program

  • Thread starter Thread starter Illuminati
  • Start date Start date
  • Tags Tags
    Rk4
AI Thread Summary
A user is developing a 4th order Runge-Kutta program in C to simulate a spacecraft's trajectory to the moon but is encountering issues with the RK4 implementation. The user has shared the code file, specifically recommending the "shoot_the_moon3.c" version, which includes a .plt file for generating output data in .png format. The spacecraft is intended to follow a circular orbit but is instead exhibiting behavior akin to a massed spring. The user suspects that the problem may be related to an initial value issue and is seeking assistance from those more experienced in C programming to identify the errors in the code.
Illuminati
Messages
5
Reaction score
0
Hey Folks,

So I've been making an 4th order Runge-Kutta program for finding a way to shoot the moon with a spacecraft . However for some reason the RK4 part of the program does not work and I cannot figure it out.

I've written it in C and attached the file. If someone who is more well versed in C could take a look at it and let me know what I'm screwing up I would be greatly appreciative.

Thanks!

Edit: I've attached a couple different methods to this post. If viewing try using shoot_the_moon3.c, it should have a working .plt file to output a .png of the data
 

Attachments

Last edited:
Technology news on Phys.org
I suppose I should add that the spacecraft is supposed to have some kind of circular orbit, instead it acts more like a massed spring

it might be an initial value problem
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Replies
22
Views
4K
Replies
8
Views
4K
Replies
8
Views
2K
Replies
4
Views
2K
Replies
13
Views
4K
Replies
17
Views
2K
Back
Top