This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

uboiz
uboiz presents ...

2012/1/14

Simple Pendulum Simulation

Someday, I had to show for second time, now to Brawijaya Physics's students what I was knowed about Pendulum simulation. Startly that goes be well and I not have problem anything about coding. Then, when we want to enter the theoretically physics concept to Pendulum....ha.. ha :D, I was forgeted about that method and our work can't be completed. After that, I looking to the reference that explained this method for second time and finally this is our simulation. How Great God that created human to need each other not only once?

6432 views / 27 in the last 7 days

2 votes | 0 in the last 7 days

Tags: mouse simulation physics demo with-source

open in greenfoot
Your browser does not support the canvas tag.
mikeyboymikeyboy

2012/10/10

Yeah, its just finding away to incorporate that into the code as I don't know java very well :/
gusbus123gusbus123

2012/10/10

Simple way is to add a variable called gravity that = 1. Then every time it reaches the highest point of which it can go the amount of force applied for it to go back around the other way is reduced by the amount of gravity there is.
gusbus123gusbus123

2012/10/10

Or another way of doing it which will make the gravity change as it moves up and down would go something like this. initiate a variable called gravity that = 0. have a check in the act that will make the gravity be equal to : (length of wire - distance between y coordinates of center point and the ball) / 10. Then make a check in the area of code where it applies the force which will do : If the ball is going downwards (Dipping down in the U shape) the force applied will + the amount of gravity there is. Otherwise if the ball is going upwards the force applied will - the amount of gravity.
gusbus123gusbus123

2012/10/10

By the way i do not understand what your code is saying that is why i am not giving you a fully formated piece of code to you, what i have given you is based on the information i can see from watching what the scenario is doing.
MatheMagicianMatheMagician

2012/10/10

I would like it (if you haven't already) if you implemented the equation for the period of a pedulum: that is 2*PI*sqrt(Length of string (in meters)/9.8 meters per sec)
MatheMagicianMatheMagician

2012/10/10

That is all in meters and assuming you are doing this on earth: so if you want to change it to your own variables, the basic equation is this: 2*PI*sqrt(length of pendulum/Gravitational acceleration)
sp33dysp33dy

2012/10/10

That's the problem I face.. I don't know the math or have time to figure it out.
SPowerSPower

2012/10/10

Once the ball moves, it doesn't stop anymore. Not so realistic.
Game/maniacGame/maniac

2012/10/10

pretty good
mikeyboymikeyboy

2013/2/13

Is there anyone that can look at this code, try and understand it, and then suggest ways of incorporating gravity so the pendulum will slow down to a stop, rather than continuously?

See all comments

Want to leave a comment? You must first log in.

Who likes this?

reva.shikenna Game/maniac