Question

In: Physics

In Group Project C of Chapter 4, it was shown that the simple pendulum equation: y''(t)...

In Group Project C of Chapter 4, it was shown that the simple pendulum equation:

y''(t) + siny(t) = 0

has periodic solutions when the initial displacement and velocity are small. Show that the period of the solution may depend on the initial conditions by using the vectorized Runge–Kutta algorithm with h 0.02 to approximate the solutions to the simple pendulum problem on for the initial conditions:

a) y(t) = 0.1 y'(t) = 0

b) y(t) = 0.5 y'(t) = 0

c) y(t) = 1.0 y'(t) = 0

Solutions

Expert Solution

Code to solve and plot the ode using python

Here, we have plotted the solution for t from 0 to 50. By counting the number of peaks in the plot, we can compare the time period of the pendulum.

#!usr/bin/env/python
#Runge-Kutta Method

import numpy as np
import matplotlib.pyplot as plt

"""defining the fucntion to be sin(y(t))"""

def func(t,x):

    return -np.sin(x)

def frange(start, stop, step):
   x = start
   while x < stop:
       yield x
       x += step
"""solving and plotting the solution for y"(t) = sin(y(t)) by rung-kutta 4 point algorithm"""
def rksolve(init1,init2):
    h = 0.02
    t = map(float,frange(0,50,h))
    x = [init1]
    y = [init2]
    """calculating y(t) derivatives"""
    for i in range(len(t)-1):
        s1 = func(t[i],x[i])
        s2 = func(t[i] + h/2,x[i] + h/2 * s1)
        s3 = func(t[i] + h/2,x[i] + h/2 * s2)
        s4 = func(t[i] + h,x[i] + h * s3)
        y.append(y[i] + h/6*(s1 + s4 + 2 * ( s2 + s3 )))
        s1 = y[i]
        s2 = y[i] + h/2 * s1
        s3 = y[i] + h/2 * s2
        s4 = y[i] + h * s3
        x.append(x[i] + h/6*(s1 + s4 + 2 * ( s2 +s3)))
    """calculating y values"""
    plt.plot(t,x,'r')
    plt.plot(t,[0 for i in t],'b')
    plt.show()
    return(0)
rksolve(0.1,0)
rksolve(0.5,0)
rksolve(1.0,0)

The output plots are as follows:(shown in the order of execution)

It is clear from the figure that initial condition A had more peaks (number of peak = 8) than condition B (number of peak =7.5) and c(number of peak =7) had. So, time period had a trend of Tc > Tb > Ta. Timeperiod depends on initial condition.


Related Solutions

Why is mass not a factor in the equation for the period of a simple pendulum?
Why is mass not a factor in the equation for the period of a simple pendulum?
an LTIC system is specified by the equation (D2 +4D + 4)y(t) = Dx(t) with initial...
an LTIC system is specified by the equation (D2 +4D + 4)y(t) = Dx(t) with initial condition y'(0) = -4... How do I find the other initial condition?
The period T of a simple pendulum is given by T=2π√L/g where L is the length...
The period T of a simple pendulum is given by T=2π√L/g where L is the length of the pendulum and g is the acceleration due to gravity. Assume that g = 9.80 m/s^2 exactly, and that L, in meters, is lognormal with parameters μL = 0.6 and σ^2L=0.05. NOTE: This is a multi-part question. Once an answer is submitted, you will be unable to return to this part. Find the mean of T. Find the median of T. Find the...
Let   y(t) = (1 + t)^2 solution of the differential equation y´´ (t) + p (t) y´...
Let   y(t) = (1 + t)^2 solution of the differential equation y´´ (t) + p (t) y´ (t) + q (t) y (t) = 0 (*) If the Wronskian of two solutions of (*) equals three. (a) ffind p(t) and q(t) (b) Solve y´´ (t) + p (t) y´ (t) + q (t) y (t) = 1 + t
DIFFERENTIAL EQUATIONS A simple pendulum is an example of a free, damped vibration. Derive the equation...
DIFFERENTIAL EQUATIONS A simple pendulum is an example of a free, damped vibration. Derive the equation of motion of a simple pendulum of mass m and length l, displaced a small angle (<15o) from equilibrium in a viscous medium of damping constant b. Devise an experimental means of determining the damping constant and find this value for air. PLEASE SHOW THE COMPLETE PROCEDURE OF THE DIFFERENTIAL EQUATION SOLUTION
Solve the frictionless pendulum equation use Runge- kuta 4 or forward Euler ly'' = -g*sin(y) where...
Solve the frictionless pendulum equation use Runge- kuta 4 or forward Euler ly'' = -g*sin(y) where g is gravitational acceleration and l is the length of the pendulum. The function y(t) represents the angle of the pendulum with respect to the vertial and y'(t0 the angular velocity. You will need to write the second-order equation as a system of two first-order equations, and you will need to write a function file that will evaluate this system of equations. Plot the...
Solve the frictionless pendulum equation use Runge- kuta 4 or forward Euler ly'' = -g*sin(y) where...
Solve the frictionless pendulum equation use Runge- kuta 4 or forward Euler ly'' = -g*sin(y) where g is gravitational acceleration and l is the length of the pendulum. The function y(t) represents the angle of the pendulum with respect to the vertial and y'(t0 the angular velocity. You will need to write the second-order equation as a system of two first-order equations, and you will need to write a function file that will evaluate this system of equations. Plot the...
Find the general solution of this differential equation: y'''+y''+y'+y=4e^(-t)+4sin(t)
Find the general solution of this differential equation: y'''+y''+y'+y=4e^(-t)+4sin(t)
Find the general solution to the differential equation. y'=xy/x−4 y(x)=C⋅ ...
Find the general solution to the differential equation. y'=xy/x−4 y(x)=C⋅ ...
Given the following economy: Y = C(Y - T) + I(r) + G C(Y - T)...
Given the following economy: Y = C(Y - T) + I(r) + G C(Y - T) = a + b(Y - T) I(r) = c - dr M/P = L(r,Y) L(r,Y) = eY - fr i. Solve for Y as a function of r, the exogenous variables G and T, and the model's parameters a, b, c, and d. ii. Solve for r as a function of Y, M, P, and the parameters e and f. iii. Derive the aggregate...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT