SlideShare a Scribd company logo
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
What are Mechanical Vibrations?
What are Mechanical Vibrations?
What are mechanical vibrations?
What are mechanical vibrations?
What are mechanical vibrations?
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/
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.
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.
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
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.
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 :)
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.
Class Hierarchy
● System
○ MultiDoFNonLinearSystem
■ SingleDoFNonLinearSystem
● SingleDoFLinearSystem
○ BaseExcitationSystem
■ QuarterCarSystem
○ MassSpringDamperSystem
○ TorsionalPendulumSystem
○ BookBalanceOnCupSystem
○ SimplePendulum
● SimplePendulum
● CompoundPendulumSystem
● BookBalanceOnCupSystem
■ MultiDoFLinearSystem
● BicycleSystem
● HalfCarSystem
● MultiStoryBuildingSystem
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
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
Notebook demo: Car Driving On a Road
Statically rendered version [Vertical Vibration of a Quarter Car]
https://moorepants.github.io/resonance
Providing a Jupyter Environment
Microsoft Azure Notebooks
CoCalc (formerly SageMathCloud)
Google Colaboratory JupyterHub
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.
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
Running the Course
The nbgrader extension lets us release, collect, and grade notebooks
[nbgrader demo]
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
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.

More Related Content

PPTX
Introduction to machine_learning
PDF
STEAM Workshops with Binder and JupyterHub
PPTX
Developing Computational Skills in the Sciences with Matlab Webinar 2017
PDF
Jupyter: A Gateway for Scientific Collaboration and Education
PPTX
Python Awareness for Exploration and Production Students and Professionals
PDF
AAUP 2013: OA Textbooks and MOOCs (D. Fisher)
PDF
Resources for Teaching Undergraduate Computational Physics
PDF
2015 03-28-eb-final
Introduction to machine_learning
STEAM Workshops with Binder and JupyterHub
Developing Computational Skills in the Sciences with Matlab Webinar 2017
Jupyter: A Gateway for Scientific Collaboration and Education
Python Awareness for Exploration and Production Students and Professionals
AAUP 2013: OA Textbooks and MOOCs (D. Fisher)
Resources for Teaching Undergraduate Computational Physics
2015 03-28-eb-final

Similar to Resonance Introduction at SacPy (20)

PDF
Machine Learning, LIX004M5
PDF
Migrating from matlab to python
PDF
Learning Python: Tips from Cognitive Science, Jupyter, and Community
PDF
Machine Learning, LIX004M5
PDF
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
PPTX
Practical engineering
PDF
Ds & ada
PPTX
An introduction to Jupyter notebooks and the Noteable service
PDF
2018 learning approach-digitaltrends
DOC
.doc
PDF
Machine Learning Lecture 1 - Introduction
PDF
Mining Scipy Lectures
DOCX
Engineering VibrationFourth EditionDaniEl J. inman.docx
PPTX
Introduction to Deep Learning and ML.pptx
PPTX
Introduction to Deep Learning and ML.pptx
PDF
JupyterHub: Learning at Scale
PDF
Data Science Reinvents Learning?
PPTX
Python-data-science.pptx
PDF
The Joy of SciPy, Part I
PDF
Introduction To Data Science Laura Igual Santi Segu
Machine Learning, LIX004M5
Migrating from matlab to python
Learning Python: Tips from Cognitive Science, Jupyter, and Community
Machine Learning, LIX004M5
[Harvard CS264] 02 - Parallel Thinking, Architecture, Theory & Patterns
Practical engineering
Ds & ada
An introduction to Jupyter notebooks and the Noteable service
2018 learning approach-digitaltrends
.doc
Machine Learning Lecture 1 - Introduction
Mining Scipy Lectures
Engineering VibrationFourth EditionDaniEl J. inman.docx
Introduction to Deep Learning and ML.pptx
Introduction to Deep Learning and ML.pptx
JupyterHub: Learning at Scale
Data Science Reinvents Learning?
Python-data-science.pptx
The Joy of SciPy, Part I
Introduction To Data Science Laura Igual Santi Segu
Ad

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
Welding lecture in detail for understanding
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
web development for engineering and engineering
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Well-logging-methods_new................
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
R24 SURVEYING LAB MANUAL for civil enggi
Internet of Things (IOT) - A guide to understanding
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Welding lecture in detail for understanding
OOP with Java - Java Introduction (Basics)
Embodied AI: Ushering in the Next Era of Intelligent Systems
web development for engineering and engineering
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CH1 Production IntroductoryConcepts.pptx
Sustainable Sites - Green Building Construction
CYBER-CRIMES AND SECURITY A guide to understanding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Well-logging-methods_new................
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
R24 SURVEYING LAB MANUAL for civil enggi
Ad

Resonance Introduction at SacPy

  • 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. What are Mechanical Vibrations?
  • 3. What are Mechanical Vibrations?
  • 4. What are mechanical vibrations?
  • 5. What are mechanical vibrations?
  • 6. What are mechanical vibrations?
  • 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. 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. 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. 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. 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. 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. 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. Class Hierarchy ● System ○ MultiDoFNonLinearSystem ■ SingleDoFNonLinearSystem ● SingleDoFLinearSystem ○ BaseExcitationSystem ■ QuarterCarSystem ○ MassSpringDamperSystem ○ TorsionalPendulumSystem ○ BookBalanceOnCupSystem ○ SimplePendulum ● SimplePendulum ● CompoundPendulumSystem ● BookBalanceOnCupSystem ■ MultiDoFLinearSystem ● BicycleSystem ● HalfCarSystem ● MultiStoryBuildingSystem
  • 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. 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. Notebook demo: Car Driving On a Road Statically rendered version [Vertical Vibration of a Quarter Car] https://moorepants.github.io/resonance
  • 18. Providing a Jupyter Environment Microsoft Azure Notebooks CoCalc (formerly SageMathCloud) Google Colaboratory JupyterHub
  • 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. 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. Running the Course The nbgrader extension lets us release, collect, and grade notebooks [nbgrader demo]
  • 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. 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.