Explore BrainMass

Explore BrainMass

    Simple Harmonic Motion: Write a program to integrate an equation

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    See the attached file for the formulas.

    Determine an appropriate step size h by assuming that an h that works as expected for simple harmonic motion is good enough for the given initial angle. In particular, if the position at the end of one period is within 0.1% of the original point, we'll be satisfied.

    © BrainMass Inc. brainmass.com November 24, 2022, 11:38 am ad1c9bdddf


    Solution Preview

    See attached file.

    I chose to solve this using Euler's method. First you have to convert the second-order ODE into two first-order ODEs.

    Let v = theta'

    Since theta'' = v', v' = -(g/l)*theta.

    With me this far? Please try to make the above make sense to you. All we are doing is breaking the problem up into two smaller problems.

    Now we have to iterate with the following (where i denotes the discrete time interval):

    theta[i+1] = ...

    Solution Summary

    The solution provides good explanations and alternative methods used in solving the problems.