GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Nov-2004, 14:51
helpme helpme is offline
New Member
 
Join Date: Nov 2004
Posts: 1
helpme is on a distinguished road

Need Help Starting the following problem



The problem states that I need to write a C program which will be able to determine the angle at which a gun will shoot at in order to intercept a flying object. I must then turn the output into a .csv file and plot the solution in an Excel graph.

the problem also states that the projectile will start at (0, 0). It will have an initial velocity of Vo = 400 m.s-1 and a mass m = 75 g, while friction is neglected. It will intercept a flying object that will start at (5000, 2000), or 5 km in horizontal distance and 2000 meters of altitude. This object will be flying at 100 m.s-1 (360 km.h-1) horizontally towards the gun.

Acoording to instructions,
-I must use Euler’s method or Runge-Kutta with a step of h=0.01 in order to solve the differential equations of motion of the two objects.

-i then must write a function "double distance (double angle);" which will return the difference of their y components when the two objects will exactly be on top of each other (i.e. they have the same x component) in function of the initial angle of the projectile.

-Then, i must apply bisection method in order to find at what angle the distance function is equal to zero (i.e. interception of the flying object by the projectile). You will use bisection method between 0 and Pi/2, assuming that there is only one solution in this interval.

-Finally the results need to be printed in a .csv file.

Now here's my question... How do I get started? I am having a lot of trouble figuring out what to do, and i dont really understand Euler's method or Runge-Kutta. I do know a little about the bisection method. Can someone help me write the fist few lines of code and the code for either runge-kutta or Euler in order to get started? I would greatly appreciate it.

Thanks in advance 8-)
  #2  
Old 24-Nov-2004, 15:44
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,218
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold
Quote:
Originally Posted by helpme

The problem states that I need to write a C program which will be able to determine the angle at which a gun will shoot at in order to intercept a flying object. I must then turn the output into a .csv file and plot the solution in an Excel graph.

the problem also states that the projectile will start at (0, 0). It will have an initial velocity of Vo = 400 m.s-1 and a mass m = 75 g, while friction is neglected. It will intercept a flying object that will start at (5000, 2000), or 5 km in horizontal distance and 2000 meters of altitude. This object will be flying at 100 m.s-1 (360 km.h-1) horizontally towards the gun.

Acoording to instructions,
-I must use Euler’s method or Runge-Kutta with a step of h=0.01 in order to solve the differential equations of motion of the two objects.

-i then must write a function "double distance (double angle);" which will return the difference of their y components when the two objects will exactly be on top of each other (i.e. they have the same x component) in function of the initial angle of the projectile.

-Then, i must apply bisection method in order to find at what angle the distance function is equal to zero (i.e. interception of the flying object by the projectile). You will use bisection method between 0 and Pi/2, assuming that there is only one solution in this interval.

-Finally the results need to be printed in a .csv file.

Now here's my question... How do I get started? I am having a lot of trouble figuring out what to do, and i dont really understand Euler's method or Runge-Kutta. I do know a little about the bisection method. Can someone help me write the fist few lines of code and the code for either runge-kutta or Euler in order to get started? I would greatly appreciate it.

Thanks in advance 8-)


First: write the differential equations of motionto be solved.

Now, this assignment is from what kind of class? Math (numerical analysis) or what? If the assignment is to use Euler's method or Runge Kutta, you must be expected to know what these are (course prerequisites or course notes or textbook reading assignment or ???). OR ... it's just possible that you are expected to use the internet or some other resource to discover what these things are in the context of solving differential equations numerically. Having someone else do your research for you is one possibility. Looking for yourself is another.

You go ahead and get started; if you have specific questions, tell us what you found, and what you don't understand. I'm guessing that someone here can help.

Regards,

Dave
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache / PHP problem, maybe output length? HaganeNoKokoro Apache Web Server Forum 3 07-Aug-2008 05:42
CD burner will not burn, new problem sdshaman Computer Hardware Forum 4 07-Feb-2008 00:17
Problem in array Kay Chan C Programming Language 2 05-Oct-2004 22:16
Mpeg2 SVCD disc problem mrnobody Computer Software Forum - Windows 0 13-Aug-2004 09:51
Another FX 5600 problem (but with details that might shed light on this) BobDaDuck Computer Hardware Forum 2 16-Apr-2004 08:53

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:31.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.