2

I am a non-mathematician using applied math to try to solve a website monitoring problem with detecting deviations in traffic patterns on websites, and without getting into too much detail, need an equation of a sine curve that "slants". I need to input $x$ (and other variables), and get $y$, so $y$ must be by itself on the left and no where else.

I tried this, but $y$ is not by itself so i cannot use: $$y=\sin(x+\frac{y}{3})$$ I need to know $x$ before I can know $y$ as $y$ depends on $x$. If there's a way to use this as a base but move the $y$ out of sine and over to the left, that might just answer this if it can absorb the other modifications below.

I tried this, but it's really just a sine curve within another, not a clean single line. This matters because this equation will get heavily modified (below) and where they merge together will break it up, so it cannot be used: $$y=\sin(x+\frac{\sin(x)}{2})$$ By Unclean, it makes more sense when viewing it like this $y=sin(x+sin(x))$

If it helps, I made this and if I did not need it to slant, this is otherwise exactly what I need after all the modifications are implemented:

$$y=(max-min)*(\frac{1}{2}\sin(\frac{x-hour+6}{\frac{period}{2}}pi))+(\frac{max+min}{2})$$

$$y=(30-10)*(\frac{1}{2}\sin(\frac{x-3+6}{\frac{24}{2}}pi))+(\frac{30+10}{2})$$ https://www.wolframalpha.com/input?i=y%3D%28%2830-%28%2810%29%29%29*%28%28sin%28%28%28x-%283%2B6%29%29%2F%2824%2F2%29%29*pi%29%29%2F2%29%29%2B%2830%2F2%29%2B%2810%2F2%29

It has variables for the min and max, the period in hours, aligning the lowest traffic to a specific hour. It just doesn't slant to determine what hour is for the "max" traffic. max traffic is never exactly $pi$ distance off (12 hours apart), it's usually like $\frac{3pi}{4}$ off (9 hours off). The trough and crest of the website's traffic patterns are slightly off, so I need it to slant a varying amount depending on the constituent services that run the sites.

Ultimately this is going into a Prometheus Query, so there may be rare limitations with what the language allows me to use. I don't think it will be an issue here, but calculus level things probably cannot be done. https://prometheus.io/docs/prometheus/latest/querying/functions/ https://prometheus.io/docs/prometheus/latest/querying/operators/

I'm not asking for someone to build the full formula, just hopefully provide a good base like in the first one that I can use knowing that it will have significant modifications like those shown above. I am at about the end of my math abilities.

Thanks and I hope I am not asking for too much. If I am, please provide what you can to help.

Much appreciated,

  • 1
    What exactly do you mean by "..... a sine curve that "slants" ...." what do you mean by "slants" ?? Can you explain that in plain English ? – Hosam Hajeer Jan 17 '24 at 19:31
  • 1
    Tip: Write $\sin$ for $\sin$. – Robin Jan 17 '24 at 19:59
  • You can solve it by converting to a Kepler equation – Тyma Gaidash Jan 17 '24 at 20:05
  • 1
    Actually, it is much better if you let $x$ and $y$ be functions of a parameter $t$. That is use parametric equations for $x$ and $y$ instead of writing $y$ explicitly in terms of $x$. – Hosam Hajeer Jan 17 '24 at 20:41
  • Thanks, i changed it to \sin. By slant i mean like in the first 2 examples where the crest is not mid-way between the troughs. I looked at the Kepler link, and I don't see the epsilon ε symbol in the Prometheus tool we're using, so it may not be possible. I'll have to look up Kepler and find out what this is though. – FigureOfCode Jan 17 '24 at 20:50
  • @FigureOfCode $\epsilon$ is just a variable and can be renamed. You can rewrite your equation as $M=E-\epsilon \sin(E);M=x,E=x+\frac y3,\epsilon=\frac13$, solve for $E$, and then for $y$. However, there may be other methods too besides this one. – Тyma Gaidash Jan 17 '24 at 20:59
  • @Tyma Gaidash, I looked at what you wrote, but there's an x within sin and we are solving for x, which brings us back to the same issue with y being in both of places instead. Sorry I don't know enough to know how this advances the solution. – FigureOfCode Jan 18 '24 at 16:46

0 Answers0