Skip to content

Homework 4 Update #8

Merged
merged 9 commits into from
Feb 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 37 additions & 0 deletions HW4/README.md
Original file line number Diff line number Diff line change
@@ -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.png)

The spring is unstretched when x_C=0.5 m. 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/2\*K \*(DL)^2

where DL = 0.5 - sqrt(0.5^2+(0.5-x_C)^2) and K=30 N/m.

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.
Binary file added HW4/collar_mass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
270 changes: 270 additions & 0 deletions HW4/collar_mass.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions lecture_10/lecture_10.aux
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Springs-masses\relax }}{4}{figure.caption.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Automate Gauss Elimination}{6}{subsection.1.2}}
\newlabel{automate-gauss-elimination}{{1.2}{6}{Automate Gauss Elimination}{subsection.1.2}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Problem (Diagonal element is zero)}{6}{subsection.1.3}}
\newlabel{problem-diagonal-element-is-zero}{{1.3}{6}{Problem (Diagonal element is zero)}{subsection.1.3}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.3.1}Spring-Mass System again}{8}{subsubsection.1.3.1}}
\newlabel{spring-mass-system-again}{{1.3.1}{8}{Spring-Mass System again}{subsubsection.1.3.1}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Problem (Diagonal element is zero)}{7}{subsection.1.3}}
\newlabel{problem-diagonal-element-is-zero}{{1.3}{7}{Problem (Diagonal element is zero)}{subsection.1.3}{}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.3.1}Spring-Mass System again}{9}{subsubsection.1.3.1}}
\newlabel{spring-mass-system-again}{{1.3.1}{9}{Spring-Mass System again}{subsubsection.1.3.1}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Springs-masses\relax }}{9}{figure.caption.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4}Tridiagonal matrix}{9}{subsection.1.4}}
\newlabel{tridiagonal-matrix}{{1.4}{9}{Tridiagonal matrix}{subsection.1.4}{}}
\gdef \LT@i {\LT@entry
{2}{67.64778pt}\LT@entry
{2}{61.69104pt}\LT@entry
{1}{261.39424pt}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4}Tridiagonal matrix}{10}{subsection.1.4}}
\newlabel{tridiagonal-matrix}{{1.4}{10}{Tridiagonal matrix}{subsection.1.4}{}}