View previous topic :: View next topic |
Author |
Message |
rklee Uber-Karma
Joined: 11 Sep 2003 Posts: 495 Location: Malvern, PA Pittsburgh, PA
|
Posted: Sat Nov 22, 2003 7:47 pm Post subject: Modeling physical things on computer |
|
|
I think some of you know I'm taking a class called Numerical Methods right now. It's really quite fun modeling real things on the computer. I recently accomplished a simple program that models an object on a string given different initial conditions. Maybe you'll find this interesting... cause I certainly do.
http://www.qualityimporting.com/public/temp/output.wrl
it's a VRML File... you need a plugin. Virtual Reality Modeling Language
http://www.parallelgraphics.com/products/cortona/
If you're interested this is created using Runge Kutta 4th (Classic Runge Kutta) which is the same method most analysis programs use to integrate functions numerically and even to model other functions.
Do you guys know what True Type Fonts use? They're all based on functions I know that but... anyone know how it's modeled? _________________ "My Heart Is In the Work" - Andrew Carnegie |
|
Back to top |
|
|
rklee Uber-Karma
Joined: 11 Sep 2003 Posts: 495 Location: Malvern, PA Pittsburgh, PA
|
Posted: Sat Nov 22, 2003 7:53 pm Post subject: |
|
|
I forgot to mention, that file is done for approx 100 seconds with an integration iteration every 0.01 seconds. It takes 4 slope approximations to calculate the next step and it also uses 6 state equations, x,y,z, vx, vy,vz. Therefore it's at least 40000 slope functions * approximately 20 calculations for each. So I would say it's in the order of 10^5 or 10^6th calculations.
So that is a mass of 1kg gravity of 9.8m/s^2 spring constant of 10N/m initial spring length of 2m. Also the spring is attached to 0,0,0.
It is done with initial conditions of x = 1, y = -2 (downwards), z=0, vx=0 vy=0 vz=1m/s.
Interesting right? There are some that don't repeat so much but this is an interesting pattern. _________________ "My Heart Is In the Work" - Andrew Carnegie |
|
Back to top |
|
|
Mogri Uber-Karma
Joined: 12 Sep 2003 Posts: 535 Location: Malvern & Philadelphia, PA
|
Posted: Sun Nov 23, 2003 1:59 pm Post subject: |
|
|
So that's a single equation? _________________ "A club without the right direction, is a misguided stick."
-- Master Wham |
|
Back to top |
|
|
rklee Uber-Karma
Joined: 11 Sep 2003 Posts: 495 Location: Malvern, PA Pittsburgh, PA
|
Posted: Sun Nov 23, 2003 11:45 pm Post subject: |
|
|
Not really.
It's based on basically two forces right now, Gravity and spring force. So you get 3 equations at first, Force in x = blah force in y = blay force in z = blah. However you don't plot forces (accelerations) so from those three equations u get can break it down into 6 first order equations (only one derivative) from those you can get the position at any point in time. It's too complicated a problem to get an exacct answer to. You need an iterative process to model it.
I have been playing with it to give it like a wind blowing on it once in a while to see how it moves... and it's actually quite interesting to see it swinging in the wind. _________________ "My Heart Is In the Work" - Andrew Carnegie |
|
Back to top |
|
|
rklee Uber-Karma
Joined: 11 Sep 2003 Posts: 495 Location: Malvern, PA Pittsburgh, PA
|
Posted: Sun Nov 23, 2003 11:51 pm Post subject: |
|
|
Not really.
It's based on basically two forces right now, Gravity and spring force. So you get 3 equations at first, Force in x = blah force in y = blay force in z = blah. However you don't plot forces (accelerations) so from those three equations u get can break it down into 6 first order equations (only one derivative) from those you can get the position at any point in time. It's too complicated a problem to get an exacct answer to. You need an iterative process to model it.
I have been playing with it to give it like a wind blowing on it once in a while to see how it moves... and it's actually quite interesting to see it swinging in the wind. _________________ "My Heart Is In the Work" - Andrew Carnegie |
|
Back to top |
|
|
|