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

AI Thread Summary
To simulate Newtonian motion using C code, Euler's Method and the Runge Kutta 4th Order Method have been successfully applied to calculate various motion parameters over a 60-second interval. The user seeks recommendations for software to visualize the simulation and inquires about the complexity of implementing this in C. Suggestions include using Java or MATLAB for better graphics capabilities, while also noting the availability of graphics packages for the Mingw compiler. Concerns were raised about the accuracy of the simulation if the integration method was not applied correctly. Overall, the discussion emphasizes the importance of selecting appropriate tools for effective simulation visualization.
Harmony
Messages
201
Reaction score
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
Use whatever language you're comfortable with. C is fine for this since it isn't very complicated.
 
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.
 
Oh you need to DRAW the simulation? I suggest using either Java or MATLAB then.
 
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.
 

Similar threads

Back
Top