Skip to content

Mass spring system#9

Merged
moorepants merged 5 commits intopydy:masterfrom
tarzzz:mass_spring_system
Jun 15, 2013
Merged

Mass spring system#9
moorepants merged 5 commits intopydy:masterfrom
tarzzz:mass_spring_system

Conversation

@tarzzz
Copy link
Contributor

@tarzzz tarzzz commented Jun 7, 2013

This example is to illustrate the visualization abilities of pydy-viz.
It utilizes the javascript rendering abilities of IPython notebooks to provide visualization and simulation of a mass spring system, using WebGL (three.js).

karan and others added 2 commits June 3, 2013 01:35
This system is used to analyze the working of webGL's inline IPython notebooks,using Three.js, and  TrackBallControls.js
…e IPython

notebook for simulation and visualization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a method to get data to the client from the server. But you will want to either use http requests (post, get) or make use of the IPython kernel structure. It will probably be a good idea to have some methods eventually that split out all necessary information from the python code (time histories, shapes, colors, etc) as a json file which can then be passed to the js code more fluidly. But this is a good start for a demonstration of the ideas.

@moorepants
Copy link
Member

Tarun,

Make sure that you include the proper license information for any external javascript code that you did not write. We can't just copy it and paste without including the license either in the code or as a file that hangs with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this problem the solution is trivial, but I'd like you to include code here that goes from the Kane object to a ode in first order form that can be integrated with odeint (from scipy). This will make the example much easier to extend for multiple bodies. So please use the dummify, lambdify, odeint method to get your simulation results instead of writing in out explicitly.

@ghost ghost assigned moorepants Jun 7, 2013
@asmeurer
Copy link

asmeurer commented Jun 7, 2013

three.js is MIT, so there are no license issues (you just have to have a copy of that license somewhere). The easiest way to distribute it is to either ship a minified version, or to add it as a git submodule. Look at how IPython does things in with their notebook javascript dependencies.

@moorepants
Copy link
Member

Two things before merging:

  1. Add a readme with problem description and how to run it.
  2. Find the license for the TrackBallControls.js file and add it.

@moorepants
Copy link
Member

@gilbertgede @hazelnusse @angadhn

If you have time check out this concept @tarzzz put together to give some idea of how the visualization would work in an IPython notebook.

@asmeurer
Copy link

For me, it shows a dot repeatedly moving from the origin, then jumping back.

@moorepants
Copy link
Member

That's all it does. The dot's position is governed by the solution to the ode and it embeds three.js in the notebook. Nothing grand but just a small proof of concept.

@asmeurer
Copy link

Right. I just expected it to look more like a mass on a spring.

@moorepants
Copy link
Member

I think we're going to start with just rigid body animations. But we may be able to add in some flexible spring visualizations since that is such a common item in rigid body systems.

moorepants added a commit that referenced this pull request Jun 15, 2013
@moorepants moorepants merged commit de1e6e2 into pydy:master Jun 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants