RK4 Solver Issue

  • Thread starter Illuminati
  • Start date
  • #1

Main Question or Discussion Point

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:

Answers and Replies

  • #2
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
 

Related Threads on RK4 Solver Issue

  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
6
Views
1K
  • Last Post
Replies
1
Views
6K
  • Last Post
Replies
2
Views
4K
Replies
11
Views
7K
Replies
13
Views
4K
  • Last Post
Replies
9
Views
5K
  • Last Post
Replies
1
Views
19K
  • Last Post
Replies
7
Views
12K
Top