Finding an oscillator's period with a dataset in Mathematica

AI Thread Summary
The user is attempting to find the period of an oscillator using a dataset in Mathematica, specifically employing the NonLinearRegress function. They encounter an error when trying to transpose the dataset into time and position lists, despite the lists appearing to be of the same shape. The error message indicates a shape mismatch between the lists, which is puzzling to the user. They suggest that importing the data directly from the URL may resolve the issue. The discussion revolves around troubleshooting this specific error in Mathematica.
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:
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...
Back
Top