How can I simulate Newtonian motion using C code and graphics packages?

In summary, the conversation discusses solving a motion equation using Euler's Method and Runge Kutta 4th Order Method. The individual has compiled the variation of various parameters with respect to time and is looking for software to simulate the motion. The use of C language is recommended, but other options such as Java or MATLAB are also suggested. There is a potential issue with the integration at 60 second intervals and the availability of graphics packages for the MingW compiler is mentioned. Other options for graphics simulations, such as Borland C, VB.net, and C# are also mentioned.
  • #1
Harmony
203
0

Homework Statement



http://img399.imageshack.us/img399/4277/cartyf8.jpg
http://g.imageshack.us/img399/cartyf8.jpg/1/

Homework Equations


Euler's Method, Runge Kutta 4th Order Method

The Attempt at a Solution



I have solved the motion equation for the above question using Euler's Method and Runge Kutta method. Using C language, I have compiled the variation of angle, angular velocity, angular acceleration, displacement, velocity and the acceleration of the cart and the pendulum with respect to time in the time interval of 60 seconds.

I wish to simulate the motion of the cart. Which software should I use to simulate the motion? Would C code for such simulation difficult to make?

Thanks in advanced.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Use whatever language you're comfortable with. C is fine for this since it isn't very complicated.
 
  • #3
I have tried to look for web resources for the simulation. But most of the resources are not too helpful. Is there any graphic library of Mingw compiler? Thanks in advanced.
 
  • #4
Oh you need to DRAW the simulation? I suggest using either Java or MATLAB then.
 
  • #5
Did you compile the velocity and displacement at 60 seconds intervals, or did you integrate using Runge-Kutta at 60 second intervals?
If it is the latter, there is a little problem, because the cart is running down at 0.5g and it goes far after 60 seconds.

There are graphics packages similar to the Borland C graphics available to Linux users for the MingW compiler. I have looked for it but have not tried it yet. If you are familiar with Java, it provides very good tools for graphics simulations. Alternatively, if you have access to Borland C, it provides a simple but practical package. Not forgetting VB.net or C#, they all provide graphics capabilities when speed is not critical.
 

1. What is Newtonian motion simulation?

Newtonian motion simulation is a computerized model that illustrates and predicts the movement of objects based on Newton's laws of motion.

2. How does Newtonian motion simulation work?

Newtonian motion simulation uses mathematical equations and algorithms to simulate the forces and motions of objects in a virtual environment.

3. What are the applications of Newtonian motion simulation?

Newtonian motion simulation has various applications in fields such as physics, engineering, and video game development. It is used to study and predict the behavior of objects in different scenarios.

4. Is Newtonian motion simulation accurate?

Newtonian motion simulation can be accurate if the initial conditions and parameters are entered correctly. However, it may not account for all factors such as air resistance and friction, so results may vary from real-world observations.

5. How can Newtonian motion simulation be beneficial?

Newtonian motion simulation can be beneficial as it allows scientists and engineers to study, analyze, and predict the behavior of objects in a controlled environment without the need for physical experiments. It also helps in understanding complex concepts and designing efficient systems.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Programming and Computer Science
Replies
15
Views
2K
  • Astronomy and Astrophysics
Replies
7
Views
4K
  • Programming and Computer Science
Replies
4
Views
4K
  • General Math
Replies
1
Views
1K
  • Astronomy and Astrophysics
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
10
Views
6K
  • Advanced Physics Homework Help
Replies
4
Views
6K
  • Advanced Physics Homework Help
Replies
7
Views
4K
  • Programming and Computer Science
Replies
14
Views
4K
Back
Top