From 3780f0c36732e6e6d24aca6beb2e1b1dbcfe90a1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Cooper" Date: Tue, 21 Feb 2017 12:51:57 -0500 Subject: [PATCH] added HW4 --- HW4/README.md | 37 ++++++ HW4/collar_mass.svg | 270 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 307 insertions(+) create mode 100644 HW4/README.md create mode 100644 HW4/collar_mass.svg diff --git a/HW4/README.md b/HW4/README.md new file mode 100644 index 0000000..f9c6f19 --- /dev/null +++ b/HW4/README.md @@ -0,0 +1,37 @@ +# Homework #3 +## due 3/1/17 by 11:59pm + + +1. Use your repository 'roots_and_optimization'. Document all the HW4 work under the +heading `# Homework #4` in your `README.md` file + + a. Create a function called 'collar_potential_energy' that computes the total + potential energy of a collar connected to a spring and sliding on a rod. As shown in + the figure given a position, xc, and angle, theta: + + ![Collar-mass on an inclined rod](collar_mass.svg) + + The spring is unstretched when $x_{C}=0.5$. The potential energy due to gravity is: + + $PE_{g}=m x_{C}g\sin\theta$ + + where m=0.5 kg, and g is the acceleration due to gravity, + + and the potential energy due to the spring is: + + $PE_{s}=1/2K (\Delta L)^{2}$ + + where $\Delta L = 0.5 - \sqrt{0.5^{2}+(0.5-x_{C})^{2}}$ + + b. Use the `goldmin.m` function to solve for the minimum potential energy at xc when + theta=0. *create an anonymous function with `@(x) collar_potential_energy(x,theta)` in + the input for goldmin. Be sure to include the script that solves for xc* + + c. Create a for-loop that solves for the minimum potential energy position, xc, at a + given angle, theta, for theta = 0..90 degrees. + + d. Include a plot of xc vs theta. `plot(theta,xc)` with + + `![Steady-state position of collar on rod at angle theta](plot.png)` + +3. Commit your changes to your repository. Sync your local repository with github. diff --git a/HW4/collar_mass.svg b/HW4/collar_mass.svg new file mode 100644 index 0000000..cc18c3d --- /dev/null +++ b/HW4/collar_mass.svg @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + xc + + + + + + + + 𝝷 + + + L0=0.5m + +