Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Resonance Introduction at SacPy

224 views

Published on

SacPy presentation by Jason Moore and Kenneth Lyons on November 9th, 2017.

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Resonance Introduction at SacPy

  1. 1. Resonance An Interactive Textbook and Software Library for Learning About Mechanical Vibrations SacPy Thursday, November 9th, 2017 Jason K. Moore and Kenneth Lyons Mechanical and Aerospace Engineering Department University of California, Davis
  2. 2. What are Mechanical Vibrations?
  3. 3. What are Mechanical Vibrations?
  4. 4. What are mechanical vibrations?
  5. 5. What are mechanical vibrations?
  6. 6. What are mechanical vibrations?
  7. 7. Class Description ● Upper level elective (juniors and seniors) ● 10-30 students ● 4 hours per week, 10 weeks + 1 exam week ● Prereqs: dynamics and programming ● Assessment ○ In class notebook exercises ○ Weekly homeworks ○ Midterm exam ○ Class project ● Course website: https://moorepants.github.io/eng122/
  8. 8. Learning Objectives 1) Students will be able to analyze vibrational measurement data to draw conclusions about the measured system's vibrational nature and describe how the system behaves vibrationally. 2) Students will be able to create simple mathematical and computational models of real vibrating systems that can be used to answer specific questions about the system by concisely demonstrating the vibrational phenomena. 3) Students will be able to design a mechanical structure that has desirable vibrational behavior. Key aspect is the order of these topics and that we do not have an objective associated with analytical understanding of the concepts.
  9. 9. Course Design ● That students can learn about mechanical vibrations engineering through "computational thinking" and "computational experimentation", i.e. actively interacting with a computer by writing code to simulate and analyze computational models and experimental data. ● That the computer allows students to solve vibration engineering problems without knowing all of the mathematical theory a priori. This means that we can motivate students to dig deeper into the theory and by presenting it posteriori when the motivation is high. The students will be introduced to data analysis techniques to study vibrations before analytical techniques. ● Students learn best by doing. The content is meant to used in class while the instructors act as a coach through the learning. ● That each lesson should have a motivated real life example that drives the investigation. ● Open access materials promote easy reuse, remixing, and dissemination.
  10. 10. Computational Thinking Before computers analytical mathematics and experimentation were the two ways to learn and reason about the world. The computer (especially fast ones) provides a new method. “Computational Thinking” is a way to think and solve problems using the constructs and abstractions in a computer instead of the ones in analytic mathematics. Example: What is the probability of rolling at least two 3’s in 10 dice rolls? New way: just write some code from random import choice count = 0 num_trials = 10000 for trial in range(num_trials): rolls = [] for roll in range(10): rolls.append(choice([1, 2, 3, 4, 5, 6])) if len([r for r in rolls if r == 3]) > 1: count += 1 print(count / num_trials) Result: 0.5236 Old way: remember the binomial theorem? Result: 0.5233
  11. 11. Computational Experimentation The idea that you can run experiments (simulations) to learn about the world without having the real physical object and phenomena. This requires that you can create computational models of the real world that predict the phenomena of interest. Once you have a sufficient model, you can do thousands, millions of experiments.
  12. 12. Why Python? ● Easy language to learn ● Can hide and abstract away programming details, language should be hidden and the engineering concepts should be the focus ● Python objects can be designed to map directly to engineering concepts and objects ● Rich and powerful scientific libraries (NumPy, SciPy, Pandas, matplotlib, SymPy, etc) ● Jupyter Notebooks ● Learning Python provides a very valuable career skill ● Popular! ● It’s the professor’s favorite language :)
  13. 13. Resonance: The Software Library ● Open Source: https://github.com/moorepants/resonance (CC-BY 4.0) ● Docs: http://resonance.readthedocs.io ● Conda: https://anaconda.org/conda-forge/resonance ● Pip: https://pypi.org/project/resonance/ Design Principles ● Students only create functions, no need to understand classes and objects. ● Hide the simulation details (linear/nonlinear ODE solutions). ● Centered around the “System” object. Systems represent real things: a car, a bridge, a bicycle, an airplane wing. ● Easy visualizations (time history plots and animations of systems) ● Extra informative and lots of error messages (try to predict student mistakes) ● Students can use and construct systems. ● Don’t teach programming for the sake of teaching programming. Show them how to solve problems and introduce programming along the way to solve those problems.
  14. 14. Class Hierarchy ● System ○ MultiDoFNonLinearSystem ■ SingleDoFNonLinearSystem ● SingleDoFLinearSystem ○ BaseExcitationSystem ■ QuarterCarSystem ○ MassSpringDamperSystem ○ TorsionalPendulumSystem ○ BookBalanceOnCupSystem ○ SimplePendulum ● SimplePendulum ● CompoundPendulumSystem ● BookBalanceOnCupSystem ■ MultiDoFLinearSystem ● BicycleSystem ● HalfCarSystem ● MultiStoryBuildingSystem
  15. 15. Textbook ● Open Access (CC-BY) ● Written in Jupyter Notebooks: mixes prose, math, videos, graphics, code, widgets ● https://moorepants.github.io/resonance ● Writing it as we go along this quarter ● All chapters should have context: a real problem to solve
  16. 16. Notebook demo: Book Balancing on a Cup Statically rendered version [Introducing Mechanical Vibrations By Investigating a Book Oscillating on a Cylindrical Cup] https://moorepants.github.io/resonance
  17. 17. Notebook demo: Car Driving On a Road Statically rendered version [Vertical Vibration of a Quarter Car] https://moorepants.github.io/resonance
  18. 18. Providing a Jupyter Environment Microsoft Azure Notebooks CoCalc (formerly SageMathCloud) Google Colaboratory JupyterHub
  19. 19. JupyterHub JupyterHub allows us the freedom to set things up the way we want. Many options for deployment, customization, etc. Free and open source (BSD). Friendly and active community, consisting of people that work on Jupyter itself. Written to be administered by you, so there is documentation for running your own JupyterHub.
  20. 20. Our JupyterHub Configuration Overview: ● Bare metal server ● Local user accounts ● Google OAuth (students use their UCD accounts) ● Ansible deployment: https://github.com/jupyterhub/jupyterhub-deploy-teaching This setup achieves our main goals: ● run persistently for several years with low cost ● install/update packages as we see fit (sometimes right before class starts) ● simple to maintain* ● restrict access to specific UCD students
  21. 21. Running the Course The nbgrader extension lets us release, collect, and grade notebooks [nbgrader demo]
  22. 22. Our Experience So Far Positive ● Students seem motivated to learn about vibrations (they want to know how the simulations work) ● Students are able to work at different levels of abstraction for solving problems ● Students can approach fairly complex systems and run the entire analysis process ● They like Python. Negative ● The overhead of introducing a programming language ● resonance lib needs to expose the right details ● Classwork can move too fast ● nbgrader workflow isn’t ideal for our homework style ● Students haven’t quite grokked good notebook style yet ● Not quite sure yet if the learning objectives have been met
  23. 23. More Information Repository: https://github.com/moorepants/resonance Course website: https://moorepants.github.io/eng122/ Jason K. Moore ● moorepants.info ● @moorepants (twitter, Github, G+, etc) Kenneth Lyons ● ixjlyons.com ● @ixjlyons Funding Much of this work has been made possible through the Undergraduate Instructional Innovation Program funds provided by the Association of American Universities (AAU) and Google which is administered by UC Davis's Center for Educational Effectiveness.

×