Determining the Equation of a Sine and Cosine Graph that speeds up

  • I
  • Thread starter FGD
  • Start date
  • #1
FGD
13
0

Summary:

What is the equation I would need to fit my function to the graph?

Main Question or Discussion Point

My function needs to speed up towards the left. How do I do this?
Wave.jpg

Green is the graph.
Red is my function that needs to match the graph.
A = Amplitude = -0.13
H = Phase Shift = 0.1625
V = Vertical Shift = 0.05
P = period = 0.4
B = 2π / P
Y = A (Cos(B (X-H) ) + V
 

Answers and Replies

  • #2
FactChecker
Science Advisor
Gold Member
5,692
2,106
Using that function, there is no way to "speed up" the left side without changing the right side. The parameter B controls the "speed" evenly across the entire thing.
 
  • #3
FGD
13
0
Is there another function that would work?
 
  • #4
FactChecker
Science Advisor
Gold Member
5,692
2,106
My immediate answer is to treat the two sides separately, using the same function but changing B. Is that ok? For other ideas, you should specify any additional requirements that you have.
 
  • #5
FGD
13
0
Good suggestion. You just gave me another thought. Would there be some way to alter B based on X?
The additional requirements are that this data set will be compared against multiple with the same function. My worst fit is this data set. (Again faster frequency on the left. Red is my function)
Checkmark.jpg
 
  • #6
FactChecker
Science Advisor
Gold Member
5,692
2,106
Good suggestion. You just gave me another thought. Would there be some way to alter B based on X?
The additional requirements are that this data set will be compared against multiple with the same function. My worst fit is this data set. (Again faster frequency on the left. Red is my function)View attachment 264304
I don't know a good way to change B smoothly based on x, because that would change the right side. What I had in mind was something where you leave B with its current value when x > H and give it a larger value when x < H.
 
  • #7
FGD
13
0
AllData.jpg

Here is the full data set. The order is Red, Green, Pink, Yellow, Blue, Purple. If I can get this function to work then I hopefully can get each data set to morph into the next over time.
 
  • #9
FGD
13
0
Yeah something very similar to the bicubic example in that link.
 
  • #10
FactChecker
Science Advisor
Gold Member
5,692
2,106
Yeah something very similar to the bicubic example in that link.
If you can use something like MATLAB, it has some fairly sophisticated curve-fitting tools. See https://www.mathworks.com/help/curvefit/multivariate-and-rational-splines.html

If MATLAB is not available to you, you might look at the free statistical package, R. The first answer here has the R code for a multivariate interpolation using a referenced package. I have no experience with it.
 

Related Threads on Determining the Equation of a Sine and Cosine Graph that speeds up

Replies
3
Views
3K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
13
Views
6K
  • Last Post
Replies
3
Views
962
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
3
Views
3K
Replies
1
Views
6K
  • Last Post
Replies
1
Views
1K
Top