LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 947
Default Sin Function Data Analysis

"best fit" line ...for a sine curve. any

Hi. I might be wrong, but I get about

-17.136457630408 * Sin(0.89542489309982 + 0.680013434718991 * x)

Different methods arrive at slightly different solutions, but they appear to all agree with a freq of about 0.68.
Of course, your data shows an offset from the start .(0.89..)

Just for fun. Not what you wanted, but if you wanted to Curve fit your data with just Sin, you could phase the Sin & Cos frequencies together with a phase shift via the Fourier Transform.
This will reproduce your data.
However, from inspection, this does not work for what you want because the data is not periodic at the end points.. Your ending data point does not complete a cycle.
Therefore, this will just reproduce your data.
The equation has been arranged by the Abs( ) maximum value of each frequency component. We note that they all appear to be important for accuracy.
Note that with an even number of data points, the highest frequency cancels the Sin function, and the remaining Cos function just alternates (+-) and hence is changed to (-1)^x

Sub Demo()
Dim n
Dim x
Dim Pi
Pi = WorksheetFunction.Pi

For x = 0 To 21
n = -0.690127272727273 _
- 0.584581818181818 * (-1) ^ x _
- 12.8103481758612 * Sin(0.565539827065221 - (2 * Pi * x) / 11#) _
+ 8.56499995503438 * Sin(2.98941440438005 + (3 * Pi * x) / 11#) _
- 3.83348772011928 * Sin(1.00524778699338 - (Pi * x) / 11#) _
- 3.41877601052572 * Sin(3.01947952790798 - (4 * Pi * x) / 11#) _
- 2.30614951785526 * Sin(2.76357456361827 - (5 * Pi * x) / 11#) _
- 1.75316017345818 * Sin(2.5352536449401 - (6 * Pi * x) / 11#) _
- 1.48203251984954 * Sin(2.33432031961824 - (7 * Pi * x) / 11#) _
- 1.32029235196495 * Sin(2.13811691588771 - (8 * Pi * x) / 11#) _
- 1.22360877020275 * Sin(1.94568189061646 - (9 * Pi * x) / 11#) _
- 1.1768369078447 * Sin(1.75967181016055 - (10 * Pi * x) / 11#)

Cells(x + 1, 2) = n
Next x
End Sub

--
HTH :)
Dana DeLouis


"Matt" wrote in message ...

What i'm looking to find is an equation that models the data so i can put
that equation into matlab. I know the length of the pendulum, g, etc., and
each set of data is taken every 1 cylce- the time measurements arent
significant for right now. What I mean't more was a trendline- for charts, i
know that you can create a linear regression, or "best fit" line and show the
equation. I am looking to do something like this, but for a sine curve. any
ideas? thanks!

matt

"Bernard Liengme" wrote:


You will have to do better than that to get homework help.
If you plot the data (XY plot) you will see a sine wave.
Were the measurements made every second, every 1/10 of second.....?
What exactly do you want to find - the length of the pendulum, the value of
g ?
You have not given us enough data.
The sine function in Excel is =SIN(A1) bit if A1 has degrees you need
=SIN(RADIANS(A1))
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Matt" wrote in message
...

Hi,
I currently have a set of data for a pendelum, resembeling a sin function.
What functions or equations in excell can I use to find the sin function
representing this pendelum using my data?

Thanks!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I add data analysis function in tool? Michiko Excel Worksheet Functions 1 November 8th 05 09:26 AM
Excel function/what-if analysis Su Excel Discussion (Misc queries) 2 July 18th 05 12:54 PM
Why " data analysis plus " override " data analysis " once instal. Alfred H K Yip Excel Worksheet Functions 1 March 20th 05 08:10 AM
Analysis ToolPak installed but no Data Analysis option Eric Stephens Excel Discussion (Misc queries) 3 February 2nd 05 09:17 PM
My XIRR function has dropped out, analysis toolpak doesn't fix. Jake Excel Worksheet Functions 3 December 15th 04 09:25 PM


All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"