Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C-Programming Help

  1. Feb 11, 2005 #1
    C-Programming Help URGENT

    Hi, I have to create a program within the next week or so to plot the trajectory of a rocket through space on its journey from the Earth to the Moon. I know how to do the actual programming side of things (or at least I think I do!) but I'm having immense problems transferring the maths into C language. My main difficulty is with the use of vectors and they're components. I've spent 3 solid days trying to do just this first part of my computing project (it's a compulsory part of my 1st year Physics' practical course) and have got absolutely no where. I've had several demonstrators look at it in the computing labs and we've sat for hours debugging it (we kept getting the acceleration of the rocket to constantly be zero) and they've finally given up and admitted that it's most likely something in my 'maths' that's wrong, but none of them know how to help and have practically abandoned me. :surprised

    So if anyone out their has some free time on their hands and is willing to help me (please, I'm begging you!!!!! :cry: ) could you PM me and I will pass on my email details and can send you a copy of the problem sheet & my current program (well, I have about 5versions as the demonstrators kept making me try lots of different things).

    Thanks so much
  2. jcsd
  3. Feb 11, 2005 #2


    User Avatar
    Staff Emeritus

    Ok, so what exactly are you having trouble with? Why don't you post the code you have so we can look at it?
  4. Feb 11, 2005 #3


    User Avatar
    Science Advisor
    Homework Helper

    How about pick out one very specific algorithm you're having problems with and describe it along with the equations you wish to implement in C. Are you familiar with the "program development cycle"? You know, first define what the problem is, then decide how the problem is to be specified in "pseudo code", then start writing small pieces of it, checking each small piece first before using them together, gradually building the program up to meet your requirements. I'm assuming you're not attempting to just jump into there and do it all at once right? No good programmer does that. It's always piece by piece, checking each, adding to it, gradually building it up. Use a debugger too. You know like Microsoft C++ is nice. You can do all sorts of things with that even change values of variables "on the fly".
  5. Feb 12, 2005 #4
    *Hugs ChloƩ*. I'd help you, but I don't know any C :frown:.
  6. Feb 12, 2005 #5
    Maybe its just a logical error.We will try to Help.Post the codes or atleast parts of it where you are experiencing trouble
  7. Feb 13, 2005 #6
    Thanks for the offers of help. I'm at home at the moment, but will be back in Oxford this evening so I'll put a copy of my code up later along with the problem sheet.


    PS. Thanks Nylex - shame you don't know C. U still use TSR - i dnt see you on there any more?
  8. Feb 15, 2005 #7
    Hi, I'm back again. I've posted details of my code and 'project overview' sheet in the following thread:

    I've had a couple of people offering advice, and NateTG has been particularly helpful, but I'd appreciate several people's views on the matter to make sure I'm not going horribly wrong with my interpretation of the acceleration formula.

    Thanks once again :tongue:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook