Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: ruler501 on March 03, 2011, 11:31:19 pm

Title: Equation generating
Post by: ruler501 on March 03, 2011, 11:31:19 pm
I want to create an equation that works kindof like the sin/cos function but has irregular zeros. It needs to have maximums of 1 and minimums of -1. How would I do this? Thank you for any help.
Title: Re: Equation generating
Post by: AngelFish on March 03, 2011, 11:34:17 pm
Sin(x2) or Cos(x2) should work. If you need something less predictable, may I recommend 2Rand-1?
Title: Re: Equation generating
Post by: ruler501 on March 03, 2011, 11:41:43 pm
i already have specified values for all zeros. I just need to control how the graph acts in between them
Title: Re: Equation generating
Post by: AngelFish on March 03, 2011, 11:48:50 pm
Oh, that's a very different question from what I was answering. However, I can tell you right off the bat that if you have more than about 5 irregular zeros, you're not going to be able to compute one of the equations very quickly. I'd recommend that you read up on Interpolation (http://en.wikipedia.org/wiki/Interpolation) and especially Polynomial Interpolation (http://en.wikipedia.org/wiki/Polynomial_interpolation) to figure out the equation. It depends on how irregular your data points truly are, but your function will probably have a degree on the order of N-1, where N is the number of data points.
Title: Re: Equation generating
Post by: ZippyDee on March 28, 2011, 06:41:38 am
If they're really THAT irregular you can always use a data-smoothing algorithm such as a uniform b-spline.
Title: Re: Equation generating
Post by: AngelFish on March 28, 2011, 06:56:31 am
I think the point is to have a random function, not a smooth one ;)
Title: Re: Equation generating
Post by: ZippyDee on March 28, 2011, 07:09:44 am
I want to create an equation that works kindof like the sin/cos function
[/quote
This made me think of curves. That made me think of b-splines.