http://scratch.mit.edu/projects/thecooltodd/127882
Any ideas? I describe what I need help with on the project notes.
Offline
I just glanced at the scripts, and haven't figured out specifically what the problem is, but i didn't see any kind of "dt" (time step) variable or wait step, so it could be a case where the equations are going unstable. I may be wrong, though. Looks like a good start of a project.
Offline
Actually, switch the sin and cos functions used to compute vx1 and vy1, and see how that works...
Offline
chalkmarrow wrote:
I just glanced at the scripts, and haven't figured out specifically what the problem is, but i didn't see any kind of "dt" (time step) variable or wait step, so it could be a case where the equations are going unstable. I may be wrong, though. Looks like a good start of a project.
I guess the time variable would just be how long each loop is.
Offline
chalkmarrow wrote:
Actually, switch the sin and cos functions used to compute vx1 and vy1, and see how that works...
If I did that then Vy would have a value when it is pointing straight down and Vx would have a value if the pendulum is horizontal.
Offline
Would you object to using the Rotational Intertial approach? It turns out to be much simpler. With that approach, you just look at the gravitational torque that is being applied to the rotational system and use rotational inertial (mR^2) and the rotational form of Newtons second law instead of the usual F=ma.
If you want to go that way, I can probably get you something working pretty fast.
Offline
I have just created a project that simulates a pendulum.
http://scratch.mit.edu/projects/archmage/128694
You can check it out if you want. There isn't a lot of code in it.
Offline
Cool thanks. The only thing is that uses angular velocity... I need a pendulum that breaks down the X and Y components. Unless you wanna try make a double pendulum without that?
Offline
You never said you wanted a double pendulum. Are you going to use this for anything specific?
Offline
A double pendulum?
Offline
archmage wrote:
You never said you wanted a double pendulum. Are you going to use this for anything specific?
Possibly for my next science fair project.
Offline
Mayhem wrote:
A double pendulum?
Search for it on youtube ;D
Offline
Oh, like this?
http://scratch.mit.edu/projects/Mayhem/129626
Offline
Here's some nice GIFs I found:
http://i144.photobucket.com/albums/r162/thecooltodd/doublepe.gif
http://i144.photobucket.com/albums/r162/thecooltodd/Double-compound-pendulum.gif
Offline
Yep. That's a pretty non-linear system. I'd be impressed if someone could simulate that in Scratch such that it actually runs at a reasonable rate. The matrix method is pretty straightforward, so that might be a good start...
Offline
What's the matrix method? If it involves a matrix it would be a lot harder to do in Scratch...
Offline
Well, this is the closest I can get to one:
http://scratch.mit.edu/projects/thecooltodd/131516
lol
Offline
It turns out to be pretty complicated. Maybe something only paddle2see or canthiar could do
Here's a good link for the governing equations:
http://www.myphysicslab.com/dbl_pendulum.html
Offline
Thanks. I found several websites like that as well. How fast could scratch calculate these though?
θ1'' = −g (2 m1 + m2) sin θ1 − m2 g sin(θ1 − 2 θ2) − 2 sin(θ1 − θ2) m2 (θ2'2 L2 + θ1'2 L1 cos(θ1 − θ2))
L1 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))
θ2'' = 2 sin(θ1 − θ2) (θ1'2 L1 (m1 + m2) + g(m1 + m2) cos θ1 + θ2'2 L2 m2 cos(θ1 − θ2))
L2 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))
Offline
Btw, here are some other links:
http://scienceworld.wolfram.com/physics/DoublePendulum.html
http://www.maths.surrey.ac.uk/explore/michaelspages/Double.htm
Offline
thecooltodd wrote:
Thanks. I found several websites like that as well. How fast could scratch calculate these though?
θ1'' = −g (2 m1 + m2) sin θ1 − m2 g sin(θ1 − 2 θ2) − 2 sin(θ1 − θ2) m2 (θ2'2 L2 + θ1'2 L1 cos(θ1 − θ2))
L1 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))
θ2'' = 2 sin(θ1 − θ2) (θ1'2 L1 (m1 + m2) + g(m1 + m2) cos θ1 + θ2'2 L2 m2 cos(θ1 − θ2))
L2 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))
As g, and the mass of the two pendulems, and the lengths are constant, you can simplify the equations a lot before putting them into scratch.
EG, taking G as 10, and both pendulems as mass 1 and length 1, you get:
θ1'' = −30 sin θ1 − 10 sin(θ1 − 2 θ2) − 2 sin(θ1 − θ2) 10 (θ2'2 + θ1'2 cos(θ1 − θ2))
(3 − cos(2 θ1 − 2 θ2))L1 (3 − cos(2 θ1 − 2 θ2))
(I think)
(though shouldn't there be a "t" for time in there somewhere?)
Offline
T is actually not required for time because I'm not sure if you're familiar with calculus or not, but when it has a quotation mark that is suppose to mean second derivative, which is acceleration. So I simply make the rotational speed change by the rotational acceleration and have a separate script always changing the position by the rotational speed.
Offline
Anyways, does anyone understand the Lagrangian equation? Because actually I believe I may be able to simplify (by my definition of simplify) the overall angular acceleration equation. But I need to be sure how to use Lagrangian equations to do that...
Offline
But surely the acceleration changes as time passes... I would have thought time would be one of your basic variables in such an equation. The only variable, in a given set up, in fact.
Offline
I haven't been checking the website for a while and Chalkmarrow pointed me to this thread.
Regarding time. Normally in physics simulations you don't have to calculate the second derivative because you don't do the simulations using absolute time, it's normally done using delta times. Then you only calculate the movement made during that delta time.
Is this just to do a simulation or is it to create an equation for the path of the pendulums? If it is just for simulation I would do it using impulses and moments of inertia. Then it wouldn't matter how many pendulums were linked to one another. I think I will take a look at that approach some time today.
Offline