I've been restructuring a fair amount of the work flow for PyDy and have generated what I feel is a relatively complete example of use for the rolling disc system. The example is on my github in the bicycle_work branch:
The major changes are in:
1) examples/rollingdisc.py
2) examples/rollingdisc_lib.py (auto-generated by previous script)
3) examples/plot_rollingdisc.py
In 1), the equtions of motion are derived, and the following python functions are generated:
1) eoms --- define the right side of the EOMS in 1st order form
2) anim ---- convenient function for creating animations
3) qdot_to_u --- if you want to specify the inital qdots for numerical integration, you can use this to determine what the initial u's must be.
4) evals ---- eigenvalues of disc EOMS when linearized about the upright steady configuration
5) critical_speed -- calculates the speed where the eigenvalues go from a real pair to a complex pair
6) energy --- calculates potential and kinetic energies (useful for verifying well behaved numerical integration)
The major change is mostly how you generate the above functions. As you proceed in the kinematic/dynamic analysis, any equations you wish to output you add to a list of Sympy Relational objects (of the form: lhs == rhs). When you have the equations you want to generate function for, you pick a name, write a docstring, choose the function signature ( i.e., f(x), f(x, params), f(x, t, params)), and you call the PyDy function: generate_function, which takes the list of equations and turns it into a string of text which is valid Python code. By doing this incrementally as you complete your analysis, you build a string of Python functions which can then be written to a text file and treated essentially as a library of functions for that particular system you are studying. Once the library is generated and written to file, you can import it and use the functionality from other places, such as in scripts which handle plotting, numerical integration, animation.
More to come soon.
~Luke