Best way to visualise data outputted from a C program

  • Thread starter Thread starter conorordan
  • Start date Start date
  • Tags Tags
    Data Program
conorordan
Messages
11
Reaction score
0

Homework Statement



I've written some C code that models the motion of two masses attached to a wall (and each other) by springs like this.

The output file is 5 columns; the time, and the positions and velocities of each block at that time.

I'm not sure how to visualise my data, ideally I want to make a simulation that shows two blocks moving as described by the data, I'm open to doing more coding and I have Matlab and Mathematica.

Homework Equations




The Attempt at a Solution



So far I've just been using Matlab to graph the motion but it isn't terribly interesting, I want something that moves. A moving plot (like a GIF file) of the Lissajous curves being plotted would be good but I'm not sure what software I need for this.

Thanks
 
Physics news on Phys.org
You can use MATLAB to draw the blocks and springs, if that's what you're after.
Draw the blocks in the correct locations, than add each spring.
If you have fully licensed matlab, you can even save it as an AVI.
 
To solve this, I first used the units to work out that a= m* a/m, i.e. t=z/λ. This would allow you to determine the time duration within an interval section by section and then add this to the previous ones to obtain the age of the respective layer. However, this would require a constant thickness per year for each interval. However, since this is most likely not the case, my next consideration was that the age must be the integral of a 1/λ(z) function, which I cannot model.
Back
Top