Isolating variables from sine-function, I'm stuck

  • Context: Undergrad 
  • Thread starter Thread starter batnas
  • Start date Start date
  • Tags Tags
    Stuck Variables
Click For Summary
SUMMARY

The discussion focuses on isolating variables from the sine function formula, specifically f(x) = Asin(ωx - φ) + B, to estimate local maxima of a sine curve using a system of four equations. The user initially attempts to isolate variables A, B, and ω but encounters difficulties. A suggestion is made to reformulate the problem using a linear system with new variables (a, b, c) derived from A, B, and φ, which simplifies the equations but leads to a complex non-linear equation for ω. The recommendation is to utilize a computer mathematics package for numerical solutions rather than attempting analytical solutions.

PREREQUISITES
  • Understanding of sine function properties and transformations
  • Familiarity with systems of equations and variable isolation techniques
  • Knowledge of numerical methods for solving non-linear equations
  • Experience with computer mathematics packages for regression analysis
NEXT STEPS
  • Research "sine regression methods" for optimizing parameters A, B, φ, and ω
  • Learn about numerical methods for solving non-linear equations using tools like MATLAB or Python's SciPy
  • Explore the use of linear systems in data fitting and parameter estimation
  • Investigate the algorithm presented in "Régressions et équations intégrales" for sinusoidal regression techniques
USEFUL FOR

Data scientists, mathematicians, and software developers involved in signal processing, curve fitting, or any application requiring the estimation of parameters from sinusoidal data.

batnas
Messages
1
Reaction score
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(f(x)=Asin(\omega x - \phi) + B), 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) y_1 = Asin(\omega x_1 - \phi) + B
  • (2) y_2 = Asin(\omega x_2 - \phi) + B
  • (3) y_3 = Asin(\omega x_3 - \phi) + B
  • (4) y_4 = Asin(\omega x_4 - \phi) + B

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

Next, we isolate A from (2.2) and substitute into the other 2:
y_2 = Asin(\omega x_2 - \phi) + y_1 - Asin(\omega x_1 - \phi) \Leftrightarrow
y_2 - y_1= Asin(\omega x_2 - \phi) - Asin(\omega x_1 - \phi) \Leftrightarrow
y_2 - y_1= A(sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)) \Leftrightarrow
A = \frac{y_2 - y_1}{sin(\omega x_2 - \phi) - sin(\omega x_1 - \phi)}
and
  • (3.3) 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)
  • (4.3) 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)

Next we want to isolate \omega from (3.3):
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
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)

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

Any help is appreciated
Thanks
\\Batnas
 
Mathematics news on Phys.org
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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 32 ·
2
Replies
32
Views
5K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K