Closed moorepants closed 7 years ago
@ixjlyons Here are some starting ideas. I'll keep playing around with this. My only worry is that we hide too many things that we'd want the students to learn. I think trying to create the notebooks first with "raw" code will show us what might be useful to abstract away, but the above stuff shows some of the things I've thought about for a long time, i.e. how to expose the symbolics and numerics in a useful way.
This looks really cool, but I agree that it's hard to tell if it hides too much. One possibility is to implement the high-level stuff (e.g. a linearize
method) but withhold showing it to them until after working through it using lower level methods -- essentially "unlocking" features only after they've learned how they work.
Starting out with pure numpy/scipy/sympy sounds like a plan. I think we'll quickly start to see patterns and pain-points that are ok to abstract away.
Yeah, there are at least two ways:
Student does something the hard way (e.g. linearize an ode on paper) and then show them a tool that does it for them.
OR
Students learn high level concept, e.g. "a linear version of the model only predicts the motion at small deviations from a nominal state", give them the model with the lmitations in mind, let them sovle some problems with it, and then maybe they will ask "how do you make a linear model?".
Closing this as we have a simpler object model. Just looked again here and there are some cool ideas, but mostly out of the scope of pass 1 for resonance.
My current thought is that if we want these materials to standout and be unique in the way vibrations is taught that we do need to develop an object model to go along with the text. Here are some ideas to start with.
We need at least two types of parameters: time varying (SymPy undefined functions of time) and constant (SymPy symbols).
NOTE : Does it make sense to assign a value to a time varying parameter? If so, does the value of time also need to be indicated?
There is the concept of a system's state. The state tells you what the numerical values are at a specificed time and should be mutable. As time changes we can update the state values. It is desirable to preserve the order of the state variables, so that matrix operations work nicely in subsequent code.
We also need an object that contains a monotonic collection of state values. Maybe a subclass of a Pandas DataFrame is appropriate (NOTE : I've had little luck successfuly subclassing a DataFrame in the past.)
A row would then be a State instance.
The students will have to specify the equations of motion manually in symbolic form. This forces them to design the model versus some kind of approach that assembles models from Springs, Masses, etc. This would be the result of Lagrange's method in our case.
There is also the concept of a model that contains the mathematical equations that attempt to describe reality.
I'd like the students to be able to use custom integrators, even one they might write themselves.
In many cases, we'd like to linearize a non-linear model about an equilibrium point. If the symbolic form of the model i
The coefficients of the canoncial form can be accessed:
Frequency analysis of a linear system.
Time series. Allen uses a
TimeSeries
object to hold values with a time index. I'm not that fond of indexing Series and DataFrames using floating point time values but maybe some hack to use an integer index for microseconds from epoch would work?