Talk:Pendulum (mathematics)

From Wikipedia, the free encyclopedia

[edit] Plots

I don't think the Figure 4 is right, because you see, the deviation should increase ever more with the increasing angle amplitude and reach Infinity at amplitude Pi, so the derivative of such graph never starts bending to the right, but it is always convex. -Bole79 12:59, 11 January 2007 (UTC)

I made the picture. To tell the truth, I wasn't really sure about the result I got, but I just plotted the formula in the document. To check whether I made any mistake, you can click on the picture and you'll find the approach and the code I have used to make it. Find what is wrong (in the article or in my code) and I will fix it Alessio Damato 13:08, 11 January 2007 (UTC)
Damato made a mistake in using SIN(Theta)/2 instead of SIN(Theta/2). The new plot is now correct. Here is the code for the MATLAB function.
function pendulum(sup,res)
%PENDULUM   Computes the ratio T/T0 for the pendulum period
%       and plots the graphic in the interval ]0, sup]
%
%     T0 = 2*pi*sqrt(L/g) is the period linear approximation
%     T = 4*sqrt(L/g)*K(k), with k = sin(theta0/2), where
%        theta0 is the pendulum amplitude, and
%        K(k) is the complete elliptic integral of the first kind
%
%   INPUT: SUP = upper limit in radians (less than pi)
%          RES = number of points used for the calculus
%             If not all arguments are passed to the function  
%             the defaults values will be:
%               SUP = pi/2
%               RES = 1000
%
%   Examples:
%       pendulum
%         Uses the interval ]0, pi/2] subdivided in 1000 parts
%         These are the default values
%
%       pendulum(0.999*pi)
%         Uses the interval ]0, 0.999*pi] subdivided 1000 parts
%
%       pendulum(pi/2,2000)
%         Uses the interval ]0, pi/2] subdivided in 2000 parts
%
if nargin < 2, res = 1000; end
if nargin < 1, sup = pi/2; end
if sup >= pi
    disp('ERROR: The upper limit must be less than pi.');
    return
end

phi=pi/2; % integration upper limit
for i=1:res
    theta0=i*sup/res; % theta0 is the pendulum amplitude
    k = sin(theta0/2);
    F = @(t) 1./sqrt(1-(k*sin(t)).^2);
    T(i)=quad(F,0,phi); % numerical integration 
end
T = 2./pi.*T; % computes the ratio
deg = 180/pi*sup*(1:res)./res; % conversion to degrees

plot(deg,T,'LineWidth',2.0); grid on;
xlabel('\fontsize{12}\bf{\theta_0} (deg)');
ylabel('\fontsize{12}\bfT / T_0');


Rui Ferreira 19:48, 15 April 2007 (UTC)

Thanks a lot for noticing the mistake and providing the right Matlab code. As you have seen, I have put in the article the right SVG version of the plot, more similar to the one that was there previously but (hopefully!) without mistakes. If you provide the Matlab code for the other plot you have added, I can create an SVG version of that as well. Bye Alessio Damato 20:06, 16 April 2007 (UTC)

[edit] The formula for the elliptic function for T under Arbitary-amplitude period

Using excel I have tried to plot the function given for T My graph peaks at 180 degrees and there is no sign of it going to infinity. The equation which seems to fit with the curve in fig 4 is as follows:-

           Replace (SIN(Theta/2))^2    with  ((SIN(Theta))/2)^2
           Replace (SIN(Theta/2))^4    with  ((SIN(Theta))/2)^4
           Replace (SIN(Theta/2))^6    with  ((SIN(Theta))/2)^6

and so on

With five terms this gives a curve very similar to Figure 4 otherwise I could not repeat the curve shown. (it went to 1.488 not 1.073) Regards

John wayman 00:09, 12 February 2007 (UTC)

[edit] System circle

This section started with "An alternative view by Calgea 19:02, 13 May 2007 (UTC))", which leads me to suspect it may be original research. I've removed the sig, but could someone with more mathematical knowledge than me check this and see whether this mathematically correct, or just a pet theory. Thanks. I'll ask Calgea (a new user) to comment. – Tivedshambo (talk) 21:34, 13 May 2007 (UTC)