cs201 - programming i fall 2017 project 2 - mechanical ...cs201 - programming i fall 2017 project 2...

2
CS201 - Programming I Fall 2017 Project 2 - Mechanical Optimization In our second project we will solve for the states of a me- chanical system than includes some hard constraints. Look at the diagram at the end - here is a description (please read carefully, some detail may be missing from the diagram) * This is a teeter-totter contraption, with balls free to roll in grooves along each side. The pivot is 3 units above the ground, the rails on either side (on which the balls roll) are 4 units long. * The balls have diameter 1.0 unit. Each rolls without friction. * There are three barriers, which are vertical with respect to the channels. They act as stops for the balls. * The springs both have different force constants (K1 and K2), however they each have the same unstretched length of 3 units. * The springs exactly obey Hooke's Law, the stretch energy is S.E. = 1/2 * K * (L-L0)^2, and the potential energy due to gravity is simply G.E. = Mh (with height measure against some arbitrary reference). Note that in these arbitrary units the acceleration due to gravity is 1. Problem 1: Choose a minimal number of variables that complete- ly specify the static state of your system. (That number is three.) Compute the final state of the system for m1 = 10, k1 = 10., and for all combinations of: k2 in range 1-40 (with steps of 3), and m2 in range 10-100 (with steps of 5). (This implies a total of 266 values.) Show your result as a heatmap of one of your selected degrees of freedom, as a function of k2 and m2. - 1 -

Upload: others

Post on 23-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS201 - Programming I Fall 2017 Project 2 - Mechanical ...CS201 - Programming I Fall 2017 Project 2 - Mechanical Optimization In our second project we will solve for the states of

CS201 - Programming IFall 2017

Project 2 - Mechanical Optimization

In our second project we will solve for the states of a me-chanical system than includes some hard constraints.

Look at the diagram at the end - here is a description (pleaseread carefully, some detail may be missing from the diagram)

* This is a teeter-totter contraption, with balls free to rollin grooves along each side. The pivot is 3 units above theground, the rails on either side (on which the balls roll) are4 units long.

* The balls have diameter 1.0 unit. Each rolls withoutfriction.

* There are three barriers, which are vertical with respect tothe channels. They act as stops for the balls.

* The springs both have different force constants (K1 and K2),however they each have the same unstretched length of 3 units.

* The springs exactly obey Hooke's Law, the stretch energy isS.E. = 1/2 * K * (L-L0)^2, and the potential energy due to gravity is simply G.E. = Mh (with height measure against some arbitrary reference). Notethat in these arbitrary units the acceleration due to gravityis 1.

Problem 1: Choose a minimal number of variables that complete-ly specify the static state of your system. (That number isthree.) Compute the final state of the system for m1 = 10, k1 =10., and for all combinations of: k2 in range 1-40 (with stepsof 3), and m2 in range 10-100 (with steps of 5). (This impliesa total of 266 values.) Show your result as a heatmap of oneof your selected degrees of freedom, as a function of k2 andm2.

- 1 -

Page 2: CS201 - Programming I Fall 2017 Project 2 - Mechanical ...CS201 - Programming I Fall 2017 Project 2 - Mechanical Optimization In our second project we will solve for the states of

Problem 2: Examining the raw output of the optimizer, are allof the results physically reasonable? (NOTE - this will dependon how you chose initial conditions for the optimizer.) Ifnot, can you suggest what is going wrong, and how you can rem-edy the problem?

HINTS: * The state variables you need for this system are reasonablyobvious - follow your intuition!

* You need to impose inequality constraints to properly incor-porate all the physics. With a good choice of variables to de-scribe the state (three in number!) you will need six con-straints (although you may be OK with only four).

* Do not worry that the springs are not generally perpendicu-lar to the ground as the device pivots - simplify by just us-ing the height of the end of each spring to compute its devia-tion from relaxed length. Also, assume that each spring takesup no space when fully compressed (i.e. each side of theteeter totter can go all the way to the ground).

- 2 -