Sure, grhodes actually showed you how to do this when he was talking about damping. Just modify the torque (or angluar acceleration) to include more forces than gravity into the equation. To let the user control the swing with a paddle you could simply add a value to the torque when the paddle is in one direction an subtract the same value when in the other.
Pendulum
try linearisation ( spelling ??? ) its a classical example in theory for a non linear system solving ( the pendulum )
Okay now I have
m*l*l*theta_double_dot + friction * theta_dot + m*g*l*sin theta = 0 but how do i solve it?
m*l*l*theta_double_dot + friction * theta_dot + m*g*l*sin theta = 0 but how do i solve it?
Numerical methods, since the equation that you just presented is more complex than the one originally proposed. Look for more numeric integration methods and see what you can find, since I haven''t implemented any of these systems myself.
Brendan
Brendan
Brendan"Mathematics is the Queen of the Sciences, and Arithmetic the Queen of Mathematics" -Gauss
February 11, 2003 04:24 PM
The simplest approach is Euler integration, like grhodes described above. Starting with theta(t0), theta_dot(t0), you can calculate theta_double_dot(t0). Next, approximate theta_dot(t0+dt) = theta_dot(t0) + theta_double_dot(t0)*dt, and theta(t0+dt) = theta(t0) + theta_dot(t0)*dt. Smaller dt will give better approximation. Repeat until you reach the wanted time t = t0+n*dt.
The equations of motion for a pendulum can be expressed in terms of elliptic functins (sn, cn etc). Surely there are some decent libraries to compute them out there.
quote:
Original post by v71
try linearisation ( spelling ??? ) its a classical example in theory for a non linear system solving ( the pendulum )
Yes, but Keem did start out with a linearized solution. The linearized solution to the pendulum problem cannot model a pendulum that rotates fully over-the-top in some cases.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
quote:
Original post by sQuid
The equations of motion for a pendulum can be expressed in terms of elliptic functins (sn, cn etc). Surely there are some decent libraries to compute them out there.
Those are the linearized solutions, which, as discussed through this thread, cannot model the behavior that Keem desires (pendulum that not only oscillates about its equilibrium point, but also can be forced to rotate fully 360 degrees).
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Could you not treat the problem as a circular motion problem?
the speed at any point on the path is then
v^2 = u^2 - 2gr(1 - cos theta)
where u is the initial speed of the pendulum and r is the radius(length of rod).
This equation is derived using conservation of energy principles. It can be possible to determine if the pendulum goes over the top if the following condition is met:
u^2 > 4gr
If this is not the case then the maximum angle obtained can be found by setting v = 0 in the top equation.
the speed at any point on the path is then
v^2 = u^2 - 2gr(1 - cos theta)
where u is the initial speed of the pendulum and r is the radius(length of rod).
This equation is derived using conservation of energy principles. It can be possible to determine if the pendulum goes over the top if the following condition is met:
u^2 > 4gr
If this is not the case then the maximum angle obtained can be found by setting v = 0 in the top equation.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement