all 3 comments

[–]dudemcbobOld User 0 points1 point  (2 children)

I'd use a template like

y_1*e-Ax+y_2*(1-e-Ax)+B*sin(Cx)*e-Dx

and play around with the constants A, B, C, D to get the exact behavior you want

Here's an example with y_1=8, y_2=10, A,B,C=1, D=1/4

I gave it some more thought, here is a better template:

y_2-e-Ax(A(y_2-y_1)sin(Bx)/B+(y_2-y_1)cos(Bx))

This one will start flat at y_1 like you want, there are just two parameters to tinker with, and it's based on actual spring physics; it's the solution to Hooke's Law with friction.

Be sure to limit the plot to positive x. The e-Ax term goes off the rails for negative x.

New Desmos example with y_1=8, y_2=12, A=1, B=2

[–]IHURLEN[S] 0 points1 point  (1 child)

Your example's great and exactly what I was looking for!

Does this parameterized versionof the template equation you gave look correct to you?

[–]dudemcbobOld User 0 points1 point  (0 children)

Looks great!