Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the function theta_discrete(theta_0, delta, num_points) below , which should create a discretized array of values from 0 to 00. Also implement pendulum_I(theta, theta_0) ,

Implement the function theta_discrete(theta_0, delta, num_points) below, which should create a discretized array of values from 0 to 00. Also implement pendulum_I(theta, theta_0), which should take a discrete array created by theta_discrete and a value of theta_0, and return an array for the integrand (,0)I(,0).

image text in transcribed

image text in transcribed

The motion of a simple pendulum is given by the differential equation where 0 is the angle of the pendulum with the vertical, so at 0 = 0 the pendulum hangs straight down. If we make the small-angle approximation sin e re, then we can solve the equation and find o(t). This gives us the expression for the period T, which is the time for the pendulum to complete one cycle: T=22 T = 2 Without the small-angle approximation, there is no analytic solution to the pendulum equation! However, the equation is integrable; we can solve its motion in terms of (difficult) integrals. In particular, the general formula for the period of a pendulum is T=472e le cos o cos or do where Do is the initial position from which the pendulum is released. This integral has no analytic solution, but we can try to do it numerically. Part A (6 points) Let's start by rewriting the formula above as two different pieces: I do T=4/7 S 10,) de I(0,60) = cos 0 cos 6c It will be instructive to look at the integrand I(0,00) itself, before we actually try to do the integral. We can already see that I will blow up when 0 = 60, as the denominator becomes zero. We can't let division by zero happen in our numerical integration, so let's solve the problem by introducing a cutoff to the integral. Introducing a new parameter 8, we write: Oo-s T(S) =4 / * * 1(0,) de and then the answer we want is T = lim so T(S). To evaluate the integral, we need a discrete set of points 0 over the range (0,00 0), and then the array I(0,00) using the discrete 0. Let's set up some functions to handle that for us. Implement the function theta_discrete (theta_0, delta, num_points) below, which should create a discretized array of O values from 0 to 00 8. Also implement pendulum_I(theta, theta_0), which should take a discrete array created by theta_discrete and a value of theta_0, and return an array for the integrand I(0,00). (These should be pretty short functions! But using functions like this helps to clarify what our intentions are when we write the program. It also lets us specify default values for things like delta , while still letting us change the value later.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Development Of Knowledge Framework For Affective Content Analysis

Authors: Swarnangini Sinha

1st Edition

B0CQJ13WZ1, 979-8223977490

More Books

Students also viewed these Databases questions

Question

Describe the five elements of the listening process.

Answered: 1 week ago