Isolating variables from sine-function, I'm stuck

In summary, the conversation discusses the development of a computer program to estimate the next local maximum of a sine-curve. The approach involves isolating variables from the sine function and using a system of equations to solve for the parameters. However, it is suggested to use a computer math package for numerical solving. It is also mentioned that there are sinusoidal regression methods available for finding optimized parameters from experimental data.
  • #1
batnas
1
0
Hey everybody

I'm developing a computer program that can take a series of data-points and estimate the next local maximum(top) of a sine-curve.

My approach to this is to take the formula for a sine-function([itex]f(x)=Asin(\omega x - \phi) + B[/itex]), and isolate all the variables, and that way I'll get a series of (more or less) simple equations, that I can use in my program.
(I'm not entirely sure this is the right approach, let me know otherwise...)

To do this we're using 4 equations with 4 unknown like this:
  • (1) [itex]y_1 = Asin(\omega x_1 - \phi) + B[/itex]
  • (2) [itex]y_2 = Asin(\omega x_2 - \phi) + B[/itex]
  • (3) [itex]y_3 = Asin(\omega x_3 - \phi) + B[/itex]
  • (4) [itex]y_4 = Asin(\omega x_4 - \phi) + B[/itex]

Then we isolate B in (1) and substitute into (2), (3) & (4):
[itex]y_1 = Asin(\omega x_1 - \phi) + B \Leftrightarrow[/itex]
[itex]B = y_1 - Asin(\omega x_1 - \phi)[/itex]
and
  • (2.2) [itex]y_2 = Asin(\omega x_2 - \phi) + y_1 - Asin(\omega x_1 - \phi)[/itex]
  • (3.2) [itex]y_3 = Asin(\omega x_3 - \phi) + y_1 - Asin(\omega x_1 - \phi)[/itex]
  • (4.2) [itex]y_4 = Asin(\omega x_4 - \phi) + y_1 - Asin(\omega x_1 - \phi)[/itex]

Next, we isolate A from (2.2) and substitute into the other 2:
[itex]y_2 = Asin(\omega x_2 - \phi) + y_1 - Asin(\omega x_1 - \phi) \Leftrightarrow[/itex]
[itex]y_2 - y_1= Asin(\omega x_2 - \phi) - Asin(\omega x_1 - \phi) \Leftrightarrow[/itex]
[itex]y_2 - y_1= A(sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)) \Leftrightarrow[/itex]
[itex]A = \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}[/itex]
and
  • (3.3) [itex]y_3 = \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_3 - \phi) + y_1 - \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_1 - \phi)[/itex]
  • (4.3) [itex]y_4 = \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_4 - \phi) + y_1 - \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_1 - \phi)[/itex]

Next we want to isolate [itex]\omega[/itex] from (3.3):
[itex]y_3 = \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_3 - \phi) + y_1 - \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_1 - \phi) \Leftrightarrow[/itex]
[itex]y_3 - y_1= \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_3 - \phi) - \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}sin(\omega x_1 - \phi)[/itex]

And this is where I get stuck...
I would think I could take [itex]sin^{-1}()[/itex] of everything, but I'm not sure if it's that simple.

Any help is appreciated
Thanks
\\Batnas
 
Mathematics news on Phys.org
  • #2
Hi !

it shoud be slightly simpler if you start with the form :
y = a*sin(w*x) +b*cos(w*x) +c
where a = A*cos(phi) , b = -A*sin(phi) and c=B
You will have a linear system of 4 equations considering (a, b, c) only.
Then you could linearly combine those equations so that (a,b,c) be eliminated. The result will be an equation with the only remaining unknown w.
But this equation is very big and non-linear relatively to w (it includes many sin and cos fonctions of many different linear functions of w.
You cannot sovle it on an analytical form.
Anyway, you will need a computer maths-package for numerical solving of non-linear équations.
As a consequence, I think that it is simpler to use a computer maths-package able to solve numerical systems of equations and directly input with the original system of 4 equations, instead of first reducing the number of equations (which leads to more complicated formulas).
Remark : If the whole problem is to find the optimised parametrers A,B,Phi,w (or a,b,B,w) from a large number of experimental data (x,y), there are some sinusoidal regression methods (seach on the WEB). For example, a non-recursive method is published in the pdf (algorithm pp.35-36): "Régressions et équations intégrales" : http://www.scribd.com/JJacquelin/documents
 

Related to Isolating variables from sine-function, I'm stuck

1. What is the purpose of isolating variables in a sine-function?

Isolating variables in a sine-function allows us to solve for a specific variable and understand its relationship to the other variables in the equation. It also allows us to manipulate the equation to find the best fit for our data or to make predictions.

2. How do I isolate a variable in a sine-function?

To isolate a variable in a sine-function, you can use algebraic manipulation techniques such as factoring, combining like terms, or using inverse operations. You can also use trigonometric identities to simplify the equation.

3. What are the common mistakes to avoid when isolating variables in a sine-function?

Some common mistakes to avoid when isolating variables in a sine-function include forgetting to apply the inverse operation to both sides of the equation, not simplifying the equation fully, and making sign errors when combining like terms.

4. Can I isolate more than one variable in a sine-function?

Yes, it is possible to isolate more than one variable in a sine-function. However, this may result in a more complicated equation and may require the use of more advanced algebraic techniques or the substitution method.

5. How do I know if I have isolated the correct variable in a sine-function?

You can check your work by plugging the isolated variable back into the original equation and ensuring that it satisfies the equation. You can also graph the original equation and the isolated variable to see if they produce the same graph.

Similar threads

Replies
3
Views
788
  • General Math
Replies
5
Views
2K
  • Linear and Abstract Algebra
Replies
17
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
758
  • Linear and Abstract Algebra
Replies
14
Views
1K
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
15
Views
875
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
772
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
541
  • Introductory Physics Homework Help
Replies
8
Views
613
Back
Top