Wikipedia:Reference desk/Archives/Mathematics/2011 November 14

= November 14 =

Find a cosine function
hello. I have a set of 8 data points and I would like to find a function of the form y=a+bcos(c[x-d]) for any real parameters a,b,c,d that exactly goes through all of them, and the more crazy oscillating the better (I'm trying to illustrate that just because a model goes through all of the given points doesn't necessarily mean it is a good model). How would I do this in a way that preferably uses technology and not by-hand computation, though I know the latter is possible. thanks. 24.92.85.35 (talk) 04:37, 14 November 2011 (UTC)
 * Just substitute the x coordinate in for x and the y coordinate in for y each time. This will give you a system of equations for which you can solve to find a,b,c and d. There may not be a solution.Widener (talk) 06:01, 14 November 2011 (UTC)
 * We have an article on Simultaneous equations. The rule of thumb is that it requires four equations to determine four unknowns. Bo Jacoby (talk) 07:55, 14 November 2011 (UTC).
 * For example, (0, 0), (1, 0), (sqrt 2, 0), (sqrt 3, 0), (sqrt 5, 0) has no solution. Eric. 151.48.27.93 (talk) 10:56, 14 November 2011 (UTC)
 * You could probably illustrate the point just as well, and with easier (though still tedious) calculations, by fitting a polynomial of degree 7 - see Curve_fitting (which reads as if it's copied from someone's lecture notes..) for general discussion and Polynomial interpolation, which gives some information about deriving such polynomials. AndrewWTaylor (talk) 16:18, 14 November 2011 (UTC)
 * Would y=a+bcos(c[x-d]) even fit four random points? 84.197.185.34 (talk) 22:08, 14 November 2011 (UTC)
 * I think so, unless two of them had the same x coordinate but different y coordinates. Widener (talk) 15:50, 15 November 2011 (UTC)