Finding an oscillator's period with a dataset in Mathematica

Click For Summary
SUMMARY

The discussion focuses on using Mathematica to determine the period of an oscillator from a dataset containing 51 measurements of time and position. The user encountered an error when attempting to transpose the data into separate time and position lists, specifically a shape mismatch error. The solution involves correctly importing the dataset using the Import function and ensuring that the data is structured properly before applying the NonLinearRegress function for analysis.

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of data structures in Mathematica
  • Knowledge of the NonLinearRegress function in Mathematica
  • Basic concepts of oscillatory motion and period determination
NEXT STEPS
  • Research how to use the Import function in Mathematica for various data formats
  • Learn about data manipulation techniques in Mathematica, specifically Transpose
  • Study the NonLinearRegress function in Mathematica for fitting models to data
  • Explore methods for visualizing oscillatory data in Mathematica
USEFUL FOR

Students and researchers in physics or engineering, Mathematica users analyzing oscillatory systems, and anyone interested in data fitting techniques using NonLinearRegress.

Shukie
Messages
91
Reaction score
0

Homework Statement


I have a dataset of an oscillator with 51 measurements, I uploaded it http://home.orange.nl/~kuip3148/osc.dat . It's in the form of {time, position}. I have to find the period of this oscillator in Mathematica.

Homework Equations


I have to use the NonLinearRegress function to find it.


The Attempt at a Solution


I started with the following code:
Code:
data = {oscdata};
{tdata, xdata} = Transpose[data]

Homework Statement


That gives me the first problem, because I get an error saying the two lists are not the same shape, while they clearly are. Anyone know why that's happening?

Code:
"Lists {tdata,xdata} and \
{{{0,0.369}},{{0.1,0.0999}},{{0.2,0.0904}},{{0.3,-0.054}},{{0.4,-0.1}}\
,{{0.5,-<<6>>}},{{0.6,-0.328}},{{0.7,-0.388}},{{0.8,-0.486}},{{0.9,-0.\
576}},<<51>>} are not the same shape"
 
Last edited by a moderator:
Physics news on Phys.org
That's strange, it worked perfectly here

Code:
data = Import["[PLAIN]http://home.orange.nl/~kuip3148/osc.dat"][/PLAIN] 
{tdata, xdata} = Transpose[data]
 
Last edited by a moderator:

Similar threads

Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
7K
Replies
6
Views
7K