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

  • Context: Undergrad 
  • Thread starter Thread starter FGD
  • Start date Start date
  • Tags Tags
    Cosine Graph Sine
Click For Summary

Discussion Overview

The discussion centers around determining a mathematical function, specifically a sine or cosine graph, that can "speed up" towards the left side of the graph. Participants explore the implications of modifying parameters such as amplitude, phase shift, vertical shift, and period, while considering how to achieve a non-uniform speed across the graph.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant proposes a function with specific parameters but questions how to adjust it to speed up on the left side.
  • Another participant argues that the parameter B controls the speed uniformly across the entire function, suggesting that changing it would affect the right side as well.
  • A suggestion is made to treat the two sides of the graph separately by modifying B, raising questions about the feasibility of this approach.
  • There is a proposal to alter B based on the value of X, with the intention of maintaining its current value when X is greater than H and increasing it when X is less than H.
  • Participants discuss the need for a multivariate interpolation function to achieve the desired graph behavior, referencing spline functions as a potential solution.
  • Further suggestions include using tools like MATLAB or R for sophisticated curve-fitting and interpolation techniques.

Areas of Agreement / Disagreement

Participants express differing views on how to adjust the function to achieve the desired speed on the left side. There is no consensus on a single approach, and multiple competing ideas are presented regarding the manipulation of parameters and the use of interpolation methods.

Contextual Notes

Participants note the additional requirement of comparing the modified function against multiple datasets, which may influence the choice of methods and parameters used in the discussion.

FGD
Messages
46
Reaction score
12
TL;DR
What is the equation I would need to fit my function to the graph?
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
 
Physics news on Phys.org
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.
 
Is there another function that would work?
 
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.
 
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
 
FGD said:
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.
 
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.
 
Yeah something very similar to the bicubic example in that link.
 
  • #10
FGD said:
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.
 

Similar threads

Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 11 ·
Replies
11
Views
33K
  • · Replies 4 ·
Replies
4
Views
2K