NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
September 21, 2020, 05:32:49 pm

A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"

 Pages: [1]   Go Down
 Author Topic: Simulation of blowing object with debris falling down  (Read 13445 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
tppramod
Newbie

Offline

Posts: 4

 « Embed this message on: January 15, 2008, 07:48:13 pm » posted from:New Delhi,Delhi,India

Hi,

This is what i need to code in C for which i need to know the physics involved:

Blowing of an object with its debris falling down. For eg. in one of the classic DOS game, PARATROOPER, by Greg Kuperberg, the enemy paratroopers land on the side of the gun base and blow the gun base. I want to have a similar simulation. Any help...

Regards,

Pramod,
New Delhi, India

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #1 on: January 15, 2008, 08:54:34 pm »

I am not getting the whole picture of what you really want.
Could you explain it in more detail. May be with a simple diagram will help a lot.
You can upload image file as an attachment.
 Logged
tppramod
Newbie

Offline

Posts: 4

 « Embed this message Reply #2 on: January 16, 2008, 11:58:10 am » posted from:New Delhi,Delhi,India

Sir,

Hope u get the clear picture once u see this beautiful simulation.

Thanks n Regards,

Pramod,
New Delhi, India
 « Last Edit: January 16, 2008, 12:34:55 pm by tppramod » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #3 on: January 16, 2008, 01:05:16 pm »

If you want to have something falling down under gravity.
Just add a gravity as an downward acceleration. ie. Fd= -m*g; // where m is the mass, g is the gravity
To make it more realistic, you can add upward drag force which is proportional to downward speed. i.e. Fu=-b*v;// where b is a constant.
So the total force is F=-m*g-b*v;
The above are physics involved. The rest are up to you how to present in a visual way.
Because it is a risk to download some executable file form somewhere you did not know and run it in your computer.
 Logged
tppramod
Newbie

Offline

Posts: 4

 « Embed this message Reply #4 on: January 16, 2008, 01:39:50 pm » posted from:New Delhi,Delhi,India

Sir,

Thanks for your reply..  Could u please tell me what is b and v?  I guess v=Velocity right?  i am not an expertise in the subject.  But i have a clear understanding of gravity, velocity and acceleration.  I want to achieve my simulation like this..  All the debris after the blast (each debris being small objects) will move upward in the first instance slightly moving away from one another (i dont know how to calculate that) then ultimately falling down with gravity in the second instance.  So can i achieve both these instances with your suggested formula...  Fd= -m*g; Fu=-b*v; F=-m*g-b*v;  Actually i am not able to relate these formula with the required simulation.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #5 on: January 16, 2008, 03:09:25 pm »

v is velocity and b is just a constant (which should proportional to the cross section of the object ..).
The drag force f=-b*v is a good approximation for relative small velocity.
For larger velocity in air, the drag force will be proportional to square of velocity.
You can check out http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=549.0

If the object need to move upward in the beginning. Just give them an upward initial velocity. Then it should be fine.

How to related those formula to the computer code?
You can use Runge-Kutta 4-th order method (library are available on the web).
If you use the EJS (Easy Java Simulation) tool, you just need to provide the equation and EJS will generate all the code for you. But if you want to code it with C by yourself.  You need to know how to do the numerical calculation with computer code or just copy existing library/code.
 Logged
tppramod
Newbie

Offline

Posts: 4

 « Embed this message Reply #6 on: January 16, 2008, 04:27:17 pm » posted from:New Delhi,Delhi,India

Thanks a lot for your valuable inputs.  Let me try coding at my end..  will revert in case of trouble.

Regards,

Pramod
 Logged
teacher/web course designer
Newbie

Offline

Posts: 11

environment, computers, gardening, politics, Africa

 « Embed this message Reply #7 on: May 07, 2009, 02:49:36 pm » posted from:HÃ¤rnÃ¶sand,Vasternorrlands Lan,Sweden

The topic here gave me the idea that it might be about "winnowing" which is the process where some one cleans harvested seeds from chaff and dirt by throwing or pouring the mixture while there is a wind. The lighter stuff blows away.

THAT would be a more constructive thing that I would like to see.
 Logged
 Pages: [1]   Go Up
A man paints with his brains and not with his hands. ..."Michelangelo (1475-1564, Italian sculptor, painter, architect and poet)"